From 2beaf4105792cc7d62b685109f5400cea4d6af2c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 24 Feb 2011 17:06:36 -0800 Subject: [PATCH] All changes up to 0.7.10, sorry Richard ;_; I'll try to be less of an airhead. --- mcMMO/Changelog.txt | 4 + mcMMO/com/gmail/nossr50/mcBlockListener.java | 8 +- mcMMO/com/gmail/nossr50/mcPermissions.java | 1 + mcMMO/com/gmail/nossr50/mcPlayerListener.java | 40 ++++---- mcMMO/com/gmail/nossr50/mcUsers.java | 34 +++++++ mcMMO/com/gmail/nossr50/mcm.java | 92 ++++++++++--------- mcMMO/plugin.yml | 2 +- 7 files changed, 113 insertions(+), 68 deletions(-) diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index ae842b926..7277a53ed 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,5 +1,9 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code# +Version 0.7.9 + XP Curve now follows a new formula + Acrobatics XP gains changed + Compiled against permissions 2.1 Version 0.7.8 Massive tweaks to XP gain for Archery, Swords, Axes, Unarmed Version 0.7.7 diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index 43c3385af..8ade17af5 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -66,7 +66,7 @@ public class mcBlockListener extends BlockListener { */ if(block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){ mcm.getInstance().woodCuttingProcCheck(player, block, loc); - mcUsers.getProfile(player).addWoodcuttingGather(2); + mcUsers.getProfile(player).addWoodcuttingGather(7); } /* * EXCAVATION @@ -78,11 +78,11 @@ public class mcBlockListener extends BlockListener { */ mcConfig.getInstance().addCoordsWatch(xyz); mcConfig.getInstance().addBlockWatch(block); - if(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= (mcUsers.getProfile(player).getWoodCuttingInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){ int skillups = 0; - while(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= (mcUsers.getProfile(player).getWoodCuttingInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(player).getWoodCuttingGatherInt() >= mcUsers.getProfile(player).getXpToLevel("woodcutting")){ skillups++; - mcUsers.getProfile(player).removeWoodCuttingGather((mcUsers.getProfile(player).getWoodCuttingInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); diff --git a/mcMMO/com/gmail/nossr50/mcPermissions.java b/mcMMO/com/gmail/nossr50/mcPermissions.java index b366362d2..d6031516e 100644 --- a/mcMMO/com/gmail/nossr50/mcPermissions.java +++ b/mcMMO/com/gmail/nossr50/mcPermissions.java @@ -26,6 +26,7 @@ public class mcPermissions { log.log(Level.SEVERE, "[mcMMO] Permissions isn't loaded, there are no restrictions."); } } + private boolean permission(Player player, String string) { return permissionsPlugin.Security.permission(player, string); } diff --git a/mcMMO/com/gmail/nossr50/mcPlayerListener.java b/mcMMO/com/gmail/nossr50/mcPlayerListener.java index 890aaa780..541e5bb15 100644 --- a/mcMMO/com/gmail/nossr50/mcPlayerListener.java +++ b/mcMMO/com/gmail/nossr50/mcPlayerListener.java @@ -197,34 +197,34 @@ public class mcPlayerListener extends PlayerListener { player.sendMessage(ChatColor.GREEN+"~~mcMMO stats~~"); player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getMining()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getMiningGather() - +"/"+(mcUsers.getProfile(target).getMiningInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("mining")+")"); player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getRepair()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getRepairGather() - +"/"+(mcUsers.getProfile(target).getRepairInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("repair")+")"); player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getWoodCutting()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getWoodCuttingGather() - +"/"+(mcUsers.getProfile(target).getWoodCuttingInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("woodcutting")+")"); player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getUnarmed()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getUnarmedGather() - +"/"+(mcUsers.getProfile(target).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("unarmed")+")"); player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getHerbalism()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getHerbalismGather() - +"/"+(mcUsers.getProfile(target).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("herbalism")+")"); player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + mcUsers.getProfile(target).getExcavation()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getExcavationGather() - +"/"+(mcUsers.getProfile(target).getExcavationInt() + 3) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("excavation")+")"); player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getArchery()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getArcheryGather() - +"/"+(mcUsers.getProfile(target).getArcheryInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("archery")+")"); player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getSwords()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getSwordsGather() - +"/"+(mcUsers.getProfile(target).getSwordsInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("swords")+")"); player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getAxes()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getAxesGather() - +"/"+(mcUsers.getProfile(target).getAxesInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("axes")+")"); player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + mcUsers.getProfile(target).getAcrobatics()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(target).getAcrobaticsGather() - +"/"+(mcUsers.getProfile(target).getAcrobaticsInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(target).getXpToLevel("acrobatics")+")"); player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+ (mcUsers.getProfile(target).getAcrobaticsInt()+ mcUsers.getProfile(target).getArcheryInt()+ @@ -267,34 +267,34 @@ public class mcPlayerListener extends PlayerListener { player.sendMessage(ChatColor.DARK_RED + "mcMMO stats"); player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getMining()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getMiningGather() - +"/"+(mcUsers.getProfile(player).getMiningInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("mining")+")"); player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + mcUsers.getProfile(player).getRepair()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getRepairGather() - +"/"+(mcUsers.getProfile(player).getRepairInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("repair")+")"); player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + mcUsers.getProfile(player).getWoodCutting()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getWoodCuttingGather() - +"/"+(mcUsers.getProfile(player).getWoodCuttingInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("woodcutting")+")"); player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getUnarmed()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getUnarmedGather() - +"/"+(mcUsers.getProfile(player).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("unarmed")+")"); player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + mcUsers.getProfile(player).getHerbalism()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getHerbalismGather() - +"/"+(mcUsers.getProfile(player).getHerbalismInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("herbalism")+")"); player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + mcUsers.getProfile(player).getExcavation()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getExcavationGather() - +"/"+(mcUsers.getProfile(player).getExcavationInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("excavation")+")"); player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getArchery()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getArcheryGather() - +"/"+(mcUsers.getProfile(player).getArcheryInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("archery")+")"); player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getSwords()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getSwordsGather() - +"/"+(mcUsers.getProfile(player).getSwordsInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("swords")+")"); player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getAxes()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getAxesGather() - +"/"+(mcUsers.getProfile(player).getAxesInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("axes")+")"); player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + mcUsers.getProfile(player).getAcrobatics()+ChatColor.DARK_AQUA + " XP("+mcUsers.getProfile(player).getAcrobaticsGather() - +"/"+(mcUsers.getProfile(player).getAcrobaticsInt() + 5) * mcLoadProperties.xpmodifier+")"); + +"/"+mcUsers.getProfile(player).getXpToLevel("acrobatics")+")"); player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+ (mcUsers.getProfile(player).getAcrobaticsInt()+ mcUsers.getProfile(player).getArcheryInt()+ diff --git a/mcMMO/com/gmail/nossr50/mcUsers.java b/mcMMO/com/gmail/nossr50/mcUsers.java index d506a408b..1667b9f87 100644 --- a/mcMMO/com/gmail/nossr50/mcUsers.java +++ b/mcMMO/com/gmail/nossr50/mcUsers.java @@ -1138,6 +1138,40 @@ class PlayerList } save(); } + public Integer getXpToLevel(String skillname){ + if(skillname.equals("mining")){ + return (getMiningInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("woodcutting")){ + return (getWoodCuttingInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("repair")){ + return (getRepairInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("herbalism")){ + return (getHerbalismInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("acrobatics")){ + return (getAcrobaticsInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("swords")){ + return (getSwordsInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("archery")){ + return (getArcheryInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("unarmed")){ + return (getUnarmedInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("excavation")){ + return (getExcavationInt() + 50) * mcLoadProperties.xpmodifier; + } + if(skillname.equals("axes")){ + return (getAxesInt() + 50) * mcLoadProperties.xpmodifier; + } else { + return 0; + } + } public int getMiningGatherInt() { if(isInt(gather)){ return Integer.parseInt(gather); diff --git a/mcMMO/com/gmail/nossr50/mcm.java b/mcMMO/com/gmail/nossr50/mcm.java index 573c39561..9311b728e 100644 --- a/mcMMO/com/gmail/nossr50/mcm.java +++ b/mcMMO/com/gmail/nossr50/mcm.java @@ -143,11 +143,11 @@ public class mcm { mcUsers.getProfile(attacker).addArcheryGather(3); if(x instanceof PigZombie) mcUsers.getProfile(attacker).addArcheryGather(7); - if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= (mcUsers.getProfile(attacker).getArcheryInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){ int skillups = 0; - while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= (mcUsers.getProfile(attacker).getArcheryInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){ skillups++; - mcUsers.getProfile(attacker).removeArcheryGather((mcUsers.getProfile(attacker).getArcheryInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -314,12 +314,12 @@ public class mcm { return; if(!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z)) && mcPermissions.getInstance().acrobatics(player)){ - mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage()); - if(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= (mcUsers.getProfile(player).getAcrobaticsInt() + 5) * mcLoadProperties.xpmodifier){ + mcUsers.getProfile(player).addAcrobaticsGather(event.getDamage() * 3); + if(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){ int skillups = 0; - while(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= (mcUsers.getProfile(player).getAcrobaticsInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(player).getAcrobaticsGatherInt() >= mcUsers.getProfile(player).getXpToLevel("acrobatics")){ skillups++; - mcUsers.getProfile(player).removeAcrobaticsGather((mcUsers.getProfile(player).getAcrobaticsInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -605,11 +605,11 @@ public class mcm { mcUsers.getProfile(player).addMiningGather(20); mcm.getInstance().blockProcCheck(block, player); } - if(mcUsers.getProfile(player).getMiningGatherInt() >= (mcUsers.getProfile(player).getMiningInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){ int skillups = 0; - while(mcUsers.getProfile(player).getMiningGatherInt() >= (mcUsers.getProfile(player).getMiningInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(player).getMiningGatherInt() >= mcUsers.getProfile(player).getXpToLevel("mining")){ skillups++; - mcUsers.getProfile(player).removeMiningGather((mcUsers.getProfile(player).getMiningInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -795,12 +795,12 @@ public class mcm { if(x instanceof Squid){ Squid defender = (Squid)event.getEntity(); if(isSwords(attacker.getItemInHand()) && defender.getHealth() > 0 && mcPermissions.getInstance().swords(attacker)){ - mcUsers.getProfile(attacker).addSwordsGather(1); - if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() + 5) * mcLoadProperties.xpmodifier){ + 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).getSwordsInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){ skillups++; - mcUsers.getProfile(attacker).removeSwordsGather((mcUsers.getProfile(attacker).getSwordsInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -809,12 +809,12 @@ public class mcm { if(isAxes(attacker.getItemInHand()) && defender.getHealth() > 0 && mcPermissions.getInstance().axes(attacker)){ - mcUsers.getProfile(attacker).addAxesGather(1); - if(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() + 5) * mcLoadProperties.xpmodifier){ + 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).getAxesInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){ skillups++; - mcUsers.getProfile(attacker).removeAxesGather((mcUsers.getProfile(attacker).getAxesInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -853,20 +853,18 @@ public class mcm { defender.setHealth(calculateDamage(defender, 8)); } //XP - if(attacker.getItemInHand().getTypeId() == 0 && Math.random() * 10 > 8){ if(defender.getHealth() != 0){ - mcUsers.getProfile(attacker).addUnarmedGather(1); - if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier){ + 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).getUnarmedInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){ skillups++; - mcUsers.getProfile(attacker).removeUnarmedGather((mcUsers.getProfile(attacker).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); } } - } if(defender.getHealth() <= 0) mcm.getInstance().simulateNaturalDrops(defender); } @@ -963,11 +961,11 @@ public class mcm { mcUsers.getProfile(attacker).addSwordsGather(3); if(x instanceof PigZombie) mcUsers.getProfile(attacker).addSwordsGather(7); - if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){ int skillups = 0; - while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= (mcUsers.getProfile(attacker).getSwordsInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){ skillups++; - mcUsers.getProfile(attacker).removeSwordsGather((mcUsers.getProfile(attacker).getSwordsInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -987,11 +985,11 @@ public class mcm { mcUsers.getProfile(attacker).addAxesGather(3); if(x instanceof PigZombie) mcUsers.getProfile(attacker).addAxesGather(7); - if(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){ int skillups = 0; - while(mcUsers.getProfile(attacker).getAxesGatherInt() >= (mcUsers.getProfile(attacker).getAxesInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){ skillups++; - mcUsers.getProfile(attacker).removeAxesGather((mcUsers.getProfile(attacker).getAxesInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -1040,11 +1038,11 @@ public class mcm { mcUsers.getProfile(attacker).addUnarmedGather(5); if(x instanceof PigZombie) mcUsers.getProfile(attacker).addUnarmedGather(15); - if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){ int skillups = 0; - while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= (mcUsers.getProfile(attacker).getUnarmedInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){ skillups++; - mcUsers.getProfile(attacker).removeUnarmedGather((mcUsers.getProfile(attacker).getUnarmedInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -1483,20 +1481,25 @@ public class mcm { if(block != null && block.getTypeId() == 42 && mcPermissions.getInstance().repair(player)){ + player.sendMessage("DEBUG CODE 0"); short durability = is.getDurability(); if(player.getItemInHand().getDurability() > 0){ + //player.sendMessage("DEBUG CODE 1"); /* * ARMOR */ if(mcm.getInstance().isArmor(is) && block.getTypeId() == 42){ + //player.sendMessage("DEBUG CODE 2"); /* * DIAMOND ARMOR */ if(mcm.getInstance().isDiamondArmor(is) && mcm.getInstance().hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){ + //player.sendMessage("DEBUG CODE 3"); mcm.getInstance().removeDiamond(player); player.getItemInHand().setDurability(mcm.getInstance().getArmorRepairAmount(is, player)); - mcUsers.getProfile(player).addRepairGather(20); + mcUsers.getProfile(player).addRepairGather(50); } else if (mcm.getInstance().isIronArmor(is) && mcm.getInstance().hasIron(player)){ + //player.sendMessage("DEBUG CODE 3"); /* * IRON ARMOR */ @@ -1505,7 +1508,7 @@ public class mcm { /* * DISTRIBUTE REPAIR XP */ - mcUsers.getProfile(player).addRepairGather(5); + mcUsers.getProfile(player).addRepairGather(20); } else { needMoreVespeneGas(is, player); } @@ -1514,20 +1517,23 @@ public class mcm { * TOOLS */ if(mcm.getInstance().isTools(is) && block.getTypeId() == 42){ + //player.sendMessage("DEBUG CODE 4"); /* * IRON TOOLS */ if(mcm.getInstance().isIronTools(is) && mcm.getInstance().hasIron(player)){ + //player.sendMessage("DEBUG CODE 5"); is.setDurability(mcm.getInstance().getToolRepairAmount(is, durability, player)); mcm.getInstance().removeIron(player); - mcUsers.getProfile(player).addRepairGather(5); + mcUsers.getProfile(player).addRepairGather(20); } else if (mcm.getInstance().isDiamondTools(is) && mcm.getInstance().hasDiamond(player) && mcUsers.getProfile(player).getRepairInt() >= 50){ //Check if its diamond and the player has diamonds + //player.sendMessage("DEBUG CODE 5"); /* * DIAMOND TOOLS */ is.setDurability(mcm.getInstance().getToolRepairAmount(is, durability, player)); mcm.getInstance().removeDiamond(player); - mcUsers.getProfile(player).addRepairGather(20); + mcUsers.getProfile(player).addRepairGather(50); } else { needMoreVespeneGas(is, player); } @@ -1540,11 +1546,11 @@ public class mcm { /* * GIVE SKILL IF THERE IS ENOUGH XP */ - if(mcUsers.getProfile(player).getRepairGatherInt() >= (mcUsers.getProfile(player).getRepairInt() + 5) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){ int skillups = 0; - while(mcUsers.getProfile(player).getRepairGatherInt() >= (mcUsers.getProfile(player).getRepairInt() +5) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(player).getRepairGatherInt() >= mcUsers.getProfile(player).getXpToLevel("repair")){ skillups++; - mcUsers.getProfile(player).removeRepairGather((mcUsers.getProfile(player).getRepairInt() + 5) * mcLoadProperties.xpmodifier); + 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()+")"); @@ -1724,11 +1730,11 @@ public class mcm { } } } - if(mcUsers.getProfile(player).getExcavationGatherInt() >= (mcUsers.getProfile(player).getExcavationInt() + 3) * mcLoadProperties.xpmodifier){ + if(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){ int skillups = 0; - while(mcUsers.getProfile(player).getExcavationGatherInt() >= (mcUsers.getProfile(player).getExcavationInt() +3) * mcLoadProperties.xpmodifier){ + while(mcUsers.getProfile(player).getExcavationGatherInt() >= mcUsers.getProfile(player).getXpToLevel("excavation")){ skillups++; - mcUsers.getProfile(player).removeExcavationGather((mcUsers.getProfile(player).getExcavationInt() + 3) * mcLoadProperties.xpmodifier); + 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()+")"); diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index 5c3e38bce..639f78289 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,3 +1,3 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 0.7.8 \ No newline at end of file +version: 0.7.10 \ No newline at end of file