feat(Core/Scripting): Add OnPlayerLearnTaxiNode hook (#25288)
This commit is contained in:
parent
f644e4522e
commit
0246faa95a
4 changed files with 19 additions and 0 deletions
|
|
@ -142,6 +142,8 @@ bool WorldSession::SendLearnNewTaxiNode(Creature* unit)
|
|||
update << uint8(1);
|
||||
SendPacket(&update);
|
||||
|
||||
sScriptMgr->OnPlayerLearnTaxiNode(GetPlayer(), curloc);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
@ -154,6 +156,8 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid)
|
|||
{
|
||||
WorldPacket msg(SMSG_NEW_TAXI_PATH, 0);
|
||||
SendPacket(&msg);
|
||||
|
||||
sScriptMgr->OnPlayerLearnTaxiNode(GetPlayer(), nodeid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -466,6 +466,7 @@ public: /* PlayerScript */
|
|||
void OnPlayerSendListInventory(Player* player, ObjectGuid vendorGuid, uint32& vendorEntry);
|
||||
void OnPlayerGetReputationPriceDiscount(Player const* player, Creature const* creature, float& discount);
|
||||
void OnPlayerGetReputationPriceDiscount(Player const* player, FactionTemplateEntry const* factionTemplate, float& discount);
|
||||
void OnPlayerLearnTaxiNode(Player const* player, uint32 nodeId);
|
||||
|
||||
// Anti cheat
|
||||
void AnticheatSetCanFlybyServer(Player* player, bool apply);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue