diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-12-09 20:03:26 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2016-12-09 20:05:00 -0300 |
commit | 19560fcea1222b17119b6ebd124643a88d703c22 (patch) | |
tree | cf24632b6cf24a214bbda42dc4c0d675f8d72517 | |
parent | 201d99077736735e96889278f9cd04b5ba089f41 (diff) |
Core/Stat: fixed Predatory Strikes
- Fixed bonus getting stuck after removing weapon
- Fixed calculation (must count both feral ap and any ap the weapon has as stated on the talent "any attack power on your equipped weapon")
-rw-r--r-- | src/server/game/Entities/Unit/StatSystem.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index d9844f4826d..d68d986961c 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -402,9 +402,24 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) if (AuraEffect const* levelMod = GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 1563, EFFECT_0)) levelBonus = CalculatePct(1.0f, levelMod->GetAmount()); - if (Item const* weapon = m_items[EQUIPMENT_SLOT_MAINHAND]) - if (AuraEffect const* weaponMod = GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 1563, EFFECT_1)) - weaponBonus = CalculatePct(static_cast<float>(ASSERT_NOTNULL(weapon->GetTemplate())->getFeralBonus()), weaponMod->GetAmount()); + // = 0 if removing the weapon, do not calculate bonus (uses template) + if (m_baseFeralAP) + { + if (Item const* weapon = m_items[EQUIPMENT_SLOT_MAINHAND]) + { + if (AuraEffect const* weaponMod = GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 1563, EFFECT_1)) + { + ItemTemplate const* itemTemplate = weapon->GetTemplate(); + int32 bonusAP = 0; + for (uint32 i = 0; i < itemTemplate->StatsCount; ++i) + if (itemTemplate->ItemStat[i].ItemStatType == ITEM_MOD_ATTACK_POWER) + bonusAP += itemTemplate->ItemStat[i].ItemStatValue; + + bonusAP += m_baseFeralAP; + weaponBonus = CalculatePct(static_cast<float>(bonusAP), weaponMod->GetAmount()); + } + } + } } switch (GetShapeshiftForm()) |