diff options
8 files changed, 359 insertions, 280 deletions
diff --git a/sql/updates/world/2013_06_25_05_world_misc.sql b/sql/updates/world/2013_06_25_05_world_misc.sql new file mode 100644 index 00000000000..378b362aa83 --- /dev/null +++ b/sql/updates/world/2013_06_25_05_world_misc.sql @@ -0,0 +1,12 @@ +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (2046,2026); +INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES +(2046, 'at_dragonspire_hall'), +(2026, 'at_blackrock_stadium'); + +-- Warchief Rend Blackhand text +SET @REND := 10429; +DELETE FROM `creature_text` WHERE `entry` IN (@REND); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@REND,0,0,"Impossible!",14,0,100,22,0,0,'Warchief Rend Blackhand'), +(@REND,1,0,"With pleasure...",14,0,100,0,0,0,'Warchief Rend Blackhand'), +(@REND,2,0,"%s is knocked off his drake!",16,0,100,0,0,0,'Warchief Rend Blackhand'); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index ab87545688a..020c81a92e1 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -18,35 +18,35 @@ #ifndef DEF_BLACKROCK_SPIRE_H #define DEF_BLACKROCK_SPIRE_H -uint32 const EncounterCount = 22; +uint32 const EncounterCount = 23; #define BRSScriptName "instance_blackrock_spire" enum DataTypes { - DATA_OMOKK = 0, - DATA_SHADOW_HUNTER_VOSHGAJIN = 1, - DATA_WARMASTER_VOONE = 2, - DATA_MOTHER_SMOLDERWEB = 3, - DATA_UROK_DOOMHOWL = 4, // not scripted - DATA_QUARTERMASTER_ZIGRIS = 5, - DATA_GIZRUL_THE_SLAVENER = 6, // not scripted - DATA_HALYCON = 7, - DATA_OVERLORD_WYRMTHALAK = 8, - DATA_PYROGAURD_EMBERSEER = 9, - DATA_WARCHIEF_REND_BLACKHAND = 10, - DATA_GYTH = 11, - DATA_THE_BEAST = 12, - DATA_GENERAL_DRAKKISATH = 13, + DATA_OMOKK = 1, + DATA_SHADOW_HUNTER_VOSHGAJIN = 2, + DATA_WARMASTER_VOONE = 3, + DATA_MOTHER_SMOLDERWEB = 4, + DATA_UROK_DOOMHOWL = 5, // not scripted + DATA_QUARTERMASTER_ZIGRIS = 6, + DATA_GIZRUL_THE_SLAVENER = 7, // not scripted + DATA_HALYCON = 8, + DATA_OVERLORD_WYRMTHALAK = 9, + DATA_PYROGAURD_EMBERSEER = 10, + DATA_WARCHIEF_REND_BLACKHAND = 11, + DATA_GYTH = 12, + DATA_THE_BEAST = 13, + DATA_GENERAL_DRAKKISATH = 14, // Extra - DATA_DRAGONSPIRE_ROOM = 14, - DATA_ROOM_1_RUNE = 15, - DATA_ROOM_2_RUNE = 16, - DATA_ROOM_3_RUNE = 17, - DATA_ROOM_4_RUNE = 18, - DATA_ROOM_5_RUNE = 19, - DATA_ROOM_6_RUNE = 20, - DATA_ROOM_7_RUNE = 21 + DATA_DRAGONSPIRE_ROOM = 15, + DATA_HALL_RUNE_1 = 16, + DATA_HALL_RUNE_2 = 17, + DATA_HALL_RUNE_3 = 18, + DATA_HALL_RUNE_4 = 19, + DATA_HALL_RUNE_5 = 20, + DATA_HALL_RUNE_6 = 21, + DATA_HALL_RUNE_7 = 22 }; enum CreaturesIds @@ -68,15 +68,18 @@ enum CreaturesIds NPC_BLACKHAND_DREADWEAVER = 9817, NPC_BLACKHAND_SUMMONER = 9818, NPC_BLACKHAND_VETERAN = 9819, - NPC_BLACKHAND_INCARCERATOR = 10316 + NPC_BLACKHAND_INCARCERATOR = 10316, + NPC_LORD_VICTOR_NEFARIUS = 10162, + NPC_REND_BLACKHAND = 10429 }; enum AdditionalData { SPELL_SUMMON_ROOKERY_WHELP = 15745, EVENT_PYROGUARD_EMBERSEER = 4884, - AREATRIGGER_ENTER_UBRS = 2046, - AREATRIGGER_STADIUM = 2026 + AREATRIGGER = 1, + AREATRIGGER_DRAGONSPIRE_HALL = 2046, + AREATRIGGER_BLACKROCK_STADIUM = 2026 }; enum GameObjectsIds @@ -93,13 +96,13 @@ enum GameObjectsIds GO_DRAKKISATH_DOOR_2 = 175947, GO_BLACKROCK_ALTAR = 175706, // Altar used to start Pyroguard Emberseer event // Runes in dragonspire hall - GO_ROOM_1_RUNE = 175197, - GO_ROOM_2_RUNE = 175199, - GO_ROOM_3_RUNE = 175195, - GO_ROOM_4_RUNE = 175200, - GO_ROOM_5_RUNE = 175198, - GO_ROOM_6_RUNE = 175196, - GO_ROOM_7_RUNE = 175194, + GO_HALL_RUNE_1 = 175197, + GO_HALL_RUNE_2 = 175199, + GO_HALL_RUNE_3 = 175195, + GO_HALL_RUNE_4 = 175200, + GO_HALL_RUNE_5 = 175198, + GO_HALL_RUNE_6 = 175196, + GO_HALL_RUNE_7 = 175194, // Runes in emberseers room GO_EMBERSEER_RUNE_1 = 175266, GO_EMBERSEER_RUNE_2 = 175267, @@ -107,7 +110,9 @@ enum GameObjectsIds GO_EMBERSEER_RUNE_4 = 175269, GO_EMBERSEER_RUNE_5 = 175270, GO_EMBERSEER_RUNE_6 = 175271, - GO_EMBERSEER_RUNE_7 = 175272 + GO_EMBERSEER_RUNE_7 = 175272, + // For Gyth event + GO_DR_PORTCULLIS = 175185 }; #endif diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index c480e3115e2..dfd808041bd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -41,11 +41,6 @@ class boss_drakkisath : public CreatureScript public: boss_drakkisath() : CreatureScript("boss_drakkisath") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_drakkisathAI(creature); - } - struct boss_drakkisathAI : public BossAI { boss_drakkisathAI(Creature* creature) : BossAI(creature, DATA_GENERAL_DRAKKISATH) {} @@ -58,10 +53,10 @@ public: void EnterCombat(Unit* /*who*/) { _EnterCombat(); - events.ScheduleEvent(EVENT_FIRE_NOVA, 6 * IN_MILLISECONDS); - events.ScheduleEvent(EVENT_CLEAVE, 8 * IN_MILLISECONDS); - events.ScheduleEvent(EVENT_CONFLIGURATION, 15 * IN_MILLISECONDS); - events.ScheduleEvent(EVENT_THUNDERCLAP, 17 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FIRE_NOVA, 6000); + events.ScheduleEvent(EVENT_CLEAVE, 8000); + events.ScheduleEvent(EVENT_CONFLIGURATION, 15000); + events.ScheduleEvent(EVENT_THUNDERCLAP, 17000); } void JustDied(Unit* /*killer*/) @@ -85,25 +80,30 @@ public: { case EVENT_FIRE_NOVA: DoCastVictim(SPELL_FIRENOVA); - events.ScheduleEvent(EVENT_FIRE_NOVA, 10 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FIRE_NOVA, 10000); break; case EVENT_CLEAVE: DoCastVictim(SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, 8 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CLEAVE, 8000); break; case EVENT_CONFLIGURATION: DoCastVictim(SPELL_CONFLIGURATION); - events.ScheduleEvent(EVENT_CONFLIGURATION, 18 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CONFLIGURATION, 18000); break; case EVENT_THUNDERCLAP: DoCastVictim(SPELL_THUNDERCLAP); - events.ScheduleEvent(EVENT_THUNDERCLAP, 20 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_THUNDERCLAP, 20000); break; } } DoMeleeAttackIfReady(); } }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_drakkisathAI(creature); + } }; void AddSC_boss_drakkisath() diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0ddbe0e1a25..e0023995cb3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -66,7 +66,6 @@ public: void JustDied(Unit* /*killer*/) { _JustDied(); - // Open doors } void IsSummonedBy(Unit* /*summoner*/) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 16f8e7b41bd..ec4cbf2ed18 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -47,7 +47,7 @@ enum Spells SPELL_STRIKE = 15580, // Combat SPELL_ENCAGE = 16045, // Combat // Cast on player by altar - SPELL_EMBERSEER_START = 16533 + SPELL_EMBERSEER_OBJECT_VISUAL = 16532 }; enum Events @@ -257,7 +257,7 @@ public: Map::PlayerList const &players = me->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (Player* player = itr->GetSource()->ToPlayer()) - if (!player->HasAura(SPELL_EMBERSEER_START)) + if (!player->HasAura(SPELL_EMBERSEER_OBJECT_VISUAL)) _hasAura = false; if (_hasAura) @@ -275,19 +275,16 @@ public: if (!UpdateVictim()) return; - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_FIRENOVA: - DoCast(SPELL_FIRENOVA); + DoCast(me, SPELL_FIRENOVA); events.ScheduleEvent(EVENT_FIRENOVA, 6000); break; case EVENT_FLAMEBUFFET: - DoCast(SPELL_FLAMEBUFFET); + DoCast(me, SPELL_FLAMEBUFFET); events.ScheduleEvent(EVENT_FLAMEBUFFET, 14000); break; case EVENT_PYROBLAST: diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index 4fc82275e6a..ced6fdd5b67 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -25,7 +25,27 @@ enum Spells SPELL_WHIRLWIND = 13736, // sniffed SPELL_CLEAVE = 15284, SPELL_MORTAL_STRIKE = 16856, - SPELL_FRENZY = 8269 + SPELL_FRENZY = 8269, + SPELL_KNOCKDOWN = 13360 // On spawn during Gyth fight +}; + +enum Says +{ + // Rend Blackhand + SAY_BLACKHAND_1 = 0, + SAY_BLACKHAND_2 = 1, + EMOTE_BLACKHAND_DISMOUNT = 2, + // Victor Nefarius + SAY_NEFARIUS_1 = 0, + SAY_NEFARIUS_2 = 1, + SAY_NEFARIUS_3 = 2, + SAY_NEFARIUS_4 = 3, + SAY_NEFARIUS_5 = 4, + SAY_NEFARIUS_6 = 5, + SAY_NEFARIUS_7 = 6, + SAY_NEFARIUS_8 = 7, + SAY_NEFARIUS_9 = 8, + SAY_NEFARIUS_10 = 9, }; enum Adds @@ -44,14 +64,14 @@ struct Wave float o_pos; }; -static Wave Wave2[]= +static Wave Wave2[]= // 22 sec { { 10447, 209.8637f, -428.2729f, 110.9877f, 0.6632251f }, { 10442, 209.3122f, -430.8724f, 110.9814f, 2.9147f }, { 10442, 211.3309f, -425.9111f, 111.0006f, 1.727876f } }; -static Wave Wave3[]= +static Wave Wave3[]= // 60 sec { { 10742, 208.6493f, -424.5787f, 110.9872f, 5.8294f }, { 10447, 203.9482f, -428.9446f, 110.982f, 4.677482f }, @@ -59,7 +79,7 @@ static Wave Wave3[]= { 10442, 206.3079f, -424.7509f, 110.9943f, 4.08407f } }; -static Wave Wave4[]= +static Wave Wave4[]= // 49 sec { { 10742, 212.3541f, -412.6826f, 111.0352f, 5.88176f }, { 10447, 212.5754f, -410.2841f, 111.0296f, 2.740167f }, @@ -67,7 +87,7 @@ static Wave Wave4[]= { 10442, 210.6568f, -412.1552f, 111.0124f, 0.9773844f } }; -static Wave Wave5[]= +static Wave Wave5[]= // 60 sec { { 10742, 210.2188f, -410.6686f, 111.0211f, 5.8294f }, { 10447, 209.4078f, -414.13f, 111.0264f, 4.677482f }, @@ -76,7 +96,7 @@ static Wave Wave5[]= { 10442, 208.0854f, -412.1505f, 111.0057f, 4.08407f } }; -static Wave Wave6[]= +static Wave Wave6[]= // 27 sec { { 10742, 213.9138f, -426.512f, 111.0013f, 3.316126f }, { 10447, 213.7121f, -429.8102f, 110.9888f, 1.413717f }, @@ -89,7 +109,15 @@ enum Events { EVENT_WHIRLWIND = 1, EVENT_CLEAVE = 2, - EVENT_MORTAL_STRIKE = 3 + EVENT_MORTAL_STRIKE = 3, + + EVENT_GYTH_1 = 5, + EVENT_GYTH_2 = 6, + EVENT_GYTH_3 = 7, + EVENT_GYTH_4 = 8, + EVENT_GYTH_5 = 9, + EVENT_GYTH_6 = 10, + EVENT_PORTCULLIS = 11, }; class boss_rend_blackhand : public CreatureScript @@ -104,6 +132,9 @@ public: void Reset() { _Reset(); + _gythEvent = false; + _victorGUID = 0; + _portcullisGUID = 0; } void EnterCombat(Unit* /*who*/) @@ -122,15 +153,76 @@ public: void SetData(uint32 type, uint32 data) { - if (instance && type == 1 && data == 1) + if (instance && type == AREATRIGGER && data == AREATRIGGER_BLACKROCK_STADIUM) { - events.ScheduleEvent(EVENT_WHIRLWIND, 5000); - } + if (!_gythEvent) + { + _gythEvent = true; + + if (Creature* victor = me->FindNearestCreature(NPC_LORD_VICTOR_NEFARIUS, 5.0f, true)) + _victorGUID = victor->GetGUID(); + + if (GameObject* portcullis = me->FindNearestGameObject(GO_DR_PORTCULLIS, 50.0f)) + _portcullisGUID = portcullis->GetGUID(); + + if (Creature* victor = me->GetCreature(*me, _victorGUID)) + { + if (Unit* player = victor->SelectNearestPlayer(40.0f)) + { + victor->SetInFront(player); + victor->SendMovementFlagUpdate(); + } + } + } + events.ScheduleEvent(EVENT_GYTH_1, 1000); + } } void UpdateAI(uint32 diff) { + if (_gythEvent) + { + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_GYTH_1: + if (Creature* victor = me->GetCreature(*me, _victorGUID)) + victor->AI()->Talk(SAY_NEFARIUS_1); + events.ScheduleEvent(EVENT_GYTH_2, 4000); + break; + case EVENT_GYTH_2: + if (Creature* victor = me->GetCreature(*me, _victorGUID)) + victor->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + events.ScheduleEvent(EVENT_GYTH_3, 4000); + break; + case EVENT_GYTH_3: + if (Creature* victor = me->GetCreature(*me, _victorGUID)) + victor->AI()->Talk(SAY_NEFARIUS_2); + events.ScheduleEvent(EVENT_PORTCULLIS, 2000); + events.ScheduleEvent(EVENT_GYTH_4, 4000); + break; + case EVENT_GYTH_4: + if (Creature* victor = me->GetCreature(*me, _victorGUID)) + { + victor->SetInFront(me); + victor->SendMovementFlagUpdate(); + } + break; + case EVENT_PORTCULLIS: + if (GameObject* portcullis = me->FindNearestGameObject(GO_DR_PORTCULLIS, 50.0f)) + portcullis->UseDoorOrButton(); + // move wave + break; + default: + break; + } + } + } + if (!UpdateVictim()) return; @@ -159,6 +251,11 @@ public: } DoMeleeAttackIfReady(); } + private: + bool _gythEvent; + uint64 _victorGUID; + uint64 _portcullisGUID; + }; CreatureAI* GetAI(Creature* creature) const diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index 2751648ebf9..6a030af0a95 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -15,14 +15,18 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ObjectDefines.h" #include "ObjectMgr.h" #include "ScriptMgr.h" +#include "ObjectDefines.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "InstanceScript.h" #include "ScriptedCreature.h" #include "blackrock_spire.h" -#include "InstanceScript.h" -uint32 const DragonspireRunes[7] = { GO_ROOM_1_RUNE, GO_ROOM_2_RUNE, GO_ROOM_3_RUNE, GO_ROOM_4_RUNE, GO_ROOM_5_RUNE, GO_ROOM_6_RUNE, GO_ROOM_7_RUNE }; +uint32 const DragonspireRunes[7] = { GO_HALL_RUNE_1, GO_HALL_RUNE_2, GO_HALL_RUNE_3, GO_HALL_RUNE_4, GO_HALL_RUNE_5, GO_HALL_RUNE_6, GO_HALL_RUNE_7 }; uint32 const DragonspireMobs[3] = { NPC_BLACKHAND_DREADWEAVER, NPC_BLACKHAND_SUMMONER, NPC_BLACKHAND_VETERAN }; @@ -39,9 +43,7 @@ public: struct instance_blackrock_spireMapScript : public InstanceScript { - instance_blackrock_spireMapScript(InstanceMap* map) : InstanceScript(map) { } - - void Initialize() + instance_blackrock_spireMapScript(InstanceMap* map) : InstanceScript(map) { SetBossNumber(EncounterCount); HighlordOmokk = 0; @@ -64,12 +66,6 @@ public: go_blackrockaltar = 0; } - void OnPlayerEnter(Player* /*player*/) - { - if ((GetBossState(DATA_DRAGONSPIRE_ROOM) != DONE)) - Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_STORE, 4000); - } - bool IsEncounterInProgress() const { for (uint8 i = 0; i < EncounterCount; ++i) @@ -113,8 +109,8 @@ public: break; case NPC_PYROGAURD_EMBERSEER: PyroguardEmberseer = creature->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - creature->DespawnOrUnsummon(); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + creature->DisappearAndDie(); break; case NPC_WARCHIEF_REND_BLACKHAND: WarchiefRendBlackhand = creature->GetGUID(); @@ -144,93 +140,93 @@ public: break; case GO_EMBERSEER_IN: go_emberseerin = go->GetGUID(); - if ((GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE)) - go->SetGoState(GO_STATE_ACTIVE); + if (GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE) + HandleGameObject(0, true, go); break; case GO_DOORS: go_doors = go->GetGUID(); - if ((GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE)) - go->SetGoState(GO_STATE_ACTIVE); + if (GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE) + HandleGameObject(0, true, go); break; case GO_EMBERSEER_OUT: go_emberseerout = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_ACTIVE); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, true, go); break; case GO_BLACKROCK_ALTAR: go_blackrockaltar = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); break; - case GO_ROOM_1_RUNE: + case GO_HALL_RUNE_1: go_roomrunes[0] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_1_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_1) == DONE) + HandleGameObject(0, false, go); break; - case GO_ROOM_2_RUNE: + case GO_HALL_RUNE_2: go_roomrunes[1] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_2_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_2) == DONE) + HandleGameObject(0, false, go); break; - case GO_ROOM_3_RUNE: + case GO_HALL_RUNE_3: go_roomrunes[2] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_3_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_3) == DONE) + HandleGameObject(0, false, go); break; - case GO_ROOM_4_RUNE: + case GO_HALL_RUNE_4: go_roomrunes[3] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_4_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_4) == DONE) + HandleGameObject(0, false, go); break; - case GO_ROOM_5_RUNE: + case GO_HALL_RUNE_5: go_roomrunes[4] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_5_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_5) == DONE) + HandleGameObject(0, false, go); break; - case GO_ROOM_6_RUNE: + case GO_HALL_RUNE_6: go_roomrunes[5] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_6_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_6) == DONE) + HandleGameObject(0, false, go); break; - case GO_ROOM_7_RUNE: + case GO_HALL_RUNE_7: go_roomrunes[6] = go->GetGUID(); - if ((GetBossState(DATA_ROOM_7_RUNE) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_HALL_RUNE_7) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_1: go_emberseerrunes[0] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_2: go_emberseerrunes[1] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_3: go_emberseerrunes[2] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_4: go_emberseerrunes[3] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_5: go_emberseerrunes[4] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_6: go_emberseerrunes[5] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; case GO_EMBERSEER_RUNE_7: go_emberseerrunes[6] = go->GetGUID(); - if ((GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)) - go->SetGoState(GO_STATE_READY); + if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE) + HandleGameObject(0, false, go); break; } } @@ -257,6 +253,7 @@ public: case DATA_THE_BEAST: case DATA_GENERAL_DRAKKISATH: case DATA_DRAGONSPIRE_ROOM: + break; default: break; } @@ -270,14 +267,31 @@ public: { case EVENT_PYROGUARD_EMBERSEER: if (GetBossState(DATA_PYROGAURD_EMBERSEER) == NOT_STARTED) + { if (Creature* Emberseer = instance->GetCreature(PyroguardEmberseer)) Emberseer->AI()->SetData(1, 1); + } break; default: break; } } + void SetData(uint32 type, uint32 data) + { + switch (type) + { + case AREATRIGGER: + if (data == AREATRIGGER_DRAGONSPIRE_HALL) + { + if (GetBossState(DATA_DRAGONSPIRE_ROOM) != DONE) + Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_STORE, 1000); + } + default: + break; + } + } + uint64 GetData64(uint32 type) const { switch (type) @@ -336,25 +350,25 @@ public: case GO_BLACKROCK_ALTAR: return go_blackrockaltar; break; - case GO_ROOM_1_RUNE: + case GO_HALL_RUNE_1: return go_roomrunes[0]; break; - case GO_ROOM_2_RUNE: + case GO_HALL_RUNE_2: return go_roomrunes[1]; break; - case GO_ROOM_3_RUNE: + case GO_HALL_RUNE_3: return go_roomrunes[2]; break; - case GO_ROOM_4_RUNE: + case GO_HALL_RUNE_4: return go_roomrunes[3]; break; - case GO_ROOM_5_RUNE: + case GO_HALL_RUNE_5: return go_roomrunes[4]; break; - case GO_ROOM_6_RUNE: + case GO_HALL_RUNE_6: return go_roomrunes[5]; break; - case GO_ROOM_7_RUNE: + case GO_HALL_RUNE_7: return go_roomrunes[6]; break; case GO_EMBERSEER_RUNE_1: @@ -392,12 +406,12 @@ public: { case EVENT_DARGONSPIRE_ROOM_STORE: Dragonspireroomstore(); - Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_CHECK, 2500); + Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_CHECK, 3000); break; case EVENT_DARGONSPIRE_ROOM_CHECK: Dragonspireroomcheck(); if ((GetBossState(DATA_DRAGONSPIRE_ROOM) != DONE)) - Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_CHECK, 2500); + Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_CHECK, 3000); break; default: break; @@ -434,66 +448,67 @@ public: void Dragonspireroomcheck() { + Creature* mob = 0; + GameObject* rune = 0; + for (uint8 i = 0; i < 7; ++i) { bool _mobAlive = false; - if (GameObject* rune = instance->GetGameObject(go_roomrunes[i])) + if (rune = instance->GetGameObject(go_roomrunes[i])) { if (rune->GetGoState() == GO_STATE_ACTIVE) - { for (uint8 ii = 0; ii < 5; ++ii) { - if (Creature* mob = instance->GetCreature(runecreaturelist[i] [ii])) - { + if (mob = instance->GetCreature(runecreaturelist[i] [ii])) if (mob->IsAlive()) _mobAlive = true; - } } - } - - if (!_mobAlive && rune->GetGoState() == GO_STATE_ACTIVE) - { - rune->SetGoState(GO_STATE_READY); + } - switch (rune->GetEntry()) - { - case GO_ROOM_1_RUNE: - SetBossState(DATA_ROOM_1_RUNE, DONE); - break; - case GO_ROOM_2_RUNE: - SetBossState(DATA_ROOM_2_RUNE, DONE); - break; - case GO_ROOM_3_RUNE: - SetBossState(DATA_ROOM_3_RUNE, DONE); - break; - case GO_ROOM_4_RUNE: - SetBossState(DATA_ROOM_4_RUNE, DONE); - break; - case GO_ROOM_5_RUNE: - SetBossState(DATA_ROOM_5_RUNE, DONE); - break; - case GO_ROOM_6_RUNE: - SetBossState(DATA_ROOM_6_RUNE, DONE); - break; - case GO_ROOM_7_RUNE: - SetBossState(DATA_ROOM_7_RUNE, DONE); - break; - } - } + if (!_mobAlive && rune->GetGoState() == GO_STATE_ACTIVE) + { + HandleGameObject(0, false, rune); - if (GetBossState(DATA_ROOM_1_RUNE) == DONE && GetBossState(DATA_ROOM_2_RUNE) == DONE && GetBossState(DATA_ROOM_3_RUNE) == DONE && - GetBossState(DATA_ROOM_4_RUNE) == DONE &&GetBossState(DATA_ROOM_5_RUNE) == DONE && GetBossState(DATA_ROOM_6_RUNE) == DONE && - GetBossState(DATA_ROOM_7_RUNE) == DONE) + switch (rune->GetEntry()) { - SetBossState(DATA_DRAGONSPIRE_ROOM, DONE); - if (GameObject* door1 = instance->GetGameObject(go_emberseerin)) - door1->SetGoState(GO_STATE_ACTIVE); - if (GameObject* door2 = instance->GetGameObject(go_doors)) - door2->SetGoState(GO_STATE_ACTIVE); + case GO_HALL_RUNE_1: + SetBossState(DATA_HALL_RUNE_1, DONE); + break; + case GO_HALL_RUNE_2: + SetBossState(DATA_HALL_RUNE_2, DONE); + break; + case GO_HALL_RUNE_3: + SetBossState(DATA_HALL_RUNE_3, DONE); + break; + case GO_HALL_RUNE_4: + SetBossState(DATA_HALL_RUNE_4, DONE); + break; + case GO_HALL_RUNE_5: + SetBossState(DATA_HALL_RUNE_5, DONE); + break; + case GO_HALL_RUNE_6: + SetBossState(DATA_HALL_RUNE_6, DONE); + break; + case GO_HALL_RUNE_7: + SetBossState(DATA_HALL_RUNE_7, DONE); + break; + default: + break; } } } + + if (GetBossState(DATA_HALL_RUNE_1) == DONE && GetBossState(DATA_HALL_RUNE_2) == DONE && GetBossState(DATA_HALL_RUNE_3) == DONE && + GetBossState(DATA_HALL_RUNE_4) == DONE && GetBossState(DATA_HALL_RUNE_5) == DONE && GetBossState(DATA_HALL_RUNE_6) == DONE && + GetBossState(DATA_HALL_RUNE_7) == DONE) + { + SetBossState(DATA_DRAGONSPIRE_ROOM, DONE); + if (GameObject* door1 = instance->GetGameObject(go_emberseerin)) + HandleGameObject(0, true, door1); + if (GameObject* door2 = instance->GetGameObject(go_doors)) + HandleGameObject(0, true, door2); + } } std::string GetSaveData() @@ -570,7 +585,56 @@ public: }; +/*##### +# at_dragonspire_hall +#####*/ + +class at_dragonspire_hall : public AreaTriggerScript +{ +public: + at_dragonspire_hall() : AreaTriggerScript("at_dragonspire_hall") { } + + bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) + { + if (player && player->IsAlive()) + { + if (InstanceScript* instance = player->GetInstanceScript()) + instance->SetData(AREATRIGGER, AREATRIGGER_DRAGONSPIRE_HALL); + return true; + } + else + return false; + } + +}; + +/*##### +# at_blackrock_stadium +#####*/ + +class at_blackrock_stadium : public AreaTriggerScript +{ +public: + at_blackrock_stadium() : AreaTriggerScript("at_blackrock_stadium") { } + + bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) + { + if (player && player->IsAlive()) + { + if (InstanceScript* instance = player->GetInstanceScript()) + if (Creature* rend = player->FindNearestCreature(NPC_REND_BLACKHAND, 50.0f)) + rend->AI()->SetData(AREATRIGGER, AREATRIGGER_BLACKROCK_STADIUM); + return true; + } + else + return false; + } + +}; + void AddSC_instance_blackrock_spire() { new instance_blackrock_spire(); + new at_dragonspire_hall(); + new at_blackrock_stadium(); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 150ad588ae8..244d84e6989 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -29,39 +29,16 @@ enum Events EVENT_SHADOW_BOLT = 2, EVENT_FEAR = 3, EVENT_MIND_CONTROL = 4, - - // Victor Nefarius UBRS Events - EVENT_PLAYER_CHECK = 5, - EVENT_GYTH_REND_1 = 6, - EVENT_GYTH_REND_2 = 7, - EVENT_GYTH_REND_3 = 8, - EVENT_GYTH_REND_4 = 9, - EVENT_GYTH_REND_5 = 10, - EVENT_GYTH_REND_6 = 11, - // Nefarian - EVENT_SHADOWFLAME = 12, - EVENT_VEILOFSHADOW = 13, - EVENT_CLEAVE = 14, - EVENT_TAILLASH = 15, - EVENT_CLASSCALL = 16 + EVENT_SHADOWFLAME = 5, + EVENT_VEILOFSHADOW = 6, + EVENT_CLEAVE = 7, + EVENT_TAILLASH = 8, + EVENT_CLASSCALL = 9 }; enum Says { - // Victor Nefarius - // UBRS text - SAY_GYTH_REND_1 = 0, - SAY_GYTH_REND_2 = 1, - SAY_GYTH_REND_3 = 2, - SAY_GYTH_REND_4 = 3, - SAY_GYTH_REND_5 = 4, - SAY_GYTH_REND_6 = 5, - SAY_GYTH_REND_7 = 6, - SAY_GYTH_REND_8 = 7, - SAY_GYTH_REND_9 = 8, - SAY_GYTH_REND_10 = 9, - // BWL text SAY_GAMESBEGIN_1 = 10, SAY_GAMESBEGIN_2 = 11, // SAY_VAEL_INTRO = 12, Not used - when he corrupts Vaelastrasz @@ -84,12 +61,6 @@ enum Says SAY_DEATH_KNIGHT = 13 }; -enum Gameobjects -{ - // UBRS - OBJECT_DR_PORTCULLIS = 175185 -}; - enum Gossip { GOSSIP_ID = 21332, @@ -97,9 +68,6 @@ enum Gossip enum Creatures { - // UBRS - NPC_REND_BLACKHAND = 10429, - // BWL NPC_BRONZE_DRAKANOID = 14263, NPC_BLUE_DRAKANOID = 14261, NPC_RED_DRAKANOID = 14264, @@ -168,12 +136,6 @@ public: void Reset() { - if (me->GetMapId() == 229) - { - playerGUID = 0; - events.ScheduleEvent(EVENT_PLAYER_CHECK, 10000); - } - if (me->GetMapId() == 469) { if (!me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true)) @@ -194,6 +156,11 @@ public: Reset(); } + void SetData(uint32 type, uint32 data) + { + + } + void BeginEvent(Player* target) { _EnterCombat(); @@ -226,70 +193,11 @@ public: void UpdateAI(uint32 diff) { - events.Update(diff); - - if (me->GetMapId() == 229) // UBRS EVENTS - { - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_PLAYER_CHECK: - { - Map::PlayerList const &players = me->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if (Player* player = itr->GetSource()->ToPlayer()) - { - if (me->GetDistance(player) < 30.0f && player->IsAlive() && !player->IsGameMaster()) - { - playerGUID = player->GetGUID(); - me->SetInFront(player); - me->SendMovementFlagUpdate(); - events.ScheduleEvent(EVENT_GYTH_REND_1, 1000); - } - else - events.ScheduleEvent(EVENT_PLAYER_CHECK, 10000); - } - break; - } - case EVENT_GYTH_REND_1: - Talk(SAY_GYTH_REND_1); - events.ScheduleEvent(EVENT_GYTH_REND_2, 4000); - break; - case EVENT_GYTH_REND_2: - me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - events.ScheduleEvent(EVENT_GYTH_REND_3, 4000); - break; - case EVENT_GYTH_REND_3: - Talk(SAY_GYTH_REND_2); - events.ScheduleEvent(EVENT_GYTH_REND_4, 2000); - break; - case EVENT_GYTH_REND_4: - if (GameObject* portcullis = me->FindNearestGameObject(OBJECT_DR_PORTCULLIS, 50.0f)) - portcullis->SetGoState(GO_STATE_READY); - events.ScheduleEvent(EVENT_GYTH_REND_5, 2000); - break; - case EVENT_GYTH_REND_5: - if (Creature* rend = me->FindNearestCreature(NPC_REND_BLACKHAND, 5.0f, true)) - me->SetInFront(rend); - me->SendMovementFlagUpdate(); - events.ScheduleEvent(EVENT_GYTH_REND_5, 4000); - break; - case EVENT_GYTH_REND_6: - me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - events.ScheduleEvent(EVENT_GYTH_REND_6, 4000); - default: - break; - } - } - } - - if (me->GetMapId() != 469) - return; - // Only do this if we haven't spawned nefarian yet if (UpdateVictim() && SpawnedAdds <= 42) { + events.Update(diff); + if (me->HasUnitState(UNIT_STATE_CASTING)) return; @@ -370,9 +278,6 @@ public: } private: - // UBRS - uint64 playerGUID; - // BWL uint32 SpawnedAdds; }; |
