Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum keristraszaData
- {
- QUEST_SPRINGING_TRAP = 11969,
- NPC_KERISTRASZA = 26237,
- NPC_SARAGOSA = 26299,
- NPC_MALYGOS = 26310,
- GO_SIGNAL_FIRE = 194151,
- SPELL_RAELORASZ_SPARK = 62272,
- SPELL_FIRE_CORPSE = 39199,
- SPELL_FIRE_BREATH = 31962,
- SPELL_MALYGOS_EARTHQ = 46853,
- SPELL_TAXI_KERISTASZA = 46814,
- SPELL_ICE_BLOCK = 56644,
- SPELL_FROSTBOLT = 61461,
- SAY_KERISTRASZA_1 = -1002030,
- YELL_KERISTRASZA_1 = -1002031,
- YELL_KERISTRASZA_2 = -1002032,
- YELL_KERISTRASZA_3 = -1002033,
- SAY_KERISTRASZA_2 = -1002034,
- //After Fligth
- YELL_MALYGOS_1 = -1002035,
- SAY_KERISTRASZA_3 = -1002036,
- YELL_MALYGOS_2 = -1002037,
- YELL_KERISTRASZA_4 = -1002038,
- };
- const Position posKeristrasza[6] =
- {
- {4157.00f, 7035.00f, 215.87f, 0.00f}, // Summon position
- {4063.72f, 7084.12f, 174.86f, 0.00f}, // Land position
- {4054.51f, 7084.29f, 168.12f, 0.00f}, // Burn Corpse positon
- {4048.90f, 7083.94f, 168.21f, 0.00f}, // Saragosa Corpse Spawn
- {3800.47f, 6557.50f, 170.98f, 1.55f}, // Keristrasza 2ş Spawn
- {3791.76f, 6603.61f, 179.91f, 0.00f}, // Malygos Spawn
- };
- class npc_signal_fire : public CreatureScript
- {
- public:
- npc_signal_fire() : CreatureScript("npc_signal_fire") { }
- struct npc_signal_fireAI : public ScriptedAI
- {
- npc_signal_fireAI(Creature* creature) : ScriptedAI(creature) { }
- EventMap events;
- Creature* pKeristrasza;
- Creature* pSaragosa;
- Player* player;
- bool eventRunning;
- void Reset()
- {
- // Reset al variables
- events.Reset();
- pKeristrasza, pSaragosa, player = NULL;
- eventRunning = false;
- // Unlit signal
- if(GameObject* pGo = me->FindNearestGameObject(GO_SIGNAL_FIRE, 2.0f))
- pGo->SetGoState(GO_STATE_READY);
- }
- void SpellHit(Unit* caster, SpellEntry const* spell)
- {
- if (eventRunning)
- return;
- // The invisible trigger handles the event until the Fly of Keristrasza
- if(spell->Id == SPELL_RAELORASZ_SPARK)
- {
- player = caster->ToPlayer();
- // Lit the fire signal
- if(GameObject* pGo = me->FindNearestGameObject(GO_SIGNAL_FIRE, 2.0f))
- pGo->SetGoState(GO_STATE_ACTIVE);
- // Summon Keristrasza
- if(Creature* pFind = me->SummonCreature(NPC_KERISTRASZA, posKeristrasza[0]))
- {
- pKeristrasza = pFind;
- pFind->SetFlying(true);
- pFind->GetMotionMaster()->MovePoint(1, posKeristrasza[1]);
- }
- eventRunning = true;
- events.ScheduleEvent(1, 6000);
- }
- }
- void UpdateAI(const uint32 diff)
- {
- events.Update(diff);
- switch(events.ExecuteEvent())
- {
- case 1:
- pKeristrasza->SetFlying(false);
- DoScriptText(SAY_KERISTRASZA_1, pKeristrasza, player);
- events.ScheduleEvent(2, 3000);
- break;
- case 2:
- DoScriptText(YELL_KERISTRASZA_1, pKeristrasza);
- pKeristrasza->GetMotionMaster()->MovePoint(1, posKeristrasza[2]);
- events.ScheduleEvent(3, 5000);
- break;
- case 3:
- DoScriptText(YELL_KERISTRASZA_2, pKeristrasza);
- // Summon Saragosa and make her die
- if(Creature* pCorpse = me->SummonCreature(NPC_SARAGOSA, posKeristrasza[3]))
- pSaragosa = pCorpse;
- events.ScheduleEvent(4, 3000);
- break;
- case 4:
- DoScriptText(YELL_KERISTRASZA_3, pKeristrasza);
- pKeristrasza->CastSpell(pSaragosa, SPELL_FIRE_BREATH, true);
- events.ScheduleEvent(5, 1000);
- break;
- case 5:
- me->AddAura(SPELL_FIRE_CORPSE, pSaragosa);
- events.ScheduleEvent(6, 1000);
- break;
- case 6:
- player->CastSpell(player, SPELL_MALYGOS_EARTHQ, true);
- events.ScheduleEvent(7, 3000);
- break;
- case 7:
- DoScriptText(SAY_KERISTRASZA_2, pKeristrasza, player);
- events.ScheduleEvent(8, 3000);
- break;
- case 8:
- // Passes the control to Keristrasza
- player->CastSpell(player, SPELL_TAXI_KERISTASZA, true);
- pKeristrasza->AI()->SetGUID(player->GetGUID());
- pSaragosa->DespawnOrUnsummon(10000);
- events.ScheduleEvent(9, 20000);
- break;
- case 9:
- Reset();
- break;
- }
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_signal_fireAI(creature);
- }
- };
- class npc_keristrasza_coldarra : public CreatureScript
- {
- public:
- npc_keristrasza_coldarra() : CreatureScript("npc_keristrasza_coldarra") { }
- struct npc_keristrasza_coldarraAI : public ScriptedAI
- {
- npc_keristrasza_coldarraAI(Creature* creature) : ScriptedAI(creature) { }
- EventMap events;
- uint64 uiPlayer;
- bool waiting;
- bool finishedWay;
- Creature* pMalygos;
- void SetGUID(const uint64 &guid, int32 /*iId*/)
- {
- me->NearTeleportTo(posKeristrasza[4].GetPositionX(), posKeristrasza[4].GetPositionY(), posKeristrasza[4].GetPositionZ(), posKeristrasza[4].GetOrientation());
- me->SetVisible(false);
- uiPlayer = guid;
- waiting = true;
- }
- void Reset()
- {
- events.Reset();
- me->SetSpeed(MOVE_FLIGHT, 3.2f, true);
- pMalygos = NULL;
- uiPlayer = 0;
- waiting = false;
- finishedWay = false;
- me->SetReactState(REACT_PASSIVE);
- }
- void UpdateAI(const uint32 diff)
- {
- if(!waiting)
- return;
- if(!finishedWay)
- {
- if(Player* player = me->GetPlayer(*me, uiPlayer))
- {
- if (!player->isInFlight())
- {
- if(me->IsWithinDist(player, 10.0f))
- {
- finishedWay = true;
- me->SetVisible(true);
- player->ToPlayer()->KilledMonsterCredit(NPC_KERISTRASZA, 0);
- events.ScheduleEvent(1, 0);
- }else
- me->DespawnOrUnsummon(0);
- }
- else
- return;
- }
- }
- events.Update(diff);
- switch(events.ExecuteEvent())
- {
- case 1:
- me->SetFlying(false);
- if(Player* player = me->GetPlayer(*me, uiPlayer))
- DoScriptText(SAY_KERISTRASZA_3, me, player);
- events.ScheduleEvent(2, 5000);
- break;
- case 2:
- if(Creature* pSumm = me->SummonCreature(NPC_MALYGOS, posKeristrasza[5]))
- {
- pMalygos = pSumm;
- pSumm->SetFlying(true);
- pSumm->SetReactState(REACT_PASSIVE);
- pSumm->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
- pSumm->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.4f);
- DoScriptText(YELL_MALYGOS_2, pMalygos);
- pMalygos->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
- me->SetUInt64Value(UNIT_FIELD_TARGET, pMalygos->GetGUID());
- }
- events.ScheduleEvent(3, 6000);
- break;
- case 3:
- DoScriptText(YELL_KERISTRASZA_4, me);
- me->AddAura(SPELL_ICE_BLOCK, me);
- if(pMalygos)
- pMalygos->DespawnOrUnsummon(7000);
- me->DespawnOrUnsummon(7000);
- break;
- }
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_keristrasza_coldarraAI(creature);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement