From fa7c8663892bd2758f2ce095c4aabd6fa5cd0ec9 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Wed, 24 Apr 2024 18:24:14 +0200 Subject: [PATCH] Anub'Arak no longer triggers Locust Swarm before cast, scale damage per tick --- sql/world/base/naxx40_spells.sql | 5 +++ src/naxx40Scripts/boss_anubrekhan_40.cpp | 47 +++++++++++++++++++++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/sql/world/base/naxx40_spells.sql b/sql/world/base/naxx40_spells.sql index 11929e2..9f02b35 100644 --- a/sql/world/base/naxx40_spells.sql +++ b/sql/world/base/naxx40_spells.sql @@ -4,3 +4,8 @@ INSERT INTO spell_dbc (`ID`,`Category`,`DispelType`,`Mechanic`,`Attributes`,`Att (90001,0,0,0,8388864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,101,0,0,0,0,21,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,28,0,0,1,0,0,0,0,0,4,0,0,0,0,0,18,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,351083,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7626,0,1,0,0,'Summon Corpse Scarabs (5)','','','','','','','','','','','','','','','',16712190,'','','','','','','','','','','','','','','','',16712172,'','','','','','','','','','','','','','','','',16712188,'','','','','','','','','','','','','','','','',16712188,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0), # 29105 - Corpse Scarabs (5) (90002,0,0,0,8388864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,101,0,0,0,0,21,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,28,0,0,1,0,0,0,0,0,9,0,0,0,0,0,18,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,351083,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7626,0,1,0,0,'Summon Corpse Scarabs (10)','','','','','','','','','','','','','','','',16712190,'','','','','','','','','','','','','','','','',16712172,'','','','','','','','','','','','','','','','',16712188,'','','','','','','','','','','','','','','','',16712188,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0); # 28864 - Corpse Scarabs (10 +-- Anub'Arak +-- Locust Swarm: Reduce damage ~1500 to ~1000, increase radius 25yd to 30yd +DELETE FROM `spell_script_names` WHERE `spell_id` = 28785; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) +VALUES(28785, 'spell_anub_locust_swarm_40'); diff --git a/src/naxx40Scripts/boss_anubrekhan_40.cpp b/src/naxx40Scripts/boss_anubrekhan_40.cpp index fcaab47..991190a 100644 --- a/src/naxx40Scripts/boss_anubrekhan_40.cpp +++ b/src/naxx40Scripts/boss_anubrekhan_40.cpp @@ -236,12 +236,7 @@ public: case EVENT_LOCUST_SWARM: { Talk(EMOTE_LOCUST); - // Set damage for periodic trigger effect to a random value between 875 and 1125 - int32 modifiedLocustSwarmDamage = urand(875, 1125); me->CastSpell(me, SPELL_LOCUST_SWARM, false); - // Update the periodic trigger effect with custom damage - me->CastCustomSpell(me, SPELL_LOCUST_SWARM_TRIGGER, &modifiedLocustSwarmDamage, nullptr, nullptr, true, nullptr, nullptr, me->GetGUID()); - events.ScheduleEvent(EVENT_SPAWN_GUARD, 3000); events.RepeatEvent(90000); break; @@ -258,7 +253,49 @@ public: }; }; +class spell_anub_locust_swarm_40 : public SpellScriptLoader +{ +public: + spell_anub_locust_swarm_40() : SpellScriptLoader("spell_anub_locust_swarm_40") { } + + class spell_anub_locust_swarm_40_AuraScript : public AuraScript + { + PrepareAuraScript(spell_anub_locust_swarm_40_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_LOCUST_SWARM_TRIGGER }); + } + + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) + { + Unit* caster = GetCaster(); + if (!caster || (caster->GetMap()->GetDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC)) + { + return; + } + PreventDefaultAction(); + int32 modifiedLocustSwarmDamage = 812; + CustomSpellValues values; + values.AddSpellMod(SPELLVALUE_BASE_POINT0, modifiedLocustSwarmDamage); + values.AddSpellMod(SPELLVALUE_RADIUS_MOD, 3000); // 30yd + caster->CastCustomSpell(SPELL_LOCUST_SWARM_TRIGGER, values, caster, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID()); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anub_locust_swarm_40_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_anub_locust_swarm_40_AuraScript(); + } +}; + void AddSC_boss_anubrekhan_40() { new boss_anubrekhan_40(); + new spell_anub_locust_swarm_40(); }