feat(Core/GameObject): Implement OnGameObjectModifyHealth() hook (#17374)
This commit is contained in:
parent
2779833768
commit
c25d0b38e8
3 changed files with 30 additions and 1 deletions
|
|
@ -160,6 +160,21 @@ void ScriptMgr::OnGameObjectDamaged(GameObject* go, Player* player)
|
|||
}
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectModifyHealth(GameObject* go, Unit* attackerOrHealer, int32& change, SpellInfo const* spellInfo)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
||||
ExecuteScript<AllGameObjectScript>([&](AllGameObjectScript* script)
|
||||
{
|
||||
script->OnGameObjectModifyHealth(go, attackerOrHealer, change, spellInfo);
|
||||
});
|
||||
|
||||
if (auto tempScript = ScriptRegistry<GameObjectScript>::GetScriptById(go->GetScriptId()))
|
||||
{
|
||||
tempScript->OnModifyHealth(go, attackerOrHealer, change, spellInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit)
|
||||
{
|
||||
ASSERT(go);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue