Jump to content

[patch][6559] Implement Two New Chat_msg_* Options


Guest NoFantasy

Recommended Posts

Implement two chat options: CHAT_MSG_RAID_BOSS_EMOTE and CHAT_MSG_RAID_BOSS_WHISPER

Revision: 6541+ (patch made for 6541)

Who made it: NoFantasy

Info: if the optional bool=true, text will display as yellow text on screen and in addition in chat log. I chose to use already existing functions since i _think_ the packet will look the same for these two. From script it can be tested using creature->MonsterTextEmote("does the happy dance.",0,true);

Patch:

Index: src/game/Creature.h
===================================================================
--- src/game/Creature.h        (revision 6541)
+++ src/game/Creature.h        (working copy)
@@ -464,8 +464,8 @@
                void setEmoteState(uint8 emote) { m_emoteState = emote; };
                void Say(const char* text, const uint32 language, const uint64 TargetGuid) { MonsterSay(text,language,TargetGuid); }
                void Yell(const char* text, const uint32 language, const uint64 TargetGuid) { MonsterYell(text,language,TargetGuid); }
-                void TextEmote(const char* text, const uint64 TargetGuid) { MonsterTextEmote(text,TargetGuid); }
-                void Whisper(const uint64 receiver, const char* text) { MonsterWhisper(receiver,text); }
+                void TextEmote(const char* text, const uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(text,TargetGuid,IsBossEmote); }
+                void Whisper(const uint64 receiver, const char* text, bool IsBossWhisper = false) { MonsterWhisper(receiver,text,IsBossWhisper); }

                void setDeathState(DeathState s);                                     // overwrite virtual Unit::setDeathState

Index: src/game/Object.cpp
===================================================================
--- src/game/Object.cpp        (revision 6541)
+++ src/game/Object.cpp        (working copy)
@@ -1177,13 +1177,13 @@
        SendMessageToSet(&data, true);
}

-void WorldObject::MonsterTextEmote(const char* text, const uint64 TargetGuid)
+void WorldObject::MonsterTextEmote(const char* text, const uint64 TargetGuid, bool IsBossEmote)
{
        std::string rightText = "%s ";
        rightText.append(text);

        WorldPacket data(SMSG_MESSAGECHAT, 200);
-        data << (uint8)CHAT_MSG_MONSTER_EMOTE;
+        data << (uint8)(IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE);
        data << (uint32)LANG_UNIVERSAL;
        data << (uint64)GetGUID();                                                            // 2.1.0
        data << (uint32)0;                                                                            // 2.1.0
@@ -1202,10 +1202,10 @@
        SendMessageToSet(&data, true);                                                    // SendMessageToOwnTeamSet()?
}

-void WorldObject::MonsterWhisper(const uint64 receiver, const char* text)
+void WorldObject::MonsterWhisper(const uint64 receiver, const char* text, bool IsBossWhisper)
{
        WorldPacket data(SMSG_MESSAGECHAT, 200);
-        data << (uint8)CHAT_MSG_MONSTER_WHISPER;
+        data << (uint8)(IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER);
        data << (uint32)LANG_UNIVERSAL;
        data << (uint64)GetGUID();
        data << (uint32)0;                                                                            //unk1
Index: src/game/Object.h
===================================================================
--- src/game/Object.h        (revision 6541)
+++ src/game/Object.h        (working copy)
@@ -416,8 +416,8 @@

                void MonsterSay(const char* text, const uint32 language, const uint64 TargetGuid);
                void MonsterYell(const char* text, const uint32 language, const uint64 TargetGuid);
-                void MonsterTextEmote(const char* text, const uint64 TargetGuid);
-                void MonsterWhisper(const uint64 receiver, const char* text);
+                void MonsterTextEmote(const char* text, const uint64 TargetGuid, bool IsBossEmote = false);
+                void MonsterWhisper(const uint64 receiver, const char* text, bool IsBossWhisper = false);

                void SendObjectDeSpawnAnim(uint64 guid);

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use