Fixed Ancient Wills working without the full armor set.

This commit is contained in:
Lizbeth Rika committed 2015-02-02 17:46:25 +00:00
1 parent d37dd7d935
commit 5eb97215cf
1 file changed
+23 -21
@@ -130,28 +130,30 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
Entity attacker = event.source.getEntity();
if(attacker instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) attacker;
boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null;
ItemStack stack = player.inventory.armorItemInSlot(3);
if(crit && stack != null && stack.getItem() instanceof ItemTerrasteelHelm) {
boolean ahrim = hasAncientWill(stack, 0);
boolean dharok = hasAncientWill(stack, 1);
boolean guthan = hasAncientWill(stack, 2);
boolean torag = hasAncientWill(stack, 3);
boolean verac = hasAncientWill(stack, 4);
boolean karil = hasAncientWill(stack, 5);
if(hasArmorSet(player)) {
boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null;
ItemStack stack = player.inventory.armorItemInSlot(3);
if(crit && stack != null && stack.getItem() instanceof ItemTerrasteelHelm) {
boolean ahrim = hasAncientWill(stack, 0);
boolean dharok = hasAncientWill(stack, 1);
boolean guthan = hasAncientWill(stack, 2);
boolean torag = hasAncientWill(stack, 3);
boolean verac = hasAncientWill(stack, 4);
boolean karil = hasAncientWill(stack, 5);
if(ahrim)
event.entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 20, 1));
if(dharok)
event.ammount *= 1F + (1F - player.getHealth() / player.getMaxHealth()) * 0.5F;
if(guthan)
player.heal(event.ammount * 0.25F);
if(torag)
event.entityLiving.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60, 1));
if(verac)
event.source.setDamageBypassesArmor();
if(karil)
event.entityLiving.addPotionEffect(new PotionEffect(Potion.wither.id, 60, 1));
if(ahrim)
event.entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 20, 1));
if(dharok)
event.ammount *= 1F + (1F - player.getHealth() / player.getMaxHealth()) * 0.5F;
if(guthan)
player.heal(event.ammount * 0.25F);
if(torag)
event.entityLiving.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60, 1));
if(verac)
event.source.setDamageBypassesArmor();
if(karil)
event.entityLiving.addPotionEffect(new PotionEffect(Potion.wither.id, 60, 1));
}
}
}
}