|
|
@ -956,25 +956,23 @@ public abstract class AbstractCharacter extends AbstractWorldObject { |
|
|
|
if (armor.template.item_skill_used.isEmpty()) |
|
|
|
if (armor.template.item_skill_used.isEmpty()) |
|
|
|
return ib.item_defense_rating; |
|
|
|
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); |
|
|
|
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() |
|
|
|
Logger.error("Player " + playerCharacter.getObjectUUID() |
|
|
|
+ " has armor equipped without the nescessary skill to equip it"); |
|
|
|
+ " has armor equipped without the nescessary skill to equip it"); |
|
|
|
return ib.item_defense_rating; |
|
|
|
return ib.item_defense_rating; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float def = ib.item_defense_rating; |
|
|
|
float def = ib.item_defense_rating; |
|
|
|
|
|
|
|
|
|
|
|
//apply item defense bonuses
|
|
|
|
//apply item defense bonuses
|
|
|
|
|
|
|
|
|
|
|
|
if (armor != null) { |
|
|
|
if (armor != null) { |
|
|
|
def += armor.getBonus(ModType.DR, SourceType.NONE); |
|
|
|
def += armor.getBonus(ModType.DR, SourceType.NONE); |
|
|
|
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.NONE)); |
|
|
|
def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.NONE)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f))); |
|
|
|
return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|