本文整理汇总了C++中instancemap::playerlist::const_iterator::GetSource方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::GetSource方法的具体用法?C++ const_iterator::GetSource怎么用?C++ const_iterator::GetSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instancemap::playerlist::const_iterator
的用法示例。
在下文中一共展示了const_iterator::GetSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CastBloodboil
// Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited.
void CastBloodboil()
{
std::list<Unit* > targets;
Map* map = me->GetMap();
if (map->IsDungeon())
{
InstanceMap::PlayerList const& PlayerList = ((InstanceMap*)map)->GetPlayers();
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (Player* i_pl = i->GetSource())
{
if (i_pl && i_pl->IsAlive())
targets.push_back(i_pl);
}
}
}
//Sort the list of players
targets.sort(Oregon::ObjectDistanceOrderPred(me, false));
//Resize so we only get top 5
targets.resize(5);
//Aura each player in the targets list with Bloodboil.
for (std::list<Unit* >::iterator itr = targets.begin(); itr != targets.end(); ++itr)
{
Unit* pTarget = *itr;
if (pTarget && pTarget->IsAlive())
me->AddAura(SPELL_BLOODBOIL, pTarget);
}
targets.clear();
}
示例2: NextStep
uint32 NextStep(uint32 Step)
{
Unit* arca = Unit::GetUnit((*me), ArcanagosGUID);
Map* pMap = me->GetMap();
switch (Step)
{
case 0:
return 9999999;
case 1:
me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0);
return 10000;
case 2:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0);
return 20000;
case 3:
me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0);
return 10000;
case 4:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0);
return 20000;
case 5:
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0);
return 20000;
case 6:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0);
return 10000;
case 7:
FireArcanagosTimer = 500;
return 5000;
case 8:
FireMedivhTimer = 500;
DoCast(me, SPELL_MANA_SHIELD);
return 10000;
case 9:
me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
return 10000;
case 10:
if (arca)
DoCast(arca, SPELL_CONFLAGRATION_BLAST, false);
return 1000;
case 11:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0);
return 5000;
case 12:
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
arca->setActive(true);
arca->InterruptNonMeleeSpells(true);
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
return 10000;
case 13:
me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0);
return 10000;
case 14:
me->SetVisible(false);
me->ClearInCombat();
if (pMap->IsDungeon())
{
InstanceMap::PlayerList const& PlayerList = pMap->GetPlayers();
for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource()->IsAlive())
{
if (i->GetSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
i->GetSource()->CompleteQuest(9645);
}
}
}
return 50000;
case 15:
arca->DealDamage(arca, arca->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return 5000;
default :
return 9999999;
}
}