diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index ebe2cf92..2e41cd1e 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -956,25 +956,23 @@ public abstract class AbstractCharacter extends AbstractWorldObject { if (armor.template.item_skill_used.isEmpty()) return ib.item_defense_rating; - if(armor.template.item_skill_used.length() < 1){ - return ib.item_defense_rating; - } - CharacterSkill armorSkill = playerCharacter.skills.get(armor.template.item_skill_used); - if (armorSkill == null) { + + if (playerCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) && armorSkill == null) { Logger.error("Player " + playerCharacter.getObjectUUID() + " has armor equipped without the nescessary skill to equip it"); return ib.item_defense_rating; } float def = ib.item_defense_rating; + //apply item defense bonuses + if (armor != null) { def += armor.getBonus(ModType.DR, SourceType.NONE); def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.NONE)); } - return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f))); }