diff --git a/sql/updates/world/4.3.4/2020_07_10_00_world.sql b/sql/updates/world/4.3.4/2020_07_10_00_world.sql new file mode 100644 index 00000000000..c5596987d30 --- /dev/null +++ b/sql/updates/world/4.3.4/2020_07_10_00_world.sql @@ -0,0 +1,31 @@ +UPDATE `creature_template` SET `ScriptName`= 'npc_bwd_lord_victor_nefarius' WHERE `entry`= 48964; +UPDATE `creature_template` SET `flags_extra`= 128 WHERE `entry`= 57478; + +DELETE FROM `creature_text` WHERE `CreatureID`= 48964 AND `GroupID` > 4; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `comment`) VALUES +(48964, 5, 0, 'Welcome to my personal sanctum, heroes! I hope you find the accommodations to your liking. Herein you will find many of my failed experiments and ultimately my greatest triumph!', 14, 0, 100, 0, 0, 20090, 49415, ''), +(48964, 6, 0, 'Finally someone to deal with that unsightly pest! You have my thanks, \"heroes.\"', 14, 0, 100, 0, 0, 20085, 49410, ''), +(48964, 7, 0, 'That malfunctioning piece of junk was murder on the repair bills.', 14, 0, 100, 0, 0, 20086, 49411, 'Lord Victor Nefarius to Player'), +(48964, 8, 0, 'Impressive. You have managed to destroy one of my most horrific creations, a task I had thought impossible until now.', 14, 0, 100, 0, 0, 20088, 49413, ''), +(48964, 9, 0, 'Now that was really unnecessary.', 14, 0, 100, 0, 0, 20087, 49412, ''), +(48964, 10, 0, 'We never did see eye to eye... Good riddance I say!', 14, 0, 100, 0, 0, 20089, 49414, ''); + +UPDATE `creature_text` SET `TextRange`= 3 WHERE `CreatureID`= 48964; + +SET @CGUID := 396406; +DELETE FROM `creature` WHERE `guid`= @CGUID+0; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES +(@CGUID+0, 48964, 669, 5094, 5094, 3, 169, 0, 0, 0, -61.6267356872558593, -224.701385498046875, 201.37677001953125, 3.228859186172485351, 7200, 0, 0, 0, 0, 0, 0, 33554496, 0, 15595); -- Lord Victor Nefarius (Area: Blackwing Descent - Difficulty: 4) (Auras: ) + +DELETE FROM `creature_addon` WHERE `guid`= @CGUID+0; +INSERT INTO `creature_addon` (`guid`, `auras`) VALUES +(@CGUID+0, '41577'); + +-- Serverside Spells +DELETE FROM `spell_dbc` WHERE `Id` IN (41577, 94991, 75688, 75771, 75791, 75769, 75695); +INSERT INTO `spell_dbc` (`Id`, `CastingTimeIndex`, `DurationIndex`, `RangeIndex`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `Comment`) VALUES +(41577, 1, 21, 1, 0x00000110, 0x10000000, 0x00000001, 0x00100000, '(Serverside/Non-DB2) Transform: Invisible Stalker'); + +DELETE FROM `spelleffect_dbc` WHERE `Id`= 160106; +INSERT INTO `spelleffect_dbc` (`Id`, `Effect`, `EffectAura`, `EffectBasePoints`, `EffectMiscValue`, `EffectMiscValueB`, `EffectRadiusIndex`, `EffectRadiusMaxIndex`, `EffectImplicitTargetA`, `EffectImplicitTargetB`, `SpellID`, `EffectIndex`, `Comment`) VALUES +(160106, 6, 56, 1, 57478, 0, 0, 0, 1, 0, 41577, 0, ''); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.cpp index f07e1fccb7d..698b45345c3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.cpp @@ -23,10 +23,163 @@ #include "Spell.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Map.h" +#include "PassiveAI.h" #include "Player.h" #include "InstanceScript.h" #include "blackwing_descent.h" +enum LordVictorNefarius +{ + // Spells + SPELL_MOCKING_SHADOWS = 91307, + SPELL_TELEPORT_VISUAL_ONLY = 41232, + SPELL_SHADOW_WHIP = 91304, + + // Texts + SAY_INTRODUCTION = 0, + SAY_STOP_FEUD = 1, + SAY_PHASE_2 = 2, + SAY_CHIMAERON_LOST = 3, + SAY_ENTRANCE_INTRO_HEROIC = 4, + SAY_ENTRANCE_INTRO_NORMAL = 5, + SAY_MAGMAW_DEFEATED = 6, + SAY_OMNOTRON_DEFEATED = 7, + SAY_CHIMAERON_DEFEATED = 8, + SAY_ATRAMEDES_DEFEATED = 9, + SAY_MALORIAK_DEFEATED = 10, + + // Actions + ACTION_STOP_FEUD = 1, + ACTION_ENTER_PHASE_2 = 2, + ACTION_CHIMAERON_DEFEATED = 3, + + // Events + EVENT_INTRODUCE_CHIMAERON = 1, + EVENT_MOCKING_SHADOWS, + EVENT_TALK_CHIMAERON_DIED, + EVENT_TELEPORT_AWAY, + EVENT_TALK_INTRO_NORMAL, + EVENT_TALK_INTRO_HEROIC, + EVENT_TALK_BOSS_DEFEATED, + +}; + +struct npc_bwd_lord_victor_nefarius : public NullCreatureAI +{ + npc_bwd_lord_victor_nefarius(Creature* creature) : NullCreatureAI(creature), _talkTextId(0) { } + + void IsSummonedBy(Unit* summoner) override + { + if (summoner && summoner->GetEntry() == BOSS_CHIMAERON) + { + _events.ScheduleEvent(EVENT_INTRODUCE_CHIMAERON, 4s); + DoCastSelf(SPELL_TELEPORT_VISUAL_ONLY); + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_INTRODUCE_CHIMAERON: + Talk(SAY_INTRODUCTION); + break; + case EVENT_MOCKING_SHADOWS: + Talk(SAY_PHASE_2); + DoCastSelf(SPELL_MOCKING_SHADOWS); + me->AddAura(SPELL_MOCKING_SHADOWS, me); // Tempfix until player only attribute spells accept creatures as original caster + break; + case EVENT_TALK_CHIMAERON_DIED: + Talk(SAY_CHIMAERON_LOST); + _events.ScheduleEvent(EVENT_TELEPORT_AWAY, 6s); + break; + case EVENT_TELEPORT_AWAY: + DoCastSelf(SPELL_TELEPORT_VISUAL_ONLY); + me->DespawnOrUnsummon(2s); + break; + case EVENT_TALK_INTRO_NORMAL: + Talk(SAY_ENTRANCE_INTRO_NORMAL); + me->setActive(false); + break; + case EVENT_TALK_INTRO_HEROIC: + Talk(SAY_ENTRANCE_INTRO_HEROIC); + _events.ScheduleEvent(EVENT_TELEPORT_AWAY, 6s); + break; + case EVENT_TALK_BOSS_DEFEATED: + Talk(_talkTextId); + me->setActive(false); + break; + default: + break; + } + } + } + + void SetData(uint32 type, uint32 data) override + { + if (type == DATA_BOSS_DEFEATED && !me->GetMap()->IsHeroic()) + { + me->setActive(true); + switch (data) + { + case DATA_MAGMAW: _talkTextId = SAY_MAGMAW_DEFEATED; break; + case DATA_OMNOTRON_DEFENSE_SYSTEM: _talkTextId = SAY_OMNOTRON_DEFEATED; break; + case DATA_CHIMAERON: _talkTextId = SAY_CHIMAERON_DEFEATED; break; + case DATA_ATRAMEDES: _talkTextId = SAY_ATRAMEDES_DEFEATED; break; + case DATA_MALORIAK: _talkTextId = SAY_MALORIAK_DEFEATED; break; + default: + break; + } + _events.ScheduleEvent(EVENT_TALK_BOSS_DEFEATED, 15s); + } + else if (type == DATA_HEROES_ENTERED_HALLS) + { + me->setActive(true); + if (me->GetMap()->IsHeroic()) + { + DoCastSelf(SPELL_TELEPORT_VISUAL_ONLY); + _events.ScheduleEvent(EVENT_TALK_INTRO_HEROIC, 3s); + } + else + _events.ScheduleEvent(EVENT_TALK_INTRO_NORMAL, 12s); + } + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_ENTER_PHASE_2: + _events.ScheduleEvent(EVENT_MOCKING_SHADOWS, 1ms); + break; + case ACTION_CHIMAERON_DEFEATED: + // This is only going to be triggered on heroic difficulty + me->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); + _events.Reset(); + _events.ScheduleEvent(EVENT_TALK_CHIMAERON_DIED, 2s + 500ms); + break; + case ACTION_STOP_FEUD: + Talk(SAY_STOP_FEUD); + DoCastSelf(SPELL_SHADOW_WHIP); + break; + default: + break; + } + } + +private: + EventMap _events; + uint8 _talkTextId; +}; + struct go_bwd_ancient_bell : public GameObjectAI { go_bwd_ancient_bell(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { } @@ -84,14 +237,14 @@ class spell_bwd_dragon_orb : public SpellScript } }; -class at_bwd_intro: public AreaTriggerScript +class at_bwd_intro: public OnlyOnceAreaTriggerScript { public: - at_bwd_intro() : AreaTriggerScript("at_bwd_intro") { } + at_bwd_intro() : OnlyOnceAreaTriggerScript("at_bwd_intro") { } - bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) + bool _OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) { - if (InstanceScript * instance = player->GetInstanceScript()) + if (InstanceScript* instance = player->GetInstanceScript()) instance->SetData(DATA_ENTRANCE_INTRO, IN_PROGRESS); return true; } @@ -99,6 +252,7 @@ class at_bwd_intro: public AreaTriggerScript void AddSC_blackwing_descent() { + RegisterBlackwingDescentCreatureAI(npc_bwd_lord_victor_nefarius); RegisterGameObjectAI(go_bwd_ancient_bell); RegisterSpellScript(spell_bwd_dragon_orb); new at_bwd_intro(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.h index 65a802b4e0b..ceb14ecdeb3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/blackwing_descent.h @@ -42,6 +42,9 @@ enum BWDDataTypes DATA_ATRAMEDES_INTRO, DATA_ENTRANCE_INTRO, DATA_NEFARIAN_ACHIEVEMENT_STATE, + DATA_LORD_VICTOR_NEFARIUS_GENERIC, + DATA_BOSS_DEFEATED, + DATA_HEROES_ENTERED_HALLS, // Encounter Data /*Magmaw*/ @@ -62,7 +65,6 @@ enum BWDDataTypes /*Chimaeron*/ DATA_BILE_O_TRON_800, DATA_FINKLE_EINHORN, - DATA_LORD_VICTOR_NEFARIUS_CHIMAERON, /*Maloriak*/ DATA_CAULDRON_TRIGGER, @@ -128,7 +130,6 @@ enum BWDCreatureIds /*Chimaeron*/ NPC_FINKLE_EINHORN = 44202, NPC_BILE_O_TRON_800 = 44418, - NPC_LORD_VICTOR_NEFARIUS_CHIMAERON = 48964, /*Maloriak*/ NPC_CAULDRON_TRIGGER = 41505, @@ -159,7 +160,8 @@ enum BWDCreatureIds NPC_SPIRIT_OF_IRONSTAR = 43127, NPC_SPIRIT_OF_THAURISSAN = 43126, NPC_SPIRIT_OF_BURNINGEYE = 43130, - NPC_COLUMN_OF_LIGHT = 51506 + NPC_COLUMN_OF_LIGHT = 51506, + NPC_LORD_VICTOR_NEFARIUS_GENERIC = 48964 }; enum BWDGameObjectIds diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_chimaeron.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_chimaeron.cpp index ca41cf22b9b..4b4108d643b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_chimaeron.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_chimaeron.cpp @@ -38,7 +38,6 @@ enum Spells SPELL_MASSACRE = 82848, SPELL_DOUBLE_ATTACK = 88826, SPELL_DOUBLE_ATTACK_TRIGGERED = 82882, - //SPELL_GUARDIAN_TAUNT = 85667, Todo: research me SPELL_MORTALITY_1 = 82890, SPELL_MORTALITY_2 = 82934, SPELL_FEUD = 88872, @@ -48,12 +47,7 @@ enum Spells SPELL_FINKLES_MIXTURE_VISUAL = 91106, SPELL_SYSTEM_FAILURE = 88853, SPELL_REROUTE_POWER = 88861, - SPELL_SHUT_DOWN = 90405, - - // Lord Victor Nefarius - SPELL_MOCKING_SHADOWS = 91307, - SPELL_TELEPORT_VISUAL_ONLY = 41232, - SPELL_SHADOW_WHIP = 91304 + SPELL_SHUT_DOWN = 90405 }; enum Texts @@ -73,14 +67,7 @@ enum Texts SAY_ACTIVATED = 0, SAY_KNOCKED_OUT = 1, SAY_ONLINE = 2, - SAY_SHUT_DOWN = 3, - - // Lord Victor Nefarius - SAY_INTRODUCTION = 0, - SAY_STOP_FEUD = 1, - SAY_PHASE_2 = 2, - SAY_CHIMAERON_LOST = 3, - SAY_ENTRANCE_INTRO_HEROIC = 4 + SAY_SHUT_DOWN = 3 }; enum Phases @@ -107,13 +94,6 @@ enum Events // Bile-O-Tron 800 EVENT_SHUT_DOWN, - - // Lord Victor Nefarius - EVENT_INTRODUCE_CHIMAERON = 1, - EVENT_MOCKING_SHADOWS, - EVENT_TALK_CHIMAERON_DIED, - EVENT_TELEPORT_AWAY, - EVENT_TALK_HEROIC_INTRO }; enum Actions @@ -183,7 +163,7 @@ struct boss_chimaeron : public BossAI events.ScheduleEvent(EVENT_MASSACRE, 26s, 0, PHASE_1); if (IsHeroic()) - DoSummon(NPC_LORD_VICTOR_NEFARIUS_CHIMAERON, LordVictorNefariusSummonPosition, 0, TEMPSUMMON_MANUAL_DESPAWN); + DoSummon(NPC_LORD_VICTOR_NEFARIUS_GENERIC, LordVictorNefariusSummonPosition, 0, TEMPSUMMON_MANUAL_DESPAWN); if (Creature * finkle = instance->GetCreature(DATA_FINKLE_EINHORN)) if (finkle->IsAIEnabled) @@ -202,8 +182,9 @@ struct boss_chimaeron : public BossAI if (Creature* finkle = instance->GetCreature(DATA_FINKLE_EINHORN)) finkle->DespawnOrUnsummon(0ms, 30s); - if (Creature* nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_CHIMAERON)) - nefarius->DespawnOrUnsummon(); + if (IsHeroic()) + if (Creature* nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) + nefarius->DespawnOrUnsummon(); _DespawnAtEvade(); } @@ -222,9 +203,10 @@ struct boss_chimaeron : public BossAI if (finkle->IsAIEnabled) finkle->AI()->DoAction(ACTION_CHIMAERON_DIED); - if (Creature * nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_CHIMAERON)) - if (nefarius->IsAIEnabled) - nefarius->AI()->DoAction(ACTION_CHIMAERON_DEFEATED); + if (IsHeroic()) + if (Creature* nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) + if (nefarius->IsAIEnabled) + nefarius->AI()->DoAction(ACTION_CHIMAERON_DEFEATED); } @@ -246,9 +228,10 @@ struct boss_chimaeron : public BossAI DoCastAOE(SPELL_MORTALITY_1, true); DoCastSelf(SPELL_MORTALITY_2, true); - if (Creature * nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_CHIMAERON)) - if (nefarius->IsAIEnabled) - nefarius->AI()->DoAction(ACTION_ENTER_PHASE_2); + if (IsHeroic()) + if (Creature* nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) + if (nefarius->IsAIEnabled) + nefarius->AI()->DoAction(ACTION_ENTER_PHASE_2); } } @@ -306,7 +289,7 @@ struct boss_chimaeron : public BossAI case ACTION_START_FEUD: _isInFeud = true; if (IsHeroic()) - if (Creature * nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_CHIMAERON)) + if (Creature* nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) if (nefarius->IsAIEnabled) nefarius->AI()->DoAction(ACTION_STOP_FEUD); break; @@ -322,7 +305,7 @@ struct boss_chimaeron : public BossAI { switch (summon->GetEntry()) { - case NPC_LORD_VICTOR_NEFARIUS_CHIMAERON: + case NPC_LORD_VICTOR_NEFARIUS_GENERIC: break; default: summons.Summon(summon); @@ -543,82 +526,6 @@ private: InstanceScript* _instance; }; -struct npc_chimaeron_lord_victor_nefarius : public NullCreatureAI -{ - npc_chimaeron_lord_victor_nefarius(Creature* creature) : NullCreatureAI(creature), _instance(me->GetInstanceScript()) { } - - void JustAppeared() override - { - DoCastSelf(SPELL_TELEPORT_VISUAL_ONLY); - if (me->FindNearestCreature(BOSS_CHIMAERON, 50.0f, true)) - _events.ScheduleEvent(EVENT_INTRODUCE_CHIMAERON, 4s); - else - _events.ScheduleEvent(EVENT_TALK_HEROIC_INTRO, 3s); - } - - void UpdateAI(uint32 diff) override - { - _events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_INTRODUCE_CHIMAERON: - Talk(SAY_INTRODUCTION); - break; - case EVENT_MOCKING_SHADOWS: - Talk(SAY_PHASE_2); - DoCastSelf(SPELL_MOCKING_SHADOWS); - me->AddAura(SPELL_MOCKING_SHADOWS, me); // Tempfix until player only attribute spells accept creatures as original caster - break; - case EVENT_TALK_CHIMAERON_DIED: - Talk(SAY_CHIMAERON_LOST); - _events.ScheduleEvent(EVENT_TELEPORT_AWAY, 6s); - break; - case EVENT_TELEPORT_AWAY: - DoCastSelf(SPELL_TELEPORT_VISUAL_ONLY); - me->DespawnOrUnsummon(2s); - break; - case EVENT_TALK_HEROIC_INTRO: - Talk(SAY_ENTRANCE_INTRO_HEROIC); - _events.ScheduleEvent(EVENT_TELEPORT_AWAY, 6s); - break; - default: - break; - } - } - } - - void DoAction(int32 action) override - { - switch (action) - { - case ACTION_ENTER_PHASE_2: - _events.ScheduleEvent(EVENT_MOCKING_SHADOWS, 1ms); - break; - case ACTION_CHIMAERON_DEFEATED: - me->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); - _events.Reset(); - _events.ScheduleEvent(EVENT_TALK_CHIMAERON_DIED, 2s + 500ms); - break; - case ACTION_STOP_FEUD: - Talk(SAY_STOP_FEUD); - DoCastSelf(SPELL_SHADOW_WHIP); - break; - default: - break; - } - } - -private: - EventMap _events; - InstanceScript* _instance; -}; - class spell_chimaeron_caustic_slime_targeting : public SpellScript { PrepareSpellScript(spell_chimaeron_caustic_slime_targeting); @@ -826,7 +733,6 @@ void AddSC_boss_chimaeron() RegisterBlackwingDescentCreatureAI(boss_chimaeron); RegisterBlackwingDescentCreatureAI(npc_chimaeron_finkle_einhorn); RegisterBlackwingDescentCreatureAI(npc_chimaeron_bile_o_tron); - RegisterBlackwingDescentCreatureAI(npc_chimaeron_lord_victor_nefarius); RegisterSpellScript(spell_chimaeron_caustic_slime_targeting); RegisterSpellScript(spell_chimaeron_caustic_slime); RegisterAuraScript(spell_chimaeron_double_attack); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp index 3f178e05dd7..03aed4e91b5 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp @@ -45,9 +45,9 @@ ObjectData const creatureData[] = { NPC_LORD_VICTOR_NEFARIUS_ATRAMEDES, DATA_LORD_VICTOR_NEFARIUS_ATRAMEDES }, { NPC_BILE_O_TRON_800, DATA_BILE_O_TRON_800 }, { NPC_FINKLE_EINHORN, DATA_FINKLE_EINHORN }, - { NPC_LORD_VICTOR_NEFARIUS_CHIMAERON, DATA_LORD_VICTOR_NEFARIUS_CHIMAERON }, { NPC_CAULDRON_TRIGGER, DATA_CAULDRON_TRIGGER }, { NPC_LORD_VICTOR_NEFARIUS_MALORIAK, DATA_LORD_VICTOR_NEFARIUS_MALORIAK }, + { NPC_LORD_VICTOR_NEFARIUS_GENERIC, DATA_LORD_VICTOR_NEFARIUS_GENERIC }, { NPC_LORD_VICTOR_NEFARIUS_NEFARIANS_END, DATA_LORD_VICTOR_NEFARIUS_NEFARIANS_END }, { NPC_INVISIBLE_STALKER, DATA_INVISIBLE_STALKER }, { NPC_NEFARIANS_LIGHTNING_MACHINE, DATA_NEFARIANS_LIGHTNING_MACHINE }, @@ -91,6 +91,7 @@ enum Events enum Actions { + // Instance Actions ACTION_START_ATRAMEDES_INTRO = 0 }; @@ -120,7 +121,6 @@ class instance_blackwing_descent : public InstanceMapScript LoadDoorData(doorData); _deadDwarfSpirits = 0; _atramedesIntroState = NOT_STARTED; - _entranceSequenceDone = false; _nefarianAchievementEligible = true; _nefariansEndIntroDone = false; } @@ -258,9 +258,22 @@ class instance_blackwing_descent : public InstanceMapScript stalker->DespawnOrUnsummon(0s, 30s); } + if (state == DONE) + if (Creature* nefarius = GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) + if (nefarius->IsAIEnabled) + nefarius->AI()->SetData(DATA_BOSS_DEFEATED, type); + _roomStalkerGUIDs.clear(); } break; + case DATA_OMNOTRON_DEFENSE_SYSTEM: + case DATA_CHIMAERON: + case DATA_MALORIAK: + if (state == DONE) + if (Creature* nefarius = GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) + if (nefarius->IsAIEnabled) + nefarius->AI()->SetData(DATA_BOSS_DEFEATED, type); + break; case DATA_ATRAMEDES: if (state == FAIL) { @@ -268,7 +281,12 @@ class instance_blackwing_descent : public InstanceMapScript instance->SpawnGroupDespawn(SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS, false); } else if (state == DONE) + { instance->SpawnGroupDespawn(SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS, false); + if (Creature* nefarius = GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC)) + if (nefarius->IsAIEnabled) + nefarius->AI()->SetData(DATA_BOSS_DEFEATED, type); + } break; case DATA_NEFARIANS_END: if (state == FAIL) @@ -325,15 +343,17 @@ class instance_blackwing_descent : public InstanceMapScript SaveToDB(); break; case DATA_ENTRANCE_INTRO: - if (!_entranceSequenceDone) - { - if (instance->IsHeroic()) - { - instance->SummonCreature(NPC_LORD_VICTOR_NEFARIUS_CHIMAERON, LordVictorNefariusIntroPosition); - _entranceSequenceDone = true; - } - } + { + Creature* nefarius = nullptr; + if (instance->IsHeroic()) + nefarius = instance->SummonCreature(NPC_LORD_VICTOR_NEFARIUS_GENERIC, LordVictorNefariusIntroPosition); + else + nefarius = GetCreature(DATA_LORD_VICTOR_NEFARIUS_GENERIC); + + if (nefarius && nefarius->IsAIEnabled) + nefarius->AI()->SetData(DATA_HEROES_ENTERED_HALLS, DONE); break; + } case DATA_NEFARIAN_ACHIEVEMENT_STATE: _nefarianAchievementEligible = uint8(data); DoUpdateWorldState(WS_KEEPING_IT_IN_THE_FAMILY, uint8(_nefarianAchievementEligible)); @@ -419,6 +439,8 @@ class instance_blackwing_descent : public InstanceMapScript break; } + default: + break; } return ObjectGuid::Empty; @@ -489,7 +511,6 @@ class instance_blackwing_descent : public InstanceMapScript GuidVector _atramedesIntroGUIDs; uint8 _deadDwarfSpirits; uint8 _atramedesIntroState; - bool _entranceSequenceDone; bool _nefarianAchievementEligible; bool _nefariansEndIntroDone;