Scripts/BWD: scripted Electron and Magmatron abilities for Omnotron Defense System encounter
This commit is contained in:
1 parent
fe35a745c8
commit
5e56bf085d
6 files changed
+747
-53
No files matched your search
@@ -1,39 +1,55 @@
|
||||
-- Template Updates
|
||||
-- Omnotron
|
||||
UPDATE `creature_template` SET `ScriptName`= 'boss_omnotron_defense_system' WHERE `entry`= 42186;
|
||||
UPDATE `creature_template` SET `flags_extra`= 130, `unit_flags`= 0x02000000, `ScriptName`= 'boss_omnotron_defense_system' WHERE `entry`= 42186;
|
||||
-- Golems
|
||||
UPDATE `creature_template` SET `unit_flags2`= 0, `unit_flags`= 0x02000000 | 0x80000000, `ScriptName`= 'npc_omnotron_golem' WHERE `entry` IN (42166, 42178, 42179, 42180);
|
||||
UPDATE `creature_template` SET `unit_flags2`= 0, `unit_flags`= 0x02000000 | 0x80000000 WHERE `entry` IN (42166, 42178, 42179, 42180);
|
||||
-- Electron
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_omnotron_electron' WHERE `entry`= 42179;
|
||||
-- Magmatron
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_omnotron_magmatron' WHERE `entry`= 42178;
|
||||
-- Toxitron
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_omnotron_toxitron' WHERE `entry`= 42180;
|
||||
-- Arcanotron
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_omnotron_arcanotron' WHERE `entry`= 42166;
|
||||
|
||||
|
||||
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` IN (42166, 42178, 42179, 42180, 42186);
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `comment`) VALUES
|
||||
-- Omnotron
|
||||
(42186, 0, 0, 'Electron unit activated.', 14, 0, 100, 0, 0, 21865, 47924, 'Omnotron to Electron'),
|
||||
(42186, 1, 0, 'Toxitron unit activated.', 14, 0, 100, 0, 0, 21867, 47926, 'Omnotron to Toxitron'),
|
||||
(42186, 2, 0, 'Magmatron unit activated.', 14, 0, 100, 0, 0, 21866, 47925, 'Omnotron to Magmatron'),
|
||||
(42186, 3, 0, 'Arcanotron unit activated.', 14, 0, 100, 0, 0, 23378, 47927, 'Omnotron to Arcanotron'),
|
||||
(42186, 4, 0, 'Electron unit shield systems online.', 14, 0, 100, 0, 0, 21869, 47928, 'Omnotron to Electron'),
|
||||
(42186, 5, 0, 'Toxitron unit shield systems online.', 14, 0, 100, 0, 0, 21871, 47956, 'Omnotron to Toxitron'),
|
||||
(42186, 6, 0, 'Arcanotron unit shield systems online.', 14, 0, 100, 0, 0, 21872, 47930, 'Omnotron to Arcanotron'),
|
||||
(42186, 7, 0, 'Magmatron unit shield systems online.', 14, 0, 100, 0, 0, 21870, 47929, 'Omnotron to Magmatron'),
|
||||
(42186, 8, 0, 'Rerouting excess energy to Magmatron unit. Engage flamethrower device.', 14, 0, 100, 0, 0, 21873, 47931, 'Omnotron to Magmatron'),
|
||||
(42186, 9, 0, 'Defense systems obliterated. Powering down...', 14, 0, 100, 0, 0, 21864, 47934, 'Omnotron to Player');
|
||||
|
||||
/*
|
||||
(42166, @GROUP_ID+0, @ID+, '|TInterface\\Icons\\spell_arcane_arcaneresilience.blp:20|t%s begins to cast|cFFFE1CF7|Hspell:79729|h [Power Conversion]!|r', 41, 0, 100, 0, 0, 0, UNKNOWN, 'Arcanotron'),
|
||||
(42178, @GROUP_ID+0, @ID+, '|TInterface\\Icons\\ability_hunter_mastermarksman.blp:20|t%s sets his eye on |cFFFF0000$n|r and begins to cast|cFFFF0000|Hspell:79501|h [Acquiring Target]!|r', 41, 0, 100, 0, 0, 0, UNKNOWN, 'Magmatron to Player'),
|
||||
(42179, @GROUP_ID+0, @ID+, '|TInterface\\Icons\\spell_shaman_staticshock.blp:20|t%s casts|cFF1CF2FE|Hspell:79888|h [Lightning Conductor]|h|r at |cFF1CF2FE$n|r!', 41, 0, 100, 0, 0, 0, UNKNOWN, 'Electron to Player'),
|
||||
(42179, @GROUP_ID+1, @ID+, '|TInterface\\Icons\\spell_nature_lightningshield.blp:20|t%s begins to cast|cFF1CF2FE|Hspell:79900|h [Unstable Shield]!|r', 41, 0, 100, 0, 0, 0, UNKNOWN, 'Electron'),
|
||||
(42180, @GROUP_ID+0, @ID+, '|TInterface\\Icons\\spell_nature_nullifydisease.blp:20|t%s begins to cast|cFF1CFE1C|Hspell:79835|h [Poison Soaked Shell]!|r', 41, 0, 100, 0, 0, 0, UNKNOWN, 'Toxitron'),
|
||||
*/
|
||||
(42186, 0, 0, 'Electron unit activated.', 14, 0, 100, 0, 0, 21865, 47924, 'Omnotron - Activate Electron'),
|
||||
(42186, 1, 0, 'Toxitron unit activated.', 14, 0, 100, 0, 0, 21867, 47926, 'Omnotron - Activate Toxitron'),
|
||||
(42186, 2, 0, 'Magmatron unit activated.', 14, 0, 100, 0, 0, 21866, 47925, 'Omnotron - Activate Magmatron'),
|
||||
(42186, 3, 0, 'Arcanotron unit activated.', 14, 0, 100, 0, 0, 23378, 47927, 'Omnotron - Activate Arcanotron'),
|
||||
(42186, 4, 0, 'Electron unit shield systems online.', 14, 0, 100, 0, 0, 21869, 47928, 'Omnotron - Shield Electron'),
|
||||
(42186, 5, 0, 'Toxitron unit shield systems online.', 14, 0, 100, 0, 0, 21871, 47956, 'Omnotron - Shield Toxitron'),
|
||||
(42186, 6, 0, 'Arcanotron unit shield systems online.', 14, 0, 100, 0, 0, 21872, 47930, 'Omnotron - Shield Arcanotron'),
|
||||
(42186, 7, 0, 'Magmatron unit shield systems online.', 14, 0, 100, 0, 0, 21870, 47929, 'Omnotron - Shield Magmatron'),
|
||||
(42186, 8, 0, 'Rerouting excess energy to Magmatron unit. Engage flamethrower device.', 14, 0, 100, 0, 0, 21873, 47931, 'Omnotron - Magmatron Flamethrower'),
|
||||
(42186, 9, 0, 'Defense systems obliterated. Powering down...', 14, 0, 100, 0, 0, 21864, 47934, 'Omnotron - Defeat'),
|
||||
-- Arcanotron
|
||||
(42166, 0, 0, '|TInterface\\Icons\\spell_arcane_arcaneresilience.blp:20|t%s begins to cast|cFFFE1CF7|Hspell:79729|h [Power Conversion]!|r', 41, 0, 100, 0, 0, 0, 46354, 'Arcanotron'),
|
||||
-- Magmatron
|
||||
(42178, 0, 0, '|TInterface\\Icons\\ability_hunter_mastermarksman.blp:20|t%s sets his eye on |cFFFF0000$n|r and begins to cast|cFFFF0000|Hspell:79501|h [Acquiring Target]!|r', 41, 0, 100, 0, 0, 0, 46359, 'Magmatron to Player'),
|
||||
-- Electron
|
||||
(42179, 0, 0, '|TInterface\\Icons\\spell_shaman_staticshock.blp:20|t%s casts|cFF1CF2FE|Hspell:79888|h [Lightning Conductor]|h|r at |cFF1CF2FE$n|r!', 41, 0, 100, 0, 0, 0, 47759, 'Electron to Player'),
|
||||
(42179, 1, 0, '|TInterface\\Icons\\spell_nature_lightningshield.blp:20|t%s begins to cast|cFF1CF2FE|Hspell:79900|h [Unstable Shield]!|r', 41, 0, 100, 0, 0, 0, 46355, 'Electron'),
|
||||
-- Toxitron
|
||||
(42180, 0, 0, '|TInterface\\Icons\\spell_nature_nullifydisease.blp:20|t%s begins to cast|cFF1CFE1C|Hspell:79835|h [Poison Soaked Shell]!|r', 41, 0, 100, 0, 0, 0, 46356, 'Toxitron');
|
||||
|
||||
-- Spells
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_omnotron_controller_recharge',
|
||||
'spell_omnotron_recharging',
|
||||
'spell_omnotron_activated',
|
||||
'spell_omnotron_inactive');
|
||||
'spell_omnotron_inactive',
|
||||
'spell_omnotron_electrical_discharge',
|
||||
'spell_omnotron_unstable_shield',
|
||||
'spell_omnotron_aquiring_target',
|
||||
'spell_omnotron_acquiring_target_periodic',
|
||||
'spell_omnotron_barrier');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(78696, 'spell_omnotron_controller_recharge'),
|
||||
@@ -57,15 +73,32 @@ INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(95016, 'spell_omnotron_activated'),
|
||||
(95017, 'spell_omnotron_activated'),
|
||||
(95018, 'spell_omnotron_activated'),
|
||||
(78726, 'spell_omnotron_inactive');
|
||||
(78726, 'spell_omnotron_inactive'),
|
||||
(79879, 'spell_omnotron_electrical_discharge'),
|
||||
(91465, 'spell_omnotron_electrical_discharge'),
|
||||
(91466, 'spell_omnotron_electrical_discharge'),
|
||||
(91467, 'spell_omnotron_electrical_discharge'),
|
||||
(79900, 'spell_omnotron_unstable_shield'),
|
||||
(91447, 'spell_omnotron_unstable_shield'),
|
||||
(91448, 'spell_omnotron_unstable_shield'),
|
||||
(91449, 'spell_omnotron_unstable_shield'),
|
||||
(79499, 'spell_omnotron_aquiring_target'),
|
||||
(79501, 'spell_omnotron_acquiring_target_periodic'),
|
||||
(92035, 'spell_omnotron_acquiring_target_periodic'),
|
||||
(92036, 'spell_omnotron_acquiring_target_periodic'),
|
||||
(92037, 'spell_omnotron_acquiring_target_periodic'),
|
||||
(79582, 'spell_omnotron_barrier'),
|
||||
(91516, 'spell_omnotron_barrier'),
|
||||
(91517, 'spell_omnotron_barrier'),
|
||||
(91518, 'spell_omnotron_barrier');
|
||||
|
||||
-- Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (79920, 78696, 78697, 95019, 95020, 95021, 78698, 95025, 95026, 95027, 78699, 78700, 95022, 95023, 95024, 95028, 95029, 95030) AND `SourceTypeOrReferenceId`= 13;
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (78696) AND `SourceTypeOrReferenceId`= 17;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 79920, 0, 0, 31, 0, 3, 42179, 0, 0, 0, '', 'Shared Health - Target Electron'),
|
||||
(13, 1, 79920, 0, 1, 31, 0, 3, 42178, 0, 0, 0, '', 'Shared Health - Target Magmatron'),
|
||||
(13, 1, 79920, 0, 2, 31, 0, 3, 42180, 0, 0, 0, '', 'Shared Health - Target Toxitron'),
|
||||
|
||||
(13, 1, 79920, 0, 3, 31, 0, 3, 42166, 0, 0, 0, '', 'Shared Health - Target Arcanotron'),
|
||||
|
||||
(13, 1, 78696, 0, 0, 31, 0, 3, 42179, 0, 0, 0, '', 'Controller Recharge - Target Electron'),
|
||||
@@ -93,6 +126,14 @@ INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry
|
||||
(13, 1, 95029, 0, 0, 31, 0, 3, 42166, 0, 0, 0, '', 'Recharging - Target Arcanotron'),
|
||||
(13, 1, 95030, 0, 0, 31, 0, 3, 42166, 0, 0, 0, '', 'Recharging - Target Arcanotron');
|
||||
|
||||
-- Procs
|
||||
DELETE FROM `spell_proc` WHERE `SpellId` IN (79900, 91447, 91448, 91449);
|
||||
INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Chance`) VALUES
|
||||
(79900, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0),
|
||||
(91447, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0),
|
||||
(91448, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0),
|
||||
(91449, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0);
|
||||
|
||||
-- Summon Groups
|
||||
DELETE FROM `creature_summon_groups` WHERE `summonerId`= 42186 AND `summonerType`= 0;
|
||||
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES
|
||||
|
||||
@@ -1312,7 +1312,20 @@ bool SpellInfo::IsPassiveStackableWithRanks() const
|
||||
|
||||
bool SpellInfo::IsMultiSlotAura() const
|
||||
{
|
||||
return IsPassive() || Id == 55849 || Id == 40075 || Id == 44413 || Id == 79010; // Power Spark, Fel Flak Fire, Incanter's Absorption, Point of Vulnerability
|
||||
if (IsPassive())
|
||||
return true;
|
||||
|
||||
switch (Id)
|
||||
{
|
||||
case 55849: // Power Spark
|
||||
case 40075: // Fel Flak Fire
|
||||
case 44413: // Incanter's Absorption
|
||||
case 79010: // Point of Vulnerability
|
||||
case 79920: // Shared Health
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool SpellInfo::IsStackableOnOneSlotWithDifferentCasters() const
|
||||
|
||||
@@ -5237,6 +5237,16 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
|
||||
});
|
||||
|
||||
// Flamethrower
|
||||
ApplySpellFix({
|
||||
79505,
|
||||
91531,
|
||||
91532,
|
||||
91533
|
||||
}, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
|
||||
});
|
||||
|
||||
// END OF BLACKWING DESCENT SPELLS
|
||||
|
||||
|
||||
+2
-3
@@ -77,8 +77,7 @@ enum BWDCreatureIds
|
||||
NPC_MAGMATRON = 42178,
|
||||
NPC_ARCANOTRON = 42166,
|
||||
NPC_TOXITRON = 42180,
|
||||
NPC_ELECTRON = 42179,
|
||||
|
||||
NPC_ELECTRON = 42179
|
||||
};
|
||||
|
||||
enum BWDGameObjectIds
|
||||
@@ -97,7 +96,7 @@ enum BWDSpells
|
||||
SPELL_LIGHT_SHOW = 87949,
|
||||
|
||||
// Massive Crash
|
||||
SPELL_MASSIVE_CRASH_DAMAGE = 88287,
|
||||
SPELL_MASSIVE_CRASH_DAMAGE = 88287
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
|
||||
+656
-26
@@ -38,8 +38,21 @@ enum Spells
|
||||
SPELL_SHARED_HEALTH = 79920,
|
||||
SPELL_ACTIVATED = 78740,
|
||||
SPELL_SHUTTING_DOWN = 78746,
|
||||
|
||||
// Electron
|
||||
SPELL_ELECTRICAL_DISCHARGE = 79879,
|
||||
SPELL_UNSTABLE_SHIELD = 79900,
|
||||
SPELL_STATIC_SHOCK = 79912,
|
||||
|
||||
// Magmatron
|
||||
SPELL_INCINERATION_SECURITY_MEASURE = 79023,
|
||||
SPELL_ACQUIRING_TARGET = 79499,
|
||||
SPELL_BARRIER = 79582,
|
||||
SPELL_BACKDRAFT = 79617,
|
||||
};
|
||||
|
||||
#define SPELL_LIGHTNING_CONDUCTOR RAID_MODE<uint32>(79888, 91431, 91432, 91433)
|
||||
|
||||
enum Texts
|
||||
{
|
||||
// Omnotron
|
||||
@@ -52,6 +65,12 @@ enum Texts
|
||||
SAY_SHIELD_TOXITRON = 5,
|
||||
SAY_SHIELD_MAGMATRON = 6,
|
||||
SAY_SHIELD_ARCANOTRON = 7,
|
||||
SAY_ACQUIRING_TARGET = 8,
|
||||
SAY_POWERING_DOWN = 9,
|
||||
|
||||
// Omnotron Defense System
|
||||
SAY_ANNOUNCE_ABILITY_1 = 0,
|
||||
SAY_ANNOUNCE_ABILITY_2 = 1,
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -61,6 +80,16 @@ enum Events
|
||||
EVENT_POWER_UP_FIRST_GOLEM,
|
||||
|
||||
// Omnotron Defense System
|
||||
|
||||
// Electron
|
||||
EVENT_LIGHTNING_CONDUCTOR,
|
||||
EVENT_ELECTRICAL_DISCHARGE,
|
||||
EVENT_UNSTABLE_SHIELD,
|
||||
|
||||
// Magmatron
|
||||
EVENT_INCINERATION_SECURITY_MEASURE,
|
||||
EVENT_ACQUIRING_TARGET,
|
||||
EVENT_BARRIER,
|
||||
};
|
||||
|
||||
enum Actions
|
||||
@@ -69,6 +98,8 @@ enum Actions
|
||||
ACTION_GOLEM_ACTIVATED = 0,
|
||||
ACTION_START_ENCOUNTER = 1,
|
||||
ACTION_STOP_ENCOUNTER = 2,
|
||||
ACTION_FINISH_ENCOUNTER = 3,
|
||||
ACTION_SAY_ACQUIRING_TARGET = 4,
|
||||
|
||||
// Omnotron Defense System
|
||||
ACTION_ACTIVATE_GOLEM = 0,
|
||||
@@ -77,7 +108,8 @@ enum Actions
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_NEXT_GOLEM_IN_QUEUE = 0
|
||||
DATA_NEXT_GOLEM_IN_QUEUE = 0,
|
||||
DATA_SAY_GOLEM_SHIELD = 0
|
||||
};
|
||||
|
||||
Position const FirstGolemPatrolStartPoint = { -324.665f, -398.085f, 213.8214f };
|
||||
@@ -115,20 +147,28 @@ struct boss_omnotron_defense_system : public BossAI
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
Initialize();
|
||||
if (instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) == DONE)
|
||||
return;
|
||||
|
||||
_Reset();
|
||||
me->SummonCreatureGroup(SUMMON_GROUP_GOLEMS);
|
||||
events.ScheduleEvent(EVENT_LINK_GOLEM_HEALTH, 5s);
|
||||
events.ScheduleEvent(EVENT_POWER_UP_FIRST_GOLEM, 10s);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* target) override
|
||||
{
|
||||
target->HandleEmoteCommand(0);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
case NPC_ELECTRON:
|
||||
@@ -156,6 +196,13 @@ struct boss_omnotron_defense_system : public BossAI
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void SetGUID(ObjectGuid const& guid, int32 type) override
|
||||
{
|
||||
if (type == DATA_SAY_GOLEM_SHIELD)
|
||||
if (Creature* golem = ObjectAccessor::GetCreature(*me, guid))
|
||||
Talk(_golemInfoMap[golem->GetEntry()].ShieldTextId);
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
@@ -167,30 +214,50 @@ struct boss_omnotron_defense_system : public BossAI
|
||||
{
|
||||
Talk(_golemInfoMap[golem->GetEntry()].ActivateTextId);
|
||||
golem->CastSpell(golem, SPELL_ACTIVATED);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, golem, 1);
|
||||
}
|
||||
|
||||
SelectNextGolemGUID();
|
||||
DoCastAOE(SPELL_CONTROLLER_RECHARGE, true);
|
||||
DoCastSelf(SPELL_CONTROLLER_RECHARGE, true);
|
||||
}
|
||||
break;
|
||||
case ACTION_START_ENCOUNTER:
|
||||
instance->SetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM, IN_PROGRESS);
|
||||
|
||||
for (ObjectGuid guid : _golemGuidVector)
|
||||
if (Creature* golem = ObjectAccessor::GetCreature(*me, guid))
|
||||
golem->AI()->DoZoneInCombat();
|
||||
|
||||
// Since we blocked the first action call with our first golem we call it right away now to continue the cycle
|
||||
DoAction(ACTION_GOLEM_ACTIVATED);
|
||||
break;
|
||||
case ACTION_STOP_ENCOUNTER:
|
||||
for (uint8 i = DATA_ELECTRON; i < DATA_ELECTRON + 4; i++)
|
||||
for (ObjectGuid guid : _golemGuidVector)
|
||||
{
|
||||
if (Creature* golem = instance->GetCreature(i))
|
||||
if (Creature* golem = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, golem);
|
||||
golem->DespawnOrUnsummon(100ms);
|
||||
golem->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
instance->SetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM, FAIL);
|
||||
summons.DespawnAll();
|
||||
_DespawnAtEvade();
|
||||
break;
|
||||
case ACTION_FINISH_ENCOUNTER:
|
||||
if (instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != DONE)
|
||||
{
|
||||
Talk(SAY_POWERING_DOWN);
|
||||
_JustDied();
|
||||
for (ObjectGuid guid : _golemGuidVector)
|
||||
if (Creature* golem = ObjectAccessor::GetCreature(*me, guid))
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, golem);
|
||||
}
|
||||
break;
|
||||
case ACTION_SAY_ACQUIRING_TARGET:
|
||||
Talk(SAY_ACQUIRING_TARGET);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -213,7 +280,7 @@ struct boss_omnotron_defense_system : public BossAI
|
||||
// Randomize our golem order for each encounter
|
||||
Trinity::Containers::RandomShuffle(_golemGuidVector);
|
||||
SelectNextGolemGUID();
|
||||
DoCastAOE(SPELL_CONTROLLER_RECHARGE);
|
||||
DoCastSelf(SPELL_CONTROLLER_RECHARGE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -225,6 +292,7 @@ private:
|
||||
GuidVector _golemGuidVector;
|
||||
ObjectGuid _nextGolemGUID;
|
||||
|
||||
|
||||
// Selects the ObjectGuid for the next Golem
|
||||
void SelectNextGolemGUID()
|
||||
{
|
||||
@@ -232,11 +300,16 @@ private:
|
||||
_golemGuidVector.erase(_golemGuidVector.begin());
|
||||
_golemGuidVector.push_back(_nextGolemGUID);
|
||||
}
|
||||
|
||||
void RemoveDebuffsFromRaid()
|
||||
{
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHTNING_CONDUCTOR);
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_omnotron_golem : public ScriptedAI
|
||||
struct npc_omnotron_electron : public ScriptedAI
|
||||
{
|
||||
npc_omnotron_golem(Creature* creature) : ScriptedAI(creature), _instance(me->GetInstanceScript())
|
||||
npc_omnotron_electron(Creature* creature) : ScriptedAI(creature), _instance(me->GetInstanceScript())
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@@ -244,6 +317,7 @@ struct npc_omnotron_golem : public ScriptedAI
|
||||
void Initialize()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetNoCallAssistance(true);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
@@ -253,8 +327,6 @@ struct npc_omnotron_golem : public ScriptedAI
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
|
||||
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
@@ -265,6 +337,14 @@ struct npc_omnotron_golem : public ScriptedAI
|
||||
omnotron->AI()->DoAction(ACTION_STOP_ENCOUNTER);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_FINISH_ENCOUNTER);
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 pointId) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
@@ -308,12 +388,301 @@ struct npc_omnotron_golem : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ACTIVATED)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_LIGHTNING_CONDUCTOR, 14s);
|
||||
_events.ScheduleEvent(EVENT_ELECTRICAL_DISCHARGE, 4s);
|
||||
_events.ScheduleEvent(EVENT_UNSTABLE_SHIELD, IsHeroic() ? 40s : 50s);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
UpdateVictim();
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_LIGHTNING_CONDUCTOR:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true, 0))
|
||||
{
|
||||
Talk(SAY_ANNOUNCE_ABILITY_1, target);
|
||||
DoCast(target, SPELL_LIGHTNING_CONDUCTOR);
|
||||
_events.Repeat(21s, 22s);
|
||||
}
|
||||
break;
|
||||
case EVENT_ELECTRICAL_DISCHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true, 0))
|
||||
DoCast(target, SPELL_ELECTRICAL_DISCHARGE);
|
||||
_events.Repeat(6s);
|
||||
break;
|
||||
case EVENT_UNSTABLE_SHIELD:
|
||||
DoCastSelf(SPELL_UNSTABLE_SHIELD);
|
||||
Talk(SAY_ANNOUNCE_ABILITY_2);
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->SetGUID(me->GetGUID(), DATA_SAY_GOLEM_SHIELD);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
struct npc_omnotron_magmatron : public ScriptedAI
|
||||
{
|
||||
npc_omnotron_magmatron(Creature* creature) : ScriptedAI(creature), _instance(me->GetInstanceScript())
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetNoCallAssistance(true);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
if (_instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != IN_PROGRESS)
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_STOP_ENCOUNTER);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_FINISH_ENCOUNTER);
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 pointId) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pointId == POINT_START_WAYPOINTS)
|
||||
{
|
||||
me->GetMotionMaster()->MovePath(BOSS_OMNOTRON * 100, true);
|
||||
me->SetWalk(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ACTIVATE_GOLEM:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveAurasDueToSpell(SPELL_INACTIVE);
|
||||
me->RemoveAurasDueToSpell(SPELL_POWERED_DOWN);
|
||||
|
||||
if (_instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != IN_PROGRESS)
|
||||
{
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_START_WAYPOINTS, FirstGolemPatrolStartPoint);
|
||||
}
|
||||
else
|
||||
DoZoneInCombat();
|
||||
|
||||
// Golem is online, time to inform the controller about it
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_GOLEM_ACTIVATED);
|
||||
break;
|
||||
case ACTION_DEACTIVATE_GOLEM:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
_events.Reset();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ACTIVATED)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_INCINERATION_SECURITY_MEASURE, 9s + 500ms);
|
||||
_events.ScheduleEvent(EVENT_ACQUIRING_TARGET, 19s);
|
||||
_events.ScheduleEvent(EVENT_BARRIER, IsHeroic() ? 40s : 50s);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_ACQUIRING_TARGET && target)
|
||||
{
|
||||
Talk(SAY_ANNOUNCE_ABILITY_1, target);
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_SAY_ACQUIRING_TARGET);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INCINERATION_SECURITY_MEASURE:
|
||||
DoCastAOE(SPELL_INCINERATION_SECURITY_MEASURE);
|
||||
_events.Repeat(27s);
|
||||
break;
|
||||
case EVENT_ACQUIRING_TARGET:
|
||||
DoCastAOE(SPELL_ACQUIRING_TARGET, true);
|
||||
_events.Repeat(27s);
|
||||
break;
|
||||
case EVENT_BARRIER:
|
||||
DoCastSelf(SPELL_BARRIER);
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->SetGUID(me->GetGUID(), DATA_SAY_GOLEM_SHIELD);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
struct npc_omnotron_toxitron : public ScriptedAI
|
||||
{
|
||||
npc_omnotron_toxitron(Creature* creature) : ScriptedAI(creature), _instance(me->GetInstanceScript())
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetNoCallAssistance(true);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
if (_instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != IN_PROGRESS)
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_STOP_ENCOUNTER);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_FINISH_ENCOUNTER);
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 pointId) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pointId == POINT_START_WAYPOINTS)
|
||||
{
|
||||
me->GetMotionMaster()->MovePath(BOSS_OMNOTRON * 100, true);
|
||||
me->SetWalk(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ACTIVATE_GOLEM:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveAurasDueToSpell(SPELL_INACTIVE);
|
||||
me->RemoveAurasDueToSpell(SPELL_POWERED_DOWN);
|
||||
|
||||
if (_instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != IN_PROGRESS)
|
||||
{
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_START_WAYPOINTS, FirstGolemPatrolStartPoint);
|
||||
}
|
||||
else
|
||||
DoZoneInCombat();
|
||||
|
||||
// Golem is online, time to inform the controller about it
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_GOLEM_ACTIVATED);
|
||||
break;
|
||||
case ACTION_DEACTIVATE_GOLEM:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
_events.Reset();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ACTIVATED)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
@@ -333,6 +702,122 @@ private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
struct npc_omnotron_arcanotron : public ScriptedAI
|
||||
{
|
||||
npc_omnotron_arcanotron(Creature* creature) : ScriptedAI(creature), _instance(me->GetInstanceScript())
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetNoCallAssistance(true);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
if (_instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != IN_PROGRESS)
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_STOP_ENCOUNTER);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_FINISH_ENCOUNTER);
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 pointId) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pointId == POINT_START_WAYPOINTS)
|
||||
{
|
||||
me->GetMotionMaster()->MovePath(BOSS_OMNOTRON * 100, true);
|
||||
me->SetWalk(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_ACTIVATE_GOLEM:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveAurasDueToSpell(SPELL_INACTIVE);
|
||||
me->RemoveAurasDueToSpell(SPELL_POWERED_DOWN);
|
||||
|
||||
if (_instance->GetBossState(DATA_OMNOTRON_DEFENSE_SYSTEM) != IN_PROGRESS)
|
||||
{
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_START_WAYPOINTS, FirstGolemPatrolStartPoint);
|
||||
}
|
||||
else
|
||||
DoZoneInCombat();
|
||||
|
||||
// Golem is online, time to inform the controller about it
|
||||
if (Creature* omnotron = _instance->GetCreature(DATA_OMNOTRON_DEFENSE_SYSTEM))
|
||||
omnotron->AI()->DoAction(ACTION_GOLEM_ACTIVATED);
|
||||
break;
|
||||
case ACTION_DEACTIVATE_GOLEM:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
_events.Reset();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_ACTIVATED)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
class GuidCheck
|
||||
{
|
||||
public:
|
||||
@@ -417,20 +902,12 @@ class spell_omnotron_recharging : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_omnotron_recharging);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_INACTIVE,
|
||||
SPELL_POWERED_DOWN
|
||||
});
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* golem = GetTarget()->ToCreature())
|
||||
if (golem->IsAIEnabled)
|
||||
golem->AI()->DoAction(ACTION_ACTIVATE_GOLEM);
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
||||
if (Creature* golem = GetTarget()->ToCreature())
|
||||
if (golem->IsAIEnabled)
|
||||
golem->AI()->DoAction(ACTION_ACTIVATE_GOLEM);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -493,12 +970,165 @@ class spell_omnotron_inactive : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_omnotron_electrical_discharge : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_omnotron_electrical_discharge);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_chainTargetCount = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDamageBonus(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetHitDamage();
|
||||
AddPct(damage, _chainTargetCount * 20);
|
||||
_chainTargetCount++;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_omnotron_electrical_discharge::HandleDamageBonus, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
private:
|
||||
uint8 _chainTargetCount;
|
||||
};
|
||||
|
||||
class spell_omnotron_unstable_shield : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_omnotron_unstable_shield);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_STATIC_SHOCK
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return eventInfo.GetDamageInfo();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* caster = GetTarget();
|
||||
Unit* target = eventInfo.GetDamageInfo()->GetAttacker();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
caster->CastSpell(target, SPELL_STATIC_SHOCK, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_omnotron_unstable_shield::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_omnotron_unstable_shield::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
class DistanceCheck
|
||||
{
|
||||
public:
|
||||
DistanceCheck(Unit* caster) : _caster(caster) { }
|
||||
|
||||
bool operator()(WorldObject* object)
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
return !unit->IsWithinMeleeRange(_caster);
|
||||
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
Unit* _caster;
|
||||
};
|
||||
*/
|
||||
|
||||
class spell_omnotron_aquiring_target : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_omnotron_aquiring_target);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
Trinity::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void HandleDummyEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->StopMoving();
|
||||
caster->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_omnotron_aquiring_target::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_omnotron_aquiring_target::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_omnotron_acquiring_target_periodic : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_omnotron_acquiring_target_periodic);
|
||||
|
||||
void HandleTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_omnotron_acquiring_target_periodic::HandleTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_omnotron_barrier : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_omnotron_barrier);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_BACKDRAFT });
|
||||
}
|
||||
|
||||
void HandleAbsorbRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_BACKDRAFT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_omnotron_barrier::HandleAbsorbRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_omnotron_defense_system()
|
||||
{
|
||||
RegisterBlackwingDescentCreatureAI(boss_omnotron_defense_system);
|
||||
RegisterBlackwingDescentCreatureAI(npc_omnotron_golem);
|
||||
RegisterBlackwingDescentCreatureAI(npc_omnotron_electron);
|
||||
RegisterBlackwingDescentCreatureAI(npc_omnotron_magmatron);
|
||||
RegisterBlackwingDescentCreatureAI(npc_omnotron_toxitron);
|
||||
RegisterBlackwingDescentCreatureAI(npc_omnotron_arcanotron);
|
||||
RegisterSpellScript(spell_omnotron_controller_recharge);
|
||||
RegisterAuraScript(spell_omnotron_recharging);
|
||||
RegisterAuraScript(spell_omnotron_activated);
|
||||
RegisterSpellScript(spell_omnotron_inactive);
|
||||
RegisterSpellScript(spell_omnotron_electrical_discharge);
|
||||
RegisterAuraScript(spell_omnotron_unstable_shield);
|
||||
RegisterSpellScript(spell_omnotron_aquiring_target);
|
||||
RegisterAuraScript(spell_omnotron_acquiring_target_periodic);
|
||||
RegisterAuraScript(spell_omnotron_barrier);
|
||||
}
|
||||
+1
@@ -95,6 +95,7 @@ class instance_blackwing_descent : public InstanceMapScript
|
||||
_roomStalkerTargetDummyLeftGuid = creature->GetGUID();
|
||||
else if (creature->GetExactDist2d(MassiveCrashTargetPositionRight) < 1.0f)
|
||||
_roomStalkerTargetDummyRightGuid = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user