本文整理汇总了C++中GuidVector类的典型用法代码示例。如果您正苦于以下问题:C++ GuidVector类的具体用法?C++ GuidVector怎么用?C++ GuidVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GuidVector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddJustAggroed
void AddJustAggroed(Unit* pWho)
{
// Let all adds attack
for (GuidVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr)
{
Creature* pAdd = m_creature->GetMap()->GetCreature(*itr);
if (pAdd && !pAdd->getVictim())
pAdd->AI()->AttackStart(pWho);
}
}
示例2: Reset
void Reset() override
{
m_Phase = PHASE_GROUND;
m_PhaseSwitchTimer = 80000;
m_uiFreezingSlashTimer = 20000;
m_uiPenetratingColdTimer = urand(15000, 25000);
m_uiBurrowerSummonTimer = 10000;
m_uiBerserkTimer = 10 * MINUTE * IN_MILLISECONDS;
m_vSpheresGuidVector.clear();
m_vSpheresGuidVector.resize(MAX_FROSTSPHERES, ObjectGuid());
}
示例3: Cleanup
void Cleanup(Creature* infernal, InfernalPoint *point)
{
for (GuidVector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
{
if (*itr == infernal->GetGUID())
{
infernals.erase(itr);
break;
}
}
positions.push_back(point);
}
示例4: InfernalCleanup
void InfernalCleanup()
{
//Infernal Cleanup
for (GuidVector::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
if (Unit* pInfernal = ObjectAccessor::GetUnit(*me, *itr))
if (pInfernal->IsAlive())
{
pInfernal->SetVisible(false);
pInfernal->setDeathState(JUST_DIED);
}
infernals.clear();
}
示例5: JustDied
void JustDied(Unit* /*pKiller*/) override
{
for (GuidVector::const_iterator itr = m_vSnoboldGuidsVector.begin(); itr != m_vSnoboldGuidsVector.end(); ++itr)
{
if (Creature* pSnobold = m_creature->GetMap()->GetCreature(*itr))
{
if (!pSnobold->isAlive())
continue;
// ToDo: check if there is any player vehicle mounting involved
SendAIEvent(AI_EVENT_CUSTOM_EVENTAI_A, m_creature, pSnobold);
}
}
}
示例6: DoSetupAdds
void DoSetupAdds()
{
m_uiSetupAddsTimer = 0;
if (!m_pInstance)
return;
GuidList lAddGuids;
m_pInstance->GetKelidanAddList(lAddGuids);
// Sort Adds to vector if not already done
if (!lAddGuids.empty())
{
m_vAddGuids.reserve(lAddGuids.size());
std::list<Creature*> lAdds;
for (GuidList::const_iterator itr = lAddGuids.begin(); itr != lAddGuids.end(); ++itr)
{
if (Creature* pAdd = m_pInstance->instance->GetCreature(*itr))
lAdds.push_back(pAdd);
}
// Sort them by angle
lAdds.sort(SortByAngle(m_creature));
for (std::list<Creature*>::const_iterator itr = lAdds.begin(); itr != lAdds.end(); ++itr)
m_vAddGuids.push_back((*itr)->GetObjectGuid());
}
// Respawn killed adds and reset counter
m_uiKilledAdds = 0;
for (GuidVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr)
{
Creature* pAdd = m_pInstance->instance->GetCreature(*itr);
if (pAdd && !pAdd->isAlive())
pAdd->Respawn();
}
// Cast pentagram
uint8 s = m_vAddGuids.size();
for (uint8 i = 0; i < s; ++i)
{
Creature* pCaster = m_pInstance->instance->GetCreature(m_vAddGuids[i]);
Creature* pTarget = m_pInstance->instance->GetCreature(m_vAddGuids[(i + 2) % s]);
if (pCaster && pTarget)
pCaster->CastSpell(pTarget, SPELL_CHANNELING, TRIGGERED_NONE);
}
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}
示例7: DespawnGuids
void ScriptedAI::DespawnGuids(GuidVector& spawns)
{
for (ObjectGuid& guid : spawns)
if (Creature* spawn = m_creature->GetMap()->GetCreature(guid))
spawn->ForcedDespawn();
spawns.clear();
}
示例8: RemoveGravityLapse
// Wrapper to remove Gravity Lapse - this should be removed on aura 44251 expires
void RemoveGravityLapse()
{
GuidVector vGuids;
m_creature->FillGuidsListFromThreatList(vGuids);
for (GuidVector::const_iterator itr = vGuids.begin(); itr != vGuids.end(); ++itr)
{
Unit* pUnit = m_creature->GetMap()->GetUnit(*itr);
if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER)
{
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
}
}
}
示例9: npc_vimgol_visual_bunnyAI
npc_vimgol_visual_bunnyAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pMap = (ScriptedMap*)pCreature->GetInstanceData();
GuidVector bunnyGuids;
if (m_pMap)
{
m_pMap->GetCreatureGuidVectorFromStorage(m_creature->GetEntry(), bunnyGuids);
for (auto it = bunnyGuids.begin(); it != bunnyGuids.end(); ++it)
if ((*it) == m_creature->GetObjectGuid())
m_uiBunnyId = std::distance(bunnyGuids.begin(), it);
}
Reset();
}
示例10: playersInsideCircles
uint8 playersInsideCircles()
{
uint32 tmpAuras[5] = {
SPELL_VIMGOL_POP_TEST_A, SPELL_VIMGOL_POP_TEST_B, SPELL_VIMGOL_POP_TEST_C,
SPELL_VIMGOL_POP_TEST_D, SPELL_VIMGOL_POP_TEST_E
};
uint8 tmpCounter = 0;
if (m_uiBunnyGuids.size() < 5 && m_pMap)
{
m_uiBunnyGuids.clear();
m_pMap->GetCreatureGuidVectorFromStorage(NPC_VIMGOL_VISUAL_BUNNY, m_uiBunnyGuids);
}
for (int i = 0; i < 5; i++)
m_uiActiveCircles[i] = false;
std::list<Player*> playerList;
GetPlayerListWithEntryInWorld(playerList, m_creature, 30);
for (auto itr = playerList.begin(); itr != playerList.end(); ++itr)
{
if (!(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_A) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_B) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_C) &&
!(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_D) && !(*itr)->HasAura(SPELL_VIMGOL_POP_TEST_E))
continue;
for (auto it = m_uiBunnyGuids.begin(); it != m_uiBunnyGuids.end(); ++it)
{
for (int i = 0; i < 5; ++i)
{
if (!(*itr)->GetAura(tmpAuras[i], SpellEffectIndex(0)))
continue;
if ((*it) != (*itr)->GetAura(tmpAuras[i], SpellEffectIndex(0))->GetCasterGuid())
continue;
m_uiActiveCircles[std::distance(m_uiBunnyGuids.begin(), it)] = true;
}
}
}
for (int i = 0; i < 5; i++)
if (m_uiActiveCircles[i])
++tmpCounter;
return tmpCounter;
}
示例11: DoTeleportToPlatform
// Wrapper to teleport all players to the platform - Workaround for missing spell
void DoTeleportToPlatform()
{
m_creature->NearTeleportTo(aVorpilTeleportLoc[0], aVorpilTeleportLoc[1], aVorpilTeleportLoc[2], 0.0f);
float fX, fY, fZ;
GuidVector vGuids;
m_creature->FillGuidsListFromThreatList(vGuids);
for (GuidVector::const_iterator itr = vGuids.begin(); itr != vGuids.end(); ++itr)
{
Unit* pTarget = m_creature->GetMap()->GetUnit(*itr);
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{
pTarget->GetRandomPoint(aVorpilTeleportLoc[0], aVorpilTeleportLoc[1], aVorpilTeleportLoc[2], 4.0f, fX, fY, fZ);
DoTeleportPlayer(pTarget, fX, fY, fZ, m_creature->GetAngle(fX, fY));
}
}
}
示例12: DoSummonDrakkariInvaders
// Wrapper to handle the drakkari invaders summon
void DoSummonDrakkariInvaders()
{
if (!m_pInstance)
return;
// check if there are there are at least 2 triggers in the vector
if (m_vTriggers.size() < 2)
return;
if (roll_chance_i(30))
{
// Summon a troll in the corner and 2 trolls in the air
if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_pInstance->GetTrollgoreCornerTrigger()))
pTrigger->CastSpell(pTrigger, roll_chance_i(20) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
// get two random outside triggers
uint8 uiMaxTriggers = m_vTriggers.size();
uint8 uiPos1 = urand(0, uiMaxTriggers - 1);
uint8 uiPos2 = (uiPos1 + urand(1, uiMaxTriggers - 1)) % uiMaxTriggers;
if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_vTriggers[uiPos1]))
pTrigger->CastSpell(pTrigger, roll_chance_i(30) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_vTriggers[uiPos2]))
pTrigger->CastSpell(pTrigger, roll_chance_i(30) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
}
else
{
// Summon 3 trolls in the air
for (auto m_vTrigger : m_vTriggers)
{
if (Creature* pTrigger = m_creature->GetMap()->GetCreature(m_vTrigger))
pTrigger->CastSpell(pTrigger, roll_chance_i(30) ? SPELL_SUMMON_INVADER_1 : SPELL_SUMMON_INVADER_2, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, m_creature->GetObjectGuid());
}
}
}
示例13: JustDied
void JustDied(Unit* /*killer*/) override
{
LiveTriggerGUID.clear();
DeadTriggerGUID.clear();
_JustDied();
Talk(SAY_DEATH);
instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
}
示例14: Reset
void Reset() override
{
LiveTriggerGUID.clear();
DeadTriggerGUID.clear();
me->SetReactState(REACT_PASSIVE);
instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
_Reset();
Initialize();
}
示例15: CastBunnySpell
void CastBunnySpell(Creature* pTarget, uint32 uSpell)
{
if (!uSpell)
return;
std::list<Creature*> creatureList;
GetCreatureListWithEntryInGrid(creatureList, m_creature, NPC_VIMGOL_VISUAL_BUNNY, 200.0f);
for (auto& bunny : creatureList)
for (auto it = m_uiBunnyGuids.begin(); it != m_uiBunnyGuids.end(); ++it)
if ((*it) == bunny->GetObjectGuid())
if (m_uiActiveCircles[std::distance(m_uiBunnyGuids.begin(), it)])
bunny->CastSpell(pTarget ? pTarget : bunny, uSpell, TRIGGERED_OLD_TRIGGERED);
}