mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
Core/Logging: Re-Implemented onChat scripting system
This commit is contained in:
@@ -1213,6 +1213,31 @@ void ScriptMgr::OnPlayerDuelEnd(Player* winner, Player* loser, DuelCompleteType
|
||||
FOREACH_SCRIPT(PlayerScript)->OnDuelEnd(winner, loser, type);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Player* receiver)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, receiver);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, group);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, guild);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Channel* channel)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, channel);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerEmote(Player* player, uint32 emote)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnEmote(player, emote);
|
||||
|
||||
@@ -716,6 +716,17 @@ class PlayerScript : public ScriptObject
|
||||
// Called when a duel ends
|
||||
virtual void OnDuelEnd(Player* /*winner*/, Player* /*loser*/, DuelCompleteType /*type*/) { }
|
||||
|
||||
// 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*/) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user