diff options
author | megamage <none@none> | 2009-02-11 11:51:17 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-11 11:51:17 -0600 |
commit | 848af429189fe20fef67cbb09295c3ecd5b9fae6 (patch) | |
tree | b69e91f3471eafefae863733df6dd6854f3be8c1 /src/game/Player.cpp | |
parent | 8012f78d00ef29025397d2fe8a18dc1eb8876292 (diff) |
[7263] Fixed AP calculation in some cases
Fixed use AP dynamic mods (bonuses from stats)
Apply ITEM_MOD_ATTACK_POWER for ranged AP
Implement feral AP from weapon dps for druids
Signed-off-by: DiSlord <dislord@nomail.com>
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 210728eb777..da8e171eb5b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6920,6 +6920,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl break; case ITEM_MOD_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(val), apply); + HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(val), apply); break; case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(val), apply); @@ -6997,7 +6998,19 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl SetBaseWeaponDamage(attType, MAXDAMAGE, damage); } - if(IsInFeralForm()) + if (proto->Class == ITEM_CLASS_WEAPON && proto->Delay) + { + // Druids get feral AP bonus from weapon dps + if(getClass() == CLASS_DRUID && (slot==EQUIPMENT_SLOT_MAINHAND || slot==EQUIPMENT_SLOT_OFFHAND)) + { + float dps = (proto->Damage[0].DamageMin + proto->Damage[0].DamageMax)/(2*proto->Delay/1000.0f); + int32 feral_bonus = int32(dps*14.0f) - 767; + if (feral_bonus > 0) + ApplyFeralAPBonus(feral_bonus, apply); + } + } + + if(!IsUseEquipedWeapon(slot==EQUIPMENT_SLOT_MAINHAND)) return; if (proto->Delay) @@ -12377,6 +12390,7 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a break; case ITEM_MOD_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply); + HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); sLog.outDebug("+ %u ATTACK_POWER", enchant_amount); break; case ITEM_MOD_RANGED_ATTACK_POWER: |