Scripts/BWD: initial work on Nefarian's End encounter
This commit is contained in:
1 parent
2bacebe93b
commit
6aac908192
7 files changed
+976
-80
No files matched your search
@@ -0,0 +1,104 @@
|
||||
-- Template Updates
|
||||
-- Nefarian
|
||||
UPDATE `creature_template` SET `ScriptName`= 'boss_nefarians_end' WHERE `entry`= 41376;
|
||||
UPDATE `creature_template` SET `flags_extra`= 512 WHERE `entry` IN (41376, 51104, 51105, 51106);
|
||||
-- Onyxia
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_nefarians_end_onyxia' WHERE `entry`= 41270;
|
||||
UPDATE `creature_template` SET `unit_flags2`= 134219776 WHERE `entry`= 41270;
|
||||
|
||||
-- Lord Victor Nefarius
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_nefarians_end_lord_victor_nefarius' WHERE `entry`= 41379;
|
||||
-- Orb of Culmination
|
||||
UPDATE `gameobject_template` SET `ScriptName`= 'go_nefarians_end_orb_of_culmination' WHERE `entry`= 203254;
|
||||
|
||||
|
||||
-- Spell Scripts
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_bwd_dragon_orb',
|
||||
'spell_nefarians_end_electrical_charge',
|
||||
'spell_nefarians_end_lightning_discharge_triggered_periodic_aura');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(78219, 'spell_bwd_dragon_orb'),
|
||||
(78220, 'spell_bwd_dragon_orb'),
|
||||
(78949, 'spell_nefarians_end_electrical_charge'),
|
||||
(95793, 'spell_nefarians_end_electrical_charge'),
|
||||
(77832, 'spell_nefarians_end_lightning_discharge_triggered_periodic_aura');
|
||||
|
||||
-- Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (81198, 81159, 81174, 81176, 81158, 81175, 81177) AND `SourceTypeOrReferenceId`= 13;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 81198, 0, 0, 31, 0, 3, 42844, 0, 0, 0, '', 'Electrocute - Target Invisible Stalker'),
|
||||
(13, 1, 81159, 0, 0, 31, 0, 3, 41270, 0, 0, 0, '', 'Chains A Steel - Target Onyxia'),
|
||||
(13, 1, 81174, 0, 0, 31, 0, 3, 41270, 0, 0, 0, '', 'Chains B Steel - Target Onyxia'),
|
||||
(13, 1, 81176, 0, 0, 31, 0, 3, 41270, 0, 0, 0, '', 'Chains C Steel - Target Onyxia'),
|
||||
(13, 1, 81158, 0, 0, 31, 0, 3, 41270, 0, 0, 0, '', 'Chains A Lightning - Target Onyxia'),
|
||||
(13, 1, 81175, 0, 0, 31, 0, 3, 41270, 0, 0, 0, '', 'Chains B Lightning - Target Onyxia'),
|
||||
(13, 1, 81177, 0, 0, 31, 0, 3, 41270, 0, 0, 0, '', 'Chains C Lightning - Target Onyxia');
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` IN (41379, 41376);
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `comment`) VALUES
|
||||
-- Nefarian
|
||||
(41376, 0, 0, 'The air crackles with electricity!', 41, 0, 100, 0, 0, 0, 43521, 'Nefarian to Player'),
|
||||
-- Lord Victor Nefarius
|
||||
(41379, 0, 0, 'Ha ha ha ha ha! The heroes have made it to the glorious finale. I take it you are in good spirits? Prepared for the final battle? Then gaze now upon my ultimate creation! RISE, SISTER!', 14, 0, 100, 1, 0, 20066, 41762, 'Lord Victor Nefarius to Player'),
|
||||
(41379, 1, 0, 'Behold the brood mother, Onyxia, REBORN! Perhaps my finest work.', 14, 0, 100, 22, 0, 20070, 49416, 'Lord Victor Nefarius to Player'),
|
||||
(41379, 2, 0, 'My dearest sibling, do you hunger? THEN FEAST UPON OUR ENEMIES!', 14, 0, 100, 22, 0, 20071, 49417, 'Lord Victor Nefarius to Player');
|
||||
UPDATE `creature_text` SET `TextRange`= 3 WHERE `CreatureID` IN (41379, 41376);
|
||||
|
||||
-- Addons
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN (35592, 41376, 51104, 51105, 51106, 41270);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `bytes2`, `auras`) VALUES
|
||||
(35592, 0, '78173'),
|
||||
-- Nefarian
|
||||
(41376, 1, '94132'),
|
||||
(51104, 1, '94132'),
|
||||
(51105, 1, '94132'),
|
||||
(51106, 1, '94132'),
|
||||
-- Onyxia
|
||||
(41270, 1, '94132 29266');
|
||||
|
||||
-- Spawn Groups
|
||||
DELETE FROM `creature_summon_groups` WHERE `summonerId`= 41376 AND `summonerType`= 0;
|
||||
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES
|
||||
(41376, 0, 0, 41270, -107.324, -224.6647, -7.330293, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -143.6852, -249.2931, -5.34586, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -111.4442, -268.6278, -5.34586, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -67.22468, -244.3953, -5.34586, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -66.85265, -205.3938, -5.34586, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -108.5982, -180.2777, -5.34586, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -143.3391, -199.5975, -5.34586, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42844, -107.2374, -224.5609, -7.330293, 3.141593, 8, 0),
|
||||
(41376, 0, 0, 42098, -141.3331, -224.6247, 1.512104, 0, 8, 0),
|
||||
(41376, 0, 0, 42098, -90.35625, -253.4714, 1.46139, 2.111848, 8, 0),
|
||||
(41376, 0, 0, 42098, -90.22045, -195.6071, 1.505078, 4.118977, 8, 0);
|
||||
|
||||
-- Spawns
|
||||
SET @OGUID := 239510;
|
||||
DELETE FROM `gameobject` WHERE `guid`= @OGUID;
|
||||
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
|
||||
(@OGUID+0, 203254, 669, 5094, 0, 15, 169, 0, -27.84375, -224.4774, 63.30268, 6.265733, 0, 0, -0.00872612, 0.9999619, 7200, 255, 1, 26365); -- Orb of Culmination (Area: 0 - Difficulty: 6)
|
||||
|
||||
SET @CGUID := 259779;
|
||||
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+1;
|
||||
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, 35592, 669, 5094, 0, 15, 169, 0, 0, 0, -27.80208, -224.4497, 63.34686, 6.248279, 7200, 0, 0, 0, 0, 0, 0, 0, 0, 26365), -- Invisible Stalker (Float, Uninteractible, GiganticAOI) (Area: 0 - Difficulty: 6) (Auras: 78173 - Dragon Orb)
|
||||
(@CGUID+1, 42098, 669, 5094, 0, 15, 169, 0, 0, 0, -166.655, -224.602, 40.48163, 0, 7200, 0, 0, 0, 0, 0, 0, 0, 0, 26365); -- Invisible Stalker (Cataclysm Boss, Ignore Combat, Floating) (Area: 0 - Difficulty: 6) (Auras: 78495 - Aura of Dread)
|
||||
|
||||
DELETE FROM `creature_addon` WHERE `guid`= @CGUID+1;
|
||||
INSERT INTO `creature_addon` (`guid`, `auras`) VALUES
|
||||
(@CGUID+1, '78495');
|
||||
|
||||
-- Spawn Groups
|
||||
DELETE FROM `instance_spawn_groups` WHERE `instanceMapId`= 669;
|
||||
UPDATE `spawn_group_template` SET `groupFlags`= 4 WHERE `groupId`= 402;
|
||||
DELETE FROM `spawn_group` WHERE `groupId`= 402 AND `spawnType`= 1 AND `spawnId`= @OGUID;
|
||||
DELETE FROM `spawn_group` WHERE `groupId`= 402 AND `spawnType`= 0 AND `spawnId` BETWEEN @CGUID+0 AND @CGUID+1;
|
||||
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES
|
||||
(402, 1, @OGUID),
|
||||
(402, 0, @CGUID+0),
|
||||
(402, 0, @CGUID+1);
|
||||
|
||||
-- Npc Text
|
||||
UPDATE `npc_text` SET `text0_0`= 'A large humanoid hand print is embedded on the surface of the orb. A soft green glow seems to pulse within.', `BroadcastTextID0`= 41760 WHERE `ID`= 16139;
|
||||
@@ -5474,6 +5474,44 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO;
|
||||
});
|
||||
|
||||
// Dragon Orb
|
||||
ApplySpellFix({
|
||||
78219,
|
||||
78220
|
||||
}, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].MaxRadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_4_YARDS);
|
||||
});
|
||||
|
||||
// Shadowflame Breath
|
||||
ApplySpellFix({
|
||||
77826,
|
||||
94124,
|
||||
94125,
|
||||
94126,
|
||||
}, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_1].Amplitude = 1500;
|
||||
});
|
||||
|
||||
// Electrical Charge
|
||||
ApplySpellFix({ 78949 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].Amplitude = 3000;
|
||||
});
|
||||
|
||||
// Lightning Discharge
|
||||
ApplySpellFix({
|
||||
81435,
|
||||
81436,
|
||||
81437,
|
||||
81438,
|
||||
}, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].MaxRadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_18_YARDS);
|
||||
});
|
||||
|
||||
|
||||
// ENDOF BLACKWING DESCENT SPELLS
|
||||
|
||||
// Living Bomb
|
||||
|
||||
+35
@@ -52,6 +52,40 @@ private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
enum DragonOrb
|
||||
{
|
||||
SPELL_DRAGON_ORB_1 = 78219
|
||||
};
|
||||
|
||||
Position const DragonOrb1Offset = { -28.80208f, -216.4497f, 71.34686f };
|
||||
Position const DragonOrb2Offset = { -28.80208f, -232.4497f, 71.34686f };
|
||||
|
||||
class spell_bwd_dragon_orb : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_bwd_dragon_orb);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DRAGON_ORB_1 });
|
||||
}
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
if (GetSpellInfo()->Id == SPELL_DRAGON_ORB_1)
|
||||
dest.Relocate(DragonOrb1Offset);
|
||||
else
|
||||
dest.Relocate(DragonOrb2Offset);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_bwd_dragon_orb::SetDest, EFFECT_0, TARGET_DEST_CASTER_RANDOM);
|
||||
}
|
||||
};
|
||||
|
||||
class at_bwd_intro: public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
@@ -68,5 +102,6 @@ class at_bwd_intro: public AreaTriggerScript
|
||||
void AddSC_blackwing_descent()
|
||||
{
|
||||
RegisterGameObjectAI(go_bwd_ancient_bell);
|
||||
RegisterSpellScript(spell_bwd_dragon_orb);
|
||||
new at_bwd_intro();
|
||||
}
|
||||
+70
-55
@@ -66,78 +66,92 @@ enum BWDDataTypes
|
||||
/*Maloriak*/
|
||||
DATA_CAULDRON_TRIGGER,
|
||||
DATA_CAULDRON,
|
||||
DATA_LORD_VICTOR_NEFARIUS_MALORIAK
|
||||
DATA_LORD_VICTOR_NEFARIUS_MALORIAK,
|
||||
|
||||
/*Nefarian's End*/
|
||||
DATA_LORD_VICTOR_NEFARIUS_NEFARIANS_END,
|
||||
DATA_INVISIBLE_STALKER,
|
||||
DATA_BLACKWING_ELEVATOR_ONYXIA,
|
||||
DATA_NEFARIANS_LIGHTNING_MACHINE,
|
||||
DATA_ONYXIA,
|
||||
};
|
||||
|
||||
enum BWDCreatureIds
|
||||
{
|
||||
// Bosses
|
||||
BOSS_MAGMAW = 41570,
|
||||
BOSS_OMNOTRON = 42186,
|
||||
BOSS_CHIMAERON = 43296,
|
||||
BOSS_ATRAMEDES = 41442,
|
||||
BOSS_MALORIAK = 41378,
|
||||
BOSS_NEFARIAN = 41376,
|
||||
BOSS_MAGMAW = 41570,
|
||||
BOSS_OMNOTRON = 42186,
|
||||
BOSS_CHIMAERON = 43296,
|
||||
BOSS_ATRAMEDES = 41442,
|
||||
BOSS_MALORIAK = 41378,
|
||||
BOSS_NEFARIAN = 41376,
|
||||
|
||||
// Encounter related creatures
|
||||
/*Magmaw*/
|
||||
NPC_MAGMAWS_PINCER_1 = 41620,
|
||||
NPC_MAGMAWS_PINCER_2 = 41789,
|
||||
NPC_EXPOSED_HEAD_OF_MAGMAW = 42347,
|
||||
NPC_EXPOSED_HEAD_OF_MAGMAW_2 = 48270,
|
||||
NPC_PILLAR_OF_FLAME = 41843,
|
||||
NPC_LAVA_PARASITE_1 = 41806,
|
||||
NPC_LAVA_PARASITE_2 = 42321,
|
||||
NPC_MASSIVE_CRASH = 47330,
|
||||
NPC_ROOM_STALKER = 47196,
|
||||
NPC_MAGMAW_SPIKE_STALKER = 41767,
|
||||
NPC_NEFARIAN_MAGMAW = 49427,
|
||||
NPC_BLAZING_BONE_CONSTRUCT = 49416,
|
||||
NPC_IGNITION = 49447,
|
||||
NPC_MAGMAWS_PINCER_1 = 41620,
|
||||
NPC_MAGMAWS_PINCER_2 = 41789,
|
||||
NPC_EXPOSED_HEAD_OF_MAGMAW = 42347,
|
||||
NPC_EXPOSED_HEAD_OF_MAGMAW_2 = 48270,
|
||||
NPC_PILLAR_OF_FLAME = 41843,
|
||||
NPC_LAVA_PARASITE_1 = 41806,
|
||||
NPC_LAVA_PARASITE_2 = 42321,
|
||||
NPC_MASSIVE_CRASH = 47330,
|
||||
NPC_ROOM_STALKER = 47196,
|
||||
NPC_MAGMAW_SPIKE_STALKER = 41767,
|
||||
NPC_NEFARIAN_MAGMAW = 49427,
|
||||
NPC_BLAZING_BONE_CONSTRUCT = 49416,
|
||||
NPC_IGNITION = 49447,
|
||||
|
||||
/*Omnotron Defense System*/
|
||||
NPC_MAGMATRON = 42178,
|
||||
NPC_ARCANOTRON = 42166,
|
||||
NPC_TOXITRON = 42180,
|
||||
NPC_ELECTRON = 42179,
|
||||
NPC_CHEMICAL_CLOUD = 42934,
|
||||
NPC_POISON_BOMB = 42897,
|
||||
NPC_POISON_PUDDLE = 42920,
|
||||
NPC_POWER_GENERATOR = 42733,
|
||||
NPC_LORD_VICTOR_NEFARIUS_OMNOTRON = 49226,
|
||||
NPC_MAGMATRON = 42178,
|
||||
NPC_ARCANOTRON = 42166,
|
||||
NPC_TOXITRON = 42180,
|
||||
NPC_ELECTRON = 42179,
|
||||
NPC_CHEMICAL_CLOUD = 42934,
|
||||
NPC_POISON_BOMB = 42897,
|
||||
NPC_POISON_PUDDLE = 42920,
|
||||
NPC_POWER_GENERATOR = 42733,
|
||||
NPC_LORD_VICTOR_NEFARIUS_OMNOTRON = 49226,
|
||||
|
||||
/*Atramedes*/
|
||||
NPC_SONAR_PULSE = 41546,
|
||||
NPC_SONAR_PULSE_BOMB = 49623,
|
||||
NPC_TRACKING_FLAMES = 41879,
|
||||
NPC_REVERBERATING_FLAME = 41962,
|
||||
NPC_LORD_VICTOR_NEFARIUS_ATRAMEDES = 49580,
|
||||
NPC_OBNOXIOUS_FIEND = 49740,
|
||||
NPC_SONAR_PULSE = 41546,
|
||||
NPC_SONAR_PULSE_BOMB = 49623,
|
||||
NPC_TRACKING_FLAMES = 41879,
|
||||
NPC_REVERBERATING_FLAME = 41962,
|
||||
NPC_LORD_VICTOR_NEFARIUS_ATRAMEDES = 49580,
|
||||
NPC_OBNOXIOUS_FIEND = 49740,
|
||||
|
||||
/*Chimaeron*/
|
||||
NPC_FINKLE_EINHORN = 44202,
|
||||
NPC_BILE_O_TRON_800 = 44418,
|
||||
NPC_LORD_VICTOR_NEFARIUS_CHIMAERON = 48964,
|
||||
NPC_FINKLE_EINHORN = 44202,
|
||||
NPC_BILE_O_TRON_800 = 44418,
|
||||
NPC_LORD_VICTOR_NEFARIUS_CHIMAERON = 48964,
|
||||
|
||||
/*Maloriak*/
|
||||
NPC_CAULDRON_TRIGGER = 41505,
|
||||
NPC_ABERRATION = 41440,
|
||||
NPC_PRIME_SUBJECT = 41841,
|
||||
NPC_FLASH_FREEZE = 41576,
|
||||
NPC_ABSOLUTE_ZERO = 41961,
|
||||
NPC_LORD_VICTOR_NEFARIUS_MALORIAK = 49799,
|
||||
NPC_VILE_SWILL = 49811,
|
||||
NPC_CAULDRON_TRIGGER = 41505,
|
||||
NPC_ABERRATION = 41440,
|
||||
NPC_PRIME_SUBJECT = 41841,
|
||||
NPC_FLASH_FREEZE = 41576,
|
||||
NPC_ABSOLUTE_ZERO = 41961,
|
||||
NPC_LORD_VICTOR_NEFARIUS_MALORIAK = 49799,
|
||||
NPC_VILE_SWILL = 49811,
|
||||
|
||||
/*Nefarian's End*/
|
||||
NPC_LORD_VICTOR_NEFARIUS_NEFARIANS_END = 41379,
|
||||
NPC_INVISIBLE_STALKER = 35592,
|
||||
NPC_INVISIBLE_STALKER_CATACLYSM_BOSS = 42098,
|
||||
NPC_NEFARIANS_LIGHTNING_MACHINE = 51089,
|
||||
NPC_ONYXIA = 41270,
|
||||
|
||||
/*Events*/
|
||||
NPC_SPIRIT_OF_MOLTENFIST = 43125,
|
||||
NPC_SPIRIT_OF_ANVILRAGE = 43128,
|
||||
NPC_SPIRIT_OF_SHADOWFORGE = 43129,
|
||||
NPC_SPIRIT_OF_COREHAMMER = 43122,
|
||||
NPC_SPIRIT_OF_ANGERFORGE = 43119,
|
||||
NPC_SPIRIT_OF_IRONSTAR = 43127,
|
||||
NPC_SPIRIT_OF_THAURISSAN = 43126,
|
||||
NPC_SPIRIT_OF_BURNINGEYE = 43130,
|
||||
NPC_COLUMN_OF_LIGHT = 51506
|
||||
NPC_SPIRIT_OF_MOLTENFIST = 43125,
|
||||
NPC_SPIRIT_OF_ANVILRAGE = 43128,
|
||||
NPC_SPIRIT_OF_SHADOWFORGE = 43129,
|
||||
NPC_SPIRIT_OF_COREHAMMER = 43122,
|
||||
NPC_SPIRIT_OF_ANGERFORGE = 43119,
|
||||
NPC_SPIRIT_OF_IRONSTAR = 43127,
|
||||
NPC_SPIRIT_OF_THAURISSAN = 43126,
|
||||
NPC_SPIRIT_OF_BURNINGEYE = 43130,
|
||||
NPC_COLUMN_OF_LIGHT = 51506
|
||||
};
|
||||
|
||||
enum BWDGameObjectIds
|
||||
@@ -147,7 +161,8 @@ enum BWDGameObjectIds
|
||||
GO_ATHENAEUM_DOOR = 208291,
|
||||
GO_DOODAD_BLACKROCKV2_LABROOM_CAULDRON_01 = 203306,
|
||||
GO_GROWTH_CHAMBER = 206704,
|
||||
GO_LARGE_GROWTH_CHAMBER = 206705
|
||||
GO_LARGE_GROWTH_CHAMBER = 206705,
|
||||
GO_DOODAD_BLACKWINGV2_ELEVATOR_ONYXIA = 207834
|
||||
};
|
||||
|
||||
enum BWDMisc
|
||||
|
||||
+668
@@ -0,0 +1,668 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "CommonPredicates.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "blackwing_descent.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Nefarian
|
||||
SPELL_INTRO_2_STALKER_TRANSFORM = 78750,
|
||||
SPELL_INTRO_3_SHRINK_AURA = 78753,
|
||||
SPELL_INTRO_4_LIFT_OFF_ANIM_KIT = 78692,
|
||||
SPELL_INTRO_5A_START_FIGHT_PROC = 78730,
|
||||
SPELL_ELECTRICAL_CHARGE_NEFARIAN = 95793,
|
||||
SPELL_SHADOW_OF_COWARDICE = 79355,
|
||||
|
||||
// Onyxia
|
||||
SPELL_PERMANENT_FEIGN_DEATH = 29266,
|
||||
SPELL_ONYXIA_START_FIGHT_1_PERIODIC = 81516,
|
||||
SPELL_ELECTRICAL_CHARGE_ONYXIA = 78949,
|
||||
SPELL_ELECTRICAL_OVERLOAD = 78999,
|
||||
SPELL_LIGHTNING_DISCHARGE = 78090,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_LEFT_1 = 81435,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_LEFT_2 = 81436,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_RIGHT_1 = 81437,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_RIGHT_2 = 81438,
|
||||
|
||||
|
||||
// Nefarian and Onyxia
|
||||
SPELL_TAIL_LASH = 77827,
|
||||
SPELL_SHADOWFLAME_BREATH = 77826,
|
||||
|
||||
// Nefarian's Lightning Machine
|
||||
SPELL_ELECTROCUTE = 81198,
|
||||
|
||||
// Invisible Stalker (Cataclysm Boss, Ignore Combat, Floating)
|
||||
SPELL_INTRO_1_TRANSFORM_VISUAL = 78205,
|
||||
SPELL_CHAINS_A_STEEL = 81159,
|
||||
SPELL_CHAINS_B_STEEL = 81174,
|
||||
SPELL_CHAINS_C_STEEL = 81176,
|
||||
SPELL_CHAINS_A_LIGHTNING = 81158,
|
||||
SPELL_CHAINS_B_LIGHTNING = 81175,
|
||||
SPELL_CHAINS_C_LIGHTNING = 81177
|
||||
};
|
||||
|
||||
enum Texts
|
||||
{
|
||||
// Nefarian
|
||||
SAY_ANNOUNCE_AIR_CRACKLES = 0,
|
||||
|
||||
// Lord Victor Nefarius
|
||||
SAY_INTRO_1 = 0,
|
||||
SAY_INTRO_2 = 1,
|
||||
SAY_INTRO_3 = 2
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
// Nefarian
|
||||
EVENT_CHAIN_ONYXIA = 1,
|
||||
EVENT_REMOVE_TRANSFORM_AURA,
|
||||
EVENT_LIFT_OFF,
|
||||
EVENT_ANNOUNCE_AIR_CRACKLES,
|
||||
EVENT_MAKE_ATTACKABLE,
|
||||
EVENT_FLY_CYCLIC_PATH,
|
||||
|
||||
// Onyxia
|
||||
EVENT_LIGHTNING_DISCHARGE,
|
||||
EVENT_ELECTRICAL_CHARGE,
|
||||
|
||||
// Nefarian and Onyxia
|
||||
EVENT_TAIL_LASH,
|
||||
EVENT_SHADOWFLAME_BREATH,
|
||||
|
||||
// Lord Victor Nefarius
|
||||
EVENT_TALK_INTRO_2,
|
||||
EVENT_TALK_INTRO_3,
|
||||
EVENT_CAST_TRANSFORM_VISUAL,
|
||||
EVENT_RAISE_ELEVATOR
|
||||
};
|
||||
|
||||
enum Phases
|
||||
{
|
||||
PHASE_ONE = 1,
|
||||
PHASE_TWO = 2,
|
||||
PHASE_THREE = 3
|
||||
};
|
||||
|
||||
enum Actions
|
||||
{
|
||||
// Lord Victor Nefarius
|
||||
ACTION_START_INTRO = 0,
|
||||
|
||||
// Nefarian
|
||||
ACTION_ONYXIA_ENGAGED = 0,
|
||||
|
||||
// Onyxia
|
||||
ACTION_REANIMATED = 0,
|
||||
ACTION_UPDATE_ELECTRICAL_CHARGE = 1,
|
||||
};
|
||||
|
||||
enum TransportStopFrames
|
||||
{
|
||||
TRANSPORT_STOP_FRAME_LOWERED = 0,
|
||||
TRANSPORT_STOP_FRAME_RAISED = 1
|
||||
};
|
||||
|
||||
enum SummonGroups
|
||||
{
|
||||
SUMMON_GROUP_ELEVATOR = 0
|
||||
};
|
||||
|
||||
enum MovePoints
|
||||
{
|
||||
POINT_LIFTOFF = 1,
|
||||
};
|
||||
|
||||
enum EncounterFrames
|
||||
{
|
||||
FRAME_INDEX_ONYXIA = 2,
|
||||
FRAME_INDEX_NEFARIAN = 3
|
||||
};
|
||||
|
||||
struct OnyxiaChainData
|
||||
{
|
||||
Position ComparisonPosition;
|
||||
uint32 ChainSpellId;
|
||||
uint32 LightningSpellId;
|
||||
};
|
||||
|
||||
std::vector<OnyxiaChainData> OnyxiaChainInfo =
|
||||
{
|
||||
{ { -141.3331f, -224.6247f }, SPELL_CHAINS_A_STEEL, SPELL_CHAINS_A_LIGHTNING },
|
||||
{ { -90.35625f, -253.4714f }, SPELL_CHAINS_B_STEEL, SPELL_CHAINS_B_LIGHTNING },
|
||||
{ { -90.22045f, -195.6071f }, SPELL_CHAINS_C_STEEL, SPELL_CHAINS_C_LIGHTNING }
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
SOUND_ID_ROAR = 7274
|
||||
};
|
||||
|
||||
Position const NefarianSummonPosition = { -166.655f, -224.602f, 40.48163f, 0.0f };
|
||||
Position const NefarianLiftOffPosition = { -162.076f, -224.604f, 57.9262f };
|
||||
|
||||
static constexpr uint32 const CyclicPathPoints = 17;
|
||||
Position const NefarianCyclicPath[CyclicPathPoints] =
|
||||
{
|
||||
{ -162.076f, -224.604f, 57.9262f },
|
||||
{ -169.3941f, -250.8021f, 91.78177f },
|
||||
{ -154.9757f, -272.2014f, 92.11506f },
|
||||
{ -132.934f, -286.8906f, 92.25407f },
|
||||
{ -106.7951f, -292.2639f, 93.06911f },
|
||||
{ -81.66319f, -287.3004f, 93.81921f },
|
||||
{ -59.42708f, -272.5538f, 94.29151f },
|
||||
{ -44.60417f, -251.0191f, 94.40255f },
|
||||
{ -39.86979f, -225.0208f, 93.93014f },
|
||||
{ -44.62847f, -198.8733f, 94.15247f },
|
||||
{ -59.65799f, -176.8993f, 94.81911f },
|
||||
{ -81.1875f, -162.474f, 94.70798f },
|
||||
{ -107.0816f, -157.3715f, 94.20808f },
|
||||
{ -132.8073f, -162.3507f, 93.4026f },
|
||||
{ -154.6771f, -177.1233f, 92.95815f },
|
||||
{ -169.151f, -199.1771f, 92.23587f },
|
||||
{ -174.6406f, -225.2222f, 92.31927f }
|
||||
};
|
||||
|
||||
struct boss_nefarians_end : public BossAI
|
||||
{
|
||||
boss_nefarians_end(Creature* creature) : BossAI(creature, DATA_NEFARIANS_END)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void JustAppeared() override
|
||||
{
|
||||
events.SetPhase(PHASE_ONE);
|
||||
events.ScheduleEvent(EVENT_CHAIN_ONYXIA, 1s, 0, PHASE_ONE);
|
||||
events.ScheduleEvent(EVENT_REMOVE_TRANSFORM_AURA, 26s + 700ms, 0, PHASE_ONE);
|
||||
me->SendSetPlayHoverAnim(false);
|
||||
DoCastSelf(SPELL_INTRO_2_STALKER_TRANSFORM);
|
||||
DoCastSelf(SPELL_INTRO_3_SHRINK_AURA);
|
||||
SetupTransportSpawns();
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
if (Creature* onyxia = instance->GetCreature(DATA_ONYXIA))
|
||||
if (onyxia->IsAlive())
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, onyxia);
|
||||
|
||||
if (!events.IsInPhase(PHASE_ONE))
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
|
||||
if (GameObject* elevator = instance->GetGameObject(DATA_BLACKWING_ELEVATOR_ONYXIA))
|
||||
if (Transport* transport = elevator->ToTransport())
|
||||
transport->SetTransportState(GO_STATE_TRANSPORT_STOPPED, TRANSPORT_STOP_FRAME_LOWERED);
|
||||
|
||||
summons.DespawnAll();
|
||||
instance->SetBossState(DATA_NEFARIANS_END, FAIL);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case POINT_LIFTOFF:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
DoCastSelf(SPELL_INTRO_5A_START_FIGHT_PROC);
|
||||
MoveCyclicPath(NefarianCyclicPath, CyclicPathPoints, 14.0f);
|
||||
|
||||
if (Creature* machine = instance->GetCreature(DATA_NEFARIANS_LIGHTNING_MACHINE))
|
||||
machine->CastSpell(machine, SPELL_ELECTROCUTE);
|
||||
|
||||
if (Creature* onyxia = instance->GetCreature(DATA_ONYXIA))
|
||||
if (onyxia->IsAIEnabled)
|
||||
onyxia->AI()->DoAction(ACTION_REANIMATED);
|
||||
|
||||
for (ObjectGuid guid : summons)
|
||||
{
|
||||
if (Creature* stalker = instance->instance->GetCreature(guid))
|
||||
{
|
||||
if (stalker->GetEntry() == NPC_INVISIBLE_STALKER_CATACLYSM_BOSS)
|
||||
{
|
||||
for (OnyxiaChainData data : OnyxiaChainInfo)
|
||||
{
|
||||
if (stalker->GetExactDist2d(data.ComparisonPosition) < 1.0f)
|
||||
{
|
||||
stalker->InterruptNonMeleeSpells(true);
|
||||
stalker->CastSpell(stalker, data.LightningSpellId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ONYXIA_ENGAGED:
|
||||
DoCastSelf(SPELL_ELECTRICAL_CHARGE_NEFARIAN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim() && !events.IsInPhase(PHASE_ONE))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CHAIN_ONYXIA:
|
||||
for (ObjectGuid guid : summons)
|
||||
{
|
||||
if (Creature* stalker = ObjectAccessor::GetCreature(*me, guid))
|
||||
if (stalker->GetEntry() == NPC_INVISIBLE_STALKER_CATACLYSM_BOSS)
|
||||
for (OnyxiaChainData data : OnyxiaChainInfo)
|
||||
if (stalker->GetExactDist2d(data.ComparisonPosition) < 1.0f)
|
||||
stalker->CastSpell(stalker, data.ChainSpellId);
|
||||
}
|
||||
break;
|
||||
case EVENT_REMOVE_TRANSFORM_AURA:
|
||||
me->RemoveAurasDueToSpell(SPELL_INTRO_2_STALKER_TRANSFORM);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SendMovementSetSplineAnim(Movement::AnimType::FlyToGround);
|
||||
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
|
||||
me->SendSetPlayHoverAnim(true);
|
||||
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
|
||||
events.ScheduleEvent(EVENT_LIFT_OFF, 2s, 0, PHASE_ONE);
|
||||
break;
|
||||
case EVENT_LIFT_OFF:
|
||||
DoCastSelf(SPELL_INTRO_4_LIFT_OFF_ANIM_KIT);
|
||||
me->RemoveAurasDueToSpell(SPELL_INTRO_3_SHRINK_AURA);
|
||||
events.ScheduleEvent(EVENT_ANNOUNCE_AIR_CRACKLES, 8s + 500ms, 0, PHASE_ONE);
|
||||
break;
|
||||
case EVENT_ANNOUNCE_AIR_CRACKLES:
|
||||
Talk(SAY_ANNOUNCE_AIR_CRACKLES);
|
||||
me->GetMotionMaster()->MovePoint(POINT_LIFTOFF, NefarianLiftOffPosition, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
// This is some clusterfuck. Need to remove it once we have a proper generic way
|
||||
void SetupTransportSpawns()
|
||||
{
|
||||
GameObject* elevator = instance->GetGameObject(DATA_BLACKWING_ELEVATOR_ONYXIA);
|
||||
if (!elevator)
|
||||
return;
|
||||
|
||||
Transport* transport = elevator->ToTransport();
|
||||
if (!transport)
|
||||
return;
|
||||
|
||||
std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(me->GetEntry(), SUMMONER_TYPE_CREATURE, SUMMON_GROUP_ELEVATOR);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
Map* map = me->GetMap();
|
||||
for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); itr++)
|
||||
{
|
||||
|
||||
TempSummon* summon = new TempSummon(nullptr, me, false);
|
||||
if (!summon->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, 0, itr->entry, itr->pos, nullptr, 0, true))
|
||||
{
|
||||
delete summon;
|
||||
continue;
|
||||
}
|
||||
|
||||
Position pos = itr->pos;
|
||||
float x, y, z, o;
|
||||
pos.GetPosition(x, y, z, o);
|
||||
transport->CalculatePassengerOffset(x, y, z, &o);
|
||||
|
||||
transport->AddPassenger(summon);
|
||||
summon->m_movementInfo.transport.pos.Relocate({ x, y, z, o });
|
||||
summon->Relocate(pos);
|
||||
summon->SetHomePosition(pos);
|
||||
summon->SetTransportHomePosition({ x, y, z, o });
|
||||
|
||||
PhasingHandler::InheritPhaseShift(summon, me);
|
||||
|
||||
map->AddToMap(summon->ToCreature());
|
||||
summon->InitSummon();
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCyclicPath(Position const* pathPoints, size_t pathSize, float velocity)
|
||||
{
|
||||
Movement::MoveSplineInit init(me);
|
||||
Movement::PointsArray path;
|
||||
path.reserve(pathSize);
|
||||
std::transform(pathPoints, pathPoints + pathSize, std::back_inserter(path), [](Position const& point)
|
||||
{
|
||||
return G3D::Vector3(point.GetPositionX(), point.GetPositionY(), point.GetPositionZ());
|
||||
});
|
||||
|
||||
init.SetUncompressed();
|
||||
init.MovebyPath(path);
|
||||
init.SetFly();
|
||||
init.SetSmooth();
|
||||
init.SetCyclic();
|
||||
init.SetVelocity(velocity);
|
||||
init.Launch();
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_nefarians_end_onyxia : public ScriptedAI
|
||||
{
|
||||
npc_nefarians_end_onyxia(Creature* creature) : ScriptedAI(creature), _instance(me->GetInstanceScript())
|
||||
{
|
||||
me->AddUnitState(UNIT_STATE_IGNORE_PATHFINDING); // Remove this little workarround when mmaps for transports have arrived.
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
if (_instance->GetBossState(DATA_NEFARIANS_END) != IN_PROGRESS)
|
||||
_instance->SetBossState(DATA_NEFARIANS_END, IN_PROGRESS);
|
||||
|
||||
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, FRAME_INDEX_ONYXIA);
|
||||
|
||||
if (Creature* nefarian = _instance->GetCreature(DATA_NEFARIANS_END))
|
||||
nefarian->AI()->DoAction(ACTION_ONYXIA_ENGAGED);
|
||||
|
||||
DoCastSelf(SPELL_ELECTRICAL_CHARGE_ONYXIA);
|
||||
_events.ScheduleEvent(EVENT_TAIL_LASH, 20s);
|
||||
_events.ScheduleEvent(EVENT_SHADOWFLAME_BREATH, 11s, 12s);
|
||||
_events.ScheduleEvent(EVENT_LIGHTNING_DISCHARGE, 22s);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
if (Creature* nefarian = _instance->GetCreature(DATA_NEFARIANS_END))
|
||||
nefarian->AI()->EnterEvadeMode();
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_REANIMATED:
|
||||
me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_UNK_29);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
me->PlayDirectSound(SOUND_ID_ROAR);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
DoCastSelf(SPELL_ONYXIA_START_FIGHT_1_PERIODIC);
|
||||
break;
|
||||
case ACTION_UPDATE_ELECTRICAL_CHARGE:
|
||||
if (Aura* chargeAura = me->GetAura(SPELL_ELECTRICAL_CHARGE_ONYXIA))
|
||||
{
|
||||
uint8 stacks = chargeAura->GetStackAmount();
|
||||
if (stacks == chargeAura->GetSpellInfo()->StackAmount)
|
||||
{
|
||||
DoCastAOE(SPELL_ELECTRICAL_OVERLOAD);
|
||||
stacks = 1;
|
||||
chargeAura->SetStackAmount(stacks);
|
||||
}
|
||||
me->SetPower(POWER_ALTERNATE_POWER, stacks - 1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_TAIL_LASH:
|
||||
DoCastSelf(SPELL_TAIL_LASH);
|
||||
_events.Repeat(17s, 18s);
|
||||
break;
|
||||
case EVENT_SHADOWFLAME_BREATH:
|
||||
DoCastVictim(SPELL_SHADOWFLAME_BREATH);
|
||||
_events.Repeat(13s, 17s);
|
||||
break;
|
||||
case EVENT_LIGHTNING_DISCHARGE:
|
||||
DoCastSelf(SPELL_LIGHTNING_DISCHARGE);
|
||||
_events.Repeat(22s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
struct npc_nefarians_end_lord_victor_nefarius : public PassiveAI
|
||||
{
|
||||
npc_nefarians_end_lord_victor_nefarius(Creature* creature) : PassiveAI(creature), _instance(me->GetInstanceScript()), _started(false){ }
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_START_INTRO:
|
||||
if (_started)
|
||||
break;
|
||||
Talk(SAY_INTRO_1);
|
||||
DoSummon(BOSS_NEFARIAN, NefarianSummonPosition, 0, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
_events.ScheduleEvent(EVENT_TALK_INTRO_2, 22s);
|
||||
_events.ScheduleEvent(EVENT_RAISE_ELEVATOR, 20s + 500ms);
|
||||
_events.ScheduleEvent(EVENT_CAST_TRANSFORM_VISUAL, 26s + 700ms);
|
||||
_started = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_TALK_INTRO_2:
|
||||
Talk(SAY_INTRO_2);
|
||||
_events.ScheduleEvent(EVENT_TALK_INTRO_3, 11s);
|
||||
break;
|
||||
case EVENT_TALK_INTRO_3:
|
||||
Talk(SAY_INTRO_3);
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
case EVENT_RAISE_ELEVATOR:
|
||||
if (GameObject* elevator = _instance->GetGameObject(DATA_BLACKWING_ELEVATOR_ONYXIA))
|
||||
if (Transport* transport = elevator->ToTransport())
|
||||
transport->SetTransportState(GO_STATE_TRANSPORT_STOPPED, TRANSPORT_STOP_FRAME_RAISED);
|
||||
break;
|
||||
case EVENT_CAST_TRANSFORM_VISUAL:
|
||||
if (Creature* stalker = me->FindNearestCreature(NPC_INVISIBLE_STALKER_CATACLYSM_BOSS, 1.0f))
|
||||
{
|
||||
stalker->CastSpell(stalker, SPELL_INTRO_1_TRANSFORM_VISUAL);
|
||||
stalker->DespawnOrUnsummon(2s + 400ms);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool _started;
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
struct go_nefarians_end_orb_of_culmination : public GameObjectAI
|
||||
{
|
||||
go_nefarians_end_orb_of_culmination(GameObject* go) : GameObjectAI(go), _instance(me->GetInstanceScript()) { }
|
||||
|
||||
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
|
||||
{
|
||||
if (Creature* stalker = _instance->GetCreature(DATA_INVISIBLE_STALKER))
|
||||
stalker->RemoveAllAuras();
|
||||
|
||||
if (Creature* nefarius = _instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS_NEFARIANS_END))
|
||||
if (nefarius->IsAIEnabled)
|
||||
nefarius->AI()->DoAction(ACTION_START_INTRO);
|
||||
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
class spell_nefarians_end_electrical_charge : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_nefarians_end_electrical_charge);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
});
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Creature* target = GetTarget()->ToCreature();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_ELECTRICAL_CHARGE_NEFARIAN)
|
||||
{
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
{
|
||||
if (Creature* onyxia = instance->GetCreature(DATA_ONYXIA))
|
||||
{
|
||||
if (Aura* aura = onyxia->GetAura(SPELL_ELECTRICAL_CHARGE_ONYXIA))
|
||||
aura->ModStackAmount(1);
|
||||
|
||||
if (onyxia->IsAIEnabled)
|
||||
onyxia->AI()->DoAction(ACTION_UPDATE_ELECTRICAL_CHARGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ModStackAmount(1);
|
||||
if (target->IsAIEnabled)
|
||||
target->AI()->DoAction(ACTION_UPDATE_ELECTRICAL_CHARGE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_nefarians_end_electrical_charge::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_nefarians_end_lightning_discharge_triggered_periodic_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_nefarians_end_lightning_discharge_triggered_periodic_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_LEFT_1,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_LEFT_2,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_RIGHT_1,
|
||||
SPELL_LIGHTNING_DISCHARGE_VISUAL_RIGHT_2
|
||||
});
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
target->CastSpell(target, SPELL_LIGHTNING_DISCHARGE_VISUAL_LEFT_1, true);
|
||||
target->CastSpell(target, SPELL_LIGHTNING_DISCHARGE_VISUAL_LEFT_2, true);
|
||||
target->CastSpell(target, SPELL_LIGHTNING_DISCHARGE_VISUAL_RIGHT_1, true);
|
||||
target->CastSpell(target, SPELL_LIGHTNING_DISCHARGE_VISUAL_RIGHT_2, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_nefarians_end_lightning_discharge_triggered_periodic_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nefarians_end()
|
||||
{
|
||||
RegisterBlackwingDescentCreatureAI(boss_nefarians_end);
|
||||
RegisterBlackwingDescentCreatureAI(npc_nefarians_end_onyxia);
|
||||
RegisterBlackwingDescentCreatureAI(npc_nefarians_end_lord_victor_nefarius);
|
||||
RegisterAuraScript(spell_nefarians_end_electrical_charge);
|
||||
RegisterAuraScript(spell_nefarians_end_lightning_discharge_triggered_periodic_aura);
|
||||
|
||||
RegisterGameObjectAI(go_nefarians_end_orb_of_culmination);
|
||||
}
|
||||
+59
-25
@@ -24,33 +24,39 @@
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ BOSS_MAGMAW, DATA_MAGMAW },
|
||||
{ BOSS_OMNOTRON, DATA_OMNOTRON_DEFENSE_SYSTEM },
|
||||
{ BOSS_ATRAMEDES, DATA_ATRAMEDES },
|
||||
{ BOSS_CHIMAERON, DATA_CHIMAERON },
|
||||
{ BOSS_MALORIAK, DATA_MALORIAK },
|
||||
{ NPC_ELECTRON, DATA_ELECTRON },
|
||||
{ NPC_MAGMATRON, DATA_MAGMATRON },
|
||||
{ NPC_TOXITRON, DATA_TOXITRON },
|
||||
{ NPC_ARCANOTRON, DATA_ARCANOTRON },
|
||||
{ NPC_NEFARIAN_MAGMAW, DATA_NEFARIAN_MAGMAW },
|
||||
{ NPC_LORD_VICTOR_NEFARIUS_OMNOTRON, DATA_LORD_VICTOR_NEFARIUS_OMNOTRON },
|
||||
{ NPC_COLUMN_OF_LIGHT, DATA_COLUMN_OF_LIGHT },
|
||||
{ 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 },
|
||||
{ 0, 0 } // END
|
||||
{ BOSS_MAGMAW, DATA_MAGMAW },
|
||||
{ BOSS_OMNOTRON, DATA_OMNOTRON_DEFENSE_SYSTEM },
|
||||
{ BOSS_ATRAMEDES, DATA_ATRAMEDES },
|
||||
{ BOSS_CHIMAERON, DATA_CHIMAERON },
|
||||
{ BOSS_MALORIAK, DATA_MALORIAK },
|
||||
{ BOSS_NEFARIAN, DATA_NEFARIANS_END },
|
||||
{ NPC_ELECTRON, DATA_ELECTRON },
|
||||
{ NPC_MAGMATRON, DATA_MAGMATRON },
|
||||
{ NPC_TOXITRON, DATA_TOXITRON },
|
||||
{ NPC_ARCANOTRON, DATA_ARCANOTRON },
|
||||
{ NPC_NEFARIAN_MAGMAW, DATA_NEFARIAN_MAGMAW },
|
||||
{ NPC_LORD_VICTOR_NEFARIUS_OMNOTRON, DATA_LORD_VICTOR_NEFARIUS_OMNOTRON },
|
||||
{ NPC_COLUMN_OF_LIGHT, DATA_COLUMN_OF_LIGHT },
|
||||
{ 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_NEFARIANS_END, DATA_LORD_VICTOR_NEFARIUS_NEFARIANS_END },
|
||||
{ NPC_INVISIBLE_STALKER, DATA_INVISIBLE_STALKER },
|
||||
{ NPC_NEFARIANS_LIGHTNING_MACHINE, DATA_NEFARIANS_LIGHTNING_MACHINE },
|
||||
{ NPC_ONYXIA, DATA_ONYXIA },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
ObjectData const gameobjectData[] =
|
||||
{
|
||||
{ GO_ANCIENT_BELL, DATA_ANCIENT_BELL },
|
||||
{ GO_ATHENAEUM_DOOR, DATA_ATHENAEUM_DOOR },
|
||||
{ GO_DOODAD_BLACKROCKV2_LABROOM_CAULDRON_01, DATA_CAULDRON },
|
||||
{ 0, 0 } // END
|
||||
{ GO_ANCIENT_BELL, DATA_ANCIENT_BELL },
|
||||
{ GO_ATHENAEUM_DOOR, DATA_ATHENAEUM_DOOR },
|
||||
{ GO_DOODAD_BLACKROCKV2_LABROOM_CAULDRON_01, DATA_CAULDRON },
|
||||
{ GO_DOODAD_BLACKWINGV2_ELEVATOR_ONYXIA, DATA_BLACKWING_ELEVATOR_ONYXIA },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
@@ -71,7 +77,8 @@ Position const LordVictorNefariusIntroPosition = { -290.4809f, -224.5955f, 191.
|
||||
enum Events
|
||||
{
|
||||
EVENT_MAKE_ANCIENT_BELL_SELECTABLE = 1,
|
||||
EVENT_RESPAWN_ATRAMEDES
|
||||
EVENT_RESPAWN_ATRAMEDES,
|
||||
EVENT_RESPAWN_NEFARIAN_END_SETUP
|
||||
};
|
||||
|
||||
enum Actions
|
||||
@@ -81,7 +88,8 @@ enum Actions
|
||||
|
||||
enum SpawnGroup
|
||||
{
|
||||
SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS = 400
|
||||
SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS = 400,
|
||||
SPAWN_GROUP_NEFARIANS_END = 402
|
||||
};
|
||||
|
||||
enum SummonGroups
|
||||
@@ -253,10 +261,21 @@ class instance_blackwing_descent : public InstanceMapScript
|
||||
else if (state == DONE)
|
||||
instance->SpawnGroupDespawn(SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS, false);
|
||||
break;
|
||||
case DATA_NEFARIANS_END:
|
||||
if (state == FAIL)
|
||||
{
|
||||
instance->SpawnGroupDespawn(SPAWN_GROUP_NEFARIANS_END, false);
|
||||
_events.ScheduleEvent(EVENT_RESPAWN_NEFARIAN_END_SETUP, 30s);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (type != DATA_NEFARIANS_END)
|
||||
if (IsNefarianAvailable())
|
||||
instance->SpawnGroupSpawn(SPAWN_GROUP_NEFARIANS_END, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -397,6 +416,9 @@ class instance_blackwing_descent : public InstanceMapScript
|
||||
instance->SpawnGroupSpawn(SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS, true);
|
||||
instance->SummonCreature(BOSS_ATRAMEDES, AtramedesRespawnPosition);
|
||||
break;
|
||||
case EVENT_RESPAWN_NEFARIAN_END_SETUP:
|
||||
instance->SpawnGroupSpawn(SPAWN_GROUP_NEFARIANS_END, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -420,6 +442,9 @@ class instance_blackwing_descent : public InstanceMapScript
|
||||
|
||||
if (GetBossState(DATA_ATRAMEDES) != DONE)
|
||||
instance->SpawnGroupSpawn(SPAWN_GROUP_ANCIENT_DWARVEN_SHIELDS, true);
|
||||
|
||||
if (IsNefarianAvailable())
|
||||
instance->SpawnGroupSpawn(SPAWN_GROUP_NEFARIANS_END, true);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -433,6 +458,15 @@ class instance_blackwing_descent : public InstanceMapScript
|
||||
uint8 _deadDwarfSpirits;
|
||||
uint8 _atramedesIntroState;
|
||||
bool _entranceSequenceDone;
|
||||
|
||||
bool IsNefarianAvailable() const
|
||||
{
|
||||
for (BWDDataTypes data : { DATA_MAGMAW, DATA_OMNOTRON_DEFENSE_SYSTEM, DATA_CHIMAERON, DATA_ATRAMEDES, DATA_MALORIAK })
|
||||
if (GetBossState(data) != DONE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -79,6 +79,7 @@ void AddSC_boss_omnotron_defense_system();
|
||||
void AddSC_boss_atramedes();
|
||||
void AddSC_boss_chimaeron();
|
||||
void AddSC_boss_maloriak();
|
||||
void AddSC_boss_nefarians_end();
|
||||
void AddSC_blackwing_descent();
|
||||
void AddSC_instance_deadmines(); //Deadmines
|
||||
void AddSC_boss_glubtok();
|
||||
@@ -309,6 +310,7 @@ void AddEasternKingdomsScripts()
|
||||
AddSC_boss_atramedes();
|
||||
AddSC_boss_chimaeron();
|
||||
AddSC_boss_maloriak();
|
||||
AddSC_boss_nefarians_end();
|
||||
AddSC_blackwing_descent();
|
||||
AddSC_instance_deadmines(); //Deadmines
|
||||
AddSC_boss_glubtok();
|
||||
|
||||
Reference in new issue
Block a user