本文整理汇总了C++中Creature::BuildMonsterChat方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::BuildMonsterChat方法的具体用法?C++ Creature::BuildMonsterChat怎么用?C++ Creature::BuildMonsterChat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature::BuildMonsterChat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: data
void BattleGround::SendYell2ToAll(int32 entry, uint32 language, uint64 const& guid, int32 arg1, int32 arg2)
{
Creature* source = GetBgMap()->GetCreature(guid);
if(!source)
return;
char buf[256];
sprintf(buf, GetMangosString(entry), GetMangosString(arg1), GetMangosString(arg2));
for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if(!plr)
{
sLog.outError("BattleGround: Player " UI64FMTD " not found!", itr->first);
continue;
}
source->BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, buf, language, source->GetName(), itr->first);
plr->GetSession()->SendPacket(&data);
}
}
示例2: JustDied
void JustDied(Unit *victim)
{
if(pInstance && IsEvent)
{
pInstance->SetData(DATA_AZGALOREVENT, DONE);
Unit* pCreature = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_AZGALOR));
if(pCreature)
{
Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000);
Map *map = pCreature->GetMap();
if (map->IsDungeon() && pUnit)
{
pUnit->SetVisibility(VISIBILITY_OFF);
Map::PlayerList const &PlayerList = map->GetPlayers();
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource())
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID());
i->getSource()->GetSession()->SendPacket(&data);
WorldPacket data2(SMSG_PLAY_SOUND, 4);
data2 << 10986;
i->getSource()->GetSession()->SendPacket(&data2);
}
}
}
}
}
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
}
示例3: SetData
void SetData(uint32 type, uint32 data)
{
switch (type)
{
case DATA_RAGEWINTERCHILLEVENT:
m_auiEncounter[0] = data;
break;
case DATA_ANETHERONEVENT:
m_auiEncounter[1] = data;
break;
case DATA_KAZROGALEVENT:
m_auiEncounter[2] = data;
break;
case DATA_AZGALOREVENT:
{
m_auiEncounter[3] = data;
if (data == DONE)
{
if (ArchiYell)
break;
ArchiYell = true;
Creature* creature = instance->GetCreature(Azgalor);
if (creature)
{
Creature* unit = creature->SummonCreature(21987, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000);
Map* map = creature->GetMap();
if (map->IsDungeon() && unit)
{
unit->SetVisible(false);
Map::PlayerList const &PlayerList = map->GetPlayers();
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource())
{
WorldPacket packet(SMSG_MESSAGECHAT, 200);
unit->BuildMonsterChat(&packet, CHAT_MSG_MONSTER_YELL, YELL_EFFORTS, 0, YELL_EFFORTS_NAME, i->getSource()->GetGUID());
i->getSource()->GetSession()->SendPacket(&packet);
WorldPacket data2(SMSG_PLAY_SOUND, 4);
data2 << uint32(10986);
data2 << uint64(unit->GetGUID());
i->getSource()->GetSession()->SendPacket(&data2);
}
}
}
}
}
}
break;
case DATA_ARCHIMONDEEVENT:
m_auiEncounter[4] = data;
break;
case DATA_RESET_TRASH_COUNT:
Trash = 0;
break;
case DATA_TRASH:
if (data)
Trash = data;
else
Trash--;
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
break;
case TYPE_RETREAT:
if (data == SPECIAL)
{
if (!m_uiAncientGemGUID.empty())
{
for (std::list<uint64>::const_iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr)
{
//don't know how long it expected
DoRespawnGameObject(*itr, DAY);
}
}
}
break;
case DATA_ALLIANCE_RETREAT:
allianceRetreat = data;
HandleGameObject(HordeGate, true);
SaveToDB();
break;
case DATA_HORDE_RETREAT:
hordeRetreat = data;
HandleGameObject(ElfGate, true);
SaveToDB();
break;
case DATA_RAIDDAMAGE:
RaidDamage += data;
if (RaidDamage >= MINRAIDDAMAGE)
RaidDamage = MINRAIDDAMAGE;
break;
case DATA_RESET_RAIDDAMAGE:
RaidDamage = 0;
break;
}
//.........这里部分代码省略.........
示例4: SetData
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break;
case DATA_ANETHERONEVENT:
Encounters[1] = data;
break;
case DATA_KAZROGALEVENT: Encounters[2] = data; break;
case DATA_AZGALOREVENT:
{
Encounters[3] = data;
if (data == DONE)
{
if (ArchiYell)break;
ArchiYell = true;
Creature* pCreature = instance->GetCreature(Azgalor);
if (pCreature)
{
Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000);
Map* pMap = pCreature->GetMap();
if (pMap->IsDungeon() && pUnit)
{
pUnit->SetVisibility(VISIBILITY_OFF);
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource())
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,YELL_EFFORTS,0,YELL_EFFORTS_NAME,i->getSource()->GetGUID());
i->getSource()->GetSession()->SendPacket(&data);
WorldPacket data2(SMSG_PLAY_SOUND, 4);
data2 << 10986;
i->getSource()->GetSession()->SendPacket(&data2);
}
}
}
}
}
}
break;
case DATA_ARCHIMONDEEVENT: Encounters[4] = data; break;
case DATA_RESET_TRASH_COUNT: Trash = 0; break;
case DATA_TRASH:
if (data) Trash = data;
else Trash--;
UpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
break;
case DATA_ALLIANCE_RETREAT:
allianceRetreat = data;
OpenDoor(HordeGate,true);
SaveToDB();
break;
case DATA_HORDE_RETREAT:
hordeRetreat = data;
OpenDoor(ElfGate,true);
SaveToDB();
break;
case DATA_RAIDDAMAGE:
RaidDamage += data;
if (RaidDamage >= MINRAIDDAMAGE)
RaidDamage = MINRAIDDAMAGE;
break;
case DATA_RESET_RAIDDAMAGE:
RaidDamage = 0;
break;
}
debug_log("BSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data);
if (data == DONE)
SaveToDB();
}