diff --git a/sql/updates/world/custom/custom_2018_08_05_00_world.sql b/sql/updates/world/custom/custom_2018_08_05_00_world.sql new file mode 100644 index 0000000000..669a6e8773 --- /dev/null +++ b/sql/updates/world/custom/custom_2018_08_05_00_world.sql @@ -0,0 +1,121 @@ +-- Template Updates +-- Shadow of Obsidius +UPDATE `creature_template` SET `modelid1`= 35979, `BaseVariance`= 0.5, `DamageModifier`= 4 WHERE `entry`= 40818; +UPDATE `creature_template` SET `BaseVariance`= 0.5, `DamageModifier`= 8 WHERE `entry`= 40817; + +-- Template Addon +DELETE FROM `creature_template_addon` WHERE `entry` IN (40817, 40818); +INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES +(40817, '76190 76164 76167 75054'), +(40818, '76190 76164 76167 75054'); + +-- Spells +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_obsidius_twitchy', +'spell_obsidius_transformation', +'spell_obsidius_transformation_not_selectable', +'spell_obsidius_transformation_scale', +'spell_obsidius_crepuscular_veil'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(76167, 'spell_obsidius_twitchy'), +(76196, 'spell_obsidius_transformation'), +(76242, 'spell_obsidius_transformation_not_selectable'), +(76200, 'spell_obsidius_transformation_scale'), +(76189, 'spell_obsidius_crepuscular_veil'); + +-- Procs +DELETE FROM `spell_proc` WHERE `SpellId`= 76167; +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Cooldown`, `Charges`, `Chance`) VALUES +(76167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 0, 0); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceEntry` IN (76196, 82393) AND `SourceTypeOrReferenceId`= 13; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES +(13, 1, 76196, 0, 0, 31, 0, 3, 40817, 0, 0, 0, '', 'Transformation - Target Shadow of Obsidius'), +(13, 1, 82393, 0, 0, 31, 0, 3, 39670, 0, 0, 0, '', 'Stop Heart - Target Raz the Crazed'); + +-- Areatriggers +DELETE FROM `areatrigger_scripts` WHERE `entry`= 6016; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(6016, 'at_raz_obsidius_event'); + +-- Creature Twilight Element Warden SAI +SET @ENTRY := -361820; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361822; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361824; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361825; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361823; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361819; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361821; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +SET @ENTRY := -361823; +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, 1, 0, 100, 0, 200, 300, 4000, 5000, 11, 75205, 0, 0, 0, 0, 0, 19, 40343, 200, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 200 and 300 ms (and later repeats every 4000 and 5000 ms) - Self: Cast spell 75205 on Closest alive creature Channel Target (40343) in 200 yards // Twilight Element Warden - Out of Combat - Cast 'Bore'"), +(@ENTRY, 0, 1, 2, 25, 0, 100, 0, 0, 0, 0, 0, 11, 74919, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On reset (e.g. after reaching home) - Self: Cast spell 74919 on Self // "), +(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 2111, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Set faction to 2111 // "), +(@ENTRY, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 10, 361667, 0, 0, 0, 0, 0, 0, "On death - Creature Ascendant Lord Obsidius 39705 (361667): Set creature data #0 to 0 // "); + +DELETE FROM `creature_formations` WHERE `leaderGUID`= 361820; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `groupAI`, `dist`, `angle`) VALUES +(361820, 361820, 3, 0, 0), +(361820, 361822, 3, 0, 0), +(361820, 361823, 3, 0, 0), +(361820, 361824, 3, 0, 0), +(361820, 361825, 3, 0, 0), +(361820, 361819, 3, 0, 0), +(361820, 361821, 3, 0, 0); + +-- Achievement +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`= 15961; +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(15961, 11, 0, 0, 'achievement_ascendant_descending'); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index bae16719c1..2a775d5a45 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4625,6 +4625,13 @@ void SpellMgr::LoadSpellInfoCorrections() { spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(7); // 10yd }); + + // Transformation + ApplySpellFix({ 76196 }, [](SpellInfo* spellInfo) + { + spellInfo->MaxAffectedTargets = 1; + }); + // ENDOF BLACKROCK CAVERNS SPELLS // diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.cpp index b681a6c46a..93e7d0a358 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.cpp @@ -525,7 +525,8 @@ private: enum RazTheCrazed { // Texts - SAY_SMASH = 0, + SAY_SMASH = 0, + SAY_TIRED = 1, // Spells SPELL_AGGRO_NEARBY_TARGETS = 80189, @@ -538,15 +539,18 @@ enum RazTheCrazed SPELL_FURIOUS_SWIPE = 80206, SPELL_FURIOUS_SWIPE_DUMMY = 80340, SPELL_FURIOUS_RAGE = 80218, + SPELL_STOP_HEART = 82393, + SPELL_INSTAKILL_SELF = 29878, - EVENT_DISABLE_GRAVITY_AND_HOVER = 1, - EVENT_SAY_SMASH, + EVENT_SAY_SMASH = 1, EVENT_START_ESCORT_PATH, EVENT_FACE_TO_THE_SIDE, EVENT_LEAP_FROM_BRIDGE, EVENT_LEAP_FROM_LEDGE, EVENT_LEAP_OVER_BORER_PACKS, - EVENT_RESUME_ESCORT + EVENT_RESUME_ESCORT, + EVENT_LEAP_AT_OBSIDIUS, + EVENT_KILL_RAZ }; Position const RazPathRomogg[] = @@ -573,19 +577,12 @@ Position const RazPathCorla[] = struct npc_raz_the_crazed : public EscortAI { - npc_raz_the_crazed(Creature* creature) : EscortAI(creature), _instance(creature->GetInstanceScript()) - { - SetCombatMovement(false); - } + npc_raz_the_crazed(Creature* creature) : EscortAI(creature), _instance(creature->GetInstanceScript()) { } void EnterEvadeMode(EvadeReason why) override { EscortAI::EnterEvadeMode(why); DoCastSelf(SPELL_AGGRO_NEARBY_TARGETS, true); - if (_instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_ROMOGG) - BuildRomoggPath(); - else if (_instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_CORLA) - BuildCorlaPath(); } void JustAppeared() override @@ -602,22 +599,38 @@ struct npc_raz_the_crazed : public EscortAI _events.ScheduleEvent(EVENT_LEAP_FROM_LEDGE, 2s); BuildCorlaPath(); } + else if (_instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_OBSIDIUS) + _events.ScheduleEvent(EVENT_LEAP_AT_OBSIDIUS, 2s); + SetDespawnAtEnd(false); DoCastSelf(SPELL_AGGRO_NEARBY_TARGETS, true); } + void JustDied(Unit* /*killer*/) override + { + Talk(SAY_TIRED); + me->DespawnOrUnsummon(9s); + } + void DoAction(int32 action) override { if (action == ACTION_BREAK_OUT_OF_PRISON) { me->RemoveAurasDueToSpell(SPELL_HIGH_SECURITY_SHADOW_PRISON); + me->SetDisableGravity(false); + me->SetHover(false); DoCastSelf(SPELL_LEAP_FROM_CAGE); - _events.ScheduleEvent(EVENT_DISABLE_GRAVITY_AND_HOVER, 2s + 500ms); _events.ScheduleEvent(EVENT_START_ESCORT_PATH, 4s); _events.ScheduleEvent(EVENT_SAY_SMASH, 4s); } } + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + { + if (spell->Id == SPELL_STOP_HEART) + _events.ScheduleEvent(EVENT_KILL_RAZ, 4s); + } + void BuildRomoggPath() { for (uint8 i = 0; i < 12; i++) @@ -649,7 +662,7 @@ struct npc_raz_the_crazed : public EscortAI if (!target) return; - if (!target->IsInCombatWith(me)) + if (!target->IsInCombat()) return; if (spell->Id == SPELL_FURIOUS_SWIPE_DUMMY) @@ -669,16 +682,12 @@ struct npc_raz_the_crazed : public EscortAI { switch (eventId) { - case EVENT_DISABLE_GRAVITY_AND_HOVER: - me->SetDisableGravity(false); - me->SetHover(false); - break; case EVENT_SAY_SMASH: Talk(SAY_SMASH); break; case EVENT_START_ESCORT_PATH: me->SetHomePosition(me->GetPosition()); - Start(false, false); + Start(true, true); break; case EVENT_FACE_TO_THE_SIDE: me->SetFacingTo(5.061455f); @@ -698,6 +707,13 @@ struct npc_raz_the_crazed : public EscortAI DoCastSelf(SPELL_LEAP_OVER_BORER_PACKS); me->DespawnOrUnsummon(2s); break; + case EVENT_LEAP_AT_OBSIDIUS: + Talk(SAY_SMASH); + DoCastSelf(SPELL_LEAP_AT_OBSIDIUS); + break; + case EVENT_KILL_RAZ: + DoCastSelf(SPELL_INSTAKILL_SELF); + break; default: break; } @@ -726,6 +742,23 @@ class at_raz_corla_event : public AreaTriggerScript } }; +class at_raz_obsidius_event : public AreaTriggerScript +{ + public: + at_raz_obsidius_event() : AreaTriggerScript("at_raz_obsidius_event") { } + + bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) + { + if (InstanceScript* instance = player->GetInstanceScript()) + if (instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_CORLA + && instance->GetBossState(DATA_KARSH_STEELBENDER) == DONE) + instance->SetData(DATA_RAZ_LAST_AREA_INDEX, RAZ_AREA_INDEX_OBSIDIUS); + + return true; + + } +}; + void AddSC_blackrock_caverns() { RegisterBlackrockCavernsCreatureAI(npc_fire_cyclone); @@ -736,4 +769,5 @@ void AddSC_blackrock_caverns() RegisterBlackrockCavernsCreatureAI(npc_crazed_mage); RegisterBlackrockCavernsCreatureAI(npc_raz_the_crazed); new at_raz_corla_event(); + new at_raz_obsidius_event(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.h index be94618d07..88c4f8c042 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/blackrock_caverns.h @@ -48,6 +48,7 @@ enum BRCCreatureIds BOSS_CORLA_HERALD_OF_TWILIGHT = 39679, BOSS_KARSH_STEELBENDER = 39698, BOSS_BEAUTY = 39700, + BOSS_ASCENDANT_LORD_OBSIDIUS = 39705, // Encounter Related /*Rom'ogg Bonecrusher*/ @@ -59,16 +60,19 @@ enum BRCCreatureIds NPC_TWILIGHT_ZEALOT = 50284, NPC_EVOLVED_TWILIGHT_ZEALOT = 39987, - NPC_TWILIGHT_FLAME_CALLER = 39708, - NPC_RAZ_THE_CRAZED = 39670, - /*Karsh Steelbender*/ NPC_INVISIBLE_STALKER = 39842, NPC_BOUND_FLAMES = 50417, /*Beauty*/ NPC_LUCKY = 40008, - NPC_SPOT = 40011 + NPC_SPOT = 40011, + + /*Ascendant Lord Obsidius*/ + NPC_SHADOW_OF_OBSIDIUS = 40817, + + NPC_TWILIGHT_FLAME_CALLER = 39708, + NPC_RAZ_THE_CRAZED = 39670, }; enum BRCActions @@ -86,7 +90,8 @@ enum BRCRazAreaIndex Position const RazTheCrazedSummonPositions[] = { { 249.2639f, 949.1614f, 191.7866f, 3.141593f }, - { 406.1927f, 906.0121f, 163.4926f, 4.310963f } + { 406.1927f, 906.0121f, 163.4926f, 4.310963f }, + { 308.9653f, 635.8195f, 64.79769f, 4.555309f } }; template diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_ascendant_lord_obsidius.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_ascendant_lord_obsidius.cpp index f69f7abeab..620ab81039 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_ascendant_lord_obsidius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_ascendant_lord_obsidius.cpp @@ -18,95 +18,358 @@ #include "ScriptMgr.h" #include "blackrock_caverns.h" #include "ScriptedCreature.h" +#include "SpellAuraEffects.h" +#include "SpellMgr.h" enum Text { - YELL_AGGRO = 0, - YELL_KILL = 1, - YELL_SWITCHING_SHADOWS = 2, - YELL_DEATH = 3, - EMOTE_SWITCHING_SHADOWS = 4 + // Ascendant Lord Obsidius + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_TRANSFORMATION = 2, + SAY_DEATH = 3, + SAY_ANNOUNCE_TRANSFORMATION = 4 }; enum Spells { - SPELL_MANA_TAP = 36021, - SPELL_ARCANE_TORRENT = 36022, - SPELL_DOMINATION = 35280, + // Ascendant Lord Obsidius + SPELL_STOP_HEART = 82393, + SPELL_STONE_BLOW = 76185, + SPELL_THUNDERCLAP = 76186, + SPELL_TRANSFORMATION = 76196, + + // Shadow of Obsidius + SPELL_SHADOWY_CORRUPTION = 75054, +}; + +#define SPELL_TWILIGHT_CORRUPTION RAID_MODE(76188, 93613) + +enum SpellVisualKits +{ + SPELL_VISUAL_SPOTTED = 14893 }; enum Events { - EVENT_MANA_TAP = 1, - EVENT_ARCANE_TORRENT = 2, - EVENT_DOMINATION = 3 + // Ascendant Lord Obsidius + EVENT_FINISH_RAZ_INTRO = 1, + EVENT_STONE_BLOW , + EVENT_TWILIGHT_CORRUPTION, + EVENT_THUNDERCLAP, }; -class boss_ascendant_lord_obsidius : public CreatureScript +enum Data +{ + DATA_DEAD_ELEMENTAL_WARDEN = 0, + DATA_ASCENDANT_DESCENDING +}; + +Position const ShadowOfObsidiusPositions[] = +{ + { 331.6267f, 563.5573f, 66.08982f, 3.141593f }, + { 332.2361f, 544.75f, 66.08982f, 3.141593f }, + { 324.6545f, 554.1979f, 66.10867f, 3.141593f } +}; + +struct boss_ascendant_lord_obsidius : public BossAI +{ + boss_ascendant_lord_obsidius(Creature* creature) : BossAI(creature, DATA_ASCENDANT_LORD_OBSIDIUS) { } + + void Reset() override + { + _Reset(); + _transformationCount = 0; + _deadElementalWardenCount = 0; + _achievementEnligible = true; + + if (instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_OBSIDIUS) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_STUNNED); + + for (uint8 i = 0; i < (IsHeroic() ? 3 : 2); i++) + { + if (Creature* shadow = DoSummon(NPC_SHADOW_OF_OBSIDIUS, ShadowOfObsidiusPositions[i], 0, TEMPSUMMON_MANUAL_DESPAWN)) + { + if (instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_OBSIDIUS) + { + shadow->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + shadow->RemoveAurasDueToSpell(SPELL_SHADOWY_CORRUPTION); + } + } + } + } + + void JustEngagedWith(Unit* /*who*/) override + { + _JustEngagedWith(); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_STONE_BLOW, 8s); + events.ScheduleEvent(EVENT_TWILIGHT_CORRUPTION, 12s); + + if (IsHeroic()) + events.ScheduleEvent(EVENT_THUNDERCLAP, 15s + 600ms); + + for (ObjectGuid guid : summons) + if (Creature* shadow = ObjectAccessor::GetCreature(*me, guid)) + shadow->AI()->DoZoneInCombat(); + } + + void KilledUnit(Unit* who) override + { + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_CORRUPTION); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + Talk(SAY_DEATH); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + _EnterEvadeMode(); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_CORRUPTION); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + summons.DespawnAll(); + _DespawnAtEvade(); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) override + { + if ((me->HealthBelowPctDamaged(69, damage) && _transformationCount == 0) + || (me->HealthBelowPctDamaged(34, damage) && _transformationCount == 1)) + { + Talk(SAY_TRANSFORMATION); + Talk(SAY_ANNOUNCE_TRANSFORMATION); + DoCastAOE(SPELL_TRANSFORMATION, true); + _transformationCount++; + } + } + + void SetData(uint32 type, uint32 data) override + { + switch (type) + { + case DATA_DEAD_ELEMENTAL_WARDEN: + _deadElementalWardenCount++; + if (_deadElementalWardenCount == 7) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_STUNNED); + + for (ObjectGuid guid : summons) + { + if (Creature* shadow = ObjectAccessor::GetCreature(*me, guid)) + { + shadow->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + shadow->RemoveAurasDueToSpell(SPELL_SHADOWY_CORRUPTION); + } + } + DoCastAOE(SPELL_STOP_HEART); + } + break; + case DATA_ASCENDANT_DESCENDING: + _achievementEnligible = false; + break; + default: + break; + } + } + + uint32 GetData(uint32 data) const override + { + if (data == DATA_ASCENDANT_DESCENDING) + return _achievementEnligible; + + return 0; + } + + 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_STONE_BLOW: + DoCastVictim(SPELL_STONE_BLOW); + events.Repeat(12s); + break; + case EVENT_TWILIGHT_CORRUPTION: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_TWILIGHT_CORRUPTION)) + DoCast(target, SPELL_TWILIGHT_CORRUPTION); + events.Repeat(12s); + break; + case EVENT_THUNDERCLAP: + DoCastAOE(SPELL_THUNDERCLAP); + events.Repeat(23s); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } +private: + uint8 _transformationCount; + uint8 _deadElementalWardenCount; + bool _achievementEnligible; +}; + +class spell_obsidius_twitchy : public AuraScript +{ + PrepareAuraScript(spell_obsidius_twitchy); + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* target = GetTarget(); + if (DamageInfo* damage = eventInfo.GetDamageInfo()) + { + if (Unit* attacker = damage->GetAttacker()) + { + target->SendPlaySpellVisualKit(SPELL_VISUAL_SPOTTED, 0, 0); + target->getThreatManager().resetAllAggro(); + target->AddThreat(attacker, 100000000); + } + } + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_obsidius_twitchy::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + +class spell_obsidius_transformation : public SpellScript +{ + PrepareSpellScript(spell_obsidius_transformation); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; i++) + if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[i].BasePoints)) + if (Unit* caster = GetCaster()) + caster->CastSpell(GetHitUnit(), spell->Id, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_obsidius_transformation::HandleEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +class spell_obsidius_transformation_not_selectable : public AuraScript +{ + PrepareAuraScript(spell_obsidius_transformation_not_selectable); + + void AfterRemmove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + Unit* target = GetTarget(); + if (caster == target) + return; + + Position pos1 = target->GetPosition(); + Position pos2 = caster->GetPosition(); + caster->NearTeleportTo(pos1); + target->NearTeleportTo(pos2); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_obsidius_transformation_not_selectable::AfterRemmove, EFFECT_0, SPELL_AURA_MOD_UNATTACKABLE, AURA_EFFECT_HANDLE_REAL); + } +}; + +class spell_obsidius_transformation_scale : public AuraScript +{ + PrepareAuraScript(spell_obsidius_transformation_scale); + + void HandlePeriodic(AuraEffect const* aurEff) + { + if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[aurEff->GetEffIndex()].BasePoints)) + GetTarget()->CastSpell(GetTarget(), spell->Id, true); + + Remove(); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_obsidius_transformation_scale::HandlePeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY); + } +}; + +class spell_obsidius_crepuscular_veil : public SpellScript +{ + PrepareSpellScript(spell_obsidius_crepuscular_veil); + + void HandleAchievement() + { + Unit* target = GetHitUnit(); + if (!target) + return; + + Aura* aura = target->GetAura(GetSpellInfo()->Id); + if (!aura) + return; + + if (aura->GetStackAmount() == GetSpellInfo()->StackAmount) + { + InstanceScript* instance = target->GetInstanceScript(); + if (!instance) + return; + + if (Creature* obsidius = instance->GetCreature(DATA_ASCENDANT_LORD_OBSIDIUS)) + obsidius->AI()->SetData(DATA_ASCENDANT_DESCENDING, FAIL); + } + } + + void Register() override + { + AfterHit += SpellHitFn(spell_obsidius_crepuscular_veil::HandleAchievement); + } +}; + +class achievement_ascendant_descending : public AchievementCriteriaScript { public: - boss_ascendant_lord_obsidius(): CreatureScript("boss_ascendant_lord_obsidius") { } + achievement_ascendant_descending() : AchievementCriteriaScript("achievement_ascendant_descending") { } - struct boss_ascendant_lord_obsidiusAI : public BossAI + bool OnCheck(Player* /*source*/, Unit* target) override { - boss_ascendant_lord_obsidiusAI(Creature* creature) : BossAI(creature, DATA_ASCENDANT_LORD_OBSIDIUS) { } + if (!target) + return false; - void Reset() override - { - _Reset(); - } + if (target->IsAIEnabled) + return target->GetAI()->GetData(DATA_ASCENDANT_DESCENDING); - void JustEngagedWith(Unit* /*who*/) override - { - _JustEngagedWith(); - events.ScheduleEvent(EVENT_MANA_TAP, 30000); - Talk(YELL_AGGRO); - } - - void KilledUnit(Unit* who) override - { - if (who->GetTypeId() == TYPEID_PLAYER) - Talk(YELL_KILL); - } - - void JustDied(Unit* /*killer*/) override - { - _JustDied(); - Talk(YELL_DEATH); - } - - 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_MANA_TAP: - DoCastVictim(SPELL_MANA_TAP, true); - events.ScheduleEvent(EVENT_MANA_TAP, urand(14000, 22000)); - break; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetBlackrockCavernsAI(creature); + return false; } }; void AddSC_boss_ascendant_lord_obsidius() { - new boss_ascendant_lord_obsidius(); + RegisterBlackrockCavernsCreatureAI(boss_ascendant_lord_obsidius); + RegisterAuraScript(spell_obsidius_twitchy); + RegisterSpellScript(spell_obsidius_transformation); + RegisterAuraScript(spell_obsidius_transformation_not_selectable); + RegisterAuraScript(spell_obsidius_transformation_scale); + RegisterSpellScript(spell_obsidius_crepuscular_veil); + new achievement_ascendant_descending(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/instance_blackrock_caverns.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/instance_blackrock_caverns.cpp index 98a2956758..5cf3955ff2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/instance_blackrock_caverns.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/instance_blackrock_caverns.cpp @@ -25,6 +25,7 @@ ObjectData const creatureData[] = { BOSS_CORLA_HERALD_OF_TWILIGHT, DATA_CORLA_HERALD_OF_TWILIGHT }, { BOSS_KARSH_STEELBENDER, DATA_KARSH_STEELBENDER }, { BOSS_BEAUTY, DATA_BEAUTY }, + { BOSS_ASCENDANT_LORD_OBSIDIUS, DATA_ASCENDANT_LORD_OBSIDIUS }, { NPC_RAZ_THE_CRAZED, DATA_RAZ_THE_CRAZED }, { NPC_LUCKY, DATA_LUCKY }, { NPC_SPOT, DATA_SPOT }, @@ -111,15 +112,18 @@ class instance_blackrock_caverns : public InstanceMapScript switch (data) { case RAZ_AREA_INDEX_ROMOGG: - if (!GetCreature(DATA_RAZ_THE_CRAZED)) - instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_ROMOGG]); + instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_ROMOGG]); break; case RAZ_AREA_INDEX_CORLA: instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_CORLA]); break; + case RAZ_AREA_INDEX_OBSIDIUS: + instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_OBSIDIUS]); + break; default: break; } + SaveToDB(); } }