mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Scripts/GB: finished Erudax implementation
This commit is contained in:
114
sql/updates/world/4.3.4/custom_2018_02_08_00_world.sql
Normal file
114
sql/updates/world/4.3.4/custom_2018_02_08_00_world.sql
Normal file
@@ -0,0 +1,114 @@
|
||||
-- Template Updates
|
||||
-- Erudax
|
||||
UPDATE `creature_template` SET `mechanic_immune_mask`= 667893759, `scriptname`= 'boss_erudax', `flags_extra`= `flags_extra`|1073741824 WHERE `entry`= 40484;
|
||||
UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `mechanic_immune_mask`= 667893759, `flags_extra`= `flags_extra`|1073741824 WHERE `entry`= 48822;
|
||||
-- Faceless Portal Stalker
|
||||
UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 131 WHERE `entry`= 44314;
|
||||
UPDATE `creature_template_addon` SET `auras`= '' WHERE `entry`= 44314;
|
||||
-- Shadow Gale Stalker
|
||||
UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 128 WHERE `entry`= 40567;
|
||||
-- Faceless Corruptor
|
||||
UPDATE `creature_template` SET `scriptname`= 'npc_erudax_faceless_corruptor', `mechanic_immune_mask`= 634339327, `flags_extra`= 1073741824 WHERE `entry` IN (40600, 48844);
|
||||
UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `flags_extra`= 1073741824 WHERE `entry` IN (48828, 48845);
|
||||
-- Alexstrasza's Egg
|
||||
UPDATE `creature_template` SET `RegenHealth`= 0 WHERE `entry`= 40486;
|
||||
-- Twilight Hatchling
|
||||
UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry` IN (39388, 48832);
|
||||
|
||||
-- Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (75656, 75664, 91086, 75520, 91049, 75763, 91040, 75809) AND `SourceTypeOrReferenceId` = 13;
|
||||
INSERT INTO `conditions` (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ScriptName, Comment) VALUES
|
||||
(13, 1, 75656, 0, 0, 31, 0, 3, 40566, 0, 0, 0, '', 'Shadow Gale Trigger - Target Shadow Gale Controller'),
|
||||
(13, 1, 75664, 0, 0, 31, 0, 3, 40567, 0, 0, 0, '', 'Shadow Gale - Target Shadow Gale Stalker'),
|
||||
(13, 1, 91086, 0, 0, 31, 0, 3, 40567, 0, 0, 0, '', 'Shadow Gale - Target Shadow Gale Stalker'),
|
||||
(13, 1, 75520, 0, 0, 31, 0, 3, 40486, 0, 0, 0, '', 'Twilight Corruption - Target Alexstrasza''s Egg'),
|
||||
(13, 1, 91049, 0, 0, 31, 0, 3, 40486, 0, 0, 0, '', 'Twilight Corruption - Target Alexstrasza''s Egg'),
|
||||
(13, 1, 75763, 0, 0, 31, 0, 3, 40484, 0, 0, 0, '', 'Umbral Mending - Target Erduax'),
|
||||
(13, 1, 91040, 0, 0, 31, 0, 3, 40484, 0, 0, 0, '', 'Umbral Mending - Target Erduax'),
|
||||
(13, 1, 75809, 0, 0, 31, 0, 3, 40600, 0, 0, 0, '', 'Shield of Nightmares - Target Faceless Corruptor'),
|
||||
(13, 1, 75809, 0, 0, 31, 0, 3, 48844, 0, 0, 0, '', 'Shield of Nightmares - Target Faceless Corruptor');
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN (39388, 48832);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES
|
||||
(39388, 76192),
|
||||
(48832, 91044);
|
||||
|
||||
-- Spells
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_erudax_shadow_gale_trigger',
|
||||
'spell_erudax_shadow_gale',
|
||||
'spell_erudax_shadow_gale_aura',
|
||||
'spell_erudax_twilight_corruption');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(75656, 'spell_erudax_shadow_gale_trigger'),
|
||||
(75692, 'spell_erudax_shadow_gale'),
|
||||
(91087, 'spell_erudax_shadow_gale'),
|
||||
(75694, 'spell_erudax_shadow_gale_aura'),
|
||||
(75520, 'spell_erudax_twilight_corruption'),
|
||||
(91049, 'spell_erudax_twilight_corruption');
|
||||
|
||||
-- Spell Target Positions
|
||||
DELETE FROM `spell_target_position` WHERE `ID` IN (75704, 91072);
|
||||
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES
|
||||
(75704, 0, 670, -620.443, -827.19, 241.8573, 3.184877, 15595),
|
||||
(91072, 0, 670, -620.443, -827.19, 241.8573, 3.184877, 15595),
|
||||
(91072, 1, 670, -620.443, -827.19, 241.8573, 3.184877, 15595);
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`= 40484;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `Comment`) VALUES
|
||||
(40484, 0, 0, 'The darkest days are still ahead!', 14, 0, 100, 0, 0, 18638, 47770, 'Erudax - Aggro'),
|
||||
(40484, 1, 0, '|TInterface\\Icons\\spell_shadow_shadowfury.blp:20|t%s begins to cast |cFFA043E7|Hspell:75694|h[Shadow Gale]|h|r!', 41, 0, 100, 0, 0, 0, 40609, 'Erudax - Announce Shadow Gale'),
|
||||
(40484, 2, 0, 'F\'lakh ghet! The shadow\'s hunger cannot be sated!', 14, 0, 100, 0, 0, 18644, 47774, 'Erudax - Shadow Gale'),
|
||||
(40484, 3, 0, 'Come, suffering... Enter, chaos!', 14, 0, 100, 0, 0, 18646, 40612, 'Erudax to Erudax'),
|
||||
(40484, 4, 0, '%s summons a |cFFFF0000Faceless Guardian|r!', 41, 0, 100, 0, 0, 0, 0, 'Erudax to Erudax'),
|
||||
(40484, 5, 0, '|TInterface\\Icons\\spell_shadow_sacrificialshield.blp:20|t%s begins to cast |cFF006EFD|Hspell:75809|h[Shield of Nightmares]|h|r on the |cFF006EFDFaceless Corruptor|r!', 41, 0, 100, 0, 0, 0, 40610, 'Erudax - Shield of Nightmares'),
|
||||
(40484, 6, 0, 'Flesh for the offering!', 14, 0, 100, 0, 0, 18640, 47772, 'Erudax - Slay 1'),
|
||||
(40484, 6, 1, 'Ahahaha!', 16, 0, 100, 0, 0, 18639, 47771, 'Erudax - Slay 2'),
|
||||
(40484, 7, 0, 'Ywaq maq oou; ywaq maq ssaggh. Yawq ma shg\'fhn.', 14, 0, 100, 0, 0, 18641, 47773, 'Erudax - Death');
|
||||
|
||||
-- Achiement
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id`= 16001;
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
|
||||
(16001, 11, 0, 0, 'achievement_dont_need_to_break_eggs');
|
||||
|
||||
-- Currency Loot
|
||||
DELETE FROM `creature_onkill_reward` WHERE `creature_id` IN (40484, 48822);
|
||||
INSERT INTO `creature_onkill_reward` (`creature_id`, `CurrencyId1`, `CurrencyCount1`) VALUES
|
||||
(40484, 395, 3500),
|
||||
(48822, 395, 7000);
|
||||
|
||||
-- Loot
|
||||
UPDATE `creature_template` SET `lootid`= 40484 WHERE `entry`= 40484;
|
||||
UPDATE `creature_template` SET `lootid`= 48822 WHERE `entry`= 48822;
|
||||
DELETE FROM `creature_loot_template` WHERE `entry` IN (40484, 48822);
|
||||
INSERT INTO `creature_loot_template` (`Entry`, `Reference`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
|
||||
(40484, 404840, 100, 1, 0, 2, 2),
|
||||
(48822, 488220, 100, 1, 0, 2, 2);
|
||||
|
||||
DELETE FROM `reference_loot_template` WHERE `entry` IN (404840, 488220);
|
||||
INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
|
||||
-- Normal
|
||||
(404840, 56133, 0, 1, 1, 1, 1),
|
||||
(404840, 56128, 0, 1, 1, 1, 1),
|
||||
(404840, 56135, 0, 1, 1, 1, 1),
|
||||
(404840, 56129, 0, 1, 1, 1, 1),
|
||||
(404840, 56136, 0, 1, 1, 1, 1),
|
||||
(404840, 56138, 0, 1, 1, 1, 1),
|
||||
(404840, 56132, 0, 1, 1, 1, 1),
|
||||
(404840, 56130, 0, 1, 1, 1, 1),
|
||||
(404840, 56131, 0, 1, 1, 1, 1),
|
||||
(404840, 56137, 0, 1, 1, 1, 1),
|
||||
-- Heroic
|
||||
(488220, 56460, 0, 1, 1, 1, 1),
|
||||
(488220, 56455, 0, 1, 1, 1, 1),
|
||||
(488220, 56464, 0, 1, 1, 1, 1),
|
||||
(488220, 56457, 0, 1, 1, 1, 1),
|
||||
(488220, 56463, 0, 1, 1, 1, 1),
|
||||
(488220, 56462, 0, 1, 1, 1, 1),
|
||||
(488220, 56458, 0, 1, 1, 1, 1),
|
||||
(488220, 56459, 0, 1, 1, 1, 1),
|
||||
(488220, 56456, 0, 1, 1, 1, 1),
|
||||
(488220, 56461, 0, 1, 1, 1, 1),
|
||||
(488220, 52078, 100, 1, 2, 1, 1); -- Chaos Orb
|
||||
@@ -4125,9 +4125,9 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
// Ground Siege
|
||||
ApplySpellFix({ 74634, 90249 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
// SPELL_ATTR3_ONLY_TARGET_PLAYERS is the only attribute here so we can nullify it
|
||||
spellInfo->AttributesEx3 = 0;
|
||||
spellInfo->AttributesEx3 &= ~SPELL_ATTR3_ONLY_TARGET_PLAYERS;
|
||||
});
|
||||
|
||||
// Drahga Shadowburner
|
||||
// Flaming Fixate
|
||||
ApplySpellFix({ 82850 }, [](SpellInfo* spellInfo)
|
||||
@@ -4141,6 +4141,20 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS;
|
||||
});
|
||||
|
||||
// Erudax
|
||||
// Twilight Blast
|
||||
ApplySpellFix({ 76194, 91042 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->MaxAffectedTargets = 1;
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO;
|
||||
});
|
||||
|
||||
// Shadow Gale
|
||||
ApplySpellFix({ 75664, 91086 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AttributesEx5 &= ~SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING;
|
||||
});
|
||||
|
||||
// ENDOF GRIM_BATOL SPELLS
|
||||
|
||||
//
|
||||
|
||||
@@ -30,12 +30,23 @@ enum Spells
|
||||
SPELL_ENFEEBLING_BLOW = 75789,
|
||||
SPELL_SHADOW_GALE_TRIGGER = 75656,
|
||||
SPELL_SHADOW_GALE = 75664,
|
||||
SPELL_SUMMON_FACELESS_CORRUPTOR = 75704,
|
||||
SPELL_SHIELD_OF_NIGHTMARES = 75809,
|
||||
|
||||
// Shadow Gale Controller
|
||||
SPELL_SUMMON_SHADOW_GALE_STALKER = 75655,
|
||||
|
||||
// Shadow Gale Stalker
|
||||
SPELL_SHADOW_GALE_TRIGGER_RUN_SPEED_TRIGGER = 92296,
|
||||
SPELL_SHADOW_GALE_TRIGGER_RUN_SPEED_TRIGGER = 75675,
|
||||
|
||||
// Faceless Corruptor
|
||||
SPELL_TWILIGHT_CORRUPTION = 75520,
|
||||
SPELL_UMBRAL_MENDING = 75763,
|
||||
SPELL_SIPHON_ESSENCE = 75755,
|
||||
|
||||
// Alexstrasza's Egg
|
||||
SPELL_SUMMON_TWILIGHT_EGG = 91056,
|
||||
SPELL_SUMMON_TWILIGHT_HATCHLING = 91058
|
||||
};
|
||||
|
||||
enum Texts
|
||||
@@ -55,8 +66,54 @@ enum Events
|
||||
// Erudax
|
||||
EVENT_BINDING_SHADOWS = 1,
|
||||
EVENT_ENFEEBLING_BLOW,
|
||||
EVENT_SUMMON_SHADOW_GALE_STALKER,
|
||||
EVENT_SHADOW_GALE,
|
||||
EVENT_CHASE_VICTIM,
|
||||
EVENT_SUMMON_FACELESS_CORRUPTOR,
|
||||
EVENT_SHIELD_OF_NIGHTMARES,
|
||||
|
||||
// Faceless Corruptor
|
||||
EVENT_SEND_ENCOUNTER_FRAME,
|
||||
EVENT_TWILIGHT_CORRUPTION,
|
||||
EVENT_UMBRAL_MENDING,
|
||||
EVENT_ATTACK_PLAYER,
|
||||
EVENT_SIPHON_ESSENCE
|
||||
};
|
||||
|
||||
enum Actions
|
||||
{
|
||||
ACTION_FINISH_CORRUPTION = 1,
|
||||
ACTION_FAIL_ACHIEVEMENT = 1
|
||||
};
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_ACHIEVEMT_ENLIGIBLE = 1
|
||||
};
|
||||
|
||||
Position const facelessCorruptorPositions1[] =
|
||||
{
|
||||
{ -656.2604f, -833.0052f, 234.1771f },
|
||||
{ -701.7274f, -833.2674f, 232.4126f },
|
||||
{ -729.4792f, -865.7899f, 232.5132f },
|
||||
};
|
||||
|
||||
Position const facelessCorruptorPositions2[] =
|
||||
{
|
||||
{ -660.3993f, -824.5052f, 233.6518f },
|
||||
{ -699.3420f, -818.5434f, 232.4729f },
|
||||
{ -728.7292f, -791.1129f, 232.4201f }
|
||||
};
|
||||
|
||||
enum Points
|
||||
{
|
||||
POINT_PATH_1,
|
||||
POINT_PATH_2,
|
||||
POINT_PATH_3
|
||||
};
|
||||
|
||||
enum ModelIds
|
||||
{
|
||||
MODEL_ID_INVISIBLE = 11686
|
||||
};
|
||||
|
||||
class boss_erudax : public CreatureScript
|
||||
@@ -66,7 +123,15 @@ class boss_erudax : public CreatureScript
|
||||
|
||||
struct boss_erudaxAI : public BossAI
|
||||
{
|
||||
boss_erudaxAI(Creature* creature) : BossAI(creature, DATA_ERUDAX) { }
|
||||
boss_erudaxAI(Creature* creature) : BossAI(creature, DATA_ERUDAX)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_achievementEnligible = true;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
@@ -75,7 +140,13 @@ class boss_erudax : public CreatureScript
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
events.ScheduleEvent(EVENT_BINDING_SHADOWS, Seconds(10) + Milliseconds(500));
|
||||
events.ScheduleEvent(EVENT_ENFEEBLING_BLOW, Seconds(19));
|
||||
events.ScheduleEvent(EVENT_SHADOW_GALE, Seconds(21) + Milliseconds(500));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SHADOW_GALE_STALKER, Seconds(21) + Milliseconds(500));
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* killed) override
|
||||
@@ -88,6 +159,7 @@ class boss_erudax : public CreatureScript
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
DespawnFacelessCorruptors();
|
||||
summons.DespawnAll();
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
@@ -97,25 +169,57 @@ class boss_erudax : public CreatureScript
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
DespawnFacelessCorruptors();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void DespawnFacelessCorruptors()
|
||||
{
|
||||
for (auto itr = _corruptorGUIDList.begin(); itr != _corruptorGUIDList.end(); itr++)
|
||||
{
|
||||
if (Creature* corruptor = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, corruptor);
|
||||
corruptor->DespawnOrUnsummon(Milliseconds(100));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_FAIL_ACHIEVEMENT)
|
||||
_achievementEnligible = false;
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
|
||||
if (summon->GetEntry() == NPC_SHADOW_GALE_STALKER)
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
Talk(SAY_SHADOW_GALE);
|
||||
Talk(SAY_ANNOUNCE_SHADOW_GALE);
|
||||
summon->CastSpell(summon, SPELL_SHADOW_GALE_TRIGGER_RUN_SPEED_TRIGGER);
|
||||
DoCastAOE(SPELL_SHADOW_GALE);
|
||||
events.ScheduleEvent(EVENT_BINDING_SHADOWS, Seconds(21));
|
||||
events.ScheduleEvent(EVENT_ENFEEBLING_BLOW, Seconds(20));
|
||||
events.ScheduleEvent(EVENT_SHADOW_GALE, Seconds(55));
|
||||
case NPC_SHADOW_GALE_STALKER:
|
||||
Talk(SAY_SHADOW_GALE);
|
||||
Talk(SAY_ANNOUNCE_SHADOW_GALE);
|
||||
// needed because the summons visual effect of the following spell cast gets lost else
|
||||
events.ScheduleEvent(EVENT_SHADOW_GALE, Milliseconds(1));
|
||||
summons.Summon(summon);
|
||||
break;
|
||||
case NPC_FACELESS_CORRUPTOR_1:
|
||||
case NPC_FACELESS_CORRUPTOR_2:
|
||||
_corruptorGUIDList.insert(summon->GetGUID());
|
||||
break;
|
||||
default:
|
||||
summons.Summon(summon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
if (type == DATA_ACHIEVEMT_ENLIGIBLE)
|
||||
return _achievementEnligible;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
@@ -137,15 +241,41 @@ class boss_erudax : public CreatureScript
|
||||
case EVENT_ENFEEBLING_BLOW:
|
||||
DoCastVictim(SPELL_ENFEEBLING_BLOW);
|
||||
break;
|
||||
case EVENT_SHADOW_GALE:
|
||||
case EVENT_SUMMON_SHADOW_GALE_STALKER:
|
||||
DoCastSelf(SPELL_SHADOW_GALE_TRIGGER, true);
|
||||
break;
|
||||
case EVENT_SHADOW_GALE:
|
||||
if (Creature* shadowGale = instance->GetCreature(DATA_SHADOW_GALE_STALKER))
|
||||
shadowGale->CastSpell(shadowGale, SPELL_SHADOW_GALE_TRIGGER_RUN_SPEED_TRIGGER);
|
||||
DoCastAOE(SPELL_SHADOW_GALE);
|
||||
events.ScheduleEvent(EVENT_BINDING_SHADOWS, Seconds(21));
|
||||
events.ScheduleEvent(EVENT_ENFEEBLING_BLOW, Seconds(20));
|
||||
events.ScheduleEvent(EVENT_SUMMON_FACELESS_CORRUPTOR, Seconds(18));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SHADOW_GALE_STALKER, Seconds(55));
|
||||
break;
|
||||
case EVENT_SUMMON_FACELESS_CORRUPTOR:
|
||||
Talk(SAY_FACELESS_CORRUPTORS);
|
||||
Talk(SAY_ANNOUNCE_GUARDIANS);
|
||||
DoCastSelf(SPELL_SUMMON_FACELESS_CORRUPTOR, true);
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SHIELD_OF_NIGHTMARES, Seconds(19));
|
||||
break;
|
||||
case EVENT_SHIELD_OF_NIGHTMARES:
|
||||
if (instance->GetCreature(DATA_FACELESS_CORRUPTOR_1) || instance->GetCreature(DATA_FACELESS_CORRUPTOR_2))
|
||||
{
|
||||
Talk(SAY_ANNOUNCE_SHIELD_OF_NIGHTMARES);
|
||||
DoCastAOE(SPELL_SHIELD_OF_NIGHTMARES);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _achievementEnligible;
|
||||
GuidSet _corruptorGUIDList;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
@@ -154,6 +284,127 @@ class boss_erudax : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class npc_erudax_faceless_corruptor : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_erudax_faceless_corruptor() : CreatureScript("npc_erudax_faceless_corruptor") { }
|
||||
|
||||
struct npc_erudax_faceless_corruptorAI : public ScriptedAI
|
||||
{
|
||||
npc_erudax_faceless_corruptorAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()){ }
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if (me->GetEntry() == NPC_FACELESS_CORRUPTOR_1)
|
||||
me->GetMotionMaster()->MovePoint(POINT_PATH_1, facelessCorruptorPositions1[0], true);
|
||||
else
|
||||
me->GetMotionMaster()->MovePoint(POINT_PATH_1, facelessCorruptorPositions2[0], true);
|
||||
_events.ScheduleEvent(EVENT_SEND_ENCOUNTER_FRAME, Seconds(7) + Milliseconds(500));
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
me->DespawnOrUnsummon(Milliseconds(100));
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
switch (point)
|
||||
{
|
||||
case POINT_PATH_1:
|
||||
if (me->GetEntry() == NPC_FACELESS_CORRUPTOR_1)
|
||||
me->GetMotionMaster()->MovePoint(POINT_PATH_2, facelessCorruptorPositions1[1], true);
|
||||
else
|
||||
me->GetMotionMaster()->MovePoint(POINT_PATH_2, facelessCorruptorPositions2[1], true);
|
||||
break;
|
||||
case POINT_PATH_2:
|
||||
if (me->GetEntry() == NPC_FACELESS_CORRUPTOR_1)
|
||||
me->GetMotionMaster()->MovePoint(POINT_PATH_3, facelessCorruptorPositions1[2], true);
|
||||
else
|
||||
me->GetMotionMaster()->MovePoint(POINT_PATH_3, facelessCorruptorPositions2[2], true);
|
||||
break;
|
||||
case POINT_PATH_3:
|
||||
_events.ScheduleEvent(EVENT_TWILIGHT_CORRUPTION, Seconds(1));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_FINISH_CORRUPTION)
|
||||
_events.ScheduleEvent(EVENT_UMBRAL_MENDING, Milliseconds(400));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
me->DespawnOrUnsummon(Seconds(5));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SEND_ENCOUNTER_FRAME:
|
||||
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
break;
|
||||
case EVENT_TWILIGHT_CORRUPTION:
|
||||
if (Creature* erudax = _instance->GetCreature(DATA_ERUDAX))
|
||||
erudax->AI()->DoAction(ACTION_FAIL_ACHIEVEMENT);
|
||||
DoCastAOE(SPELL_TWILIGHT_CORRUPTION);
|
||||
break;
|
||||
case EVENT_UMBRAL_MENDING:
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
|
||||
DoCastAOE(SPELL_UMBRAL_MENDING);
|
||||
_events.ScheduleEvent(EVENT_ATTACK_PLAYER, Seconds(3));
|
||||
_events.ScheduleEvent(EVENT_SIPHON_ESSENCE, Seconds(55));
|
||||
break;
|
||||
case EVENT_ATTACK_PLAYER:
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Player* player = me->SelectNearestPlayer(100.0f))
|
||||
me->AI()->AttackStart(player);
|
||||
break;
|
||||
case EVENT_SIPHON_ESSENCE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
DoCast(target, SPELL_SIPHON_ESSENCE);
|
||||
_events.Repeat(Seconds(11));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetGrimBatolAI<npc_erudax_faceless_corruptorAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_erudax_shadow_gale_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -192,7 +443,7 @@ class ShadowGaleDistanceCheck
|
||||
|
||||
bool operator()(WorldObject* object)
|
||||
{
|
||||
return (object->GetDistance2d(_pos.GetPositionX(), _pos.GetPositionY()) <= 3.0f);
|
||||
return (object->GetDistance2d(_pos.GetPositionX(), _pos.GetPositionY()) <= 4.0f);
|
||||
}
|
||||
private:
|
||||
Position _pos;
|
||||
@@ -212,7 +463,10 @@ class spell_erudax_shadow_gale : public SpellScriptLoader
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.remove_if(ShadowGaleDistanceCheck(GetExplTargetDest()->GetPosition()));
|
||||
if (Unit* caster = GetCaster())
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (Creature* shadowGale = instance->GetCreature(DATA_SHADOW_GALE_STALKER))
|
||||
targets.remove_if(ShadowGaleDistanceCheck(shadowGale->GetPosition()));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -257,10 +511,110 @@ class spell_erudax_shadow_gale_aura : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_erudax_twilight_corruption: public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_erudax_twilight_corruption() : SpellScriptLoader("spell_erudax_twilight_corruption") { }
|
||||
|
||||
class spell_erudax_twilight_corruption_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_erudax_twilight_corruption_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), true));
|
||||
targets.resize(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_erudax_twilight_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_erudax_twilight_corruption_SpellScript();
|
||||
}
|
||||
|
||||
class spell_erudax_twilight_corruption_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_erudax_twilight_corruption_AuraScript);
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetOwner()->ToUnit())
|
||||
{
|
||||
if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, target))
|
||||
{
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
int32 damage = CalculatePct(target->GetMaxHealth(), spell->Effects[EFFECT_0].BasePoints);
|
||||
target->CastCustomSpell(target, spellId, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnAuraRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* creature = caster->ToCreature())
|
||||
if (creature->IsAIEnabled)
|
||||
creature->AI()->DoAction(ACTION_FINISH_CORRUPTION);
|
||||
|
||||
if (Unit* owner = GetOwner()->ToUnit())
|
||||
{
|
||||
owner->CastSpell(owner, SPELL_SUMMON_TWILIGHT_EGG, true);
|
||||
owner->CastSpell(owner, SPELL_SUMMON_TWILIGHT_HATCHLING, true);
|
||||
owner->SetDisplayId(MODEL_ID_INVISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_erudax_twilight_corruption_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_erudax_twilight_corruption_AuraScript::OnAuraRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_erudax_twilight_corruption_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_dont_need_to_break_eggs : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_dont_need_to_break_eggs() : AchievementCriteriaScript("achievement_dont_need_to_break_eggs") { }
|
||||
|
||||
bool OnCheck(Player* /*source*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (target->GetMap()->IsHeroic())
|
||||
return target->GetAI()->GetData(DATA_ACHIEVEMT_ENLIGIBLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_erudax()
|
||||
{
|
||||
new boss_erudax();
|
||||
new npc_erudax_faceless_corruptor();
|
||||
new spell_erudax_shadow_gale_trigger();
|
||||
new spell_erudax_shadow_gale();
|
||||
new spell_erudax_shadow_gale_aura();
|
||||
new spell_erudax_twilight_corruption();
|
||||
new achievement_dont_need_to_break_eggs();
|
||||
}
|
||||
|
||||
@@ -26,46 +26,54 @@ uint32 const EncounterCount = 5;
|
||||
enum GBDataTypes
|
||||
{
|
||||
// Encounter States
|
||||
DATA_GENERAL_UMBRISS = 0,
|
||||
DATA_FORGEMASTER_THRONGUS = 1,
|
||||
DATA_DRAHGA_SHADOWBURNER = 2,
|
||||
DATA_ERUDAX = 3,
|
||||
DATA_GENERAL_UMBRISS = 0,
|
||||
DATA_FORGEMASTER_THRONGUS = 1,
|
||||
DATA_DRAHGA_SHADOWBURNER = 2,
|
||||
DATA_ERUDAX = 3,
|
||||
|
||||
// Encounter Data
|
||||
DATA_VALIONA = 4,
|
||||
DATA_FACELESS_PORTAL_STALKER = 5,
|
||||
DATA_SHADOW_GALE_STALKER = 6
|
||||
DATA_VALIONA = 4,
|
||||
DATA_FACELESS_PORTAL_STALKER = 5,
|
||||
DATA_SHADOW_GALE_STALKER = 6,
|
||||
DATA_SHADOW_GALE_CONTROLLER_STALKER = 7,
|
||||
DATA_FACELESS_CORRUPTOR_1 = 8,
|
||||
DATA_FACELESS_CORRUPTOR_2 = 9
|
||||
};
|
||||
|
||||
enum GBCreatureIds
|
||||
{
|
||||
// Bosses
|
||||
BOSS_GENERAL_UMBRISS = 39625,
|
||||
BOSS_FORGEMASTER_THRONGUS = 40177,
|
||||
BOSS_DRAHGA_SHADOWBURNER = 40319,
|
||||
BOSS_ERUDAX = 40484,
|
||||
BOSS_GENERAL_UMBRISS = 39625,
|
||||
BOSS_FORGEMASTER_THRONGUS = 40177,
|
||||
BOSS_DRAHGA_SHADOWBURNER = 40319,
|
||||
BOSS_ERUDAX = 40484,
|
||||
|
||||
// General Umbriss encounter
|
||||
NPC_BLITZ_STALKER = 40040,
|
||||
NPC_GROUND_SIEGE_STALKER = 40030,
|
||||
NPC_MALIGNANT_TROGG = 39984,
|
||||
NPC_TROGG_DWELLER = 45467,
|
||||
NPC_BLITZ_STALKER = 40040,
|
||||
NPC_GROUND_SIEGE_STALKER = 40030,
|
||||
NPC_MALIGNANT_TROGG = 39984,
|
||||
NPC_TROGG_DWELLER = 45467,
|
||||
|
||||
// Forgemaster Throngus Encounter
|
||||
NPC_CAVE_IN_STALKER = 40228,
|
||||
NPC_FIXATE_STALKER = 40255,
|
||||
NPC_CAVE_IN_STALKER = 40228,
|
||||
NPC_FIXATE_STALKER = 40255,
|
||||
|
||||
// Drahga Shadowburner Encounter
|
||||
NPC_INVOCATION_OF_FLAME_STALKER = 40355,
|
||||
NPC_INVOKED_FLAMING_SPIRIT = 40357,
|
||||
NPC_SEEPING_TWILIGHT = 40365,
|
||||
NPC_DEVOURING_FLAMES = 48798,
|
||||
NPC_VALIONA = 40320,
|
||||
NPC_INVOCATION_OF_FLAME_STALKER = 40355,
|
||||
NPC_INVOKED_FLAMING_SPIRIT = 40357,
|
||||
NPC_SEEPING_TWILIGHT = 40365,
|
||||
NPC_DEVOURING_FLAMES = 48798,
|
||||
NPC_VALIONA = 40320,
|
||||
|
||||
// Erudax Encounter
|
||||
NPC_FACELESS_PORTAL_STALKER = 44314,
|
||||
NPC_ALEXSTRASZAS_EGG = 40486,
|
||||
NPC_SHADOW_GALE_STALKER = 40567,
|
||||
NPC_FACELESS_PORTAL_STALKER = 44314,
|
||||
NPC_ALEXSTRASZAS_EGG = 40486,
|
||||
NPC_SHADOW_GALE_STALKER = 40567,
|
||||
NPC_SHADOW_GALE_CONTROLLER_STALKER = 40566,
|
||||
NPC_FACELESS_CORRUPTOR_1 = 40600,
|
||||
NPC_FACELESS_CORRUPTOR_2 = 48844,
|
||||
NPC_TWILIGHT_HATCHLING = 39388,
|
||||
NPC_HATCHED_TWILIGHT_EGG = 40846,
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -21,14 +21,17 @@
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ BOSS_GENERAL_UMBRISS, DATA_GENERAL_UMBRISS },
|
||||
{ BOSS_FORGEMASTER_THRONGUS, DATA_FORGEMASTER_THRONGUS },
|
||||
{ BOSS_DRAHGA_SHADOWBURNER, DATA_DRAHGA_SHADOWBURNER },
|
||||
{ BOSS_ERUDAX, DATA_ERUDAX },
|
||||
{ NPC_VALIONA, DATA_VALIONA },
|
||||
{ NPC_FACELESS_PORTAL_STALKER, DATA_FACELESS_PORTAL_STALKER },
|
||||
{ NPC_SHADOW_GALE_STALKER, DATA_SHADOW_GALE_STALKER },
|
||||
{ 0, 0 } // End
|
||||
{ BOSS_GENERAL_UMBRISS, DATA_GENERAL_UMBRISS },
|
||||
{ BOSS_FORGEMASTER_THRONGUS, DATA_FORGEMASTER_THRONGUS },
|
||||
{ BOSS_DRAHGA_SHADOWBURNER, DATA_DRAHGA_SHADOWBURNER },
|
||||
{ BOSS_ERUDAX, DATA_ERUDAX },
|
||||
{ NPC_VALIONA, DATA_VALIONA },
|
||||
{ NPC_FACELESS_PORTAL_STALKER, DATA_FACELESS_PORTAL_STALKER },
|
||||
{ NPC_SHADOW_GALE_STALKER, DATA_SHADOW_GALE_STALKER },
|
||||
{ NPC_SHADOW_GALE_CONTROLLER_STALKER, DATA_SHADOW_GALE_CONTROLLER_STALKER },
|
||||
{ NPC_FACELESS_CORRUPTOR_1, DATA_FACELESS_CORRUPTOR_1 },
|
||||
{ NPC_FACELESS_CORRUPTOR_2, DATA_FACELESS_CORRUPTOR_2 },
|
||||
{ 0, 0 } // End
|
||||
};
|
||||
|
||||
class instance_grim_batol : public InstanceMapScript
|
||||
@@ -68,10 +71,23 @@ class instance_grim_batol : public InstanceMapScript
|
||||
drahga->AI()->JustSummoned(creature);
|
||||
break;
|
||||
case NPC_SHADOW_GALE_STALKER:
|
||||
case NPC_HATCHED_TWILIGHT_EGG:
|
||||
if (Creature* erudax = GetCreature(DATA_ERUDAX))
|
||||
erudax->AI()->JustSummoned(creature);
|
||||
break;
|
||||
case NPC_TWILIGHT_HATCHLING:
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
if (Creature* erudax = GetCreature(DATA_ERUDAX))
|
||||
erudax->AI()->JustSummoned(creature);
|
||||
|
||||
if (Creature* stalker = GetCreature(DATA_SHADOW_GALE_CONTROLLER_STALKER))
|
||||
{
|
||||
creature->SetSpeed(MOVE_FLIGHT, 4.5f);
|
||||
creature->GetMotionMaster()->MoveCirclePath(stalker->GetPositionX(), stalker->GetPositionY(), 253.845f, 30.0f, true, 8);
|
||||
}
|
||||
break;
|
||||
case NPC_ALEXSTRASZAS_EGG:
|
||||
creature->SetHealth(creature->GetMaxHealth());
|
||||
alexstraszasEggGuidList.insert(creature->GetGUID());
|
||||
break;
|
||||
default:
|
||||
@@ -95,21 +111,23 @@ class instance_grim_batol : public InstanceMapScript
|
||||
portal->RemoveAurasDueToSpell(SPELL_PORTAL_VISUAL);
|
||||
}
|
||||
if (state == FAIL)
|
||||
{
|
||||
for (auto itr = alexstraszasEggGuidList.begin(); itr != alexstraszasEggGuidList.end(); itr++)
|
||||
{
|
||||
if (Creature* egg = instance->GetCreature((*itr)))
|
||||
{
|
||||
egg->Respawn();
|
||||
egg->SetHealth(egg->GetMaxHealth());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData(uint32 data, uint32 value) override
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
GuidSet alexstraszasEggGuidList;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user