diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index f9554b5b0..edc9c076e 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,5 +1,16 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code# +Version 0.9 + / 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 diff --git a/mcMMO/com/gmail/nossr50/mcAcrobatics.java b/mcMMO/com/gmail/nossr50/mcAcrobatics.java index c86b3993e..4a314b3ec 100644 --- a/mcMMO/com/gmail/nossr50/mcAcrobatics.java +++ b/mcMMO/com/gmail/nossr50/mcAcrobatics.java @@ -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()) diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index 2629e9950..81a8f614d 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -45,99 +45,102 @@ public class mcBlockListener extends BlockListener { } //put all Block related code here public void onBlockDamage(BlockDamageEvent event) { - //STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2); - Player player = event.getPlayer(); - ItemStack inhand = player.getItemInHand(); - //player.sendMessage("mcMMO DEBUG: EVENT-OK DMG LEVEL ("+event.getDamageLevel().getLevel()+")"); - Block block = event.getBlock(); - Location loc = block.getLocation(); - int dmg = event.getDamageLevel().getLevel(); - /* - * HERBALISM - */ - if(dmg == 3){ - if(mcPermissions.getInstance().herbalism(player)) - mcHerbalism.getInstance().herbalismProcCheck(block, player); + //STARTED(0), DIGGING(1), BROKEN(3), STOPPED(2); + Player player = event.getPlayer(); + ItemStack inhand = player.getItemInHand(); + //player.sendMessage("mcMMO DEBUG: EVENT-OK DMG LEVEL ("+event.getDamageLevel().getLevel()+")"); + 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 + */ + if(dmg == 3){ + 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)) - mcMining.getInstance().miningBlockCheck(player, block); - } else { - mcMining.getInstance().miningBlockCheck(player, block); - } + * MINING + */ + if(mcPermissions.getInstance().mining(player)){ + if(mcLoadProperties.miningrequirespickaxe){ + if(mcm.getInstance().isMiningPick(inhand)) + mcMining.getInstance().miningBlockCheck(player, block); + } else { + mcMining.getInstance().miningBlockCheck(player, block); } - /* - * WOOD CUTTING - */ - if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){ - if(mcLoadProperties.woodcuttingrequiresaxe){ - if(mcm.getInstance().isAxes(inhand)){ - mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc); - mcUsers.getProfile(player).addWoodcuttingGather(7); - } - } else { + } + /* + * WOOD CUTTING + */ + if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){ + if(mcLoadProperties.woodcuttingrequiresaxe){ + if(mcm.getInstance().isAxes(inhand)){ mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc); - mcUsers.getProfile(player).addWoodcuttingGather(7); + mcUsers.getProfile(player).addWoodcuttingGather(7); } - /* - * IF PLAYER IS USING TREEFELLER - */ - if(mcPermissions.getInstance().woodcuttingability(player) && mcUsers.getProfile(player).getTreeFellerMode() && block.getTypeId() == 17){ - mcWoodCutting.getInstance().treeFeller(block, player); - for(Block blockx : mcConfig.getInstance().getTreeFeller()){ - if(blockx != null){ - Material mat = Material.getMaterial(blockx.getTypeId()); - byte damage = 0; - ItemStack item = new ItemStack(mat, 1, (byte)0, damage); - blockx.setTypeId(0); - if(item.getTypeId() == 17){ + } else { + mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc); + mcUsers.getProfile(player).addWoodcuttingGather(7); + } + mcSkills.getInstance().XpCheck(player); + /* + * IF PLAYER IS USING TREEFELLER + */ + if(mcPermissions.getInstance().woodcuttingability(player) && mcUsers.getProfile(player).getTreeFellerMode() && block.getTypeId() == 17){ + mcWoodCutting.getInstance().treeFeller(block, player); + for(Block blockx : mcConfig.getInstance().getTreeFeller()){ + if(blockx != null){ + Material mat = Material.getMaterial(17); + byte damage = 0; + ItemStack item = new ItemStack(mat, 1, (byte)0, damage); + 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); - if(Math.random() * 10 > 8) + } + + if(item.getTypeId() == 18){ + mat = Material.getMaterial(6); + item = new ItemStack(mat, 1, (byte)0, damage); + if(Math.random() * 10 > 8) blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item); - } } } + } /* * NOTE TO SELF * I NEED TO REMOVE TREE FELL BLOCKS FROM BEING WATCHED AFTER THIS CODE IS EXECUTED * OR ELSE IT COULD BE A MEMORY LEAK SITUATION */ mcConfig.getInstance().clearTreeFeller(); - } - } + } + } /* * EXCAVATION */ 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 World world = event.getBlock().getWorld(); diff --git a/mcMMO/com/gmail/nossr50/mcCombat.java b/mcMMO/com/gmail/nossr50/mcCombat.java index d2a443d2d..72a6c1dfd 100644 --- a/mcMMO/com/gmail/nossr50/mcCombat.java +++ b/mcMMO/com/gmail/nossr50/mcCombat.java @@ -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,181 +487,36 @@ public class mcCombat { } attacker.sendMessage(ChatColor.RED+"**Your target is bleeding**"); } - } else if(mcUsers.getProfile(attacker).getSwordsInt() >= 900){ - if(Math.random() * 100 > 25){ - mcConfig.getInstance().addBleedTrack(x); - if(x instanceof Player){ - Player target = (Player)x; - mcUsers.getProfile(target).setBleedTicks(6); - } - attacker.sendMessage(ChatColor.RED+"**Your target is bleeding**"); + } 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(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); - 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 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){ + 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; - 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() >= 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!"); - } + } else if(Math.random() * 1000 <= mcUsers.getProfile(attacker).getAxesInt()){ + 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!"); } } } diff --git a/mcMMO/com/gmail/nossr50/mcConfig.java b/mcMMO/com/gmail/nossr50/mcConfig.java index 64e61053c..c41389d28 100644 --- a/mcMMO/com/gmail/nossr50/mcConfig.java +++ b/mcMMO/com/gmail/nossr50/mcConfig.java @@ -15,6 +15,7 @@ public class mcConfig { static ArrayList partyChatList = new ArrayList(); static ArrayList godModeList = new ArrayList(); HashMap arrowTracker = new HashMap(); + //HashMap xptracker = new HashMap(); static ArrayList bleedTracker = new ArrayList(); static ArrayList mobSpawnTracker = new ArrayList(); public boolean isBlockWatched(Block block) {return blockWatchList.contains(block);} diff --git a/mcMMO/com/gmail/nossr50/mcEntityListener.java b/mcMMO/com/gmail/nossr50/mcEntityListener.java index 5bded139a..546f9a24b 100644 --- a/mcMMO/com/gmail/nossr50/mcEntityListener.java +++ b/mcMMO/com/gmail/nossr50/mcEntityListener.java @@ -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 diff --git a/mcMMO/com/gmail/nossr50/mcExcavation.java b/mcMMO/com/gmail/nossr50/mcExcavation.java index 25863aa20..61de2ad52 100644 --- a/mcMMO/com/gmail/nossr50/mcExcavation.java +++ b/mcMMO/com/gmail/nossr50/mcExcavation.java @@ -127,12 +127,12 @@ public class mcExcavation { } //CHANCE TO GET SULPHUR if(mcLoadProperties.sulphur == true && mcUsers.getProfile(player).getExcavationInt() > 75){ - if(Math.random() * 10 > 9){ - mcUsers.getProfile(player).addExcavationGather(3); - mat = Material.getMaterial(289); - is = new ItemStack(mat, 1, (byte)0, (byte)0); - loc.getWorld().dropItemNaturally(loc, is); - } + if(Math.random() * 10 > 9){ + mcUsers.getProfile(player).addExcavationGather(3); + mat = Material.getMaterial(289); + is = new ItemStack(mat, 1, (byte)0, (byte)0); + loc.getWorld().dropItemNaturally(loc, is); + } } //CHANCE TO GET BONES if(mcLoadProperties.bones == true && mcUsers.getProfile(player).getExcavationInt() > 175){ @@ -142,16 +142,8 @@ public class mcExcavation { is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } - } + } } - 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); } } diff --git a/mcMMO/com/gmail/nossr50/mcHerbalism.java b/mcMMO/com/gmail/nossr50/mcHerbalism.java index be737cd0a..5b0279832 100644 --- a/mcMMO/com/gmail/nossr50/mcHerbalism.java +++ b/mcMMO/com/gmail/nossr50/mcHerbalism.java @@ -38,22 +38,28 @@ public class mcHerbalism { * We need to check not-wheat stuff for if it was placed by the player or not */ if(!mcConfig.getInstance().isBlockWatched(block)){ - if(type == 39 || type == 40){ - mcUsers.getProfile(player).addHerbalismGather(10); - } - if(type == 37 || type == 38){ - mcUsers.getProfile(player).addHerbalismGather(3); + 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){ diff --git a/mcMMO/com/gmail/nossr50/mcMMO.java b/mcMMO/com/gmail/nossr50/mcMMO.java index ecbabd32a..8efa50bba 100644 --- a/mcMMO/com/gmail/nossr50/mcMMO.java +++ b/mcMMO/com/gmail/nossr50/mcMMO.java @@ -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 diff --git a/mcMMO/com/gmail/nossr50/mcMining.java b/mcMMO/com/gmail/nossr50/mcMining.java index 989e18e49..c74670f73 100644 --- a/mcMMO/com/gmail/nossr50/mcMining.java +++ b/mcMMO/com/gmail/nossr50/mcMining.java @@ -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()); @@ -36,29 +66,29 @@ public class mcMining { loc.getWorld().dropItemNaturally(loc, item); } } - if(block.getTypeId() == 21){ - 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); - } - if(block.getTypeId() == 56){ - mat = Material.getMaterial(264); - item = new ItemStack(mat, 1, (byte)0, damage); - loc.getWorld().dropItemNaturally(loc, item); - } - if(block.getTypeId() == 1){ - mat = Material.getMaterial(4); - item = new ItemStack(mat, 1, (byte)0, damage); - loc.getWorld().dropItemNaturally(loc, item); - } - if(block.getTypeId() == 16){ - mat = Material.getMaterial(263); - item = new ItemStack(mat, 1, (byte)0, damage); - loc.getWorld().dropItemNaturally(loc, item); - } + if(block.getTypeId() == 21){ + 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); + } + if(block.getTypeId() == 56){ + mat = Material.getMaterial(264); + item = new ItemStack(mat, 1, (byte)0, damage); + loc.getWorld().dropItemNaturally(loc, item); + } + if(block.getTypeId() == 1){ + mat = Material.getMaterial(4); + item = new ItemStack(mat, 1, (byte)0, damage); + loc.getWorld().dropItemNaturally(loc, item); + } + if(block.getTypeId() == 16){ + mat = Material.getMaterial(263); + item = new ItemStack(mat, 1, (byte)0, damage); + loc.getWorld().dropItemNaturally(loc, item); + } } public void blockProcCheck(Block block, Player player){ if(player != null){ @@ -72,46 +102,129 @@ public class mcMining { if(block.getTypeId() == 1 || block.getTypeId() == 24){ mcUsers.getProfile(player).addMiningGather(3); blockProcCheck(block, player); - } - //COAL - if(block.getTypeId() == 16){ + } + //COAL + if(block.getTypeId() == 16){ mcUsers.getProfile(player).addMiningGather(10); blockProcCheck(block, player); - } - //GOLD - if(block.getTypeId() == 14){ + } + //GOLD + if(block.getTypeId() == 14){ mcUsers.getProfile(player).addMiningGather(35); blockProcCheck(block, player); - } - //DIAMOND - if(block.getTypeId() == 56){ + } + //DIAMOND + if(block.getTypeId() == 56){ mcUsers.getProfile(player).addMiningGather(75); blockProcCheck(block, player); - } - //IRON - if(block.getTypeId() == 15){ + } + //IRON + if(block.getTypeId() == 15){ mcUsers.getProfile(player).addMiningGather(25); blockProcCheck(block, player); - } - //REDSTONE - if(block.getTypeId() == 73 || block.getTypeId() == 74){ + } + //REDSTONE + if(block.getTypeId() == 73 || block.getTypeId() == 74){ mcUsers.getProfile(player).addMiningGather(15); blockProcCheck(block, player); - } - //LAPUS - if(block.getTypeId() == 21){ + } + //LAPUS + if(block.getTypeId() == 21){ 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); - } - player.sendMessage(ChatColor.YELLOW+"Mining skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(player).getMining()+")"); - } + } + mcSkills.getInstance().XpCheck(player); + } + /* + * 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); } - } diff --git a/mcMMO/com/gmail/nossr50/mcPermissions.java b/mcMMO/com/gmail/nossr50/mcPermissions.java index 7464acc5b..c4c5ae336 100644 --- a/mcMMO/com/gmail/nossr50/mcPermissions.java +++ b/mcMMO/com/gmail/nossr50/mcPermissions.java @@ -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"); diff --git a/mcMMO/com/gmail/nossr50/mcPlayerListener.java b/mcMMO/com/gmail/nossr50/mcPlayerListener.java index 2482c2b3e..4483352dd 100644 --- a/mcMMO/com/gmail/nossr50/mcPlayerListener.java +++ b/mcMMO/com/gmail/nossr50/mcPlayerListener.java @@ -70,26 +70,20 @@ 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); - //STEW, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS - mcHerbalism.getInstance().stewCheck(player, is); + //BREADCHECK, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS + mcHerbalism.getInstance().breadCheck(player, is); + //STEW, CHECKS HERBALISM SKILL FOR BREAD HP MODIFIERS + mcHerbalism.getInstance().stewCheck(player, is); } } public void onPlayerCommandPreprocess(PlayerChatEvent event){ diff --git a/mcMMO/com/gmail/nossr50/mcRepair.java b/mcMMO/com/gmail/nossr50/mcRepair.java index f50fb7443..3fe3b9fa3 100644 --- a/mcMMO/com/gmail/nossr50/mcRepair.java +++ b/mcMMO/com/gmail/nossr50/mcRepair.java @@ -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){ diff --git a/mcMMO/com/gmail/nossr50/mcSkills.java b/mcMMO/com/gmail/nossr50/mcSkills.java index b6d1c5e65..8d37ccea6 100644 --- a/mcMMO/com/gmail/nossr50/mcSkills.java +++ b/mcMMO/com/gmail/nossr50/mcSkills.java @@ -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; diff --git a/mcMMO/com/gmail/nossr50/mcTimer.java b/mcMMO/com/gmail/nossr50/mcTimer.java index abe41b282..cda7a1daf 100644 --- a/mcMMO/com/gmail/nossr50/mcTimer.java +++ b/mcMMO/com/gmail/nossr50/mcTimer.java @@ -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!"); + } + } + } } } } diff --git a/mcMMO/com/gmail/nossr50/mcUsers.java b/mcMMO/com/gmail/nossr50/mcUsers.java index 0abac32e4..3986e6ece 100644 --- a/mcMMO/com/gmail/nossr50/mcUsers.java +++ b/mcMMO/com/gmail/nossr50/mcUsers.java @@ -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(); diff --git a/mcMMO/com/gmail/nossr50/mcWoodCutting.java b/mcMMO/com/gmail/nossr50/mcWoodCutting.java index 8a52c3969..f7fae2717 100644 --- a/mcMMO/com/gmail/nossr50/mcWoodCutting.java +++ b/mcMMO/com/gmail/nossr50/mcWoodCutting.java @@ -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) @@ -43,7 +73,7 @@ public class mcWoodCutting { ArrayList blocklist = new ArrayList(); ArrayList toAdd = new ArrayList(); if(block != null) - blocklist.add(block); + blocklist.add(block); while(isdone == false){ addBlocksToTreeFelling(blocklist, toAdd, radius); } @@ -55,7 +85,7 @@ public class mcWoodCutting { */ for(Block x : toAdd){ if(!mcConfig.getInstance().isTreeFellerWatched(x)) - mcConfig.getInstance().addTreeFeller(x); + mcConfig.getInstance().addTreeFeller(x); } } public void addBlocksToTreeFelling(ArrayList blocklist, ArrayList toAdd, Integer radius){ @@ -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' */ diff --git a/mcMMO/com/gmail/nossr50/mcm.java b/mcMMO/com/gmail/nossr50/mcm.java index 57eda619a..c6b1b9b91 100644 --- a/mcMMO/com/gmail/nossr50/mcm.java +++ b/mcMMO/com/gmail/nossr50/mcm.java @@ -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"); diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index a3acd4756..cfbee228a 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,3 +1,3 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 0.8.20 \ No newline at end of file +version: 0.9 WIP \ No newline at end of file