Another WIP of 0.9, not recommended for use

This commit is contained in:
nossr50 2011-03-12 22:18:15 -08:00
parent 0111d992eb
commit cdb5547ed1
19 changed files with 707 additions and 501 deletions

View File

@ -1,5 +1,16 @@
Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code#
Version 0.9
/<skillname> now shows much more information to the player regarding their stats
Unarmed disarm is now based directly on your skill level
Axe crits is now based directly on your skill level
Herbalism now applies double drops to herbs
/mmoedit is no longer case sensitive
Version 0.8.22
Fixed bug where Axes did less damage than normal
Acrobatic rolls now give XP
Acrobatics XP increased for non-rolls
Version 0.8.21
Fixed bug where axe criticals would dupe items
Version 0.8.20

View File

@ -18,6 +18,11 @@ public class mcAcrobatics {
if(Math.random() * 1000 <= mcUsers.getProfile(player).getAcrobaticsInt()){
event.setCancelled(true);
player.sendMessage("**ROLLED**");
if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z))
&& mcPermissions.getInstance().acrobatics(player)){
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 8);
mcSkills.getInstance().XpCheck(player);
}
return;
}
}
@ -25,16 +30,8 @@ public class mcAcrobatics {
return;
if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z))
&& mcPermissions.getInstance().acrobatics(player)){
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 8);
if(player != null && mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
int skillups = 0;
while(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
skillups++;
mcUsers.getProfile(player).removeAcrobaticsGather(mcUsers.getProfile(player).getXpToLevel("acrobatics"));
mcUsers.getProfile(player).skillUpAcrobatics(1);
}
player.sendMessage(ChatColor.YELLOW+"Acrobatics skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getAcrobatics()+")");
}
mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 12);
mcSkills.getInstance().XpCheck(player);
mcConfig.getInstance().addBlockWatch(loc.getWorld().getBlockAt(xx, y, z));
if(player.getHealth() - event.getDamage() <= 0){
if(mcUsers.getProfile(player).isDead())

View File

@ -52,6 +52,19 @@ public class mcBlockListener extends BlockListener {
Block block = event.getBlock();
Location loc = block.getLocation();
int dmg = event.getDamageLevel().getLevel();
/*
* SUPER BREAKER CHECKS
*/
if(mcUsers.getProfile(player).getSuperBreakerMode() && dmg == 0 && mcMining.getInstance().canBeSuperBroken(block)){
if(mcLoadProperties.miningrequirespickaxe){
if(mcm.getInstance().isMiningPick(inhand))
mcMining.getInstance().SuperBreakerBlockCheck(player, block);
} else {
mcMining.getInstance().SuperBreakerBlockCheck(player, block);
}
}
/*
* HERBALISM
*/
@ -59,10 +72,10 @@ public class mcBlockListener extends BlockListener {
if(mcPermissions.getInstance().herbalism(player))
mcHerbalism.getInstance().herbalismProcCheck(block, player);
}
if(player != null && dmg == 2 && !mcConfig.getInstance().isBlockWatched(block)){
/*
* MINING
*/
if(player != null && dmg == 2 && !mcConfig.getInstance().isBlockWatched(block)){
if(mcPermissions.getInstance().mining(player)){
if(mcLoadProperties.miningrequirespickaxe){
if(mcm.getInstance().isMiningPick(inhand))
@ -84,6 +97,7 @@ public class mcBlockListener extends BlockListener {
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc);
mcUsers.getProfile(player).addWoodcuttingGather(7);
}
mcSkills.getInstance().XpCheck(player);
/*
* IF PLAYER IS USING TREEFELLER
*/
@ -91,15 +105,17 @@ public class mcBlockListener extends BlockListener {
mcWoodCutting.getInstance().treeFeller(block, player);
for(Block blockx : mcConfig.getInstance().getTreeFeller()){
if(blockx != null){
Material mat = Material.getMaterial(blockx.getTypeId());
Material mat = Material.getMaterial(17);
byte damage = 0;
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
blockx.setTypeId(0);
blockx.setType(Material.AIR);
if(item.getTypeId() == 17){
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item);
mcWoodCutting.getInstance().woodCuttingProcCheck(player, blockx, blockx.getLocation());
mcUsers.getProfile(player).addWoodcuttingGather(7);
}
if(item.getTypeId() == 18){
mat = Material.getMaterial(6);
item = new ItemStack(mat, 1, (byte)0, damage);
@ -121,22 +137,9 @@ public class mcBlockListener extends BlockListener {
*/
if(mcPermissions.getInstance().excavation(player) && block != null && player != null)
mcExcavation.getInstance().excavationProcCheck(block, player);
/*
* EXPLOIT COUNTERMEASURES
*/
mcConfig.getInstance().addBlockWatch(block);
if(player != null && mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
int skillups = 0;
while(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
skillups++;
mcUsers.getProfile(player).removeWoodCuttingGather(mcUsers.getProfile(player).getXpToLevel("woodcutting"));
mcUsers.getProfile(player).skillUpWoodCutting(1);
}
player.sendMessage(ChatColor.YELLOW+"WoodCutting skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getWoodCutting()+")");
}
}
}
}
}
public void onBlockFlow(BlockFromToEvent event) {
//Code borrowed from WorldGuard by sk89q

View File

@ -40,7 +40,7 @@ public class mcCombat {
//This may help compatability with NPC mods
if(mcUsers.getProfile(defender) == null)
mcUsers.addUser(defender);
if(mcUsers.getProfile(attacker).inParty() && mcUsers.getProfile(defender).inParty()){
if(attacker != null && defender != null && mcUsers.getProfile(attacker).inParty() && mcUsers.getProfile(defender).inParty()){
if(mcParty.getInstance().inSameParty(defender, attacker)){
event.setCancelled(true);
return;
@ -51,11 +51,10 @@ public class mcCombat {
/*
* AXE CRITICAL CHECK
*/
axeCriticalCheckPlayer(attacker, event, x, plugin);
axeCriticalCheck(attacker, event, x);
if(!mcConfig.getInstance().isBleedTracked(x)){
bleedCheck(attacker, x);
}
int healthbefore = defender.getHealth();
if(defender != null && mcPermissions.getInstance().unarmed(attacker) && attacker.getItemInHand().getTypeId() == 0){
//DMG MODIFIER
if(mcUsers.getProfile(attacker).getUnarmedInt() >= 50 && mcUsers.getProfile(attacker).getUnarmedInt() < 100){
@ -106,33 +105,7 @@ public class mcCombat {
/*
* CHECK FOR LEVEL UPS
*/
if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){
skillups++;
mcUsers.getProfile(attacker).removeSwordsGather(mcUsers.getProfile(attacker).getXpToLevel("swords"));
mcUsers.getProfile(attacker).skillUpSwords(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getSwords()+")");
}
if(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){
skillups++;
mcUsers.getProfile(attacker).removeAxesGather(mcUsers.getProfile(attacker).getXpToLevel("axes"));
mcUsers.getProfile(attacker).skillUpAxes(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getAxes()+")");
}
if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){
skillups++;
mcUsers.getProfile(attacker).removeUnarmedGather(mcUsers.getProfile(attacker).getXpToLevel("unarmed"));
mcUsers.getProfile(attacker).skillUpUnarmed(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getUnarmed()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
}
public void playerVersusSquidChecks(EntityDamageByEntityEvent event, Player attacker, Entity x, int type){
@ -143,35 +116,17 @@ public class mcCombat {
Squid defender = (Squid)event.getEntity();
if(mcm.getInstance().isSwords(attacker.getItemInHand()) && defender.getHealth() > 0 && mcPermissions.getInstance().swords(attacker)){
mcUsers.getProfile(attacker).addSwordsGather(10);
if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){
skillups++;
mcUsers.getProfile(attacker).removeSwordsGather(mcUsers.getProfile(attacker).getXpToLevel("swords"));
mcUsers.getProfile(attacker).skillUpSwords(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getSwords()+")");
}
}
mcSkills.getInstance().XpCheck(attacker);
if(mcm.getInstance().isAxes(attacker.getItemInHand())
&& defender.getHealth() > 0
&& mcPermissions.getInstance().axes(attacker)){
mcUsers.getProfile(attacker).addAxesGather(10);
if(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){
skillups++;
mcUsers.getProfile(attacker).removeAxesGather(mcUsers.getProfile(attacker).getXpToLevel("axes"));
mcUsers.getProfile(attacker).skillUpAxes(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getAxes()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
if(defender.getHealth() <= 0)
return;
if(mcUsers.getProfile(attacker).getAxesInt() >= 500){
event.setDamage(calculateDamage(event, (4 - axeNerf(attacker.getItemInHand().getTypeId()))));
event.setDamage(calculateDamage(event, 4));
}
}
/*
@ -200,15 +155,7 @@ public class mcCombat {
//XP
if(defender.getHealth() != 0){
mcUsers.getProfile(attacker).addUnarmedGather(10);
if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){
skillups++;
mcUsers.getProfile(attacker).removeUnarmedGather(mcUsers.getProfile(attacker).getXpToLevel("unarmed"));
mcUsers.getProfile(attacker).skillUpUnarmed(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getUnarmed()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
}
}
@ -223,12 +170,10 @@ public class mcCombat {
if(defender.getHealth() <= 0)
return;
if(mcUsers.getProfile(attacker).getAxesInt() >= 500){
event.setDamage(calculateDamage(event, (4 - axeNerf(attacker.getItemInHand().getTypeId()))));
event.setDamage(calculateDamage(event, 4));
}
}
if(type == 0 && mcPermissions.getInstance().unarmed(attacker)){
if(defender.getHealth() <= 0)
return;
if(mcUsers.getProfile(attacker).getUnarmedInt() >= 50 && mcUsers.getProfile(attacker).getUnarmedInt() < 100){
event.setDamage(calculateDamage(event, 1));
} else if(mcUsers.getProfile(attacker).getUnarmedInt() >= 100 && mcUsers.getProfile(attacker).getUnarmedInt() < 200){
@ -254,7 +199,7 @@ public class mcCombat {
/*
* AXE PROC CHECKS
*/
axeCriticalCheckMonster(attacker, event, x);
axeCriticalCheck(attacker, event, x);
if(!mcConfig.getInstance().isBleedTracked(x)){
bleedCheck(attacker, x);
}
@ -274,15 +219,7 @@ public class mcCombat {
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addSwordsGather(7);
}
if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){
skillups++;
mcUsers.getProfile(attacker).removeSwordsGather(mcUsers.getProfile(attacker).getXpToLevel("swords"));
mcUsers.getProfile(attacker).skillUpSwords(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getSwords()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
if(mcm.getInstance().isAxes(attacker.getItemInHand())
&& defender.getHealth() > 0
@ -300,24 +237,14 @@ public class mcCombat {
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addAxesGather(7);
}
if(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){
skillups++;
mcUsers.getProfile(attacker).removeAxesGather(mcUsers.getProfile(attacker).getXpToLevel("axes"));
mcUsers.getProfile(attacker).skillUpAxes(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getAxes()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
/*
* AXE DAMAGE SCALING && LOOT CHECKS
*/
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
if(defender.getHealth() <= 0)
return;
if(mcUsers.getProfile(attacker).getAxesInt() >= 500){
event.setDamage(calculateDamage(event, (4 - axeNerf(attacker.getItemInHand().getTypeId()))));
event.setDamage(calculateDamage(event, 4));
}
}
if(type == 0 && mcPermissions.getInstance().unarmed(attacker)){
@ -353,23 +280,31 @@ public class mcCombat {
if(x instanceof PigZombie)
mcUsers.getProfile(attacker).addUnarmedGather(15);
}
if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){
skillups++;
mcUsers.getProfile(attacker).removeUnarmedGather(mcUsers.getProfile(attacker).getXpToLevel("unarmed"));
mcUsers.getProfile(attacker).skillUpUnarmed(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getUnarmed()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
}
}
public void archeryCheck(EntityDamageByProjectileEvent event){
Entity y = event.getDamager();
Entity x = event.getEntity();
if(x instanceof Player){
Player defender = (Player)x;
if(mcPermissions.getInstance().unarmed(defender) && defender.getItemInHand().getTypeId() == 0){
if(mcUsers.getProfile(defender).getUnarmedInt() >= 1000){
if(Math.random() * 1000 >= 500){
event.setCancelled(true);
defender.sendMessage(ChatColor.WHITE+"**ARROW DEFLECT**");
return;
}
} else if(Math.random() * 1000 <= (mcUsers.getProfile(defender).getUnarmedInt() / 2)){
event.setCancelled(true);
defender.sendMessage(ChatColor.WHITE+"**ARROW DEFLECT**");
return;
}
}
}
/*
* Defender is player
* If attacker is player
*/
if(y instanceof Player){
Player attacker = (Player)y;
@ -407,7 +342,6 @@ public class mcCombat {
* Defender is Monster
*/
if(x instanceof Monster){
Monster defender = (Monster)x;
/*
* TRACK ARROWS USED AGAINST THE ENTITY
*/
@ -457,7 +391,6 @@ public class mcCombat {
*/
if(x instanceof Squid){
Squid defender = (Squid)x;
int healthbefore = defender.getHealth();
if(mcUsers.getProfile(attacker).getArcheryInt() >= 50 && mcUsers.getProfile(attacker).getArcheryInt() < 250)
event.setDamage(calculateDamage(event, 1));
if(mcUsers.getProfile(attacker).getArcheryInt() >= 250 && mcUsers.getProfile(attacker).getArcheryInt() < 575)
@ -528,24 +461,16 @@ public class mcCombat {
event.setDamage(calculateDamage(event, 5));
}
}
if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){
int skillups = 0;
while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){
skillups++;
mcUsers.getProfile(attacker).removeArcheryGather(mcUsers.getProfile(attacker).getXpToLevel("archery"));
mcUsers.getProfile(attacker).skillUpArchery(1);
}
attacker.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getArchery()+")");
}
mcSkills.getInstance().XpCheck(attacker);
}
}
public boolean simulateUnarmedProc(Player player){
if(mcUsers.getProfile(player).getUnarmedInt() >= 750){
if(Math.random() * 10 > 4){
if(Math.random() * 1000 >= 750){
return true;
}
}if(mcUsers.getProfile(player).getUnarmedInt() >= 350 && mcUsers.getProfile(player).getUnarmedInt() < 750){
if(Math.random() * 10 > 4){
} else {
if(Math.random() * 1000 <= mcUsers.getProfile(player).getUnarmedInt()){
return true;
}
}
@ -553,26 +478,8 @@ public class mcCombat {
}
public void bleedCheck(Player attacker, Entity x){
if(mcPermissions.getInstance().swords(attacker) && mcm.getInstance().isSwords(attacker.getItemInHand()) && !mcConfig.getInstance().isBleedTracked(x)){
if(mcUsers.getProfile(attacker).getSwordsInt() >= 50 && mcUsers.getProfile(attacker).getSwordsInt() < 200){
if(Math.random() * 10 > 8){
mcConfig.getInstance().addBleedTrack(x);
if(x instanceof Player){
Player target = (Player)x;
mcUsers.getProfile(target).setBleedTicks(4);
}
attacker.sendMessage(ChatColor.RED+"**Your target is bleeding**");
}
} else if(mcUsers.getProfile(attacker).getSwordsInt() >= 200 && mcUsers.getProfile(attacker).getSwordsInt() < 600){
if(Math.random() * 10 > 6){
mcConfig.getInstance().addBleedTrack(x);
if(x instanceof Player){
Player target = (Player)x;
mcUsers.getProfile(target).setBleedTicks(4);
}
attacker.sendMessage(ChatColor.RED+"**Your target is bleeding**");
}
} else if(mcUsers.getProfile(attacker).getSwordsInt() >= 600 && mcUsers.getProfile(attacker).getSwordsInt() < 900){
if(Math.random() * 10 > 4){
if(mcUsers.getProfile(attacker).getSwordsInt() >= 750){
if(Math.random() * 1000 >= 750){
mcConfig.getInstance().addBleedTrack(x);
if(x instanceof Player){
Player target = (Player)x;
@ -580,135 +487,31 @@ public class mcCombat {
}
attacker.sendMessage(ChatColor.RED+"**Your target is bleeding**");
}
} else if(mcUsers.getProfile(attacker).getSwordsInt() >= 900){
if(Math.random() * 100 > 25){
} else if (Math.random() * 1000 <= mcUsers.getProfile(attacker).getSwordsInt()){
mcConfig.getInstance().addBleedTrack(x);
if(x instanceof Player){
Player target = (Player)x;
mcUsers.getProfile(target).setBleedTicks(6);
mcUsers.getProfile(target).setBleedTicks(4);
}
attacker.sendMessage(ChatColor.RED+"**Your target is bleeding**");
}
}
}
}
public int axeNerf(int type){
//GOLD OR WOOD
if(type == 271 || type == 286){
return 3;
} else if (type == 258){
return 1;
} else if (type == 275){
return 1;
} else {
return 0;
}
}
public int calculateDamage(EntityDamageEvent event, int dmg){
return event.getDamage() + dmg;
}
public void axeCriticalCheckAnimals(Player attacker, EntityDamageByEntityEvent event, Entity x){
public void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Entity x){
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
if(mcUsers.getProfile(attacker).getAxesInt() >= 50 && mcUsers.getProfile(attacker).getAxesInt() < 250){
if(Math.random() * 100 > 95){
if(x instanceof Animals){
Animals animal = (Animals)x;
event.setDamage(event.getDamage() + animal.getHealth() * 2);
if(mcUsers.getProfile(attacker).getAxesInt() >= 750){
if(Math.random() * 1000 >= 750){
event.setDamage(event.getDamage() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
if(x instanceof Player){
Player player = (Player)x;
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 250 && mcUsers.getProfile(attacker).getAxesInt() < 500){
if(Math.random() * 10 > 9){
if(x instanceof Animals){
Animals animal = (Animals)x;
event.setDamage(event.getDamage() + animal.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 500 && mcUsers.getProfile(attacker).getAxesInt() < 750){
if(Math.random() * 10 > 8){
if(x instanceof Animals){
Animals animal = (Animals)x;
event.setDamage(event.getDamage() + animal.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 750 && mcUsers.getProfile(attacker).getAxesInt() < 1000){
if(Math.random() * 10 > 7){
if(x instanceof Animals){
Animals animal = (Animals)x;
event.setDamage(event.getDamage() + animal.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 1000){
if(Math.random() * 10 > 6){
if(x instanceof Animals){
Animals animal = (Animals)x;
event.setDamage(event.getDamage() + animal.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
}
}
public void axeCriticalCheckMonster(Player attacker, EntityDamageByEntityEvent event, Entity x){
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
if(mcUsers.getProfile(attacker).getAxesInt() >= 50 && mcUsers.getProfile(attacker).getAxesInt() < 250){
if(Math.random() * 100 > 95){
if(x instanceof Monster){
Monster monster = (Monster)x;
event.setDamage(event.getDamage() + monster.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 250 && mcUsers.getProfile(attacker).getAxesInt() < 500){
if(Math.random() * 10 > 9){
if(x instanceof Monster){
Monster monster = (Monster)x;
event.setDamage(event.getDamage() + monster.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 500 && mcUsers.getProfile(attacker).getAxesInt() < 750){
if(Math.random() * 10 > 8){
if(x instanceof Monster){
Monster monster = (Monster)x;
event.setDamage(event.getDamage() + monster.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 750 && mcUsers.getProfile(attacker).getAxesInt() < 1000){
if(Math.random() * 10 > 7){
if(x instanceof Monster){
Monster monster = (Monster)x;
event.setDamage(event.getDamage() + monster.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 1000){
if(Math.random() * 10 > 6){
if(x instanceof Monster){
Monster monster = (Monster)x;
event.setDamage(event.getDamage() + monster.getHealth() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
}
}
}
}
}
public void axeCriticalCheckPlayer(Player attacker, EntityDamageByEntityEvent event, Entity x, Plugin plugin){
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
if(mcUsers.getProfile(attacker).getAxesInt() >= 50 && mcUsers.getProfile(attacker).getAxesInt() < 250){
if(Math.random() * 100 > 95){
} else if(Math.random() * 1000 <= mcUsers.getProfile(attacker).getAxesInt()){
if(x instanceof Player){
Player player = (Player)x;
event.setDamage(event.getDamage() * 2);
@ -717,47 +520,6 @@ public class mcCombat {
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 250 && mcUsers.getProfile(attacker).getAxesInt() < 500){
if(Math.random() * 10 > 9){
if(x instanceof Player){
Player player = (Player)x;
event.setDamage(event.getDamage() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 500 && mcUsers.getProfile(attacker).getAxesInt() < 750){
if(Math.random() * 10 > 8){
if(x instanceof Player){
Player player = (Player)x;
event.setDamage(event.getDamage() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 750 && mcUsers.getProfile(attacker).getAxesInt() < 1000){
if(Math.random() * 10 > 7){
if(x instanceof Player){
Player player = (Player)x;
event.setDamage(event.getDamage() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
}
}
}
if(mcUsers.getProfile(attacker).getAxesInt() >= 1000){
if(Math.random() * 10 > 6){
if(x instanceof Player){
Player player = (Player)x;
event.setDamage(event.getDamage() * 2);
attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!");
player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!");
}
}
}
}
}
public void parryCheck(Player defender, EntityDamageByEntityEvent event, Entity y){
if(defender != null && mcm.getInstance().isSwords(defender.getItemInHand())

View File

@ -15,6 +15,7 @@ public class mcConfig {
static ArrayList<String> partyChatList = new ArrayList<String>();
static ArrayList<String> godModeList = new ArrayList<String>();
HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
//HashMap<Entity, Player, String[]> xptracker = new HashMap<Entity, Player, String[]>();
static ArrayList<Entity> bleedTracker = new ArrayList<Entity>();
static ArrayList<Entity> mobSpawnTracker = new ArrayList<Entity>();
public boolean isBlockWatched(Block block) {return blockWatchList.contains(block);}

View File

@ -53,14 +53,14 @@ public class mcEntityListener extends EntityListener {
/*
* ARCHERY CHECKS
*/
if(event instanceof EntityDamageByProjectileEvent){
if(event instanceof EntityDamageByProjectileEvent && event.getDamage() >= 1){
EntityDamageByProjectileEvent c = (EntityDamageByProjectileEvent)event;
mcCombat.getInstance().archeryCheck(c);
}
/*
* Entity Damage by Entity checks
*/
if(event instanceof EntityDamageByEntityEvent){
if(event instanceof EntityDamageByEntityEvent && event.getDamage() >= 1){
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event;
Entity e = eventb.getEntity(); //Defender
Entity f = eventb.getDamager(); //Attacker

View File

@ -144,14 +144,6 @@ public class mcExcavation {
}
}
}
if(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
int skillups = 0;
while(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
skillups++;
mcUsers.getProfile(player).removeExcavationGather(mcUsers.getProfile(player).getXpToLevel("excavation"));
mcUsers.getProfile(player).skillUpExcavation(1);
}
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")");
}
mcSkills.getInstance().XpCheck(player);
}
}

View File

@ -39,21 +39,27 @@ public class mcHerbalism {
*/
if(!mcConfig.getInstance().isBlockWatched(block)){
if(type == 39 || type == 40){
mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0);
if(player != null){
if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){
loc.getWorld().dropItemNaturally(loc, is);
}
}
mcUsers.getProfile(player).addHerbalismGather(10);
}
if(type == 37 || type == 38){
mat = Material.getMaterial(296);
is = new ItemStack(mat, 1, (byte)0, (byte)0);
if(player != null){
if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){
loc.getWorld().dropItemNaturally(loc, is);
}
}
mcUsers.getProfile(player).addHerbalismGather(3);
}
}
if(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
int skillups = 0;
while(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
skillups++;
mcUsers.getProfile(player).removeHerbalismGather(mcUsers.getProfile(player).getXpToLevel("herbalism"));
mcUsers.getProfile(player).skillUpHerbalism(1);
}
player.sendMessage(ChatColor.YELLOW+"Herbalism skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getHerbalism()+")");
}
mcSkills.getInstance().XpCheck(player);
}
public void breadCheck(Player player, ItemStack is){
if(is.getTypeId() == 297){

View File

@ -32,7 +32,7 @@ public class mcMMO extends JavaPlugin {
//herp
public void onEnable() {
//mcMMO_Timer.schedule(new mcTimer(this), 0, (long)(2000));
mcMMO_Timer.schedule(new mcTimer(this), 0, (long)(2000));
//Make the directory if it does not exist
new File(maindirectory).mkdir();
//Make the file if it does not exist

View File

@ -19,6 +19,36 @@ public class mcMining {
}
return instance;
}
public void superBreakerCheck(Player player, Block block){
if(mcm.getInstance().isMiningPick(player.getItemInHand())){
if(block != null){
if(!mcm.getInstance().abilityBlockCheck(block))
return;
}
int miningticks = 8;
if(mcUsers.getProfile(player).getMiningInt() >= 100)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 250)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 500)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 750)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 1000)
miningticks++;
if(!mcUsers.getProfile(player).getSuperBreakerMode() && mcUsers.getProfile(player).getSuperBreakerCooldown() == 0){
player.sendMessage(ChatColor.GREEN+"**SUPER BREAKER ACTIVATED**");
mcUsers.getProfile(player).setSuperBreakerTicks(miningticks);
mcUsers.getProfile(player).setSuperBreakerMode(true);
}
if(!mcUsers.getProfile(player).getSuperBreakerMode() && mcUsers.getProfile(player).getSuperBreakerCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
}
}
}
public void blockProcSimulate(Block block){
Location loc = block.getLocation();
Material mat = Material.getMaterial(block.getTypeId());
@ -103,15 +133,98 @@ public class mcMining {
mcUsers.getProfile(player).addMiningGather(40);
blockProcCheck(block, player);
}
if(player != null && mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
int skillups = 0;
while(mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
skillups++;
mcUsers.getProfile(player).removeMiningGather(mcUsers.getProfile(player).getXpToLevel("mining"));
mcUsers.getProfile(player).skillUpMining(1);
mcSkills.getInstance().XpCheck(player);
}
player.sendMessage(ChatColor.YELLOW+"Mining skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getMining()+")");
/*
* Handling SuperBreaker stuff
*/
public Boolean canBeSuperBroken(Block block){
int t = block.getTypeId();
if(t == 73 || t == 74 || t == 56 || t == 21 || t == 1 || t == 16 || t == 14 || t == 15){
return true;
} else {
return false;
}
}
public void SuperBreakerBlockCheck(Player player, Block block){
Location loc = block.getLocation();
Material mat = Material.getMaterial(block.getTypeId());
byte damage = 0;
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
if(block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16)
loc.getWorld().dropItemNaturally(loc, item);
if(block.getTypeId() == 1 || block.getTypeId() == 24){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
}
mat = Material.getMaterial(4);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
}
//COAL
if(block.getTypeId() == 16){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(10);
blockProcCheck(block, player);
}
mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
}
//GOLD
if(block.getTypeId() == 14){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(35);
blockProcCheck(block, player);
}
}
//DIAMOND
if(block.getTypeId() == 56){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(75);
blockProcCheck(block, player);
}
mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
}
//IRON
if(block.getTypeId() == 15){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(25);
blockProcCheck(block, player);
}
}
//REDSTONE
if(block.getTypeId() == 73 || block.getTypeId() == 74){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(15);
blockProcCheck(block, player);
}
mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item);
if(Math.random() * 10 > 5){
loc.getWorld().dropItemNaturally(loc, item);
}
}
//LAPUS
if(block.getTypeId() == 21){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(40);
blockProcCheck(block, player);
}
mat = Material.getMaterial(351);
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item);
}
mcSkills.getInstance().XpCheck(player);
block.setType(Material.AIR);
}
}

View File

@ -37,6 +37,13 @@ public class mcPermissions {
return true;
}
}
public boolean miningability(Player player){
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.mining");
} else {
return true;
}
}
public boolean woodcuttingability(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.ability.woodcutting");

View File

@ -70,21 +70,15 @@ public class mcPlayerListener extends PlayerListener {
Player player = event.getPlayer();
ItemStack is = player.getItemInHand();
/*
if(mcPermissions.getInstance().woodcuttingability(player) && mcm.getInstance().isAxes(is)){
if(block != null){
if(!mcm.getInstance().abilityBlockCheck(block))
return;
}
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() == 0){
player.sendMessage(ChatColor.GRAY+"You feel great strength enter you");
mcUsers.getProfile(player).setTreeFellerTicks(8);
mcUsers.getProfile(player).setTreeFellerMode(true);
}
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
}
}
* ABILITY ACTIVATION CHECKS
*/
if(mcPermissions.getInstance().woodcuttingability(player)){
mcWoodCutting.getInstance().treeFellerCheck(player, block);
}
if(mcPermissions.getInstance().miningability(player)){
mcMining.getInstance().superBreakerCheck(player, block);
}
if(mcPermissions.getInstance().herbalism(player)){
//BREADCHECK, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS
mcHerbalism.getInstance().breadCheck(player, is);

View File

@ -82,15 +82,7 @@ public class mcRepair {
/*
* GIVE SKILL IF THERE IS ENOUGH XP
*/
if(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
int skillups = 0;
while(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
skillups++;
mcUsers.getProfile(player).removeRepairGather(mcUsers.getProfile(player).getXpToLevel("repair"));
mcUsers.getProfile(player).skillUpRepair(1);
}
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getRepair()+")");
}
mcSkills.getInstance().XpCheck(player);
}
}
public boolean isArmor(ItemStack is){

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50;
import org.bukkit.ChatColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -32,6 +33,128 @@ public class mcSkills {
}
}
}
public void XpCheck(Player player){
/*
* ACROBATICS
*/
if(player != null && mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
int skillups = 0;
while(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){
skillups++;
mcUsers.getProfile(player).removeAcrobaticsGather(mcUsers.getProfile(player).getXpToLevel("acrobatics"));
mcUsers.getProfile(player).skillUpAcrobatics(1);
}
player.sendMessage(ChatColor.YELLOW+"Acrobatics skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getAcrobatics()+")");
}
/*
* ARCHERY
*/
if(mcUsers.getProfile(player).getArcheryGatherInt() >= mcUsers.getProfile(player).getXpToLevel("archery")){
int skillups = 0;
while(mcUsers.getProfile(player).getArcheryGatherInt() >= mcUsers.getProfile(player).getXpToLevel("archery")){
skillups++;
mcUsers.getProfile(player).removeArcheryGather(mcUsers.getProfile(player).getXpToLevel("archery"));
mcUsers.getProfile(player).skillUpArchery(1);
}
player.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getArchery()+")");
}
/*
* SWORDS
*/
if(mcUsers.getProfile(player).getSwordsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("swords")){
int skillups = 0;
while(mcUsers.getProfile(player).getSwordsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("swords")){
skillups++;
mcUsers.getProfile(player).removeSwordsGather(mcUsers.getProfile(player).getXpToLevel("swords"));
mcUsers.getProfile(player).skillUpSwords(1);
}
player.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getSwords()+")");
}
/*
* AXES
*/
if(mcUsers.getProfile(player).getAxesGatherInt() >= mcUsers.getProfile(player).getXpToLevel("axes")){
int skillups = 0;
while(mcUsers.getProfile(player).getAxesGatherInt() >= mcUsers.getProfile(player).getXpToLevel("axes")){
skillups++;
mcUsers.getProfile(player).removeAxesGather(mcUsers.getProfile(player).getXpToLevel("axes"));
mcUsers.getProfile(player).skillUpAxes(1);
}
player.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getAxes()+")");
}
/*
* UNARMED
*/
if(mcUsers.getProfile(player).getUnarmedGatherInt() >= mcUsers.getProfile(player).getXpToLevel("unarmed")){
int skillups = 0;
while(mcUsers.getProfile(player).getUnarmedGatherInt() >= mcUsers.getProfile(player).getXpToLevel("unarmed")){
skillups++;
mcUsers.getProfile(player).removeUnarmedGather(mcUsers.getProfile(player).getXpToLevel("unarmed"));
mcUsers.getProfile(player).skillUpUnarmed(1);
}
player.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getUnarmed()+")");
}
/*
* HERBALISM
*/
if(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
int skillups = 0;
while(mcUsers.getProfile(player).getHerbalismGatherInt() >= mcUsers.getProfile(player).getXpToLevel("herbalism")){
skillups++;
mcUsers.getProfile(player).removeHerbalismGather(mcUsers.getProfile(player).getXpToLevel("herbalism"));
mcUsers.getProfile(player).skillUpHerbalism(1);
}
player.sendMessage(ChatColor.YELLOW+"Herbalism skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getHerbalism()+")");
}
/*
* MINING
*/
if(player != null && mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
int skillups = 0;
while(mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){
skillups++;
mcUsers.getProfile(player).removeMiningGather(mcUsers.getProfile(player).getXpToLevel("mining"));
mcUsers.getProfile(player).skillUpMining(1);
}
player.sendMessage(ChatColor.YELLOW+"Mining skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getMining()+")");
}
/*
* WOODCUTTING
*/
if(player != null && mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
int skillups = 0;
while(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){
skillups++;
mcUsers.getProfile(player).removeWoodCuttingGather(mcUsers.getProfile(player).getXpToLevel("woodcutting"));
mcUsers.getProfile(player).skillUpWoodCutting(1);
}
player.sendMessage(ChatColor.YELLOW+"WoodCutting skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getWoodCutting()+")");
}
/*
* REPAIR
*/
if(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
int skillups = 0;
while(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){
skillups++;
mcUsers.getProfile(player).removeRepairGather(mcUsers.getProfile(player).getXpToLevel("repair"));
mcUsers.getProfile(player).skillUpRepair(1);
}
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getRepair()+")");
}
/*
* EXCAVATION
*/
if(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
int skillups = 0;
while(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){
skillups++;
mcUsers.getProfile(player).removeExcavationGather(mcUsers.getProfile(player).getXpToLevel("excavation"));
mcUsers.getProfile(player).skillUpExcavation(1);
}
player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getExcavation()+")");
}
}
public boolean isSkill(String skillname){
if(skillname.equals("mining")){
return true;

View File

@ -62,10 +62,14 @@ public class mcTimer extends TimerTask{
}
mcCombat.getInstance().bleedSimulate();
*/
/*
* TREE FELLER INTERACTIONS
* COOLDOWN INTERACTIONS
*/
for(Player player : playerlist){
/*
* WOODCUTTING ABILITY
*/
if(mcPermissions.getInstance().woodcuttingability(player)){
//Monitor the length of TreeFeller mode
if(mcUsers.getProfile(player).getTreeFellerMode()){
@ -84,6 +88,27 @@ public class mcTimer extends TimerTask{
}
}
}
/*
* MINING ABILITY
*/
if(mcPermissions.getInstance().miningability(player)){
//Monitor the length of SuperBreaker mode
if(mcUsers.getProfile(player).getSuperBreakerMode()){
mcUsers.getProfile(player).decreaseSuperBreakerTicks();
if(mcUsers.getProfile(player).getSuperBreakerTicks() <= 0){
mcUsers.getProfile(player).setSuperBreakerMode(false);
mcUsers.getProfile(player).setSuperBreakerCooldown(120);
player.sendMessage(ChatColor.GRAY+"**You feel strength leaving you**");
}
}
//Monitor the cooldown
if(!mcUsers.getProfile(player).getSuperBreakerMode() && mcUsers.getProfile(player).getSuperBreakerCooldown() >= 1){
mcUsers.getProfile(player).decreaseSuperBreakerCooldown();
if(mcUsers.getProfile(player).getSuperBreakerCooldown() == 0){
player.sendMessage(ChatColor.GREEN+"Your Super Breaker ability is refreshed!");
}
}
}
}
}
}

View File

@ -156,8 +156,8 @@ class PlayerList
protected final Logger log = Logger.getLogger("Minecraft");
private String playerName, gather, wgather, woodcutting, repair, mining, party, myspawn, myspawnworld, unarmed, herbalism, excavation,
archery, swords, axes, invite, acrobatics, repairgather, unarmedgather, herbalismgather, excavationgather, archerygather, swordsgather, axesgather, acrobaticsgather;
private boolean dead, treefellermode;
private int recentlyhurt = 0, bleedticks = 0, treefellerticks = 0, treefellercooldown = 0;
private boolean dead, treefellermode, superbreakermode;
private int recentlyhurt = 0, bleedticks = 0, superbreakerticks = 0, superbreakercooldown = 0, treefellerticks = 0, treefellercooldown = 0;
Player thisplayer;
char defaultColor;
@ -433,6 +433,9 @@ class PlayerList
public void setBleedTicks(Integer newvalue){
bleedticks = newvalue;
}
/*
* TREE FELLER STUFF
*/
public boolean getTreeFellerMode(){
return treefellermode;
}
@ -461,6 +464,38 @@ class PlayerList
treefellercooldown--;
}
}
/*
* MINING
*/
public boolean getSuperBreakerMode(){
return superbreakermode;
}
public void setSuperBreakerMode(Boolean bool){
superbreakermode = bool;
}
public Integer getSuperBreakerTicks(){
return superbreakerticks;
}
public void setSuperBreakerTicks(Integer newvalue){
superbreakerticks = newvalue;
}
public void decreaseSuperBreakerTicks(){
if(superbreakerticks >= 1){
superbreakerticks--;
}
}
public void setSuperBreakerCooldown(Integer newvalue){
superbreakercooldown = newvalue;
}
public int getSuperBreakerCooldown(){
return superbreakercooldown;
}
public void decreaseSuperBreakerCooldown(){
if(superbreakercooldown >= 1){
superbreakercooldown--;
}
}
public Integer getRecentlyHurt(){
return recentlyhurt;
}
@ -1158,34 +1193,34 @@ class PlayerList
}
}
public void modifyskill(int newvalue, String skillname){
if(skillname.equals("mining")){
if(skillname.toLowerCase().equals("mining")){
mining = String.valueOf(newvalue);
}
if(skillname.equals("woodcutting")){
if(skillname.toLowerCase().equals("woodcutting")){
woodcutting = String.valueOf(newvalue);
}
if(skillname.equals("repair")){
if(skillname.toLowerCase().equals("repair")){
repair = String.valueOf(newvalue);
}
if(skillname.equals("herbalism")){
if(skillname.toLowerCase().equals("herbalism")){
herbalism = String.valueOf(newvalue);
}
if(skillname.equals("acrobatics")){
if(skillname.toLowerCase().equals("acrobatics")){
acrobatics = String.valueOf(newvalue);
}
if(skillname.equals("swords")){
if(skillname.toLowerCase().equals("swords")){
swords = String.valueOf(newvalue);
}
if(skillname.equals("archery")){
if(skillname.toLowerCase().equals("archery")){
archery = String.valueOf(newvalue);
}
if(skillname.equals("unarmed")){
if(skillname.toLowerCase().equals("unarmed")){
unarmed = String.valueOf(newvalue);
}
if(skillname.equals("excavation")){
if(skillname.toLowerCase().equals("excavation")){
excavation = String.valueOf(newvalue);
}
if(skillname.equals("axes")){
if(skillname.toLowerCase().equals("axes")){
axes = String.valueOf(newvalue);
}
save();

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -34,6 +35,35 @@ public class mcWoodCutting {
}
}
}
public void treeFellerCheck(Player player, Block block){
if(mcm.getInstance().isAxes(player.getItemInHand())){
if(block != null){
if(!mcm.getInstance().abilityBlockCheck(block))
return;
}
int treefellticks = 8;
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 100)
treefellticks++;
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 250)
treefellticks++;
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 500)
treefellticks++;
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 750)
treefellticks++;
if(mcUsers.getProfile(player).getWoodCuttingInt() >= 1000)
treefellticks++;
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() == 0){
player.sendMessage(ChatColor.GREEN+"**TREE FELLING ACTIVATED**");
mcUsers.getProfile(player).setTreeFellerTicks(treefellticks);
mcUsers.getProfile(player).setTreeFellerMode(true);
}
if(!mcUsers.getProfile(player).getTreeFellerMode() && mcUsers.getProfile(player).getTreeFellerCooldown() >= 1){
player.sendMessage(ChatColor.RED+"You are too tired to use that ability again.");
}
}
}
public void treeFeller(Block block, Player player){
int radius = 1;
if(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= 500)
@ -69,6 +99,7 @@ public class mcWoodCutting {
int vx = x.getX();
int vy = x.getY();
int vz = x.getZ();
/*
* Run through the blocks around the broken block to see if they qualify to be 'felled'
*/

View File

@ -245,6 +245,17 @@ public class mcm {
}
if(split[0].equalsIgnoreCase("/archery")){
event.setCancelled(true);
Integer rank = 0;
if(mcUsers.getProfile(player).getArcheryInt() >= 50)
rank++;
if(mcUsers.getProfile(player).getArcheryInt() >= 250)
rank++;
if(mcUsers.getProfile(player).getArcheryInt() >= 575)
rank++;
if(mcUsers.getProfile(player).getArcheryInt() >= 725)
rank++;
if(mcUsers.getProfile(player).getArcheryInt() >= 1000)
rank++;
float skillvalue = (float)mcUsers.getProfile(player).getArcheryInt();
String percentage = String.valueOf((skillvalue / 1000) * 100);
String percentagefire = String.valueOf((skillvalue / 1500) * 100);
@ -258,23 +269,58 @@ public class mcm {
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Chance to Retrieve Arrows: "+ChatColor.YELLOW+percentage+"%");
player.sendMessage(ChatColor.RED+"Chance for Ignition: "+ChatColor.YELLOW+percentagefire+"%");
player.sendMessage(ChatColor.RED+"Damage+ (Rank"+rank+"): Bonus "+rank+" damage");
}
if(split[0].equalsIgnoreCase("/axes")){
event.setCancelled(true);
String percentage;
float skillvalue = (float)mcUsers.getProfile(player).getAxesInt();
if(mcUsers.getProfile(player).getAxesInt() < 750){
percentage = String.valueOf((skillvalue / 1000) * 100);
} else {
percentage = "75";
}
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"AXES"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes (Monster): "+ChatColor.GREEN+"Instant kill");
player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes (Players): "+ChatColor.GREEN+"Double Damage");
player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes: "+ChatColor.GREEN+"Double Damage");
player.sendMessage(ChatColor.DARK_AQUA+"Axe Mastery (500 SKILL): "+ChatColor.GREEN+"Modifies Damage");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Chance to crtically strike: "+ChatColor.YELLOW+percentage+"%");
if(mcUsers.getProfile(player).getAxesInt() < 500){
player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 500+ SKILL (AXEMASTERY)");
} else {
player.sendMessage(ChatColor.GREEN+"Axe Mastery - Bonus 4 damage");
}
}
if(split[0].equalsIgnoreCase("/swords")){
event.setCancelled(true);
String percentage, parrypercentage = null;
float skillvalue = (float)mcUsers.getProfile(player).getSwordsInt();
if(mcUsers.getProfile(player).getSwordsInt() < 750){
percentage = String.valueOf((skillvalue / 1000) * 100);
} else {
percentage = "75";
}
if(mcUsers.getProfile(player).getSwordsInt() >= 775){
parrypercentage = "20";
} else if (mcUsers.getProfile(player).getSwordsInt() >= 445){
parrypercentage = "15";
} else if (mcUsers.getProfile(player).getSwordsInt() >= 250){
parrypercentage = "10";
} else if (mcUsers.getProfile(player).getSwordsInt() >= 25){
parrypercentage = "5";
} else {
parrypercentage = "0";
}
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"SWORDS"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.DARK_AQUA+"Parrying: "+ChatColor.GREEN+"Negates Damage");
player.sendMessage(ChatColor.DARK_AQUA+"Bleed: "+ChatColor.GREEN+"Apply a 2 second bleed DoT to enemies");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Bleed Chance: "+ChatColor.YELLOW+percentage+"%");
player.sendMessage(ChatColor.RED+"Parry Chance:"+ChatColor.YELLOW+parrypercentage+"%");
}
if(split[0].equalsIgnoreCase("/acrobatics")){
event.setCancelled(true);
@ -290,13 +336,26 @@ public class mcm {
if(split[0].equalsIgnoreCase("/mining")){
float skillvalue = (float)mcUsers.getProfile(player).getMiningInt();
String percentage = String.valueOf((skillvalue / 1000) * 100);
int miningticks = 8;
if(mcUsers.getProfile(player).getMiningInt() >= 100)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 250)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 500)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 750)
miningticks++;
if(mcUsers.getProfile(player).getMiningInt() >= 1000)
miningticks++;
event.setCancelled(true);
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"MINING"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Mining Stone & Ore");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.DARK_AQUA+"Super Breaker (ABILITY): "+ChatColor.GREEN+"Fast mining");
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops: "+ChatColor.GREEN+"Double the normal loot");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%");
player.sendMessage(ChatColor.RED+"Super Breaker Length: "+ChatColor.YELLOW+(miningticks * 2)+"s");
}
if(split[0].equalsIgnoreCase("/repair")){
float skillvalue = (float)mcUsers.getProfile(player).getRepairInt();
@ -306,20 +365,75 @@ public class mcm {
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Repairing");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.DARK_AQUA+"Repair: "+ChatColor.GREEN+"Repair Iron Tools & Armor");
player.sendMessage(ChatColor.DARK_AQUA+"Super Repair: "+ChatColor.GREEN+"Fully Repair an item");
player.sendMessage(ChatColor.DARK_AQUA+"Diamond Repair ("+mcLoadProperties.repairdiamondlevel+"+ SKILL): "+ChatColor.GREEN+"Repair Diamond Tools & Armor");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Super Repair Chance: "+ChatColor.YELLOW+percentage+"%");
}
if(split[0].equalsIgnoreCase("/unarmed")){
event.setCancelled(true);
int rank = 0;
String percentage, arrowpercentage;
float skillvalue = (float)mcUsers.getProfile(player).getUnarmedInt();
if(mcUsers.getProfile(player).getUnarmedInt() < 750){
percentage = String.valueOf((skillvalue / 1000) * 100);
} else {
percentage = "75";
}
if(mcUsers.getProfile(player).getUnarmedInt() < 1000){
percentage = String.valueOf(((skillvalue / 1000) * 100) / 2);
} else {
percentage = "50";
}
if(mcUsers.getProfile(player).getUnarmedInt() >= 50)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 100)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 200)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 325)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 475)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 600)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 775)
rank++;
if(mcUsers.getProfile(player).getUnarmedInt() >= 950)
rank++;
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"UNARMED"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.DARK_AQUA+"Disarm (Players): "+ChatColor.GREEN+"Drops the foes item held in hand");
player.sendMessage(ChatColor.DARK_AQUA+"Damage+: "+ChatColor.GREEN+"Modifies Damage");
player.sendMessage(ChatColor.DARK_AQUA+"Arrow Deflect: "+ChatColor.GREEN+"Deflect arrows");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Disarm Chance: "+ChatColor.YELLOW+percentage+"%");
player.sendMessage(ChatColor.RED+"Damage+ (Rank"+rank+"): Bonus "+rank+" damage");
}
if(split[0].equalsIgnoreCase("/herbalism")){
event.setCancelled(true);
int rank = 0;
if(mcUsers.getProfile(player).getHerbalismInt() >= 50){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 150){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 250){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 350){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 450){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 550){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 650){
rank++;
} else if (mcUsers.getProfile(player).getHerbalismInt() >= 750){
rank++;
}
float skillvalue = (float)mcUsers.getProfile(player).getHerbalismInt();
String percentage = String.valueOf((skillvalue / 1000) * 100);
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"HERBALISM"+ChatColor.RED+"[]-----");
@ -329,9 +443,9 @@ public class mcm {
player.sendMessage(ChatColor.DARK_AQUA+"Double Drops (Wheat): "+ChatColor.GREEN+"Double the normal loot");
player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---");
player.sendMessage(ChatColor.RED+"Double Drop Chance: "+percentage+"%");
player.sendMessage(ChatColor.RED+"Food+ (Rank"+rank+"): Bonus "+rank+" healing");
}
if(split[0].equalsIgnoreCase("/excavation")){
event.setCancelled(true);
player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"EXCAVATION"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Digging and finding treasures");

View File

@ -1,3 +1,3 @@
name: mcMMO
main: com.gmail.nossr50.mcMMO
version: 0.8.20
version: 0.9 WIP