Fixed Disarm not working ever

This commit is contained in:
nossr50 2012-02-29 16:27:58 -08:00
parent 69dfd5645a
commit d099bc562b
3 changed files with 10 additions and 15 deletions

View File

@ -25,6 +25,7 @@ Version 1.3.00-dev
+ Added 'mcmmo.commands.inspect' permission node for the new /inspect command
+ Added Impact & Greater Impact subskills to Axes
+ Re-added mcMMO reporting damage events
= Fixed bug where Disarm didn't work at all ever
= Fixed bug where Swords command showed Bleed Length twice instead of Bleed Chance
= Fixed bug where Tree Feller wasn't checking for Tree Feller permission
= Fixed bug where Leaf Blower required Tree Feller permissions rather than Woodcutting permissions
@ -48,7 +49,7 @@ Version 1.3.00-dev
! Changed Unarmed to start with a +3 DMG (1 Heart = 2 DMG) bonus from Iron Arm Style to make leveling it more viable
! Changed Unarmed to gain bonus damage every 50 skill levels
! Changed Unarmed to gain more bonus damage total than before
! Changed Unarmed to disarm 1.5x more often than before
! Changed Unarmed to have a max disarm chance of 33.3% rather than 25%
! Changed Tree Feller to take down entire trees
! Changed mob spawn tracking to use Unique Entity ID instead of Entity Object
! Changed stats command name to mcstats for better plugin compatibility

View File

@ -28,7 +28,7 @@ public class UnarmedCommand implements CommandExecutor {
if (PP.getSkillLevel(SkillType.UNARMED) < 1000)
percentage = String.valueOf((skillvalue / 3000) * 100);
else
percentage = String.valueOf((1000 / 3000) * 100);
percentage = "33.3";
if (PP.getSkillLevel(SkillType.UNARMED) < 1000)
arrowpercentage = String.valueOf(((skillvalue / 1000) * 100) / 2);

View File

@ -42,28 +42,23 @@ public class Unarmed {
public static void disarmProcCheck(Player attacker, Player defender)
{
int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.UNARMED);
if(attacker.getItemInHand() == null)
if(attacker.getItemInHand() != null)
{
if(skillLevel >= 1000)
{
if(Math.random() * 3000 <= 1000)
{
ItemStack item = defender.getItemInHand();
if(item != null)
{
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
m.mcDropItem(defender.getLocation(), item);
defender.setItemInHand(null);
}
}
}
else
{
if(Math.random() * 3000 <= skillLevel)
{
ItemStack item = defender.getItemInHand();
if(item != null)
{
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
m.mcDropItem(defender.getLocation(), item);
defender.setItemInHand(null);
@ -72,4 +67,3 @@ public class Unarmed {
}
}
}
}