Jump to content

How to send CHAT_MSG_RAID_BOSS_EMOTE to 1 player


Recommended Posts

Posted

Hello, im creating own killstreak system for players.

And when player kills someone , i want to let them know on what streak he is , but with messagetype of CHAT_MSG_RAID_BOSS_EMOTE, ye i know , that is the hard way :/

But anyways , is this possible?

Posted

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 :(

Posted

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 *

Posted

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!

Posted

MonsterTextEmote for bosses is the same graphically as MonsterWhisper for bosses, the difference is that whisper is seen by the Unit given as parameter, and Emote is seen by everyone in some radius (100yd?)

×
×
  • 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