Advertisement
conan513

Untitled

Apr 11th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1.     for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i)
  2.     {
  3.         ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(i);
  4.         AreaTableEntry const* area = sAreaStore.LookupEntry(
  5.             (channel->ChannelID == tradeChannelID) ? cityLookupAreaID : playerZoneId);
  6.         if (channel && area && channel->ChannelID == channelId)
  7.         {
  8.             char channelName[255];
  9.             snprintf(channelName, 255, channel->pattern[0], area->area_name[0]);
  10.  
  11.             if (ChannelMgr* cMgr = channelMgr(bot->GetTeam()))
  12.             {
  13.                 if (Channel* chn = cMgr->GetJoinChannel(channelName))
  14.                 {
  15.                     chn->Join(bot, "");
  16.                     chn->Say(bot, msg.c_str(), LANG_UNIVERSAL);
  17.                 }
  18.             }
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement