feat(PlayerHooks): Add tweaks for OnPlayerQuestAccept (#282)

This commit is contained in:
iThorgrim
2025-09-02 21:46:14 +02:00
committed by GitHub
parent 1c63eacec9
commit f5ac976642
4 changed files with 18 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ namespace Hooks
PLAYER_EVENT_ON_CAN_UPDATE_SKILL = 60, // (event, player, skill_id) -- Can return true or false
PLAYER_EVENT_ON_BEFORE_UPDATE_SKILL = 61, // (event, player, skill_id, value, max, step) -- Can return new amount
PLAYER_EVENT_ON_UPDATE_SKILL = 62, // (event, player, skill_id, value, max, step, new_value)
PLAYER_EVENT_ON_QUEST_ACCEPT = 63, // (event, player, quest)
PLAYER_EVENT_COUNT
};

View File

@@ -491,6 +491,7 @@ public:
void OnPlayerBeforeUpdateSkill(Player* player, uint32 skill_id, uint32& value, uint32 max, uint32 step);
void OnPlayerUpdateSkill(Player* player, uint32 skill_id, uint32 value, uint32 max, uint32 step, uint32 new_value);
bool CanPlayerResurrect(Player* player);
void OnPlayerQuestAccept(Player* player, Quest const* quest);
/* Vehicle */
void OnInstall(Vehicle* vehicle);

View File

@@ -754,10 +754,17 @@ void Eluna::OnPlayerUpdateSkill(Player* player, uint32 skill_id, uint32 value, u
CallAllFunctions(PlayerEventBindings, key);
}
bool Eluna::CanPlayerResurrect(Player* player)
{
START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_CAN_RESURRECT, true);
Push(player);
return CallAllFunctionsBool(PlayerEventBindings, key);
}
void Eluna::OnPlayerQuestAccept(Player* player, Quest const* quest)
{
START_HOOK(PLAYER_EVENT_ON_QUEST_ACCEPT);
Push(player);
Push(quest);
CallAllFunctions(PlayerEventBindings, key);
}