OnBeforeUpdateAttackPowerAndDamage -> OnAfterUpdateAttackPowerAndDamage
This commit is contained in:
@@ -312,7 +312,6 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
|||||||
{
|
{
|
||||||
float val2 = 0.0f;
|
float val2 = 0.0f;
|
||||||
float level = float(getLevel());
|
float level = float(getLevel());
|
||||||
sScriptMgr->OnBeforeUpdateAttackPowerAndDamage(this, level, ranged);
|
|
||||||
|
|
||||||
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
|
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
|
||||||
|
|
||||||
@@ -496,6 +495,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
|||||||
|
|
||||||
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
|
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
|
||||||
|
|
||||||
|
sScriptMgr->OnAfterUpdateAttackPowerAndDamage(this, level, base_attPower, attPowerMod, attPowerMultiplier, ranged);
|
||||||
SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
|
SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
|
||||||
SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
|
SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
|
||||||
SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
|
SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
|
||||||
|
|||||||
@@ -1555,9 +1555,9 @@ void ScriptMgr::OnAfterUpdateMaxHealth(Player* player, float& value)
|
|||||||
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxHealth(player, value);
|
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxHealth(player, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptMgr::OnBeforeUpdateAttackPowerAndDamage(Player* player, float& level, bool ranged)
|
void ScriptMgr::OnAfterUpdateAttackPowerAndDamage(Player* player, float& level, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool ranged)
|
||||||
{
|
{
|
||||||
FOREACH_SCRIPT(PlayerScript)->OnBeforeUpdateAttackPowerAndDamage(player, level, ranged);
|
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateAttackPowerAndDamage(player, level, base_attPower, attPowerMod, attPowerMultiplier, ranged);
|
||||||
}
|
}
|
||||||
|
|
||||||
AllMapScript::AllMapScript(const char* name)
|
AllMapScript::AllMapScript(const char* name)
|
||||||
|
|||||||
@@ -894,7 +894,7 @@ class PlayerScript : public ScriptObject
|
|||||||
|
|
||||||
virtual void OnAfterUpdateMaxHealth(Player* /*player*/, float& /*value*/) { }
|
virtual void OnAfterUpdateMaxHealth(Player* /*player*/, float& /*value*/) { }
|
||||||
|
|
||||||
virtual void OnBeforeUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, bool /*ranged*/) { }
|
virtual void OnAfterUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*base_attPower*/, float& /*attPowerMod*/, float& /*attPowerMultiplier*/, bool /*ranged*/) { }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1209,7 +1209,7 @@ class ScriptMgr
|
|||||||
void OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
|
void OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
|
||||||
void OnAfterUpdateMaxPower(Player* player, Powers& power, float& value);
|
void OnAfterUpdateMaxPower(Player* player, Powers& power, float& value);
|
||||||
void OnAfterUpdateMaxHealth(Player* player, float& value);
|
void OnAfterUpdateMaxHealth(Player* player, float& value);
|
||||||
void OnBeforeUpdateAttackPowerAndDamage(Player* player, float& level, bool ranged);
|
void OnAfterUpdateAttackPowerAndDamage(Player* player, float& level, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool ranged);
|
||||||
|
|
||||||
public: /* GuildScript */
|
public: /* GuildScript */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user