本文整理汇总了C++中SummonList::DespawnEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ SummonList::DespawnEntry方法的具体用法?C++ SummonList::DespawnEntry怎么用?C++ SummonList::DespawnEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SummonList
的用法示例。
在下文中一共展示了SummonList::DespawnEntry方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JustDied
void JustDied(Unit* pKiller)
{
RespawnDragons(true);
summons.DespawnEntry(NPC_FLAME_TSUNAMI);
Talk(SAY_SARTHARION_DEATH);
if (pInstance)
pInstance->SetData(BOSS_SARTHARION_EVENT, DONE);
}
示例2: EnterPhase
void EnterPhase(uint32 NextPhase)
{
switch(NextPhase)
{
case 0:
break;
case 1:
case 2:
case 3:
case 4:
DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100);
DoResetThreat();
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
me->RemoveAurasDueToSpell(Transform[Phase].unaura);
DoCast(me, Transform[Phase].spell);
me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, Transform[Phase].sound);
if (Phase > 0)
{
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1]))
Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp
if (NextPhase == 2)
{
me->GetMotionMaster()->Clear();
DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura
for (uint8 i = 0; i < 4; ++i)
{
Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Vortex)
{
Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Vortex->SetSpeed(MOVE_RUN, 1.0f);
Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0));
DoZoneInCombat(Vortex);
}
}
}
else
me->AI()->AttackStart(me->getVictim());
if (NextPhase == 3)
{
me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM);
Summons.DespawnEntry(CREATURE_FEATHER_VORTEX);
me->GetMotionMaster()->MoveChase(me->getVictim());
}
break;
default:
break;
}
Phase = NextPhase;
}
示例3: JustDied
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_ZULJINEVENT, DONE);
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DEATH);
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3]))
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
示例4: DoAction
void DoAction(int32 action)
{
if (action == ACTION_REPENTANCE_DONE)
{
lSummons.DespawnEntry(NPC_SOUL_FRAGMENT);
for (SummonList::const_iterator itr = lSummons.begin(); itr != lSummons.end(); ++itr)
if (Creature* pSummon = ObjectAccessor::GetCreature(*me, (*itr)))
if (pSummon->GetEntry() == NPC_REPENTANCE_MIRROR && pSummon->IsAIEnabled)
pSummon->AI()->DoAction(ACTION_REPENTANCE_DONE);
events.ScheduleEvent(EVENT_REPENTANCE, 1500, 0, PHASE_REPENTANCE);
}
}
示例5: ResetWeapon
inline void ResetWeapon()
{
events.Reset();
Summons.DespawnEntry(NPC_TWILIGHT_ARCHER);
me->RemoveAura(SPELL_FLAMING_SHIELD);
me->RemoveAura(SPELL_PERSONAL_PHALANX);
me->RemoveAura(SPELL_DUAL_BLADES_BUFF);
me->RemoveAura(SPELL_TRASH_BUFF);
me->RemoveAura(SPELL_LAVA_PATCH);
me->RemoveAura(SPELL_ENCUMBERED);
}
示例6: EnterCombat
void EnterCombat(Unit* /*who*/) override
{
Talk(SAY_AGGRO);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
Phase = FLYING;
m_uiMovementTimer = 1000;
m_uiSummonTimer = 10000;
me->SetInCombatWithZone();
instance->SetBossState(DATA_SKADI_THE_RUTHLESS, IN_PROGRESS);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f);
me->SetWalk(false);
m_uiMountTimer = 1000;
Summons.DespawnEntry(NPC_GRAUF);
}
示例7: EnterCombat
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
Phase = FLYING;
m_uiMovementTimer = 1000;
m_uiSummonTimer = 10000;
me->SetInCombatWithZone();
if (m_instance)
{
m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS);
m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
m_uiMountTimer = 1000;
Summons.DespawnEntry(CREATURE_GRAUF);
}
}
示例8: updateai
void updateai(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->HasUnitState(UNIT_STATE_CASTING))
if (!me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_MODULATION:
DoCast(me, SPELL_MODULATION);
events.ScheduleEvent(EVENT_MODULATION, urand(18000, 22000));
break;
case EVENT_FLY:
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
events.Reset();
SetCombatMovement(false);
me->SetCanFly(true);
me->GetMotionMaster()->MovePoint(1, flyPos);
break;
case EVENT_GROUND:
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
me->CastStop();
summons.DespawnEntry(NPC_ROARING_FLAME_TARGET);
me->RemoveAurasDueToSpell(SPELL_SONAR_FIREBALL_T);
events.Reset();
me->GetMotionMaster()->MovePoint(2, groundPos);
break;
case EVENT_NEXT_SPELL:
//За одну фазу будет скастовано 7 скиллов
if (nextspell > 7)
break;
switch (nextspell)
{
case 0:
case 2:
case 5:
case 7:
for (uint8 i = 0; i < 3; i++)
me->SummonCreature(NPC_SONAR_PULSE,
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f);
break;
case 1:
case 3:
case 6:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
{
me->SummonCreature(NPC_TRACKING_FLAMES,
target->GetPositionX(), target->GetPositionY(),
target->GetPositionZ(), me->GetOrientation(),
TEMPSUMMON_TIMED_DESPAWN, 8000);
}
break;
case 4:
Talk(SAY_FLAME);
DoCast(SPELL_SEARING_FLAME_1);
DoCast(SPELL_SEARING_FLAME);
break;
}
nextspell++;
events.ScheduleEvent(EVENT_NEXT_SPELL, 10000);
break;
case EVENT_SONAR_FIREBALL:
me->CastSpell(me, SPELL_SONAR_FIREBALL, true);
events.ScheduleEvent(EVENT_SONAR_FIREBALL, 10000);
break;
case EVENT_SONAR_BOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
me->CastSpell(target, SPELL_SONAR_BOMB, true);
events.ScheduleEvent(EVENT_SONAR_BOMB, 2000);
break;
case EVENT_ROARING_FLAME:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
atramedesTarget = target;
me->SummonCreature(NPC_ROARING_FLAME_TARGET,
target->GetPositionX() + urand(5,9),
target->GetPositionY() + urand(5,9),
target->GetPositionZ());
}
break;
}
}
DoMeleeAttackIfReady();
}
示例9: UpdateAI
void UpdateAI(uint32 diff)
{
// Call speach
if (timer)
{
timer += diff;
if (timer >= 4000)
{
Talk(SAY_TENEBRON_RESPOND);
me->SetCanFly(true);
me->SetSpeed(MOVE_FLIGHT, 3.0f);
me->GetMotionMaster()->MovePath(me->GetEntry()*10, false);
timer = 0;
}
}
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
{
case EVENT_MINIBOSS_SHADOW_BREATH:
if (!urand(0,10))
Talk(SAY_TENEBRON_BREATH);
me->CastSpell(me->GetVictim(), SPELL_SHADOW_BREATH, false);
events.RepeatEvent(17500);
break;
case EVENT_MINIBOSS_SHADOW_FISSURE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
me->CastSpell(target, SPELL_SHADOW_FISSURE, false);
events.RepeatEvent(22500);
break;
case EVENT_MINIBOSS_OPEN_PORTAL:
Talk(WHISPER_OPEN_PORTAL);
Talk(SAY_TENEBRON_SPECIAL);
if (!isSartharion)
{
if (GameObject* Portal = me->GetVictim()->SummonGameObject(GO_TWILIGHT_PORTAL, portalPos[BOSS_TENEBRON_EVENT].GetPositionX(), portalPos[BOSS_TENEBRON_EVENT].GetPositionY(), portalPos[BOSS_TENEBRON_EVENT].GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
portalGUID = Portal->GetGUID();
}
else if (pInstance)
pInstance->SetData(DATA_ADD_PORTAL, 0);
events.ScheduleEvent(EVENT_MINIBOSS_SPAWN_HELPERS, 2000);
events.RepeatEvent(60000);
break;
case EVENT_MINIBOSS_SPAWN_HELPERS:
{
Talk(WHISPER_HATCH_EGGS);
Creature* cr = NULL;
for (uint8 i = 0; i < 6; ++i)
{
if (cr = me->SummonCreature(NPC_TWILIGHT_EGG, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
{
summons.Summon(cr);
cr->SetPhaseMask(16, true);
}
if (cr = me->SummonCreature(NPC_TWILIGHT_WHELP, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
{
summons.Summon(cr);
cr->SetPhaseMask(16, true);
}
}
events.ScheduleEvent(EVENT_MINIBOSS_HATCH_EGGS, 25000);
events.PopEvent();
break;
}
case EVENT_MINIBOSS_HATCH_EGGS:
{
Creature* cr = NULL;
summons.RemoveNotExisting();
summons.DespawnEntry(NPC_TWILIGHT_WHELP);
for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
{
if (cr = ObjectAccessor::GetCreature(*me, *i))
{
if (!cr->IsAlive())
continue;
if (cr->GetEntry() == NPC_TWILIGHT_EGG)
if (cr = me->SummonCreature(NPC_TWILIGHT_WHELP, cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ(), cr->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))
summons2.Summon(cr);
}
}
if (!isSartharion)
{
// Remove phase shift
if (InstanceScript* instance = me->GetInstanceScript())
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_SHIFT);
RemoveTwilightPortal();
}
//.........这里部分代码省略.........
示例10: UpdateAI
//.........这里部分代码省略.........
me->CastSpell(me, SPELL_BERSERK, true);
events.PopEvent();
}
break;
case EVENT_RESPAWN_SPHERE:
{
uint8 StartAt = urand(0,5);
uint8 i = StartAt;
do
{
if( Creature* c = ObjectAccessor::GetCreature(*me, SphereGUID[i]) )
if( !c->HasAura(SPELL_FROST_SPHERE) )
{
if( Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i+5]) )
SphereGUID[i] = c->GetGUID();
break;
}
i = (i+1)%6;
}
while( i != StartAt );
events.RepeatEvent(4000);
}
break;
case EVENT_SPELL_FREEZING_SLASH:
{
if( me->GetVictim() )
me->CastSpell(me->GetVictim(), SPELL_FREEZING_SLASH, false);
events.RepeatEvent(urand(15000,20000));
}
break;
case EVENT_SPELL_PENETRATING_COLD:
{
me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2,5,2,5));
events.RepeatEvent(18000);
}
break;
case EVENT_SUMMON_NERUBIAN:
{
me->CastCustomSpell(SPELL_SUMMON_BURROWER, SPELLVALUE_MAX_TARGETS, RAID_MODE(1,2,2,4));
events.RepeatEvent(45000);
}
break;
case EVENT_SUBMERGE:
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
bool berserk = me->HasAura(SPELL_BERSERK);
me->RemoveAllAuras();
if (berserk)
me->CastSpell(me, SPELL_BERSERK, true);
Talk(EMOTE_SUBMERGE);
Talk(EMOTE_BURROWER);
me->CastSpell(me, SPELL_SUBMERGE, false);
events.CancelEvent(EVENT_SUMMON_NERUBIAN);
events.CancelEvent(EVENT_SPELL_FREEZING_SLASH);
events.CancelEvent(EVENT_SPELL_PENETRATING_COLD);
events.RescheduleEvent(EVENT_EMERGE, EMERGE_INTERVAL);
events.RescheduleEvent(EVENT_SPELL_SUMMON_SPIKE, 2500);
events.RescheduleEvent(EVENT_SUMMON_SCARAB, 3000);
events.PopEvent();
}
break;
case EVENT_SUMMON_SCARAB:
{
uint8 i = urand(0,3);
if( Creature* c = ObjectAccessor::GetCreature(*me, BurrowGUID[i]) )
me->CastSpell(c, SPELL_SUMMON_SCARAB, true);
events.RepeatEvent(4000);
}
break;
case EVENT_EMERGE:
{
me->CastSpell(me, SPELL_SPIKE_TELE, true);
summons.DespawnEntry(NPC_SPIKE);
events.CancelEvent(EVENT_SUMMON_SCARAB);
events.RescheduleEvent(EVENT_EMERGE_2, 2000);
events.PopEvent();
}
break;
case EVENT_EMERGE_2:
{
Talk(SAY_EMERGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setAttackTimer(BASE_ATTACK, 3000);
me->RemoveAura(SPELL_SUBMERGE);
me->CastSpell(me, SPELL_EMERGE, false);
events.RescheduleEvent(EVENT_SUMMON_NERUBIAN, urand(5000,8000));
events.RescheduleEvent(EVENT_SPELL_FREEZING_SLASH, urand(7000,15000));
events.RescheduleEvent(EVENT_SPELL_PENETRATING_COLD, urand(15000,20000));
events.RescheduleEvent(EVENT_SUBMERGE, SUBMERGE_INTERVAL);
events.PopEvent();
}
break;
case EVENT_SPELL_SUMMON_SPIKE:
me->CastSpell(me, SPELL_SUMMON_SPIKE, true);
events.PopEvent();
break;
}
DoMeleeAttackIfReady();
}
示例11: UpdateAI
//.........这里部分代码省略.........
events.ScheduleEvent(EVENT_WAVE_SPAWN, 1000);
}
break;
case EVENT_WAVE_SPAWN:
{
if (PhaseCount == 3)
{
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
LK->AI()->Talk(LK_TALK_2);
}
else if (PhaseCount == 6)
{
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
LK->AI()->Talk(LK_TALK_3);
}
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason3Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
if (urand(0, 1) == 0)
{
if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER, Mason1Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER, Mason2Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
}
else
{
if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN, Mason1Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN, Mason2Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
}
PhaseCount++;
if (PhaseCount < 8)
events.ScheduleEvent(EVENT_WAVE_SPAWN, urand(10000, 20000));
else
events.ScheduleEvent(EVENT_HALOF, urand(10000, 20000));
}
break;
case EVENT_HALOF:
{
if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100))
LK->AI()->Talk(LK_TALK_4);
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason1Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason2Pos[0]))
{
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER, DalforsPos[0]))
{
HalofSpawned = true;
guidHalof = tempsum->GetGUID();
tempsum->SetHomePosition(DalforsPos[2]);
tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
}
}
break;
case EVENT_ENDED:
{
Summons.DespawnAll();
me->DespawnOrUnsummon();
}
break;
}
if (PhaseCount == 8)
if (Creature* Halof = me->GetCreature(*me, guidHalof))
if (Halof->isDead())
{
DoCast(me, SPELL_CRUSADERS_SPIRE_VICTORY, true);
Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
Summons.DespawnEntry(NPC_HALOF_THE_DEATHBRINGER);
if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
events.ScheduleEvent(EVENT_ENDED, 10000);
}
}
示例12: UpdateAI
void UpdateAI(uint32 const diff)
{
if (!intro)
{
me->SummonCreature(NPC_SLIPPERY_FLOOR, SummonPositions[0]); // floor ambient
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
me->SetReactState(REACT_AGGRESSIVE);
intro = true;
}
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SWITCH_PHASE:
if (events.GetPhaseMask() & PHASE_MASK_ONE)
{
// Emote: Ahune retreats. His defenses diminish.
// me->MonsterTextEmote(EMOTE_SUBMERGE, 0, true); //Hack Fix by jacob
events.SetPhase(PHASE_TWO);
events.ScheduleEvent(EVENT_SWITCH_PHASE, 30000);
DoCast(me, SPELL_MAKE_BONFIRE);
me->AttackStop();
me->SetReactState(REACT_PASSIVE);
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
me->SummonCreature(NPC_FROZEN_CORE, SummonPositions[0], TEMPSUMMON_CORPSE_DESPAWN);
}
else
{
events.SetPhase(PHASE_ONE);
events.ScheduleEvent(EVENT_SWITCH_PHASE, 90000);
events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, 1000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 8000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SUMMON_FROSTWIND, 9000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_ICE_SPEAR, 9500, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_EARTHEN_RING_ATTACK, 10000, 0, PHASE_ONE);
me->SetReactState(REACT_AGGRESSIVE);
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
DoCastVictim(SPELL_RESURFACE);
summons.DespawnEntry(NPC_FROZEN_CORE);
}
break;
case EVENT_COLD_SLAP:
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 8.0f, true))
{
DoCast(target, SPELL_COLD_SLAP);
Position targetPos;
target->GetNearPosition(targetPos, float(rand_norm()) * 5.0f + 35.0f, me->GetAngle(target));
target->GetMotionMaster()->MoveJump(targetPos.GetPositionX(), targetPos.GetPositionY(), targetPos.GetPositionZ(), target->GetExactDist2d(targetPos.GetPositionX(), targetPos.GetPositionY()), 10.0f);
}
events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE);
break;
case EVENT_ICE_SPEAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 120.0f, true))
{
target->CastSpell(target, SPELL_ICESPEAR_SUMMON_BUNNY);
target->CastSpell(target, SPELL_ICESPEAR_SUMMON_GO);
events.ScheduleEvent(EVENT_ICE_SPEAR_KNOCKBACK, 2000);
}
events.ScheduleEvent(EVENT_ICE_SPEAR, 7000, 0, PHASE_ONE);
break;
case EVENT_ICE_SPEAR_KNOCKBACK:
if (GameObject* go = me->FindNearestGameObject(GO_ICE_SPEAR, 120.0f))
{
go->UseDoorOrButton();
Map::PlayerList const& playerList = me->GetMap()->GetPlayers();
if (!playerList.isEmpty())
for (Map::PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
if (i->getSource() && go->GetDistance(i->getSource()) <= 2.0f)
i->getSource()->CastSpell(i->getSource(), SPELL_ICESPEAR_KNOCKBACK);
go->Delete();
}
break;
case EVENT_SUMMON_HAILSTONE:
me->SummonCreature(NPC_AHUNITE_HAILSTONE, SummonPositions[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
break;
case EVENT_SUMMON_COLDWEAVE:
me->SummonCreature(NPC_AHUNITE_COLDWEAVE, SummonPositions[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
me->SummonCreature(NPC_AHUNITE_COLDWEAVE, SummonPositions[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 5000, 0, PHASE_ONE);
//.........这里部分代码省略.........
示例13: UpdateAI
void UpdateAI(uint32 diff)
{
if (!intro)
{
me->SummonCreature(NPC_SLIPPERY_FLOOR, SummonPositions[0]); // floor ambient
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
me->SetReactState(REACT_AGGRESSIVE);
intro = true;
}
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SWITCH_PHASE:
if (events.GetPhaseMask() & PHASE_ONE)
{
// Emote: Ahune retreats. His defenses diminish.
me->TextEmote(EMOTE_SUBMERGE, 0, true);
events.SetPhase(PHASE_TWO);
events.ScheduleEvent(EVENT_SWITCH_PHASE, 40000);
events.ScheduleEvent(EVENT_GHOST_VISUAL, 10000);
events.ScheduleEvent(EVENT_GHOST_VISUAL, 20000);
events.ScheduleEvent(EVENT_GHOST_VISUAL, 30000);
me->CastSpell(me, SPELL_MAKE_BONFIRE);
// Handle Submerge. This is essentially a copy of how Ragnaros submerges... :) minus the threatwipe
me->AttackStop();
me->SetReactState(REACT_PASSIVE);
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveAurasDueToSpell(SPELL_AHUNES_SHIELD);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
// spawn core
me->SummonCreature(NPC_FROZEN_CORE, SummonPositions[0], TEMPSUMMON_CORPSE_DESPAWN);
}
else
{
events.SetPhase(PHASE_ONE);
events.ScheduleEvent(EVENT_SWITCH_PHASE, 95000);
events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, 1000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, 8000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SUMMON_FROSTWIND, 9000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_ICE_SPEAR, 9500, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_EARTHEN_RING_ATTACK, 10000, 0, PHASE_ONE);
me->SetReactState(REACT_AGGRESSIVE);
me->RestoreFaction();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
me->AddAura(SPELL_AHUNES_SHIELD, me);
me->CastSpell(me, SPELL_RESURFACE, true);
// despawn core
summons.DespawnEntry(NPC_FROZEN_CORE);
}
break;
case EVENT_COLD_SLAP:
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 8.0f, true))
{
DoCast(target, SPELL_COLD_SLAP);
Position targetPos = target->GetNearPosition(float(rand_norm()) * 5.0f + 35.0f, me->GetAngle(target));
//target->GetNearPosition(targetPos, float(rand_norm()) * 5.0f + 35.0f, me->GetAngle(target));
target->GetMotionMaster()->MoveJump(targetPos.GetPositionX(), targetPos.GetPositionY(), targetPos.GetPositionZ(), target->GetExactDist2d(targetPos.GetPositionX(), targetPos.GetPositionY()), 10.0f);
}
events.ScheduleEvent(EVENT_COLD_SLAP, 500, 0, PHASE_ONE);
break;
case EVENT_ICE_SPEAR: // FIXME: should make use of all the proper spells...
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 120.0f, true))
{
target->CastSpell(target, SPELL_ICESPEAR_SUMMON_BUNNY);
target->CastSpell(target, SPELL_ICESPEAR_SUMMON_GO);
events.ScheduleEvent(EVENT_ICE_SPEAR_KNOCKBACK, 2000);
}
events.ScheduleEvent(EVENT_ICE_SPEAR, 7000, 0, PHASE_ONE);
break;
case EVENT_ICE_SPEAR_KNOCKBACK:
if (GameObject* go = me->FindNearestGameObject(GO_ICE_SPEAR, 200.0f))
{
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
go->UseDoorOrButton();
Map::PlayerList const& playerList = me->GetMap()->GetPlayers();
if (!playerList.isEmpty())
for (Map::PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
if (i->GetSource() && go->GetDistance(i->GetSource()) <= 2.0f)
i->GetSource()->CastSpell(i->GetSource(), SPELL_ICESPEAR_KNOCKBACK);
go->Delete();
//.........这里部分代码省略.........