diff options
| author | thenecromancer <none@none> | 2010-01-13 11:51:59 +0100 |
|---|---|---|
| committer | thenecromancer <none@none> | 2010-01-13 11:51:59 +0100 |
| commit | 96a447dc8e4ef717cf78fda4e05a48fdd6d9a5e7 (patch) | |
| tree | aeec6faea532d722a0badf0cc202b75ff7e659e6 | |
| parent | efbc71746f7f038c453279b1929d4ef76bcbfe2e (diff) | |
Change only Body/Shield armor to count as base armor, and correctly add bonus armor on items as TOTAL_VALUE
This fixes various armor modifiers
--HG--
branch : trunk
| -rw-r--r-- | src/game/Player.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 05615c610fb..febf205ca11 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7138,12 +7138,29 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl if (uint32 ssvarmor = ssv->getArmorMod(proto->ScalingStatValue)) armor = ssvarmor; } - // Add armor bonus from ArmorDamageModifier if > 0 - if (proto->ArmorDamageModifier > 0) - armor += uint32(proto->ArmorDamageModifier); - if (armor) - HandleStatModifier(UNIT_MOD_ARMOR, BASE_VALUE, float(armor), apply); + if (armor)
+ {
+ UnitModifierType modType = TOTAL_VALUE;
+ if (proto->Class == ITEM_CLASS_ARMOR)
+ {
+ switch (proto->SubClass) + { + case ITEM_SUBCLASS_ARMOR_CLOTH: + case ITEM_SUBCLASS_ARMOR_LEATHER: + case ITEM_SUBCLASS_ARMOR_MAIL: + case ITEM_SUBCLASS_ARMOR_PLATE: + case ITEM_SUBCLASS_ARMOR_SHIELD: + modType = BASE_VALUE; + break; + }
+ }
+ HandleStatModifier(UNIT_MOD_ARMOR, modType, float(armor), apply);
+ }
+
+ // Add armor bonus from ArmorDamageModifier if > 0
+ if (proto->ArmorDamageModifier > 0)
+ HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(proto->ArmorDamageModifier), apply); if (proto->Block) HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(proto->Block), apply); |
