feat(Core/Scripting): Add OnPlayerLearnTaxiNode hook (#25288)

This commit is contained in:
Axel Cocat
2026-03-29 01:20:27 +01:00
committed by GitHub
parent f644e4522e
commit 0246faa95a
4 changed files with 19 additions and 0 deletions
@@ -925,6 +925,11 @@ void ScriptMgr::OnPlayerGetReputationPriceDiscount(Player const* player, Faction
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_GET_REPUTATION_PRICE_DISCOUNT, script->OnPlayerGetReputationPriceDiscount(player, factionTemplate, discount));
}
void ScriptMgr::OnPlayerLearnTaxiNode(Player const* player, uint32 nodeId)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_LEARN_TAXI_NODE, script->OnPlayerLearnTaxiNode(player, nodeId));
}
PlayerScript::PlayerScript(const char* name, std::vector<uint16> enabledHooks)
: ScriptObject(name, PLAYERHOOK_END)
{
@@ -210,6 +210,7 @@ enum PlayerHook
PLAYERHOOK_ON_SEND_LIST_INVENTORY,
PLAYERHOOK_ON_GIVE_REPUTATION,
PLAYERHOOK_ON_GET_REPUTATION_PRICE_DISCOUNT,
PLAYERHOOK_ON_LEARN_TAXI_NODE,
PLAYERHOOK_END
};
@@ -820,6 +821,14 @@ public:
* @param discount Float value of the discount, as a multiplier of the base price
*/
virtual void OnPlayerGetReputationPriceDiscount(Player const* /*player*/, FactionTemplateEntry const* /*factionTemplate*/, float& /*discount*/) {}
/**
* @brief This hook is called when a player learns a new flight path node.
*
* @param player Contains information about the Player
* @param nodeId The id of the learned taxi node
*/
virtual void OnPlayerLearnTaxiNode(Player const* /*player*/, uint32 /*nodeId*/) {}
};
#endif