diff options
author | maximius <none@none> | 2009-09-19 15:14:05 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-19 15:14:05 -0700 |
commit | 599d0fa65b2f28e99c3a5f6eca2e3b67f0f2e900 (patch) | |
tree | 84d9933790ac713526c66960f34d7bb5b0c18049 /src | |
parent | d3ba9eea44d10c3e17e679e18e44021c955378e6 (diff) |
*quest: "Long Forgotten Memories"
*quest: "A Pawn on the Eternal Board"
*World Event: AQ-War Effort
*quest: "Eranikus, Tyrant of the Dream"
*Sunken temple -> "Snake Puzzle event"
*duskwood boss "Twilight Corrupter" for quest: "The Nightmare's Corruption"
*All by kb_z, please tell me if I missed anything, and somebody please review the SQL.. a LOT Of stuff in this needs to go to TDB!
--HG--
branch : trunk
Diffstat (limited to 'src')
6 files changed, 1340 insertions, 3 deletions
diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/duskwood.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/duskwood.cpp new file mode 100644 index 00000000000..90b06863ea9 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/duskwood.cpp @@ -0,0 +1,122 @@ +/* Copyright (C) 2006 - 2009 kb_z + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Duskwood +SD%Complete: 100 +SDComment: Quest Support:8735 +SDCategory: Duskwood +EndScriptData */ + +#include "precompiled.h" + +/*###### +# at_twilight_grove +######*/ + +bool AreaTrigger_at_twilight_grove(Player* pPlayer, AreaTriggerEntry *at) +{ + if (pPlayer->HasQuestForItem(21149)) + { + Unit* TCorrupter = pPlayer->SummonCreature(15625,-10328.16,-489.57,49.95,0,TEMPSUMMON_MANUAL_DESPAWN,60000); + TCorrupter->setFaction(14); + TCorrupter->SetMaxHealth(832750); + Unit* CorrupterSpeaker = pPlayer->SummonCreature(1,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()-1,0,TEMPSUMMON_TIMED_DESPAWN,15000); + CorrupterSpeaker->SetName("Twilight Corrupter"); + CorrupterSpeaker->SetVisibility(VISIBILITY_ON); + CorrupterSpeaker->MonsterYell("Come, $N. See what the Nightmare brings...",0,pPlayer->GetGUID()); + } +return false; +}; + +/*###### +# boss_twilight_corrupter +######*/ + +#define SPELL_SOUL_CORRUPTION 25805 +#define SPELL_CREATURE_OF_NIGHTMARE 25806 +#define SPELL_LEVEL_UP 24312 + +struct TRINITY_DLL_DECL boss_twilight_corrupterAI : public ScriptedAI +{ + boss_twilight_corrupterAI(Creature *c) : ScriptedAI(c) {} + + uint32 SoulCorruption_Timer; + uint32 CreatureOfNightmare_Timer; + uint8 KillCount; + + void Reset() + { + SoulCorruption_Timer = 15000; + CreatureOfNightmare_Timer = 30000; + KillCount = 0; + } + void EnterCombat(Unit* who) + { + m_creature->MonsterYell("The Nightmare cannot be stopped!",0,m_creature->GetGUID()); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + ++KillCount; + m_creature->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true); + + if (KillCount == 3) + { + DoCast(m_creature, SPELL_LEVEL_UP, true); + KillCount = 0; + } + } + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + if(SoulCorruption_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SOUL_CORRUPTION); + SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers + } else SoulCorruption_Timer-=diff; + if(CreatureOfNightmare_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SOUL_CORRUPTION); + CreatureOfNightmare_Timer = 45000; //gotta confirm Timers + } else CreatureOfNightmare_Timer-=diff; + DoMeleeAttackIfReady(); + }; +}; +CreatureAI* GetAI_boss_twilight_corrupter(Creature* pCreature) +{ + return new boss_twilight_corrupterAI (pCreature); +} + +void AddSC_duskwood() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_twilight_corrupter"; + newscript->GetAI = &GetAI_boss_twilight_corrupter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="at_twilight_grove"; + newscript->pAreaTrigger = &AreaTrigger_at_twilight_grove; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/def_sunken_temple.h b/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/def_sunken_temple.h new file mode 100644 index 00000000000..82245095c31 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/def_sunken_temple.h @@ -0,0 +1,22 @@ +/* Copyright (C) 2006 - 2009 kb_z + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SUNKEN_TEMPLE_H +#define DEF_SUNKEN_TEMPLE_H + +#define TROLLBOSS1_DEATH 1 +#define TROLLBOSS2_DEATH 2 +#define TROLLBOSS3_DEATH 3 +#define TROLLBOSS4_DEATH 4 +#define TROLLBOSS5_DEATH 5 +#define TROLLBOSS6_DEATH 6 +#define JAMMALAN_DEATH 7 +#define MORPHAZ_DEATH 8 +#define HAZZAS_DEATH 9 +#define ERANIKUS_DEATH 10 +#define ATALALARION_DEATH 11 //optional + +#define EVENT_STATE 1 +#endif + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp new file mode 100644 index 00000000000..42ec8d5d784 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp @@ -0,0 +1,229 @@ +/* Copyright (C) 2006 - 2009 kb_z + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Sunken_Temple +SD%Complete: 100 +SDComment:Place Holder +SDCategory: Sunken Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_sunken_temple.h" + +#define GO_ATALAI_STATUE1 148830 +#define GO_ATALAI_STATUE2 148831 +#define GO_ATALAI_STATUE3 148832 +#define GO_ATALAI_STATUE4 148833 +#define GO_ATALAI_STATUE5 148834 +#define GO_ATALAI_STATUE6 148835 +#define GO_ATALAI_IDOL 148836 + +#define GO_ATALAI_LIGHT1 148883 +#define GO_ATALAI_LIGHT2 148937 + +#define NPC_MALFURION_STORMRAGE 15362 + +struct TRINITY_DLL_DECL instance_sunken_temple : public ScriptedInstance +{ + instance_sunken_temple(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + }; + + GameObject* AtalaiStatue1; + GameObject* AtalaiStatue2; + GameObject* AtalaiStatue3; + GameObject* AtalaiStatue4; + GameObject* AtalaiStatue5; + GameObject* AtalaiStatue6; + GameObject* AtalaiIdol; + + uint64 GOAtalaiStatue1; + uint64 GOAtalaiStatue2; + uint64 GOAtalaiStatue3; + uint64 GOAtalaiStatue4; + uint64 GOAtalaiStatue5; + uint64 GOAtalaiStatue6; + uint64 GOAtalaiIdol; + uint32 State; + + bool s1; + bool s2; + bool s3; + bool s4; + bool s5; + bool s6; + + void Initialize() + { + GOAtalaiStatue1 = 0; + GOAtalaiStatue2 = 0; + GOAtalaiStatue3 = 0; + GOAtalaiStatue4 = 0; + GOAtalaiStatue5 = 0; + GOAtalaiStatue6 = 0; + GOAtalaiIdol = 0; + State = 0; + AtalaiStatue1 = NULL; + AtalaiStatue2 = NULL; + AtalaiStatue3 = NULL; + AtalaiStatue4 = NULL; + AtalaiStatue5 = NULL; + AtalaiStatue6 = NULL; + AtalaiIdol = NULL; + s1 = false; + s2 = false; + s3 = false; + s4 = false; + s5 = false; + s6 = false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case GO_ATALAI_STATUE1: + AtalaiStatue1 = pGo; + GOAtalaiStatue1 = pGo->GetGUID(); + break; + case GO_ATALAI_STATUE2: + AtalaiStatue2 = pGo; + GOAtalaiStatue2 = pGo->GetGUID(); + break; + case GO_ATALAI_STATUE3: + AtalaiStatue3 = pGo; + GOAtalaiStatue3 = pGo->GetGUID(); + break; + case GO_ATALAI_STATUE4: + AtalaiStatue4 = pGo; + GOAtalaiStatue4 = pGo->GetGUID(); + break; + case GO_ATALAI_STATUE5: + AtalaiStatue5 = pGo; + GOAtalaiStatue5 = pGo->GetGUID(); + break; + case GO_ATALAI_STATUE6: + AtalaiStatue6 = pGo; + GOAtalaiStatue6 = pGo->GetGUID(); + break; + case GO_ATALAI_IDOL: + AtalaiIdol = pGo; + GOAtalaiIdol = pGo->GetGUID(); + break; + } + }; + + + virtual void Update(uint32 diff) // correct order goes form 1-6 + { + switch(State) + { + case GO_ATALAI_STATUE1: + if(!s1 && !s2 && !s3 && !s4 && !s5 && !s6) + { + UseStatue(AtalaiStatue1); + s1 = true; + State = 0; + }; + break; + case GO_ATALAI_STATUE2: + if(s1 && !s2 && !s3 && !s4 && !s5 && !s6) + { + UseStatue(AtalaiStatue2); + s2 = true; + State = 0; + }; + break; + case GO_ATALAI_STATUE3: + if(s1 && s2 && !s3 && !s4 && !s5 && !s6) + { + UseStatue(AtalaiStatue3); + s3 = true; + State = 0; + }; + break; + case GO_ATALAI_STATUE4: + if(s1 && s2 && s3 && !s4 && !s5 && !s6) + { + UseStatue(AtalaiStatue4); + s4 = true; + State = 0; + } + break; + case GO_ATALAI_STATUE5: + if(s1 && s2 && s3 && s4 && !s5 && !s6) + { + UseStatue(AtalaiStatue5); + s5 = true; + State = 0; + } + break; + case GO_ATALAI_STATUE6: + if(s1 && s2 && s3 && s4 && s5 && !s6) + { + UseLastStatue(AtalaiStatue6); + s6 = true; + State = 0; + } + break; + } + }; + + void UseStatue(GameObject* pGo) + { + pGo->SummonGameObject(GO_ATALAI_LIGHT1,pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ(),0,0,0,0,0,0); + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 4); + } + void UseLastStatue(GameObject* pGo) + { + AtalaiStatue1->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue1->GetPositionX(),AtalaiStatue1->GetPositionY(),AtalaiStatue1->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue2->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue2->GetPositionX(),AtalaiStatue2->GetPositionY(),AtalaiStatue2->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue3->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue3->GetPositionX(),AtalaiStatue3->GetPositionY(),AtalaiStatue3->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue4->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue4->GetPositionX(),AtalaiStatue4->GetPositionY(),AtalaiStatue4->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue5->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue5->GetPositionX(),AtalaiStatue5->GetPositionY(),AtalaiStatue5->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue6->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue6->GetPositionX(),AtalaiStatue6->GetPositionY(),AtalaiStatue6->GetPositionZ(),0,0,0,0,0,100000); + pGo->SummonGameObject(148838,-488.997,96.61,-189.019,-1.52,0,0,0,0,100000); + } + + void SetData(uint32 type, uint32 data) + { + if (type == EVENT_STATE) + State = data; + } + + uint32 GetData(uint32 type) + { + if (type == EVENT_STATE) + return State; + return 0; + } +}; + +InstanceData* GetInstanceData_instance_sunken_temple(Map* pMap) +{ + return new instance_sunken_temple(pMap); +} + +void AddSC_instance_sunken_temple() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sunken_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_sunken_temple; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp new file mode 100644 index 00000000000..a757c7ac4f2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp @@ -0,0 +1,71 @@ +/* Copyright (C) 2006 - 2009 kb_z + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Sunken_Temple +SD%Complete: 100 +SDComment: Area Trigger + Puzzle event support +SDCategory: Sunken Temple +EndScriptData */ + +/* ContentData +at_malfurion_Stormrage_trigger +EndContentData */ + +#include "precompiled.h" +#include "def_sunken_temple.h" + +/*##### +# at_malfurion_Stormrage_trigger +#####*/ + +bool AreaTrigger_at_malfurion_stormrage(Player* pPlayer, AreaTriggerEntry *at) +{ + if (ScriptedInstance* pInstance = pPlayer->GetInstanceData()) + { + if (!pPlayer->FindNearestCreature(15362,15)) + Unit* Malfurion = pPlayer->SummonCreature(15362, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), -1. 52, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 100000); + return false; + } +return false; +} +/*##### +# go_atalai_statue +#####*/ + +bool GOHello_go_atalai_statue(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pPlayer->GetInstanceData(); + if (!pInstance) + return false; + pInstance->SetData(EVENT_STATE,pGo->GetEntry()); + return false; +} + +void AddSC_sunken_temple() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "at_malfurion_stormrage"; + newscript->pAreaTrigger = &AreaTrigger_at_malfurion_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_atalai_statue"; + newscript->pGOHello = &GOHello_go_atalai_statue; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/silithus.cpp b/src/bindings/scripts/scripts/kalimdor/silithus.cpp index fce271a351d..5d9e4f79ae1 100644 --- a/src/bindings/scripts/scripts/kalimdor/silithus.cpp +++ b/src/bindings/scripts/scripts/kalimdor/silithus.cpp @@ -17,13 +17,14 @@ /* ScriptData SDName: Silithus SD%Complete: 100 -SDComment: Quest support: 7785, 8304. +SDComment: Quest support: 7785, 8304, 8507. SDCategory: Silithus EndScriptData */ /* ContentData npc_highlord_demitrian npcs_rutgar_and_frankal +quest_a_pawn_on_the_eternal_pawn EndContentData */ #include "precompiled.h" @@ -200,13 +201,904 @@ bool GossipSelect_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature, return true; } -/*### -## +/*#### +# quest_a_pawn_on_the_eternal_board (Defines) ####*/ +enum +{ + QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, + + FACTION_HOSTILE = 14, + FACTION_FRIENDLY = 35, + + C_ANACHRONOS = 15381, + C_FANDRAL_STAGHELM = 15382, + C_ARYGOS = 15380, + C_MERITHRA = 15378, + C_CAELESTRASZ = 15379, + + ANACHRONOS_SAY_1 = -1350000, + ANACHRONOS_SAY_2 = -1350001, + ANACHRONOS_SAY_3 = -1350002, + ANACHRONOS_SAY_4 = -1350003, + ANACHRONOS_SAY_5 = -1350004, + ANACHRONOS_SAY_6 = -1350005, + ANACHRONOS_SAY_7 = -1350006, + ANACHRONOS_SAY_8 = -1350007, + ANACHRONOS_SAY_9 = -1350008, + ANACHRONOS_SAY_10 = -1350009, + ANACHRONOS_EMOTE_1 = -1350010, + ANACHRONOS_EMOTE_2 = -1350011, + ANACHRONOS_EMOTE_3 = -1350012, + + FANDRAL_SAY_1 = -1350013, + FANDRAL_SAY_2 = -1350014, + FANDRAL_SAY_3 = -1350015, + FANDRAL_SAY_4 = -1350016, + FANDRAL_SAY_5 = -1350017, + FANDRAL_SAY_6 = -1350018, + FANDRAL_EMOTE_1 = -1350019, + FANDRAL_EMOTE_2 = -1350020, + + CAELESTRASZ_SAY_1 = -1350021, + CAELESTRASZ_SAY_2 = -1350022, + CAELESTRASZ_YELL_1 = -1350023, + + ARYGOS_SAY_1 = -1350024, + ARYGOS_YELL_1 = -1350025, + ARYGOS_EMOTE_1 = -1350026, + + MERITHRA_SAY_1 = -1350027, + MERITHRA_SAY_2 = -1350028, + MERITHRA_YELL_1 = -1350029, + MERITHRA_EMOTE_1 = -1350030, + + GO_GATE_OF_AHN_QIRAJ = 176146, + GO_GLYPH_OF_AHN_QIRAJ = 176148, + GO_ROOTS_OF_AHN_QIRAJ = 176147 +}; +/*##### +# Quest: A Pawn on the Eternal Board +#####*/ + +/* ContentData +A Pawn on the Eternal Board - creatures, gameobjects and defines +mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle. +npc_anachronos_the_ancient : Creature that controls the event. +npc_anachronos_quest_trigger: controls the spawning of the BG War mobs. +go_crystalline_tear : GameObject that begins the event and hands out quest +TO DO: get correct spell IDs and timings for spells cast upon dragon transformations +TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation,but for some unknown reason it doesnt work. +EndContentData */ + +#define QUEST_A_PAWN_ON_THE_ETERNAL_BOARD 8519 +#define EVENT_AREA_RADIUS 65 //65yds +#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) + +struct QuestCinematic +{ + int32 TextId; + uint32 Creature, Timer; +}; + +// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz +static QuestCinematic EventAnim[]= +{ + {ANACHRONOS_SAY_1, 0, 2000}, + {FANDRAL_SAY_1, 1, 4000}, + {MERITHRA_EMOTE_1, 3, 500}, + {MERITHRA_SAY_1, 3, 500}, + {ARYGOS_EMOTE_1, 2, 2000}, + {CAELESTRASZ_SAY_1, 4, 8000}, + {MERITHRA_SAY_2, 3, 6000}, + {NULL,3,2000}, + {MERITHRA_YELL_1, 3, 2500}, + {NULL, 3, 3000},//Morph + {NULL,3,4000},//EmoteLiftoff + {NULL, 3, 4000},// spell + {NULL, 3, 1250},//fly + {NULL, 3, 250},//remove flags + {ARYGOS_SAY_1, 2, 3000}, + {NULL,3,2000}, + {ARYGOS_YELL_1, 2, 3000}, + {NULL, 3, 3000},//Morph + {NULL,3,4000},//EmoteLiftoff + {NULL, 3, 4000},// spell + {NULL, 3, 1000},//fly + {NULL, 3, 1000},//remove flags + {CAELESTRASZ_SAY_2, 4, 5000}, + {NULL,3,3000}, + {CAELESTRASZ_YELL_1, 4, 3000}, + {NULL, 3, 3000},//Morph + {NULL,3,4000},//EmoteLiftoff + {NULL, 3, 2500},// spell + {ANACHRONOS_SAY_2, 0, 2000}, + {NULL, 3, 250},//fly + {NULL, 3, 25},//remove flags + {FANDRAL_SAY_2, 1, 3000}, + {ANACHRONOS_SAY_3, 0, 10000},//Both run through the armies + {NULL,3,2000},// Sands will stop + {NULL,3,8000},// Summon Gate + {ANACHRONOS_SAY_4, 0, 4000}, + {NULL, 0, 2000},//spell 1-> Arcane cosmetic (Mobs freeze) + {NULL, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs) + {NULL, 0, 7000},//BarrieR + {NULL, 0, 4000},//Glyphs + {ANACHRONOS_SAY_5, 0, 2000}, + {NULL, 0, 4000},// Roots + {FANDRAL_SAY_3, 1, 3000},//Root Text + {FANDRAL_EMOTE_1, 1, 3000},//falls knee + {ANACHRONOS_SAY_6, 0, 3000}, + {ANACHRONOS_SAY_7, 0, 3000}, + {ANACHRONOS_SAY_8, 0, 8000}, + {ANACHRONOS_EMOTE_1, 0, 1000},//Give Scepter + {FANDRAL_SAY_4, 1, 3000}, + {FANDRAL_SAY_5, 1, 3000},//->Equip hammer~Scepter, throw it at door + {FANDRAL_EMOTE_2, 1, 3000},//Throw hammer at door. + {ANACHRONOS_SAY_9, 0, 3000}, + {FANDRAL_SAY_6, 1, 3000}, //fandral goes away + {ANACHRONOS_EMOTE_2, 0, 3000}, + {ANACHRONOS_EMOTE_3, 0, 3000}, + {NULL, 0, 2000}, + {NULL, 0, 2000}, + {NULL, 0, 4000}, + {ANACHRONOS_SAY_10, 0, 3000}, + {NULL, 0, 2000}, + {NULL, 0, 3000}, + {NULL, 0, 15000}, + {NULL, 0, 5000}, + {NULL, 0, 3500}, + {NULL, 0, 5000}, + {NULL, 0, 3500}, + {NULL, 0, 5000}, + {NULL, 0, NULL} +}; + +struct Location +{ + float x, y, z, o; +}; + +//Cordinates for Spawns +static Location SpawnLocation[]= +{ + {-8085, 1528, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1526, 2.61, 3.141592},//Kaldorei Infantry + {-8085, 1524, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1522, 2.61, 3.141592},//Kaldorei Infantry + {-8085, 1520, 2.61, 3.141592},//Kaldorei Infantry + + {-8085, 1524, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1522, 2.61, 3.141592},//Kaldorei Infantry + {-8085, 1520, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1518, 2.61, 3.141592},//Kaldorei Infantry + {-8085, 1516, 2.61, 3.141592},//Kaldorei Infantry + + {-8085, 1518, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1516, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1520, 2.61, 3.141592},//Kaldorei Infantry + {-8080, 1424, 2.61, 3.141592},//Kaldorei Infantry + {-8085, 1422, 2.61, 3.141592},//Kaldorei Infantry + // 2 waves of warriors + {-8082, 1528, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1525, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1524, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1526, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1527, 2.61, 3.141592},//Kaldorei Infantry + + {-8082, 1524, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1522, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1520, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1518, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1516, 2.61, 3.141592},//Kaldorei Infantry + + {-8082, 1523, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1521, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1528, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1519, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1526, 2.61, 3.141592},//Kaldorei Infantry + + {-8082, 1524, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1522, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1520, 2.61, 3.141592},//Kaldorei Infantry + {-8078, 1518, 2.61, 3.141592},//Kaldorei Infantry + {-8082, 1516, 2.61, 3.141592},//Kaldorei Infantry + + {-8088, 1510, 2.61, 0},//Anubisath Conqueror + {-8084, 1520, 2.61, 0},//Anubisath Conqueror + {-8088, 1530, 2.61, 0},//Anubisath Conqueror + + {-8080, 1513, 2.61, 0},//Qiraj Wasp + {-8082, 1523, 2.61, 0},//Qiraj Wasp + {-8085, 1518, 2.61, 0},//Qiraj Wasp + {-8082, 1516, 2.61, 0},//Qiraj Wasp + {-8085, 1520, 2.61, 0},//Qiraj Wasp + {-8080, 1528, 2.61, 0},//Qiraj Wasp + + {-8082, 1513, 2.61, 0},//Qiraj Wasp + {-8079, 1523, 2.61, 0},//Qiraj Wasp + {-8080, 1531, 2.61, 0},//Qiraj Wasp + {-8079, 1516, 2.61, 0},//Qiraj Wasp + {-8082, 1520, 2.61, 0},//Qiraj Wasp + {-8080, 1518, 2.61, 0},//Qiraj Wasp + + {-8081, 1514, 2.61, 0},//Qiraj Tank + {-8081, 1520, 2.61, 0},//Qiraj Tank + {-8081, 1526, 2.61, 0},//Qiraj Tank + {-8081, 1512, 2.61, 0},//Qiraj Tank + {-8082, 1520, 2.61, 0},//Qiraj Tank + {-8081, 1528, 2.61, 0},//Qiraj Tank + + {-8082, 1513, 2.61, 3.141592},//Anubisath Conqueror + {-8082, 1520, 2.61, 3.141592},//Anubisath Conqueror + {-8082, 1527, 2.61, 3.141592},//Anubisath Conqueror +}; + +struct WaveData +{ + uint8 SpawnCount, UsedSpawnPoint; + uint32 CreatureId, SpawnTimer, YellTimer, DespTimer; + int32 WaveTextId; +}; + +static WaveData WavesInfo[] = +{ + {30, 0, 15423, 0, 0,24000, NULL}, //Kaldorei Soldier + {3, 35, 15424, 0, 0,24000, NULL}, //Anubisath Conqueror + {12, 38, 15414, 0, 0,24000, NULL}, //Qiraji Wasps + {6, 50, 15422, 0, 0,24000, NULL}, //Qiraji Tanks + {15, 15, 15423, 0, 0,24000, NULL} //Kaldorei Soldier + +}; + +struct SpawnSpells +{ + uint32 Timer1, Timer2, SpellId; +}; + +static SpawnSpells SpawnCast[]=// +{ + {100000, 2000, 33652}, // Stop Time + {38500, 300000, 28528}, // Poison Cloud + {58000, 300000, 35871}, // Frost Debuff (need correct spell) + {80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool) +}; +/*##### +# npc_anachronos_the_ancient +######*/ +struct TRINITY_DLL_DECL npc_anachronos_the_ancientAI : public ScriptedAI +{ + npc_anachronos_the_ancientAI(Creature* c) : ScriptedAI(c) {} + + uint32 AnimationTimer; + uint8 AnimationCount; + + uint64 AnachronosQuestTriggerGUID; + uint64 MerithraGUID; + uint64 ArygosGUID; + uint64 CaelestraszGUID; + uint64 FandralGUID; + uint64 PlayerGUID; + bool eventEnd; + + void Reset() + { + AnimationTimer = 1500; + AnimationCount = 0; + AnachronosQuestTriggerGUID = 0; + MerithraGUID = 0; + ArygosGUID = 0; + CaelestraszGUID = 0; + FandralGUID = 0; + PlayerGUID = 0; + eventEnd = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void HandleAnimation() + { + Player* plr = Unit::GetPlayer(PlayerGUID); + Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, m_creature); + Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100,m_creature); + Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, m_creature); + Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,m_creature); + Unit* mob; + AnimationTimer = EventAnim[AnimationCount].Timer; + if (eventEnd == false) + { + switch(AnimationCount) + { + case 0: + DoScriptText(ANACHRONOS_SAY_1, m_creature , Fandral); + break; + case 1: + Fandral->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + DoScriptText(FANDRAL_SAY_1, Fandral,m_creature); + 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(-8150,1530,50,7); + break; + case 13: + break; + case 14: + DoScriptText(ARYGOS_SAY_1,Arygos); + break; + case 15: + Arygos->GetMotionMaster()->MoveCharge(-8065,1530,2.61,10); + Merithra->SetVisibility(VISIBILITY_OFF); + 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,3); + break; + case 19: + Arygos->CastSpell(Arygos,50505,false); + break; + case 20: + Arygos->GetMotionMaster()->MoveCharge(-8150,1530,50,7); + 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); + 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,3); + break; + case 27: + Caelestrasz->CastSpell(Caelestrasz,54293,false); + break; + case 28: + DoScriptText(ANACHRONOS_SAY_2,m_creature, Fandral); + break; + case 29: + Caelestrasz->GetMotionMaster()->MoveCharge(-8150,1530,50,7); + DoScriptText(FANDRAL_SAY_2, Fandral, m_creature); + break; + case 30: + break; + case 31: + DoScriptText(ANACHRONOS_SAY_3, m_creature, Fandral); + break; + case 32: + Caelestrasz->SetVisibility(VISIBILITY_OFF); + Fandral->GetMotionMaster()->MoveCharge(-8108,1529,2.77,8); + m_creature->GetMotionMaster()->MoveCharge(-8113,1525,2.77,8); + break;//both run to the gate + case 33: + DoScriptText(ANACHRONOS_SAY_4, m_creature); + Caelestrasz->GetMotionMaster()->MoveCharge(-8165,1530,65,7); + break; //Text: sands will stop + case 34: + m_creature->CastSpell(plr, 23017, true);//Arcane Channeling + break; + case 35: + m_creature->CastSpell(-8088,1520.43,2.67,25158,true); + break; + case 36: + m_creature->CastSpell(plr, 25159, true); + break; + case 37: + m_creature->SummonGameObject(GO_GATE_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0); + break; + case 38: + m_creature->CastSpell(plr, 25166, true); + m_creature->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0); + break; + case 39: + DoScriptText(ANACHRONOS_SAY_5, m_creature, Fandral); + break; + case 40: + Fandral->CastSpell(m_creature, 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: + m_creature->CastStop(); + DoScriptText(FANDRAL_EMOTE_1, Fandral); + break; + case 43: + Fandral->CastStop(); + break; + case 44: + DoScriptText(ANACHRONOS_SAY_6, m_creature); + break; + case 45: + DoScriptText(ANACHRONOS_SAY_7, m_creature); + break; + case 46: + DoScriptText(ANACHRONOS_SAY_8, m_creature); + m_creature->GetMotionMaster()->MoveCharge(-8110,1527,2.77,4); + break; + case 47: + DoScriptText(ANACHRONOS_EMOTE_1, m_creature); + break; + case 48: + DoScriptText(FANDRAL_SAY_4,Fandral,m_creature); + break; + case 49: + DoScriptText(FANDRAL_SAY_5,Fandral,m_creature); + break; + case 50: + DoScriptText(FANDRAL_EMOTE_2,Fandral); + Fandral->CastSpell(-8127,1525,17.5,33806,true); + break; + case 51: + while (mob = plr->FindNearestCreature(15423,50,m_creature)) + mob->RemoveFromWorld(); + while (mob = plr->FindNearestCreature(15424,50,m_creature)) + mob->RemoveFromWorld(); + while (mob = plr->FindNearestCreature(15414,50,m_creature)) + mob->RemoveFromWorld(); + while (mob = plr->FindNearestCreature(15422,50,m_creature)) + mob->RemoveFromWorld(); + break; + case 52: + Fandral->GetMotionMaster()->MoveCharge(-8028.75, 1538.795, 2.61,4); + DoScriptText(ANACHRONOS_SAY_9, m_creature,Fandral); + break; + case 53: + DoScriptText(FANDRAL_SAY_6,Fandral); + break; + case 54: + DoScriptText(ANACHRONOS_EMOTE_2,m_creature); + break; + case 55: + Fandral->SetVisibility(VISIBILITY_OFF); + break; + case 56: + DoScriptText(ANACHRONOS_EMOTE_3, m_creature); + m_creature->GetMotionMaster()->MoveCharge(-8116,1522,3.65,4); + break; + case 57: + m_creature->GetMotionMaster()->MoveCharge(-8116.7,1527,3.7,4); + break; + case 58: + m_creature->GetMotionMaster()->MoveCharge(-8112.67,1529.9,2.86,4); + break; + case 59: + m_creature->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4); + break; + case 60: + if(plr) + DoScriptText(ANACHRONOS_SAY_10, m_creature,plr); + m_creature->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4); + break; + case 61: + m_creature->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6); + if(plr->IsInRange(m_creature,0,15)) + plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,m_creature); + break; + case 62: + m_creature->SetDisplayId(15500); + break; + case 63: + m_creature->HandleEmoteCommand(254); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + break; + case 64: + m_creature->GetMotionMaster()->MoveCharge(-8000,1400,150,9); + break; + case 65: + m_creature->SetVisibility(VISIBILITY_OFF); + if(Creature* AnachronosQuestTrigger = (Unit::GetCreature(*m_creature, AnachronosQuestTriggerGUID))) + { + DoScriptText(ARYGOS_YELL_1,m_creature); + AnachronosQuestTrigger->AI()->EnterEvadeMode(); + eventEnd=true; + } + break; + } + } + ++AnimationCount; + } + void UpdateAI(const uint32 diff) + { + if(AnimationTimer) + { + if(AnimationTimer <= diff) + HandleAnimation(); + else AnimationTimer -= diff; + } + if(AnimationCount < 65) + m_creature->CombatStop(); + if(AnimationCount == 65 || eventEnd) + m_creature->AI()->EnterEvadeMode(); + } +}; + +/*###### +# mob_qiraj_war_spawn +######*/ + +struct TRINITY_DLL_DECL mob_qiraj_war_spawnAI : public ScriptedAI +{ + mob_qiraj_war_spawnAI(Creature* c) : ScriptedAI(c) {} + + uint64 MobGUID; + uint64 PlayerGUID; + uint32 SpellTimer1, SpellTimer2, SpellTimer3,SpellTimer4; + bool Timers; + bool hasTarget; + Unit* trigger; + void Reset() + { + MobGUID = 0; + PlayerGUID = 0; + Timers = false; + hasTarget = false; + } + + void EnterCombat(Unit* who) {} + void JustDied(Unit* slayer); + + void UpdateAI(const uint32 diff) + { + Unit* target; + Player* plr = m_creature->GetPlayer(PlayerGUID); + + if(!Timers) + { + if(m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) //all but Kaldorei Soldiers + { + SpellTimer1 = SpawnCast[1].Timer1; + SpellTimer2 = SpawnCast[2].Timer1; + SpellTimer3 = SpawnCast[3].Timer1; + } + if(m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) + SpellTimer4 = SpawnCast[0].Timer1; + Timers = true; + } + if(m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422|| m_creature->GetEntry() == 15414) + { + if(SpellTimer1 < diff) + { + DoCast(m_creature, SpawnCast[1].SpellId); + DoCast(m_creature, 24319); + SpellTimer1 = SpawnCast[1].Timer2; + } else SpellTimer1 -= diff; + if(SpellTimer2 < diff) + { + DoCast(m_creature, SpawnCast[2].SpellId); + SpellTimer2 = SpawnCast[2].Timer2; + } else SpellTimer2 -= diff; + if(SpellTimer3 < diff) + { + DoCast(m_creature, SpawnCast[3].SpellId); + SpellTimer3 = SpawnCast[3].Timer2; + } else SpellTimer3 -= diff; + } + if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) + { + if(SpellTimer4 < diff) + { + m_creature->RemoveAllAttackers(); + m_creature->AttackStop(); + DoCast(m_creature, 15533); + SpellTimer4 = SpawnCast[0].Timer2; + } else SpellTimer4 -= diff; + } + if (!hasTarget) + { + if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) + target = m_creature->FindNearestCreature(15423,20,true); + if (m_creature->GetEntry() == 15423) + { + uint8 tar; + tar = rand()%3; + + if (tar == 0) + target = m_creature->FindNearestCreature(15422,20,true); + else if (tar == 1) + target = m_creature->FindNearestCreature(15424,20,true); + else if (tar == 2) + target = m_creature->FindNearestCreature(15414,20,true); + } + hasTarget = true; + m_creature->AI()->AttackStart(target); + } + if (!(trigger = m_creature->FindNearestCreature(15379,100))) + DoCast(m_creature, 33652); + + if (!UpdateVictim()) + { + hasTarget = false; + return; + } + + DoMeleeAttackIfReady(); + } +}; + +/*##### +# npc_anachronos_quest_trigger +#####*/ + +struct TRINITY_DLL_DECL npc_anachronos_quest_triggerAI : public ScriptedAI +{ + npc_anachronos_quest_triggerAI(Creature* c) : ScriptedAI(c) {} + + uint64 PlayerGUID; + + uint32 WaveTimer; + uint32 AnnounceTimer; + + int8 LiveCount; + uint8 WaveCount; + + bool EventStarted; + bool Announced; + bool Failed; + + void Reset() + { + PlayerGUID = 0; + + WaveTimer = 2000; + AnnounceTimer = 1000; + LiveCount = 0; + WaveCount = 0; + + EventStarted = false; + Announced = false; + Failed = false; + + m_creature->SetVisibility(VISIBILITY_OFF); + } + + void SummonNextWave() + { + uint8 count = WavesInfo[WaveCount].SpawnCount; + uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; + srand(time(NULL));//initializing random seed + uint8 KaldoreiSoldierCount = 0; + uint8 AnubisathConquerorCount = 0; + uint8 QirajiWaspCount = 0; + for(uint8 i = 0; i < 67; ++i) + { + Creature* Spawn = NULL; + float X = SpawnLocation[locIndex + i].x; + float Y = SpawnLocation[locIndex + i].y; + float Z = SpawnLocation[locIndex + i].z; + float O = SpawnLocation[locIndex + i].o; + uint32 desptimer = WavesInfo[WaveCount].DespTimer; + Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer); + + if(Spawn) + { + Spawn->LoadCreaturesAddon(); + if (Spawn->GetGUID()== 15423) + Spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID,15427+rand()%4); + if (i >= 30) WaveCount = 1; + if (i >= 33) WaveCount = 2; + if (i >= 45) WaveCount = 3; + if (i >= 51) WaveCount = 4; + } + + if(WaveCount < 5) //1-4 Wave + { + ((mob_qiraj_war_spawnAI*)Spawn->AI())->MobGUID = m_creature->GetGUID(); + ((mob_qiraj_war_spawnAI*)Spawn->AI())->PlayerGUID = PlayerGUID; + } + } + WaveTimer = WavesInfo[WaveCount].SpawnTimer; + AnnounceTimer = WavesInfo[WaveCount].YellTimer; + } + + void CheckEventFail() + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if(!pPlayer) + return; + + if(Group *EventGroup = pPlayer->GetGroup()) + { + Player* GroupMember; + + uint8 GroupMemberCount = 0; + uint8 DeadMemberCount = 0; + uint8 FailedMemberCount = 0; + + const Group::MemberSlotList members = EventGroup->GetMemberSlots(); + + for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++) + { + GroupMember = (Unit::GetPlayer(itr->guid)); + if(!GroupMember) + continue; + if(!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) + { + GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); + GroupMember->SetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, QUEST_STATUS_NONE); + ++FailedMemberCount; + } + ++GroupMemberCount; + + if(GroupMember->isDead()) + ++DeadMemberCount; + } + + if(GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS)) + Failed = true; //only so event can restart + } + } + + void LiveCounter() + { + --LiveCount; + if(!LiveCount) + Announced = false; + } + + void UpdateAI(const uint32 diff) + { + if(!PlayerGUID || !EventStarted) + return; + + if(WaveCount < 4) + { + if(!Announced && AnnounceTimer < diff) + { + DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature); + Announced = true; + } else AnnounceTimer -= diff; + + if(WaveTimer < diff) + SummonNextWave(); + else WaveTimer -= diff; + } + CheckEventFail(); + if (WaveCount == 4 || Failed) + EnterEvadeMode(); + }; +}; +void mob_qiraj_war_spawnAI::JustDied(Unit* slayer) +{ + m_creature->RemoveCorpse(); + if(Creature* Mob = (Unit::GetCreature(*m_creature, MobGUID))) + ((npc_anachronos_quest_triggerAI*)Mob->AI())->LiveCounter(); + +}; +/*##### +# go_crystalline_tear +######*/ + +bool GOQuestAccept_GO_crystalline_tear(Player* plr, GameObject* go, Quest const* quest) +{ + if(quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) + { + + Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, plr); + + Unit *Merithra = Anachronos_Quest_Trigger->SummonCreature(15378,-8034.535,1535.14,2.61,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,150000); + Unit *Caelestrasz = Anachronos_Quest_Trigger->SummonCreature(15379,-8032.767, 1533.148,2.61, 1.5,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,150000); + Unit *Arygos = Anachronos_Quest_Trigger->SummonCreature(15380,-8034.52, 1537.843, 2.61, 5.7,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,150000); + Unit *Fandral = Anachronos_Quest_Trigger->SummonCreature(15382,-8028.462, 1535.843, 2.61, 3.141592,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,215000); + Unit *Anachronos = Anachronos_Quest_Trigger->SummonCreature(15381,-8028.75, 1538.795, 2.61, 4,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,220000); + + Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); + Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID,15420); + Merithra->setFaction(35); + + Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); + Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID,15419); + Caelestrasz->setFaction(35); + + Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); + Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID,15418); + Arygos->setFaction(35); + + if(Anachronos_Quest_Trigger && Anachronos) + { + ((npc_anachronos_the_ancientAI*)((Creature*)Anachronos)->AI())->PlayerGUID = plr->GetGUID(); + ((npc_anachronos_quest_triggerAI*)((Creature*)Anachronos_Quest_Trigger)->AI())->Failed=false; + ((npc_anachronos_quest_triggerAI*)((Creature*)Anachronos_Quest_Trigger)->AI())->PlayerGUID = plr->GetGUID(); + ((npc_anachronos_quest_triggerAI*)((Creature*)Anachronos_Quest_Trigger)->AI())->EventStarted=true; + ((npc_anachronos_quest_triggerAI*)((Creature*)Anachronos_Quest_Trigger)->AI())->Announced=true; + } + } + return true; +} + +CreatureAI* GetAI_npc_anachronos_quest_trigger(Creature* c) +{ + return new npc_anachronos_quest_triggerAI(c); +} + +CreatureAI* GetAI_mob_qiraj_war_spawn(Creature* c) +{ + return new mob_qiraj_war_spawnAI(c); +} + +CreatureAI* GetAI_npc_anachronos_the_ancient(Creature* c) +{ + return new npc_anachronos_the_ancientAI(c); +} void AddSC_silithus() { Script *newscript; + + newscript = new Script; + newscript->Name = "go_crystalline_tear"; + newscript->pGOQuestAccept = &GOQuestAccept_GO_crystalline_tear; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_anachronos_quest_trigger"; + newscript->GetAI = &GetAI_npc_anachronos_quest_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_anachronos_the_ancient"; + newscript->GetAI = &GetAI_npc_anachronos_the_ancient; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_qiraj_war_spawn"; + newscript->GetAI = &GetAI_mob_qiraj_war_spawn; + newscript->RegisterSelf(); newscript = new Script; newscript->Name = "npc_highlord_demitrian"; diff --git a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp index 2ac360faa09..aa67f0dc82b 100644 --- a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp +++ b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp @@ -245,6 +245,7 @@ bool AreaTrigger_at_zumrah(Player* pPlayer, AreaTriggerEntry *at) return false; Zumrah->setFaction(ZUMRAH_HOSTILE_FACTION); + return true; } void AddSC_zulfarrak() |