feat: Add Player Event OnReleasedGhost

This commit is contained in:
iThorgrim
2026-01-16 22:38:59 +01:00
parent 73a5c5d0b3
commit fbc14ae1af
5 changed files with 18 additions and 2 deletions

View File

@@ -643,7 +643,8 @@ public:
PLAYERHOOK_ON_CAN_UPDATE_SKILL,
PLAYERHOOK_ON_BEFORE_UPDATE_SKILL,
PLAYERHOOK_ON_UPDATE_SKILL,
PLAYERHOOK_CAN_RESURRECT
PLAYERHOOK_CAN_RESURRECT,
PLAYERHOOK_ON_PLAYER_RELEASED_GHOST
}) { }
void OnPlayerResurrect(Player* player, float /*restore_percent*/, bool /*applySickness*/) override
@@ -960,6 +961,11 @@ public:
{
return sALE->CanPlayerResurrect(player);
}
void OnPlayerReleasedGhost(Player* player) override
{
sALE->OnPlayerReleasedGhost(player);
}
};
class ALE_ServerScript : public ServerScript

View File

@@ -237,6 +237,7 @@ namespace Hooks
PLAYER_EVENT_ON_MODIFY_SPELL_DAMAGE_TAKEN = 70, // (event, player, target, damage, spellInfo) - Can return new damage amount
PLAYER_EVENT_ON_MODIFY_HEAL_RECEIVED = 71, // (event, player, target, heal, spellInfo) - Can return new heal amount
PLAYER_EVENT_ON_DEAL_DAMAGE = 72, // (event, player, target, damage, damagetype) - Can return new damage amount
PLAYER_EVENT_ON_RELEASED_GHOST = 73, // (event, player)
PLAYER_EVENT_COUNT
};

View File

@@ -512,6 +512,7 @@ public:
void OnPlayerModifySpellDamageTaken(Player* player, Unit* target, int32& damage, SpellInfo const* spellInfo);
void OnPlayerModifyHealReceived(Player* player, Unit* target, uint32& heal, SpellInfo const* spellInfo);
uint32 OnPlayerDealDamage(Player* player, Unit* pVictim, uint32 damage, DamageEffectType damagetype);
void OnPlayerReleasedGhost(Player* player);
/* Vehicle */
void OnInstall(Vehicle* vehicle);

View File

@@ -761,6 +761,13 @@ bool ALE::CanPlayerResurrect(Player* player)
return CallAllFunctionsBool(PlayerEventBindings, key);
}
void ALE::OnPlayerReleasedGhost(Player* player)
{
START_HOOK(PLAYER_EVENT_ON_RELEASED_GHOST);
Push(player);
CallAllFunctions(PlayerEventBindings, key);
}
void ALE::OnPlayerQuestAccept(Player* player, Quest const* quest)
{
START_HOOK(PLAYER_EVENT_ON_QUEST_ACCEPT);

View File

@@ -793,6 +793,7 @@ namespace LuaGlobalFunctions
* PLAYER_EVENT_ON_MODIFY_SPELL_DAMAGE_TAKEN = 70, // (event, player, target, damage, spellInfo) - Can return new damage amount
* PLAYER_EVENT_ON_MODIFY_HEAL_RECEIVED = 71, // (event, player, target, heal, spellInfo) - Can return new heal amount
* PLAYER_EVENT_ON_DEAL_DAMAGE = 72, // (event, player, target, damage, damagetype) - Can return new damage amount
* PLAYER_EVENT_ON_RELEASED_GHOST = 73, // (event, player)
* };
* </pre>
*