|
|
|
@ -945,26 +945,29 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
@@ -945,26 +945,29 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|
|
|
|
if (armor == null) |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
ItemTemplate ib = armor.template; |
|
|
|
|
ItemTemplate template = armor.template; |
|
|
|
|
|
|
|
|
|
if (ib == null) |
|
|
|
|
if (template == null) |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
if (!armor.template.item_type.equals(ItemType.ARMOR)) |
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
if (armor.template.item_skill_used.isEmpty()) |
|
|
|
|
return ib.item_defense_rating; |
|
|
|
|
return template.item_defense_rating; |
|
|
|
|
|
|
|
|
|
CharacterSkill armorSkill = abstractCharacter.skills.get(armor.template.item_skill_used); |
|
|
|
|
|
|
|
|
|
if (abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) && armorSkill == null) { |
|
|
|
|
Logger.error("Player " + abstractCharacter.getObjectUUID() |
|
|
|
|
+ " has armor equipped without the nescessary skill to equip it"); |
|
|
|
|
return ib.item_defense_rating; |
|
|
|
|
return template.item_defense_rating; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
float def = ib.item_defense_rating; |
|
|
|
|
if (armorSkill == null) |
|
|
|
|
return template.item_defense_rating; // Mobiles do not have armor skills @TODO
|
|
|
|
|
|
|
|
|
|
float def = template.item_defense_rating; |
|
|
|
|
|
|
|
|
|
//apply item defense bonuses
|
|
|
|
|
|
|
|
|
|