aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting/ScriptMgr.h
diff options
context:
space:
mode:
authorsilinoron <none@none>2010-09-04 12:49:39 -0700
committersilinoron <none@none>2010-09-04 12:49:39 -0700
commit0f997162ee5652fd2ff5d6916f461dabc5050f9c (patch)
tree288f4f87fdfef3c9ca17854cd008a2289a495ca6 /src/server/game/Scripting/ScriptMgr.h
parent0f9fe8dbeb3990175cfac07a3b7349c9d8e668b7 (diff)
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
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r--src/server/game/Scripting/ScriptMgr.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index c55e9a9385f..7b5b6d1ef55 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -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);