void HandleAnimation() { Player* plr = Unit::GetPlayer(PlayerGUID); if (!plr) return; Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, me); Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100,me); Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, me); Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,me); if (!Fandral || !Arygos || !Caelestrasz || !Merithra) return; Unit* mob; AnimationTimer = EventAnim[AnimationCount].Timer; if (eventEnd == false) { switch(AnimationCount) { case 0: DoScriptText(ANACHRONOS_SAY_1, me , Fandral); break; case 1: Fandral->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); DoScriptText(FANDRAL_SAY_1, Fandral,me); break; case 2: Fandral->SetUInt64Value(UNIT_FIELD_TARGET,NULL); DoScriptText(MERITHRA_EMOTE_1,Merithra); break; case 3: DoScriptText(MERITHRA_SAY_1,Merithra); break; case 4: DoScriptText(ARYGOS_EMOTE_1,Arygos); break; case 5: Caelestrasz->SetUInt64Value(UNIT_FIELD_TARGET, Fandral->GetGUID()); DoScriptText(CAELESTRASZ_SAY_1, Caelestrasz); break; case 6: DoScriptText(MERITHRA_SAY_2, Merithra); break; case 7: Caelestrasz->SetUInt64Value(UNIT_FIELD_TARGET, NULL); Merithra->GetMotionMaster()->MoveCharge(-8065,1530,2.61,10); break; case 8: DoScriptText(MERITHRA_YELL_1,Merithra); break; case 9: Merithra->CastSpell(Merithra,25105,true); break; case 10: Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); Merithra->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); Merithra->GetMotionMaster()->MoveCharge(-8065,1530,6.61,3); break; case 11: Merithra->CastSpell(Merithra,24818,false); break; case 12: Merithra->GetMotionMaster()->MoveCharge(-8100,1530,50,42); break; case 13: break; case 14: DoScriptText(ARYGOS_SAY_1,Arygos); Merithra->SetVisibility(VISIBILITY_OFF); break; case 15: Arygos->GetMotionMaster()->MoveCharge(-8065,1530,2.61,10); Merithra->GetMotionMaster()->MoveCharge(-8034.535,1535.14,2.61,42); break; case 16: DoScriptText(ARYGOS_YELL_1, Arygos); break; case 17: Arygos->CastSpell(Arygos,25107,true); break; case 18: Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); Arygos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); Arygos->GetMotionMaster()->MoveCharge(-8065,1530,6.61,42); break; case 19: Arygos->CastSpell(Arygos,50505,false); break; case 20: Arygos->GetMotionMaster()->MoveCharge(-8095,1530,50,42); break; case 21: break; case 22: DoScriptText(CAELESTRASZ_SAY_2,Caelestrasz, Fandral); break; case 23: Caelestrasz->GetMotionMaster()->MoveCharge(-8065,1530,2.61,10); Arygos->SetVisibility(VISIBILITY_OFF); Arygos->GetMotionMaster()->MoveCharge(-8034.535,1535.14,2.61,10); break; case 24: DoScriptText(CAELESTRASZ_YELL_1, Caelestrasz); break; case 25: Caelestrasz->CastSpell(Caelestrasz,25106,true); break; case 26: Caelestrasz->HandleEmoteCommand(254); Caelestrasz->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); Caelestrasz->GetMotionMaster()->MoveCharge(-8065,1530,7.61,4); break; case 27: Caelestrasz->CastSpell(Caelestrasz,54293,false); break; case 28: DoScriptText(ANACHRONOS_SAY_2,me, Fandral); break; case 29: Caelestrasz->GetMotionMaster()->MoveCharge(-8095,1530,50,42); DoScriptText(FANDRAL_SAY_2, Fandral, me); break; case 30: break; case 31: DoScriptText(ANACHRONOS_SAY_3, me, Fandral); break; case 32: Caelestrasz->SetVisibility(VISIBILITY_OFF); Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535,1535.14,2.61,42); Fandral->GetMotionMaster()->MoveCharge(-8108,1529,2.77,8); me->GetMotionMaster()->MoveCharge(-8113,1525,2.77,8); break;//both run to the gate case 33: DoScriptText(ANACHRONOS_SAY_4, me); Caelestrasz->GetMotionMaster()->MoveCharge(-8050,1473,65,15); break; //Text: sands will stop case 34: DoCast(plr, 23017, true);//Arcane Channeling break; case 35: me->CastSpell(-8088,1520.43,2.67,25158,true); break; case 36: DoCast(plr, 25159, true); break; case 37: me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0); break; case 38: DoCast(plr, 25166, true); me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0); break; case 39: DoScriptText(ANACHRONOS_SAY_5, me, Fandral); break; case 40: Fandral->CastSpell(me, 25167, true); break; case 41: Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0); DoScriptText(FANDRAL_SAY_3, Fandral); break; case 42: me->CastStop(); DoScriptText(FANDRAL_EMOTE_1, Fandral); break; case 43: Fandral->CastStop(); break; case 44: DoScriptText(ANACHRONOS_SAY_6, me); break; case 45: DoScriptText(ANACHRONOS_SAY_7, me); break; case 46: DoScriptText(ANACHRONOS_SAY_8, me); me->GetMotionMaster()->MoveCharge(-8110,1527,2.77,4); break; case 47: DoScriptText(ANACHRONOS_EMOTE_1, me); break; case 48: DoScriptText(FANDRAL_SAY_4,Fandral,me); break; case 49: DoScriptText(FANDRAL_SAY_5,Fandral,me); break; case 50: DoScriptText(FANDRAL_EMOTE_2,Fandral); Fandral->CastSpell(-8127,1525,17.5,33806,true); break; case 51: { uint32 entries[4] = { 15423, 15424, 15414, 15422 }; for (uint8 i = 0; i < 4; ++i) { mob = plr->FindNearestCreature(entries[i],50,me); while (mob) { mob->RemoveFromWorld(); mob = plr->FindNearestCreature(15423,50,me); } } break; } case 52: Fandral->GetMotionMaster()->MoveCharge(-8028.75, 1538.795, 2.61,4); DoScriptText(ANACHRONOS_SAY_9, me,Fandral); break; case 53: DoScriptText(FANDRAL_SAY_6,Fandral); break; case 54: DoScriptText(ANACHRONOS_EMOTE_2,me); break; case 55: Fandral->SetVisibility(VISIBILITY_OFF); break; case 56: DoScriptText(ANACHRONOS_EMOTE_3, me); me->GetMotionMaster()->MoveCharge(-8116,1522,3.65,4); break; case 57: me->GetMotionMaster()->MoveCharge(-8116.7,1527,3.7,4); break; case 58: me->GetMotionMaster()->MoveCharge(-8112.67,1529.9,2.86,4); break; case 59: me->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4); break; case 60: if (plr) DoScriptText(ANACHRONOS_SAY_10, me,plr); me->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4); break; case 61: me->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6); if (plr->IsInRange(me,0,15)) plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,me); break; case 62: me->SetDisplayId(15500); break; case 63: me->HandleEmoteCommand(254); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); break; case 64: me->GetMotionMaster()->MoveCharge(-8000,1400,150,9); break; case 65: me->SetVisibility(VISIBILITY_OFF); if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID))) { DoScriptText(ARYGOS_YELL_1,me); AnachronosQuestTrigger->AI()->EnterEvadeMode(); eventEnd=true; } break; } } ++AnimationCount; }
void DoIntro() { if (!Madrigosa) return; switch (IntroPhase) { case 0: DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa); IntroPhaseTimer = 7000; ++IntroPhase; break; case 1: m_creature->SetInFront(Madrigosa); Madrigosa->SetInFront(m_creature); DoScriptText(YELL_MADR_INTRO, Madrigosa, m_creature); IntroPhaseTimer = 9000; ++IntroPhase; break; case 2: DoScriptText(YELL_INTRO, m_creature, Madrigosa); IntroPhaseTimer = 13000; ++IntroPhase; break; case 3: DoCast(m_creature, SPELL_INTRO_FROST_BLAST); Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); m_creature->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; IntroPhaseTimer = 28000; ++IntroPhase; break; case 4: DoScriptText(YELL_INTRO_BREAK_ICE, m_creature); IntroPhaseTimer = 6000; ++IntroPhase; break; case 5: Madrigosa->CastSpell(m_creature, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); DoScriptText(YELL_MADR_TRAP, Madrigosa); DoCast(m_creature, SPELL_INTRO_ENCAPSULATE); IntroPhaseTimer = 11000; ++IntroPhase; break; case 6: DoScriptText(YELL_INTRO_CHARGE, m_creature); IntroPhaseTimer = 5000; ++IntroPhase; break; case 7: m_creature->Kill(Madrigosa); DoScriptText(YELL_MADR_DEATH, Madrigosa); m_creature->SetHealth(m_creature->GetMaxHealth()); m_creature->AttackStop(); IntroPhaseTimer = 4000; ++IntroPhase; break; case 8: DoScriptText(YELL_INTRO_KILL_MADRIGOSA, m_creature); m_creature->SetOrientation(0.14f); m_creature->StopMoving(); Madrigosa->setDeathState(CORPSE); IntroPhaseTimer = 8000; ++IntroPhase; break; case 9: DoScriptText(YELL_INTRO_TAUNT, m_creature); IntroPhaseTimer = 5000; ++IntroPhase; break; case 10: EndIntro(); break; } }