本文整理汇总了C++中SummonList::Respawn方法的典型用法代码示例。如果您正苦于以下问题:C++ SummonList::Respawn方法的具体用法?C++ SummonList::Respawn怎么用?C++ SummonList::Respawn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SummonList
的用法示例。
在下文中一共展示了SummonList::Respawn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAI
void UpdateAI(uint32 diff)
{
events2.Update(diff);
switch (events2.ExecuteEvent())
{
case EVENT_SHADE_GATHER_NPCS:
{
std::list<Creature*> ChannelerList;
me->GetCreaturesWithEntryInRange(ChannelerList, 100.0f, NPC_ASHTONGUE_CHANNELER);
for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
summonsChanneler.Summon(*itr);
std::list<Creature*> SpawnerList;
me->GetCreaturesWithEntryInRange(SpawnerList, 100.0f, NPC_CREATURE_GENERATOR_AKAMA);
for (std::list<Creature*>::const_iterator itr = SpawnerList.begin(); itr != SpawnerList.end(); ++itr)
summonsGenerator.Summon(*itr);
summonsChanneler.Respawn();
summonsGenerator.Respawn();
ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);
if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
akama->Respawn(true);
break;
}
case EVENT_SHADE_RESET_ENCOUNTER:
me->SetVisible(true);
summonsGenerator.Respawn();
summonsChanneler.Respawn();
ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);
if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
akama->Respawn(true);
break;
}
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
{
case EVENT_SHADE_CHECK_DISTANCE:
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
if (slow > -100)
{
me->SetWalk(true);
me->GetMotionMaster()->MovePoint(POINT_START, 510.0f, 400.7993f, 112.7837f);
}
}
else
{
int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
if (slow < -100)
me->GetMotionMaster()->Clear();
else if (slow == 0)
{
summonsGenerator.DoAction(ACTION_NO_SORCERERS);
me->SetWalk(false);
}
}
if (me->IsWithinMeleeRange(me->GetVictim()))
{
me->SetReactState(REACT_AGGRESSIVE);
DoResetThreat();
me->GetVictim()->InterruptNonMeleeSpells(false);
me->AddThreat(me->GetVictim(), 1000000.0f);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_NOT_SELECTABLE);
summonsGenerator.DoAction(ACTION_STOP_SPAWNING);
break;
}
events.ScheduleEvent(EVENT_SHADE_CHECK_DISTANCE, 1000);
break;
}
DoMeleeAttackIfReady();
EnterEvadeIfOutOfCombatArea();
}