本文整理汇总了C++中GuidList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ GuidList::push_back方法的具体用法?C++ GuidList::push_back怎么用?C++ GuidList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuidList
的用法示例。
在下文中一共展示了GuidList::push_back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpawnAdds
void SpawnAdds(GuidList& List, uint32 uiEntry)
{
if (Creature* pSummon = m_creature->SummonCreature(uiEntry, SpawnNode[7][0], SpawnNode[7][1], SpawnNode[7][2], 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
{
uint8 uiPoint = urand(0, 2);
float x,y,z;
x = SpawnNode[uiPoint][0] -5 + urand(0, 10);
y = SpawnNode[uiPoint][1] -5 + urand(0, 10);
z = SpawnNode[uiPoint][2];
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pSummon->GetMotionMaster()->MovePoint(uiPoint, x, y, z);
List.push_back(pSummon->GetObjectGuid());
}
if (Creature* pSummon = m_creature->SummonCreature(uiEntry, SpawnNode[6][0], SpawnNode[6][1], SpawnNode[6][2], 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
{
uint8 uiPoint = urand(3, 5);
float x,y,z;
x = SpawnNode[uiPoint][0] -5 + urand(0, 10);
y = SpawnNode[uiPoint][1] -5 + urand(0, 10);
z = SpawnNode[uiPoint][2];
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pSummon->GetMotionMaster()->MovePoint(uiPoint, x, y, z);
List.push_back(pSummon->GetObjectGuid());
}
}
示例2: DoSummonGuards
void DoSummonGuards()
{
// 4 adds
if (Creature* pTmp = m_creature->SummonCreature(NPC_KORKRON_REAVER, fPositions[3][0], fPositions[3][1], fPositions[3][2], fPositions[3][3], TEMPSUMMON_MANUAL_DESPAWN, 0))
m_lGuards.push_back(pTmp->GetObjectGuid());
if (Creature* pTmp = m_creature->SummonCreature(NPC_KORKRON_REAVER, fPositions[4][0], fPositions[4][1], fPositions[4][2], fPositions[4][3], TEMPSUMMON_MANUAL_DESPAWN, 0))
m_lGuards.push_back(pTmp->GetObjectGuid());
if (Creature* pTmp = m_creature->SummonCreature(NPC_KORKRON_REAVER, fPositions[5][0], fPositions[5][1], fPositions[5][2], fPositions[5][3], TEMPSUMMON_MANUAL_DESPAWN, 0))
m_lGuards.push_back(pTmp->GetObjectGuid());
if (Creature* pTmp = m_creature->SummonCreature(NPC_KORKRON_REAVER, fPositions[6][0], fPositions[6][1], fPositions[6][2], fPositions[6][3], TEMPSUMMON_MANUAL_DESPAWN, 0))
m_lGuards.push_back(pTmp->GetObjectGuid());
}
示例3: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
pSummoned->CastSpell(pSummoned, SPELL_FLAME_SPHERE_SPAWN_EFFECT, true);
pSummoned->CastSpell(pSummoned, SPELL_FLAME_SPHERE_VISUAL, true);
m_lFlameOrbsGuidList.push_back(pSummoned->GetObjectGuid());
}
示例4: Reset
void Reset() override
{
DoCastSpellIfCan(m_creature, SPELL_SNEAK);
// Do only once, and only for those summoned by Arlokk
if (m_bMoveToAid)
{
// Add to GUID list to despawn later
m_lProwlerGUIDList.push_back(m_creature->GetObjectGuid());
// Count the number of prowlers alive
uint32 count = 0;
for (GuidList::const_iterator itr = m_lProwlerGUIDList.begin(); itr != m_lProwlerGUIDList.end(); ++itr)
{
if (Unit* pProwler = m_creature->GetMap()->GetUnit(*itr))
if (pProwler->isAlive())
count++;
}
// Check if more than 40 are alive, if so, despawn
if (count > 40)
{
m_creature->ForcedDespawn();
return;
}
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MovePoint(1, aArlokkWallShieldPos[0], aArlokkWallShieldPos[1], aArlokkWallShieldPos[2]);
m_bMoveToAid = false;
}
}
示例5: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
switch (pSummoned->GetEntry())
{
case NPC_HIGH_EXECUTIONER_NUZARK:
m_nuzarkGuid = pSummoned->GetObjectGuid();
break;
case NPC_SHADOW_OF_LEXLORT:
m_lexlortGuid = pSummoned->GetObjectGuid();
break;
case NPC_SEARSCALE_DRAKE:
// If it's the flying drake allow him to move in circles
if (m_bIsFirstSearScale)
{
m_bIsFirstSearScale = false;
pSummoned->SetLevitate(true);
// ToDo: this guy should fly in circles above the creature
}
m_lSearscaleGuidList.push_back(pSummoned->GetObjectGuid());
break;
default:
// The hostile mobs should attack the player only
if (Player* pPlayer = GetPlayerForEscort())
pSummoned->AI()->AttackStart(pPlayer);
break;
}
}
示例6: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
// Also remove npc flags where needed
switch (pSummoned->GetEntry())
{
case NPC_FANDRAL_STAGHELM:
m_fandralGuid = pSummoned->GetObjectGuid();
break;
case NPC_MERITHRA_OF_THE_DREAM:
m_merithraGuid = pSummoned->GetObjectGuid();
pSummoned->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
break;
case NPC_CAELESTRASZ:
m_CaelestraszGuid = pSummoned->GetObjectGuid();
pSummoned->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
break;
case NPC_ARYGOS:
m_arygosGuid = pSummoned->GetObjectGuid();
pSummoned->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
break;
case NPC_ANUBISATH_CONQUEROR:
case NPC_QIRAJI_WASP:
case NPC_QIRAJI_DRONE:
case NPC_QIRAJI_TANK:
case NPC_KALDOREI_INFANTRY:
m_lQirajiWarriorsList.push_back(pSummoned->GetObjectGuid());
break;
}
}
示例7: FindNewGroups
/**
Checks que main queue to try to form a Lfg group. Returns first match found (if any)
@param[in] check List of guids trying to match with other groups
@param[in] all List of all other guids in main queue to match against
@return LfgCompatibility type of compatibility between groups
*/
LfgCompatibility LFGQueue::FindNewGroups(GuidList& check, GuidList& all)
{
std::string strGuids = ConcatenateGuids(check);
LfgCompatibility compatibles = GetCompatibles(strGuids);
TC_LOG_DEBUG("lfg.queue.match.check", "Guids: (%s): %s - all(%s)", strGuids.c_str(), GetCompatibleString(compatibles), ConcatenateGuids(all).c_str());
if (compatibles == LFG_COMPATIBILITY_PENDING) // Not previously cached, calculate
compatibles = CheckCompatibility(check);
if (compatibles == LFG_COMPATIBLES_BAD_STATES && sLFGMgr->AllQueued(check))
{
TC_LOG_DEBUG("lfg.queue.match.check", "Guids: (%s) compatibles (cached) changed from bad states to match", strGuids.c_str());
SetCompatibles(strGuids, LFG_COMPATIBLES_MATCH);
return LFG_COMPATIBLES_MATCH;
}
if (compatibles != LFG_COMPATIBLES_WITH_LESS_PLAYERS)
return compatibles;
// Try to match with queued groups
while (!all.empty())
{
check.push_back(all.front());
all.pop_front();
LfgCompatibility subcompatibility = FindNewGroups(check, all);
if (subcompatibility == LFG_COMPATIBLES_MATCH)
return LFG_COMPATIBLES_MATCH;
check.pop_back();
}
return compatibles;
}
示例8: SelectTargetWithinDist
Unit* SelectTargetWithinDist()
{
ThreatList const& m_threatlist = m_creature->getThreatManager().getThreatList();
if (m_threatlist.empty())
return NULL;
GuidList distPositive;
for (ThreatList::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
{
if (Unit* pTemp = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()))
{
//player within 80 yards
if ((pTemp->GetTypeId() == TYPEID_PLAYER && !m_creature->IsWithinDist(pTemp, 10.0f) && m_creature->IsWithinDist(pTemp, 80.0f)))
distPositive.push_back(pTemp->GetObjectGuid());
}
}
if (!distPositive.empty())
{
GuidList::iterator m_uiPlayerGUID = distPositive.begin();
advance(m_uiPlayerGUID, (rand()%distPositive.size()));
if (Player* pTemp = m_creature->GetMap()->GetPlayer(*m_uiPlayerGUID))
return pTemp;
}
return NULL;
}
示例9: InitSentinelsNear
void InitSentinelsNear(Unit* pTarget)
{
if (!m_lAssistList.empty())
{
for (GuidList::const_iterator itr = m_lAssistList.begin(); itr != m_lAssistList.end(); ++itr)
{
if (*itr == m_creature->GetObjectGuid())
continue;
if (Creature* pBuddy = m_creature->GetMap()->GetCreature(*itr))
{
if (pBuddy->isAlive())
pBuddy->AI()->AttackStart(pTarget);
}
}
return;
}
std::list<Creature*> lAssistList;
GetCreatureListWithEntryInGrid(lAssistList, m_creature, m_creature->GetEntry(), 80.0f);
for (std::list<Creature*>::iterator iter = lAssistList.begin(); iter != lAssistList.end(); ++iter)
{
m_lAssistList.push_back((*iter)->GetObjectGuid());
if ((*iter)->GetObjectGuid() == m_creature->GetObjectGuid())
continue;
(*iter)->AI()->AttackStart(pTarget);
}
if (m_lAssistList.size() != MAX_BUDDY)
script_error_log("npc_anubisath_sentinel for %s found too few/too many buddies, expected %u.", m_creature->GetGuidStr().c_str(), MAX_BUDDY);
}
示例10: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
if (pSummoned->GetEntry() == NPC_TWILIGHT_VOLUNTEER)
{
pSummoned->SetWalk(false);
pSummoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_6);
m_lVolunteerGuidList.push_back(pSummoned->GetObjectGuid());
}
}
示例11: PrepareSummonPlaces
void PrepareSummonPlaces()
{
CreatureList lSummonList;
m_pInstance->GetGothSummonPointCreatures(lSummonList, true);
if (lSummonList.empty())
return;
// Trainees and Rider
uint8 index = 0;
uint8 uiTraineeCount = 3;
lSummonList.sort(ObjectDistanceOrder(m_creature));
for (auto& itr : lSummonList)
{
if (itr)
{
if (uiTraineeCount == 0)
break;
if (index == 1)
m_lRiderSummonPosGuids.push_back(itr->GetObjectGuid());
else
{
m_lTraineeSummonPosGuids.push_back(itr->GetObjectGuid());
--uiTraineeCount;
}
index++;
}
}
// DeathKnights
uint8 uiDeathKnightCount = 2;
lSummonList.sort(ObjectDistanceOrderReversed(m_creature));
for (auto& itr : lSummonList)
{
if (itr)
{
if (uiDeathKnightCount == 0)
break;
m_lDeathKnightSummonPosGuids.push_back(itr->GetObjectGuid());
--uiDeathKnightCount;
}
}
}
示例12: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
if (pSummoned->GetEntry() == NPC_MOLTEN_GOLEM)
{
m_lGolemGUIDList.push_back(pSummoned->GetObjectGuid());
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
pSummoned->AI()->AttackStart(pTarget);
}
}
示例13: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
if (pSummoned->GetEntry() == NPC_WALKING_BOMB)
{
m_lSummonedBombGUIDs.push_back(pSummoned->GetObjectGuid());
// calculate point for falling down
float fX, fY;
fX = 0.2 * m_afSpawnPos[0] + 0.8 * pSummoned->GetPositionX();
fY = 0.2 * m_afSpawnPos[1] + 0.8 * pSummoned->GetPositionY();
pSummoned->GetMotionMaster()->MovePoint(1, fX, fY, m_afSpawnPos[2] - 2.0f);
}
}
示例14: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
if (pSummoned->GetEntry() == NPC_GLOB_OF_VISCIDUS)
{
float fX, fY, fZ;
m_creature->GetRespawnCoord(fX, fY, fZ);
pSummoned->GetMotionMaster()->MovePoint(1, fX, fY, fZ);
m_lGlobesGuidList.push_back(pSummoned->GetObjectGuid());
}
else if (pSummoned->GetEntry() == NPC_VISCIDUS_TRIGGER)
pSummoned->CastSpell(pSummoned, SPELL_TOXIN, TRIGGERED_OLD_TRIGGERED);
}
示例15: JustSummoned
void JustSummoned(Creature* pCreature) override
{
m_lSummonedAddsGuids.push_back(pCreature->GetObjectGuid());
if (pCreature->GetEntry() == NPC_SUPPRESSER)
pCreature->FixateTarget(m_creature);
else
{
pCreature->AddThreat(m_creature, 5000);
pCreature->AI()->AttackStart(m_creature);
}
pCreature->SetInCombatWithZone();
}