Jump to content

How to send CHAT_MSG_RAID_BOSS_EMOTE to 1 player


Guest ilija

Recommended Posts

Somehow it also happens in Battlegrounds, they use something like:

    WorldPacket data(SMSG_MESSAGECHAT, 200);

   data << (uint8)CHAT_MSG_RAID_BOSS_EMOTE;
   data << (uint32)LANG_UNIVERSAL;
   data << (uint64)0;
   data << (uint32)0;                                     // 2.1.0
   data << (uint32)1;
   data << (uint8)0;
   data << (uint64)0;
   data << (uint32)(strlen(msg.c_str())+1);
   data << msg.c_str();
   data << (uint8)0;
   for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
       if (Player *plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
           if (plr->GetSession())
               plr->GetSession()->SendPacket(&data);

I have tried,

                       std::string str = "";
                       str = "You have %d kills without dying!", KillingStreak[kGUID].KillStreak;
                       WorldPacket data(SMSG_MESSAGECHAT, 200);
                       data << (uint8)CHAT_MSG_RAID_BOSS_EMOTE;
                       data << (uint32)LANG_UNIVERSAL;
                       data << (uint64)0;
                       data << (uint32)0;                                     // 2.1.0
                       data << (uint32)1;
                       data << (uint8)0;
                       data << (uint64)0;
                       data << (uint32)(str.size()+1);
                       data << str;
                       data << (uint8)0;

                       killer->GetSession()->SendPacket(&data);

But wont work :(

Link to comment
Share on other sites

Where did you use it ?

maybe try implementing some headers like Object.h in whatever file you are in

cause

I wrote

Player * plr = NULL;

plr->MonsterTextEmote("test", plr, true);

and it compiled just fine

Edit:

ok

You use std::string

so do smth like

std::string str = "mystring%s smth etc";

plr->MonsterTextEmote(str.c_str(), plr, true);

(you need to use c_str() on std::strings to convert it to char *

Link to comment
Share on other sites

char str[200];

sprintf(str,"[D10] You are on %u KillStreak!",KillingStreak[kGUID].KillStreak);

killer->MonsterTextEmote(str,kGUID,true);

Got other problem , other playes in some range can also see that , anyway to avoid that?

Got ugly hack, decrease text emote range of creatures in config , but that is very ugly!

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