mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 04:25:26 +02:00
Another WIP
This commit is contained in:
@@ -52,7 +52,8 @@ public class Axes {
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx){
|
||||
public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
|
||||
{
|
||||
Entity x = event.getEntity();
|
||||
if(x instanceof Wolf){
|
||||
Wolf wolf = (Wolf)x;
|
||||
|
@@ -305,86 +305,4 @@ public class Herbalism
|
||||
}
|
||||
Skills.XpCheckSkill(SkillType.HERBALISM, player);
|
||||
}
|
||||
public static void breadCheck(Player player, ItemStack is)
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int herbalism = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
int heal = 0;
|
||||
if(is.getTypeId() == 297)
|
||||
{
|
||||
if(herbalism >= 50 && herbalism < 150)
|
||||
{
|
||||
heal = 1;
|
||||
} else if (herbalism >= 150 && herbalism < 250)
|
||||
{
|
||||
heal = 2;
|
||||
} else if (herbalism >= 250 && herbalism < 350)
|
||||
{
|
||||
heal = 3;
|
||||
} else if (herbalism >= 350 && herbalism < 450)
|
||||
{
|
||||
heal = 4;
|
||||
} else if (herbalism >= 450 && herbalism < 550)
|
||||
{
|
||||
heal = 5;
|
||||
} else if (herbalism >= 550 && herbalism < 650)
|
||||
{
|
||||
heal = 6;
|
||||
} else if (herbalism >= 650 && herbalism < 750)
|
||||
{
|
||||
heal = 7;
|
||||
} else if (herbalism >= 750)
|
||||
{
|
||||
heal = 8;
|
||||
}
|
||||
|
||||
if(player.getHealth()+heal > 20)
|
||||
{
|
||||
player.setHealth(20);
|
||||
}
|
||||
else
|
||||
player.setHealth(player.getHealth()+heal);
|
||||
}
|
||||
}
|
||||
public static void stewCheck(Player player, ItemStack is)
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int herbalism = PP.getSkillLevel(SkillType.HERBALISM);
|
||||
int heal = 0;
|
||||
if(is.getTypeId() == 282)
|
||||
{
|
||||
if(herbalism >= 50 && herbalism < 150)
|
||||
{
|
||||
heal = 1;
|
||||
} else if (herbalism >= 150 && herbalism < 250)
|
||||
{
|
||||
heal = 2;
|
||||
} else if (herbalism >= 250 && herbalism < 350)
|
||||
{
|
||||
heal = 3;
|
||||
} else if (herbalism >= 350 && herbalism < 450)
|
||||
{
|
||||
heal = 4;
|
||||
} else if (herbalism >= 450 && herbalism < 550)
|
||||
{
|
||||
heal = 5;
|
||||
} else if (herbalism >= 550 && herbalism < 650)
|
||||
{
|
||||
heal = 6;
|
||||
} else if (herbalism >= 650 && herbalism < 750)
|
||||
{
|
||||
heal = 7;
|
||||
} else if (herbalism >= 750)
|
||||
{
|
||||
heal = 8;
|
||||
}
|
||||
|
||||
if(player.getHealth()+heal > 20)
|
||||
{
|
||||
player.setHealth(20);
|
||||
}
|
||||
else
|
||||
player.setHealth(player.getHealth()+heal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -157,41 +157,6 @@ public class Swords
|
||||
}
|
||||
}
|
||||
|
||||
public static void parryCheck(EntityDamageByEntityEvent event, Player defender)
|
||||
{
|
||||
Entity y = event.getDamager();
|
||||
PlayerProfile PPd = Users.getProfile(defender);
|
||||
if(defender != null && m.isSwords(defender.getItemInHand())
|
||||
&& mcPermissions.getInstance().swords(defender)){
|
||||
if(PPd.getSkillLevel(SkillType.SWORDS) >= 900)
|
||||
{
|
||||
if(Math.random() * 3000 <= 900)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
defender.sendMessage(ChatColor.GREEN+"**PARRIED**");
|
||||
defender.getItemInHand().setDurability((short) (defender.getItemInHand().getDurability() + 1));
|
||||
if(y instanceof Player)
|
||||
{
|
||||
Player attacker = (Player)y;
|
||||
attacker.sendMessage(ChatColor.GREEN+"**PARRIED**");
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(Math.random() * 3000 <= PPd.getSkillLevel(SkillType.SWORDS))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
defender.sendMessage(ChatColor.YELLOW+"*CLANG* SUCCESSFUL PARRY *CLANG*");
|
||||
defender.getItemInHand().setDurability((short) (defender.getItemInHand().getDurability() + 1));
|
||||
if(y instanceof Player)
|
||||
{
|
||||
Player attacker = (Player)y;
|
||||
attacker.sendMessage(ChatColor.DARK_RED+"**TARGET HAS PARRIED THAT ATTACK**");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void counterAttackChecks(EntityDamageByEntityEvent event)
|
||||
{
|
||||
//Don't want to counter attack arrows
|
||||
|
Reference in New Issue
Block a user