From a949f812a752c83dfe2346d4a14ad7df59c38b5d Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Mon, 17 Oct 2022 01:25:23 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/TempleOfAhnQiraj):=20Anubisath=20Se?= =?UTF-8?q?ntinel=20Mortal=20Strike=20and=20M=E2=80=A6=20(#13435)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...ana Burn --- .../rev_1665949856612609200.sql | 5 ++ .../mob_anubisath_sentinel.cpp | 54 ++++++++++++++----- 2 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1665949856612609200.sql diff --git a/data/sql/updates/pending_db_world/rev_1665949856612609200.sql b/data/sql/updates/pending_db_world/rev_1665949856612609200.sql new file mode 100644 index 000000000..70029b95c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1665949856612609200.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_anubisath_mortal_strike', 'spell_mana_burn_area'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(9347, 'spell_anubisath_mortal_strike'), +(26626, 'spell_mana_burn_area'); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index f7a9ae516..7d9ffdc9b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -15,22 +15,11 @@ * with this program. If not, see . */ -/* ScriptData -SDName: npc_anubisath_sentinel -SD%Complete: 95 -SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "Cell.h" -#include "CellImpl.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "Spell.h" -#include "WorldPacket.h" +#include "SpellScript.h" +#include "temple_of_ahnqiraj.h" enum Spells { @@ -316,7 +305,46 @@ public: }; }; +// 9347: Mortal Strike +class spell_anubisath_mortal_strike : public AuraScript +{ + PrepareAuraScript(spell_anubisath_mortal_strike); + + void OnPeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + + if (Unit* target = GetUnitOwner()->GetVictim()) + if (target->IsWithinDist(GetUnitOwner(), 5.f)) + GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anubisath_mortal_strike::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + +// 26626 (Server-side): Mana Burn Area +class spell_mana_burn_area : public SpellScript +{ + PrepareSpellScript(spell_mana_burn_area); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + GetCaster()->CastSpell(target, SPELL_MANAB, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mana_burn_area::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_npc_anubisath_sentinel() { new npc_anubisath_sentinel(); + RegisterSpellScript(spell_anubisath_mortal_strike); + RegisterSpellScript(spell_mana_burn_area); }