New hook OnAfterUpdateMaxHealth
This commit is contained in:
@@ -283,6 +283,7 @@ void Player::UpdateMaxHealth()
|
|||||||
value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
|
value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
|
||||||
value *= GetModifierValue(unitMod, TOTAL_PCT);
|
value *= GetModifierValue(unitMod, TOTAL_PCT);
|
||||||
|
|
||||||
|
sScriptMgr->OnAfterUpdateMaxHealth(this, value);
|
||||||
SetMaxHealth((uint32)value);
|
SetMaxHealth((uint32)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1550,6 +1550,11 @@ void ScriptMgr::OnAfterUpdateMaxPower(Player* player, Powers& power, float& valu
|
|||||||
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxPower(player, power, value);
|
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxPower(player, power, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptMgr::OnAfterUpdateMaxHealth(Player* player, float& value)
|
||||||
|
{
|
||||||
|
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxHealth(player, value);
|
||||||
|
}
|
||||||
|
|
||||||
AllMapScript::AllMapScript(const char* name)
|
AllMapScript::AllMapScript(const char* name)
|
||||||
: ScriptObject(name)
|
: ScriptObject(name)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -891,6 +891,9 @@ class PlayerScript : public ScriptObject
|
|||||||
virtual void OnAfterStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { };
|
virtual void OnAfterStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { };
|
||||||
|
|
||||||
virtual void OnAfterUpdateMaxPower(Player* /*player*/, Powers& /*power*/, float& /*value*/) { }
|
virtual void OnAfterUpdateMaxPower(Player* /*player*/, Powers& /*power*/, float& /*value*/) { }
|
||||||
|
|
||||||
|
virtual void OnAfterUpdateMaxHealth(Player* /*player*/, float& /*value*/) { }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GuildScript : public ScriptObject
|
class GuildScript : public ScriptObject
|
||||||
@@ -1203,6 +1206,7 @@ class ScriptMgr
|
|||||||
void OnBeforeBuyItemFromVendor(Player * player, uint64 vendorguid, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot);
|
void OnBeforeBuyItemFromVendor(Player * player, uint64 vendorguid, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot);
|
||||||
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);
|
||||||
|
|
||||||
public: /* GuildScript */
|
public: /* GuildScript */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user