diff --git a/sql/updates/world/4.3.4/WIP/vanessa.sql b/sql/updates/world/4.3.4/WIP/vanessa.sql index 8299b323553..69f22bf3105 100644 --- a/sql/updates/world/4.3.4/WIP/vanessa.sql +++ b/sql/updates/world/4.3.4/WIP/vanessa.sql @@ -1,15 +1,41 @@ /* + + + 21:35:31.527 -- spawn boss 21:35:37.564 -- aggro 21:35:48.422 -- deflection 1 21:35:49.607 -- deadly blades 1 +21:35:46.004 -- summon defias enforcer +21:35:46.222 -- talk reinforcmeent + +21:35:50.013 -- summon fires + +21:35:56.456 -- summon defias shadowguard +21:36:06.065 -- summon bloodmage + + +21:36:19.325 -- jump to +21:36:20.527 +21:36:20.745 -- hahaha narren 21:36:24.349 -- announce sprengstoff +21:36:25.051 -- summon ropes + CLICK ME aura --> 95527 - +21:36:48.248 -- deadly blades 2 21:36:43.428 -- # 2 + +21:13:21.384 -- blood wizard aggro +21:13:21.384 -- blood bolt 90938 +21:13:24.988 -- blood bolt +21:13:28.591 -- rage zone 90932 + +21:37:55.282 -- ride vehicle +21:37:56.093 -- move path +21:38:04.954 -- despawn + */ @@ -44,6 +70,24 @@ UPDATE `creature_template` SET `DamageModifier`= 42.2, `mechanic_immune_mask`= 6 UPDATE `creature_template` SET `VehicleId`= 1403 WHERE `entry`= 49539; -- Enraged Worgen UPDATE `creature_template` SET `DamageModifier`= 35 WHERE `entry`= 49532; +-- Defias Enforcer +UPDATE `creature_template` SET `difficulty_entry_1`= 49851 WHERE `entry`= 49850; +UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `exp`= 3 WHERE `entry`= 49851; +-- Defias Shadowguard +UPDATE `creature_template` SET `difficulty_entry_1`= 49853, `unit_class`= 4 WHERE `entry`= 49852; +UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `exp`= 3, `unit_class`= 4 WHERE `entry`= 49853; +-- Defias Blood Wizard +UPDATE `creature_template` SET `difficulty_entry_1`= 49855 WHERE `entry`= 49854; +UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `exp`= 3 WHERE `entry`= 49855; +-- Vanessa's Rope Anchor +UPDATE `creature_template` SET `InhabitType`= 4, `flags_extra`= 128 WHERE `entry`= 49552; +-- Rope +UPDATE `creature_template` SET `ScriptName`= 'npc_vanessa_rope' WHERE `entry`= 49550; + + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`= 49550; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(49550, 89731, 1, 0); -- Template Addons @@ -141,12 +185,15 @@ INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_deadmines_ride_magma_vehicle', 'spell_deadmines_magma_trap_throw_to_location', -'spell_vanessa_backslash_targeting'); +'spell_vanessa_backslash_targeting', +'spell_vanessa_backslash_targeting', +'spell_deadmines_bloodbath'); INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (92378, 'spell_deadmines_ride_magma_vehicle'), (92438, 'spell_deadmines_magma_trap_throw_to_location'), -(92620, 'spell_vanessa_backslash_targeting'); +(92620, 'spell_vanessa_backslash_targeting'), +(90925, 'spell_deadmines_bloodbath'); -- Spellclick spells DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (49457); @@ -155,9 +202,15 @@ INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `use (49457, 92399, 0, 0); -- Conditions -DELETE FROM `conditions` WHERE `SourceEntry` IN (92379) AND `SourceTypeOrReferenceId`= 13; +DELETE FROM `conditions` WHERE `SourceEntry` IN (92379, 90962, 90963) AND `SourceTypeOrReferenceId`= 13; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES -(13, 1, 92379, 0, 0, 31, 0, 3, 49454, 0, 0, 0, '', 'Ride Magma Vehicle - Vanessa''s Trap Bunny'); +(13, 1, 92379, 0, 0, 31, 0, 3, 49454, 0, 0, 0, '', 'Ride Magma Vehicle - Target Vanessa''s Trap Bunny'), +(13, 1, 90962, 0, 0, 31, 0, 3, 49850, 0, 0, 0, '', 'Whirling Blades - Target Defias Enforcer'), +(13, 1, 90962, 0, 1, 31, 0, 3, 49852, 0, 0, 0, '', 'Whirling Blades - Target Defias Shadowguard'), +(13, 1, 90962, 0, 2, 31, 0, 3, 49854, 0, 0, 0, '', 'Whirling Blades - Target Defias Blood Wizard'), +(13, 1, 90963, 0, 0, 31, 0, 3, 49850, 0, 0, 0, '', 'Whirling Blades - Target Defias Enforcer'), +(13, 1, 90963, 0, 1, 31, 0, 3, 49852, 0, 0, 0, '', 'Whirling Blades - Target Defias Shadowguard'), +(13, 1, 90963, 0, 2, 31, 0, 3, 49854, 0, 0, 0, '', 'Whirling Blades - Target Defias Blood Wizard'); -- Creature Collapsing Icicle 49481 SAI SET @ENTRY := 49481; @@ -205,3 +258,37 @@ DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (@ENTRY, 0, 0, 0, 0, 0, 100, 0, 2600, 2600, 3600, 3600, 11, 59304, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 2600 and 2600 ms (and later repeats every 3600 and 3600 ms) - Self: Cast spell Spirit Strike (59304) on Victim // "); +-- Creature Defias Enforcer 49850 SAI +SET @ENTRY := 49850; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 11, 90931, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 1000 and 1000 ms (and later repeats every 0 and 0 ms) - Self: Cast spell Charge (90931) on Closest player in 50 yards // "), +(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 6500, 7000, 30000, 30000, 11, 90925, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 6500 and 7000 ms (and later repeats every 30000 and 30000 ms) - Self: Cast spell Bloodbath (90925) on Victim // "), +(@ENTRY, 0, 2, 0, 2, 0, 100, 0, 0, 20, 29000, 30000, 11, 90929, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "When health between 0% and 20% (check every 29000 - 30000 ms) - Self: Cast spell Recklessness (90929) on Self // "); + +-- Creature Defias Shadowguard 49852 SAI +SET @ENTRY := 49852; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 11, 90954, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 1000 and 1000 ms (and later repeats every 0 and 0 ms) - Self: Cast spell Camouflage (90954) on Self // "), +(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 5500, 6000, 10000, 11000, 11, 90951, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 5500 and 6000 ms (and later repeats every 10000 and 11000 ms) - Self: Cast spell Sinister Strike (90951) on Victim // "), +(@ENTRY, 0, 2, 0, 0, 0, 100, 0, 10000, 10000, 20000, 20000, 11, 90956, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 10000 and 10000 ms (and later repeats every 20000 and 20000 ms) - Self: Cast spell Shadowstep (90956) on Victim // "), +(@ENTRY, 0, 3, 0, 0, 0, 100, 0, 13000, 13000, 16000, 16000, 11, 90960, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 13000 and 13000 ms (and later repeats every 16000 and 16000 ms) - Self: Cast spell Whirling Blades (90960) on Victim // "), +(@ENTRY, 0, 4, 0, 2, 0, 100, 0, 0, 20, 29000, 30000, 11, 90958, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "When health between 0% and 20% (check every 29000 - 30000 ms) - Self: Cast spell Evasion (90958) on Self // "); + +-- Creature Defias Blood Wizard 49854 SAI +SET @ENTRY := 49854; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 0, 0, 100, 0, 0, 0, 3000, 3000, 11, 90938, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 0 and 0 ms (and later repeats every 3000 and 3000 ms) - Self: Cast spell Bloodbolt (90938) on Victim // "), +(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 7000, 7000, 60000, 60000, 11, 90932, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 7000 and 7000 ms (and later repeats every 60000 and 60000 ms) - Self: Cast spell Ragezone (90932) on Random hostile // "); + + + + + + + diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 4b67f0547bf..0e9606f7833 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4193,7 +4193,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); }); - // "Captain" Coikie + // "Captain" Cookie // Rotten Aura ApplySpellFix({ 89735, @@ -4215,6 +4215,18 @@ void SpellMgr::LoadSpellInfoCorrections() { spellInfo->Effects[EFFECT_0].MiscValue = 200; }); + + // Summon Defias + ApplySpellFix({ + 92616, + 92617, + 92618 + }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); + spellInfo->AttributesEx2 |= SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS; + }); + // END OF DEADMINES SPELLS // @@ -4349,6 +4361,21 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx8 |= SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER; }); + // Destruction Protocoll + ApplySpellFix({ 77437 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO; + }); + + // Crumbling Ruin + ApplySpellFix({ + 75609, + 91206 + }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); + }); + // Solar Fire ApplySpellFix({ 89133, 89878 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_vanessa_van_cleef.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_vanessa_van_cleef.cpp index 8294722d210..69b7246431c 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_vanessa_van_cleef.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_vanessa_van_cleef.cpp @@ -18,6 +18,7 @@ #include "ScriptMgr.h" #include "deadmines.h" #include "InstanceScript.h" +#include "GridNotifiers.h" #include "MotionMaster.h" #include "MovementTypedefs.h" #include "MoveSplineInit.h" @@ -33,7 +34,9 @@ enum Texts // Vanessa VanCleef SAY_AGGRO = 0, SAY_SLAY = 1, - SAY_SUMMON_DEFIAS_SUPPORT = 2, + SAY_SUMMON_DEFIAS_REINFORCEMENT = 2, + SAY_DETONATION_1 = 3, + SAY_ANNOUNCE_DETONATION_1 = 4, // Vanessa VanCleef Intro SAY_ANNOUNCE_NOISE_FROM_ABOVE = 0, @@ -51,16 +54,23 @@ enum Texts enum Spells { // Vanessa VanCleef + SPELL_VANESSA_ACHIEVEMENT_SPELL = 95654, + SPELL_CLEAR_ALL_DEBUFFS = 34098, SPELL_DEFLECTION = 92614, SPELL_DEADLY_BLADES = 92622, - SPELL_BACK_SLASH = 92619, + SPELL_BACKSLASH = 92619, + SPELL_SUMMON_ENFORCER = 92616, + SPELL_SUMMON_SHADOWGUARD = 92618, + SPELL_SUMMON_BLOOD_WIZARD = 92617, + + // General Purpose Bunny JMF + SPELL_FIERY_BLAZE = 93484, // Vanessa VanCleef Nightmare SPELL_SITTING = 89279, SPELL_NOXIOUS_CONCOCTION = 92100, SPELL_NIGHTMARE_ELIXIR = 92113, - SPELL_VANESSAS_BLACKOUT_AURA = 92120, - + SPELL_VANESSAS_BLACKOUT_AURA = 92120 }; enum Events @@ -68,6 +78,13 @@ enum Events // Vanessa VanCleef EVENT_DEFLECTION = 1, EVENT_DEADLY_BLADES, + EVENT_SUMMON_DEFIAS_REINFORCEMENT, + EVENT_TALK_SUMMON_REINFORCEMENT, + EVENT_SUMMON_ENTRANCE_FIRE, + EVENT_FACE_TO_DECK, + EVENT_TALK_DETONATION_1, + EVENT_ANNOUNCE_DETONATION_1, + EVENT_SUMMON_ROPES, // Vanessa VanCleef Intro EVENT_ANNOUNCE_NOISE_FROM_ABOVE, @@ -88,10 +105,35 @@ enum Events // A Note from Vanessa VanCleef EVENT_TALK_NOTE_FALLS_TO_THE_GROUND, + + // Rope + EVENT_START_SWING +}; + +enum DefiasReinforcements +{ + REINFORCEMENT_ENFORCER = 0, + REINFORCEMENT_SHADOWGUARD = 1, + REINFORCEMENT_BLOOD_WIZARD = 2 +}; + +uint32 defiasReinforcementSpells[] = +{ + SPELL_SUMMON_ENFORCER, + SPELL_SUMMON_SHADOWGUARD, + SPELL_SUMMON_BLOOD_WIZARD +}; + +Position const defiasReinforcementPositions[] = +{ + { -79.9097f, -824.49f, 39.7954f }, + { -79.8455f, -815.483f, 39.7768f }, + { -87.2257f, -819.66f, 39.2205f } }; Position const vanessaIntroJumpPos = { -64.5677f, -820.161f, 41.123f }; Position const vanessaIntroWalkPos = { -65.30209f, -838.0382f, 41.11562f }; +Position const vanessaDetonationJumpPos = { -53.09028f, -819.5538f, 51.42455f }; class boss_vanessa_van_cleef : public CreatureScript { @@ -100,10 +142,21 @@ class boss_vanessa_van_cleef : public CreatureScript struct boss_vanessa_van_cleefAI : public BossAI { - boss_vanessa_van_cleefAI(Creature* creature) : BossAI(creature, DATA_VANESSA_VAN_CLEEF) { } + boss_vanessa_van_cleefAI(Creature* creature) : BossAI(creature, DATA_VANESSA_VAN_CLEEF) + { + Initialize(); + } + + void Initialize() + { + _currentReinforcement = REINFORCEMENT_ENFORCER; + _detonationCounter = 0; + _talkReinforcement = false; + } void Reset() override { + Initialize(); _Reset(); } @@ -111,8 +164,13 @@ class boss_vanessa_van_cleef : public CreatureScript { Talk(SAY_AGGRO); _JustEngagedWith(); + DoCastAOE(SPELL_VANESSA_ACHIEVEMENT_SPELL, true); instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); events.ScheduleEvent(EVENT_DEFLECTION, Seconds(11)); + events.ScheduleEvent(EVENT_DEADLY_BLADES, Seconds(12)); + events.ScheduleEvent(EVENT_SUMMON_ENTRANCE_FIRE, Seconds(12) + Milliseconds(500)); + events.ScheduleEvent(EVENT_SUMMON_DEFIAS_REINFORCEMENT, Seconds(14) + Milliseconds(500)); + } void JustDied(Unit* /*killer*/) override @@ -126,7 +184,6 @@ class boss_vanessa_van_cleef : public CreatureScript _EnterEvadeMode(); summons.DespawnAll(); instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); - instance->SetData(DATA_VANESSA_VAN_CLEEF_ENCOUNTER, FAIL); _DespawnAtEvade(); } @@ -136,6 +193,40 @@ class boss_vanessa_van_cleef : public CreatureScript Talk(SAY_SLAY); } + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) override + { + if (me->HealthBelowPct(50) && _detonationCounter == 0) + { + me->AttackStop(); + me->SetReactState(REACT_PASSIVE); + me->RemoveAurasDueToSpell(SPELL_DEADLY_BLADES); + events.Reset(); + DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + float distance = me->GetDistance(vanessaDetonationJumpPos); + me->GetMotionMaster()->MoveJump(vanessaDetonationJumpPos, distance, 27.96389f); + events.ScheduleEvent(EVENT_FACE_TO_DECK, Seconds(1) + Milliseconds(200)); + _detonationCounter++; + } + } + + void JustSummoned(Creature* summon) override + { + if (summon->GetEntry() != NPC_ROPE && summon->GetEntry() != NPC_GENERAL_PURPOSE_DUMMY_JMF) + BossAI::JustSummoned(summon); + else + summons.Summon(summon); + + switch (summon->GetEntry()) + { + case NPC_GENERAL_PURPOSE_DUMMY_JMF: + summon->CastSpell(summon, SPELL_FIERY_BLAZE, true); + break; + default: + break; + } + } + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) @@ -154,12 +245,65 @@ class boss_vanessa_van_cleef : public CreatureScript if (me->HealthAbovePct(25)) DoCastSelf(SPELL_DEFLECTION); break; + case EVENT_DEADLY_BLADES: + DoCastSelf(SPELL_DEADLY_BLADES); + break; + case EVENT_SUMMON_DEFIAS_REINFORCEMENT: + { + if (me->HealthAbovePct(50)) + { + if (!_talkReinforcement) + { + events.ScheduleEvent(EVENT_TALK_SUMMON_REINFORCEMENT, Milliseconds(200)); + _talkReinforcement = true; + } + + float x = defiasReinforcementPositions[_currentReinforcement].m_positionX; + float y = defiasReinforcementPositions[_currentReinforcement].m_positionY; + float z = defiasReinforcementPositions[_currentReinforcement].m_positionZ; + + me->CastSpell(x, y, z, defiasReinforcementSpells[_currentReinforcement], true); + _currentReinforcement++; + + if (_currentReinforcement > REINFORCEMENT_BLOOD_WIZARD) + _currentReinforcement = REINFORCEMENT_ENFORCER; + + events.Repeat(Seconds(10)); + } + break; + } + case EVENT_TALK_SUMMON_REINFORCEMENT: + Talk(SAY_SUMMON_DEFIAS_REINFORCEMENT); + break; + case EVENT_SUMMON_ENTRANCE_FIRE: + for (uint8 i = 0; i < 6; i++) + DoSummon(NPC_GENERAL_PURPOSE_DUMMY_JMF, VanessaEntranceFirePos[i], 0, TEMPSUMMON_MANUAL_DESPAWN); + break; + case EVENT_FACE_TO_DECK: + me->SetFacingTo(2.932153f); + events.ScheduleEvent(EVENT_TALK_DETONATION_1, Milliseconds(200)); + break; + case EVENT_TALK_DETONATION_1: + Talk(SAY_DETONATION_1); + events.ScheduleEvent(EVENT_ANNOUNCE_DETONATION_1, Seconds(3) + Milliseconds(600)); + break; + case EVENT_ANNOUNCE_DETONATION_1: + Talk(SAY_ANNOUNCE_DETONATION_1); + events.ScheduleEvent(EVENT_SUMMON_ROPES, Milliseconds(700)); + break; + case EVENT_SUMMON_ROPES: + instance->SetData(DATA_SUMMON_ROPES, 0); + break; default: break; } } DoMeleeAttackIfReady(); } + private: + uint8 _currentReinforcement; + uint8 _detonationCounter; + bool _talkReinforcement; }; CreatureAI* GetAI(Creature *creature) const override @@ -325,9 +469,126 @@ class npc_vanessa_note_from_vanessa : public CreatureScript } }; +class spell_vanessa_backslash_targeting : public SpellScriptLoader +{ + public: + spell_vanessa_backslash_targeting() : SpellScriptLoader("spell_vanessa_backslash_targeting") { } + + class spell_vanessa_backslash_targeting_SpellScript : public SpellScript + { + PrepareSpellScript(spell_vanessa_backslash_targeting_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_BACKSLASH }); + } + + void HandleHit(SpellEffIndex effIndex) + { + GetCaster()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[effIndex].BasePoints, true); + } + + void FilterTargets(std::list& targets) + { + targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_BACKSLASH)); + + if (!targets.empty()) + Trinity::Containers::RandomResize(targets, 1); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_vanessa_backslash_targeting_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_vanessa_backslash_targeting_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_vanessa_backslash_targeting_SpellScript(); + } +}; + +class npc_vanessa_rope : public CreatureScript +{ + public: + npc_vanessa_rope() : CreatureScript("npc_vanessa_rope") { } + + struct npc_vanessa_ropeAI : public ScriptedAI + { + npc_vanessa_ropeAI(Creature* creature) : ScriptedAI(creature) { } + + void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) override + { + if (!passenger) + return; + + if (apply && passenger->GetTypeId() == TYPEID_PLAYER) + { + me->RemoveAurasDueToSpell(SPELL_CLICK_ME); + _events.ScheduleEvent(EVENT_START_SWING, Milliseconds(800)); + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_START_SWING: + for (uint8 i = 0; i < 5; i++) + if (RopePos[i].GetExactDist(me->GetPosition()) <= 1.0f) + { + me->DespawnOrUnsummon(Seconds(8) + Milliseconds(900)); + me->SetSpeed(MOVE_RUN, 22.0f); // Don't ask me why but this is the correct speed to be synch with sniff behaivior + switch (i) + { + case 0: + me->GetMotionMaster()->MoveSmoothPath(0, RopePath1, 5, false, true); + break; + case 1: + me->GetMotionMaster()->MoveSmoothPath(0, RopePath2, 5, false, true); + break; + case 2: + me->GetMotionMaster()->MoveSmoothPath(0, RopePath3, 5, false, true); + break; + case 3: + me->GetMotionMaster()->MoveSmoothPath(0, RopePath4, 5, false, true); + break; + case 4: + me->GetMotionMaster()->MoveSmoothPath(0, RopePath5, 5, false, true); + break; + } + break; + } + break; + default: + break; + } + } + + } + private: + EventMap _events; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetDeadminesAI(creature); + } +}; + void AddSC_boss_vanessa_van_cleef() { new boss_vanessa_van_cleef(); new npc_vanessa_vanessa_van_cleef(); new npc_vanessa_note_from_vanessa(); + new npc_vanessa_rope(); + new spell_vanessa_backslash_targeting(); } diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index e860f50ea3b..dc3c6191f82 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -664,6 +664,35 @@ class spell_deadmines_magma_trap_throw_to_location : public SpellScriptLoader } }; +class spell_deadmines_bloodbath : public SpellScriptLoader +{ + public: + spell_deadmines_bloodbath() : SpellScriptLoader("spell_deadmines_bloodbath") { } + + class spell_deadmines_bloodbath_AuraScript : public AuraScript + { + PrepareAuraScript(spell_deadmines_bloodbath_AuraScript); + + void HandleTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + if (caster->GetVictim()) + caster->CastSpell(GetCaster()->GetVictim(), GetSpellInfo()->Effects[EFFECT_1].TriggerSpell, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_deadmines_bloodbath_AuraScript::HandleTick, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_deadmines_bloodbath_AuraScript(); + } +}; + void AddSC_deadmines() { new npc_deadmines_defias_watcher(); @@ -675,4 +704,5 @@ void AddSC_deadmines() new spell_deadmines_on_fire(); new spell_deadmines_ride_magma_vehicle(); new spell_deadmines_magma_trap_throw_to_location(); + new spell_deadmines_bloodbath(); } diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h index bfc63b96953..f9f8534ee59 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -50,7 +50,8 @@ enum DMDataTypes DATA_VANESSA_VAN_CLEEF_NIGHTMARE = 21, DATA_EMME_HARRINGTON = 22, DATA_ERIK_HARRINGTON = 23, - DATA_CALISSA_HARRINGTON = 24 + DATA_CALISSA_HARRINGTON = 24, + DATA_SUMMON_ROPES = 25 }; enum DMCreatures @@ -131,7 +132,9 @@ enum DMCreatures NPC_ENRAGED_WORGEN = 49532, NPC_JAMES_HARRINGTON = 49539, NPC_CALISSA_HARRINGTON = 49536, - + NPC_DEFIAS_SHADOWGUARD = 49852, + NPC_ROPE = 49550, + NPC_VANESSAS_ROPE_ANCHOR = 49552, }; enum DMGameObjects @@ -161,6 +164,7 @@ enum DMSpells SPELL_MOLTEN_MAGMA = 92424, SPELL_FORCE_MAGMA_TRAP_THROW = 92489, SPELL_ROPE_BEAM = 43785, + SPELL_CLICK_ME = 95527, SPELL_STEAM_VENT = 92399, SPELL_ADRENALINE = 92604, SPELL_NIGHTMARE_SLOW = 92559, @@ -402,6 +406,79 @@ Position const LightningPlatterCenterPos[] = { -143.004f, -574.9209f, 19.1443f } }; +Position const VanessaEntranceFirePos[] = +{ + { -38.11458f, -795.2952f, 39.45137f, 3.926991f }, + { -64.02257f, -797.4323f, 39.12309f, 3.926991f }, + { -46.48438f, -791.8073f, 39.12098f, 3.926991f }, + { -75.50694f, -787.1597f, 39.16325f, 3.926991f }, + { -66.18229f, -789.2778f, 39.78834f, 3.926991f }, + { -70.9809f, -795.5f, 39.14447f, 3.926991f } +}; + +Position const RopePos[] = +{ + { -62.17014f, -839.8438f, 41.48514f, 5.044002f }, + { -64.97049f, -840.0087f, 41.22668f, 4.834562f }, + { -67.79166f, -840.1736f, 40.96664f, 4.712389f }, + { -70.62153f, -840.0104f, 40.71846f, 4.537856f }, + { -73.42361f, -839.8646f, 40.47259f, 4.34587f } +}; + +Position const RopeAnchorPos[] = +{ + { -63.6059f, -862.7864f, 202.7301f, 4.607669f }, + { -64.21702f, -866.1823f, 195.3946f, 4.607669f }, + { -69.15452f, -868.9636f, 195.2482f, 4.607669f }, + { -71.11459f, -868.4636f, 200.7708f, 4.607669f }, + { -74.29688f, -877.1007f, 195.0443f, 4.607669f } +}; + +Position const RopePath1[] = +{ + { -59.18403f, -877.3125f, 35.78355f }, + { -58.08333f, -923.9757f, 50.83706f }, + { -52.68403f, -922.8768f, 50.83706f }, + { -58.59201f, -877.1684f, 38.01407f }, + { -62.86285f, -836.3472f, 46.62854f } +}; + +Position const RopePath2[] = +{ + { -62.23438f, -877.2969f, 35.78355f }, + { -66.63021f, -924.0417f, 50.83706f }, + { -60.85938f, -924.0399f, 50.83706f }, + { -62.03472f, -877.4514f, 38.01407f }, + { -64.96875f, -836.7847f, 46.62854f } +}; + +Position const RopePath3[] = +{ + { -67.98264f, -877.3785f, 35.78355f }, + { -75.66493f, -924.3958f, 50.83706f }, + { -69.01215f, -923.9114f, 50.83706f }, + { -67.80903f, -877.0972f, 38.01407f }, + { -68.02778f, -836.6268f, 46.62854f } +}; + +Position const RopePath4[] = +{ + { -74.47049f, -878.3611f, 35.78355f }, + { -82.86111f, -922.4688f, 50.83706f }, + { -77.72396f, -924.1285f, 50.83706f }, + { -71.76563f, -877.132f, 38.01407f }, + { -70.55209f, -836.6754f, 46.62854f } +}; + +Position const RopePath5[] = +{ + { -77.625f, -877.75f, 35.78355f }, + { -85.46528f, -922.4965f, 50.83706f }, + { -91.52431f, -921.3768f, 50.83706f }, + { -78.06944f, -875.9445f, 38.01407f }, + { -73.34549f, -836.3733f, 46.62854f } +}; + template AI* GetDeadminesAI(Creature* creature) { diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index af343bee2c8..d8302cb8e23 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -129,6 +129,7 @@ class instance_deadmines : public InstanceMapScript _deadEnragedWorgen = 0; _firstCookieSpawn = true; _noteSpawnChecked = false; + _ropesSpawned = false; } void OnPlayerEnter(Player* player) override @@ -143,6 +144,13 @@ class instance_deadmines : public InstanceMapScript events.ScheduleEvent(EVENT_SUMMON_NOTE_FROM_VANESSA, Milliseconds(1)); _noteSpawnChecked = true; } + + if (!_ropesSpawned) + { + for (uint8 i = 0; i < 5; i++) + if (Creature* anchor = instance->SummonCreature(NPC_VANESSAS_ROPE_ANCHOR, RopeAnchorPos[i])) + _ropeAnchorGuidSet.insert(anchor->GetGUID()); + } } void OnCreatureCreate(Creature* creature) override @@ -225,6 +233,7 @@ class instance_deadmines : public InstanceMapScript break; case NPC_VANESSAS_TRAP_BUNNY: case NPC_VANESSA_ANCHOR_BUNNY_JMF: + case NPC_VANESSAS_ROPE_ANCHOR: creature->setActive(true); creature->SetFarVisible(true); break; @@ -257,6 +266,16 @@ class instance_deadmines : public InstanceMapScript case NPC_ENRAGED_WORGEN: _ripsnarlNightareGuidSet.insert(creature->GetGUID()); break; + case NPC_DEFIAS_SHADOWGUARD: + creature->setPowerType(POWER_ENERGY); + creature->SetMaxPower(POWER_ENERGY, 100); + creature->SetPower(POWER_ENERGY, 100); + break; + case NPC_ROPE: + creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + if (Creature* vanessa = GetCreature(DATA_VANESSA_VAN_CLEEF)) + vanessa->AI()->JustSummoned(creature); + break; default: break; } @@ -522,6 +541,15 @@ class instance_deadmines : public InstanceMapScript trapBunny->AI()->DoAction(ACTION_EJECT_PLAYERS); } break; + case DATA_SUMMON_ROPES: + { + uint8 i = 0; + for (auto itr = _ropeAnchorGuidSet.begin(); itr != _ropeAnchorGuidSet.end(); itr++, i++) + if (Creature* anchor = instance->GetCreature((*itr))) + if (Creature* rope = instance->SummonCreature(NPC_ROPE, RopePos[i])) + anchor->CastSpell(rope, SPELL_ROPE_BEAM); + break; + } default: break; } @@ -815,8 +843,10 @@ class instance_deadmines : public InstanceMapScript GuidSet _helixNightmareGuidSet; GuidSet _mechanicalNightmareGuidSet; GuidSet _ripsnarlNightareGuidSet; + GuidSet _ropeAnchorGuidSet; bool _firstCookieSpawn; bool _noteSpawnChecked; + bool _ropesSpawned; }; InstanceScript* GetInstanceScript(InstanceMap* map) const override