Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ALE_SC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ class ALE_PlayerScript : public PlayerScript
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
Expand Down Expand Up @@ -955,11 +956,16 @@ class ALE_PlayerScript : public PlayerScript
{
sALE->OnPlayerUpdateSkill(player, skill_id, value, max, step, new_value);
}

bool OnPlayerCanResurrect(Player* player) override
{
return sALE->CanPlayerResurrect(player);
}

void OnPlayerReleasedGhost(Player* player) override
{
sALE->OnPlayerReleasedGhost(player);
}
};

class ALE_ServerScript : public ServerScript
Expand Down
1 change: 1 addition & 0 deletions src/LuaEngine/Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
1 change: 1 addition & 0 deletions src/LuaEngine/LuaEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ class ALE_GAME_API ALE
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);
Expand Down
7 changes: 7 additions & 0 deletions src/LuaEngine/hooks/PlayerHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/LuaEngine/methods/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
*
Expand Down