mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/ScriptSystem: Refactor ScriptMgr::OnPlayerChat to no longer accept a C-style parameter of type void*.
Instead, use overloaded methods for the different types. --HG-- branch : trunk
This commit is contained in:
@@ -675,15 +675,12 @@ public:
|
||||
// Called when a player's reputation changes (before it is actually changed)
|
||||
virtual void OnReputationChange(Player* /*player*/, uint32 /*factionID*/, int32& /*standing*/, bool /*incremental*/) { }
|
||||
|
||||
// Called when a player sends a chat message. param depends on the chat type:
|
||||
// CHAT_MSG_WHISPER - Player*: receiver;
|
||||
// CHAT_MSG_PARTY, CHAT_MSG_PARTY_LEADER - Group*: group of player;
|
||||
// CHAT_MSG_OFFICER, CHAT_MSG_GUILD - Guild*: guild of player;
|
||||
// CHAT_MSG_RAID, CHAT_MSG_RAID_LEADER, CHAT_MSG_RAID_WARNING - Group*: group of player;
|
||||
// CHAT_MSG_BATTLEGROUND, CHAT_MSG_BATTLEGROUND_LEADER - Group*: group of player;
|
||||
// CHAT_MSG_CHANNEL - Channel*: channel player speaks to;
|
||||
// other - NULL.
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, void* /*param*/ = NULL) { }
|
||||
// The following methods are called when a player sends a chat message
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/) { }
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Player* /*receiver*/) { }
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Group* /*group*/) { }
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Guild* /*guild*/) { }
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Channel* /*channel*/) { }
|
||||
|
||||
// Both of the below are called on emote opcodes
|
||||
virtual void OnEmote(Player* /*player*/, uint32 /*emote*/) { }
|
||||
@@ -887,7 +884,11 @@ class ScriptMgr
|
||||
void OnPlayerMoneyChanged(Player *player, int32& amount);
|
||||
void OnGivePlayerXP(Player *player, uint32& amount, Unit *victim);
|
||||
void OnPlayerReputationChange(Player *player, uint32 factionID, int32& standing, bool incremental);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, void* param = NULL);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Player* receiver);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Group* group);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Guild* guild);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Channel* channel);
|
||||
void OnPlayerEmote(Player* player, uint32 emote);
|
||||
void OnPlayerTextEmote(Player* player, uint32 text_emote, uint32 emoteNum, uint64 guid);
|
||||
void OnPlayerSpellCast(Player *player, Spell *spell, bool skipCheck);
|
||||
|
||||
Reference in New Issue
Block a user