From 32ff556a99358a92f912d6f6d569492f82eac48d Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Sat, 11 Nov 2023 19:45:21 +0100 Subject: [PATCH] fix(Scripts/SSC): make Fathomlord use his Spitfire Totem ability (#17674) * initial * new spell/aurascript format * leftover --- .../spell_script_tidalvess.sql | 4 ++ .../boss_fathomlord_karathress.cpp | 55 ++++++++++++------- 2 files changed, 38 insertions(+), 21 deletions(-) create mode 100644 data/sql/updates/pending_db_world/spell_script_tidalvess.sql diff --git a/data/sql/updates/pending_db_world/spell_script_tidalvess.sql b/data/sql/updates/pending_db_world/spell_script_tidalvess.sql new file mode 100644 index 000000000..baf99b0ff --- /dev/null +++ b/data/sql/updates/pending_db_world/spell_script_tidalvess.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 38452 AND `ScriptName` = 'spell_karathress_power_of_tidalvess'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(38452, 'spell_karathress_power_of_tidalvess'); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index edd836dd4..c07efaede 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -113,6 +113,11 @@ struct boss_fathomlord_karathress : public BossAI summon->SetWalk(true); summon->GetMotionMaster()->MovePoint(0, advisorsPosition[MAX_ADVISORS - 1], false); } + else + { + summon->Attack(me->GetVictim(), false); + summon->SetInCombatWithZone(); + } } void SummonedCreatureDies(Creature* summon, Unit*) override @@ -541,31 +546,38 @@ private: InstanceScript* _instance; }; -class spell_karathress_power_of_caribdis : public SpellScriptLoader +class spell_karathress_power_of_tidalvess : public AuraScript { -public: - spell_karathress_power_of_caribdis() : SpellScriptLoader("spell_karathress_power_of_caribdis") { } + PrepareAuraScript(spell_karathress_power_of_tidalvess); - class spell_karathress_power_of_caribdis_AuraScript : public AuraScript + void OnPeriodic(AuraEffect const* aurEff) { - PrepareAuraScript(spell_karathress_power_of_caribdis_AuraScript); + PreventDefaultAction(); + GetUnitOwner()->CastSpell(GetUnitOwner(), GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + } - void OnPeriodic(AuraEffect const* aurEff) - { - PreventDefaultAction(); - if (Unit* victim = GetUnitOwner()->GetVictim()) - GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_caribdis_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_karathress_power_of_caribdis_AuraScript(); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_tidalvess::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + +class spell_karathress_power_of_caribdis : public AuraScript +{ + PrepareAuraScript(spell_karathress_power_of_caribdis); + + void OnPeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + if (Unit* victim = GetUnitOwner()->GetVictim()) + { + GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_caribdis::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; @@ -575,5 +587,6 @@ void AddSC_boss_fathomlord_karathress() RegisterSerpentShrineAI(boss_fathomguard_sharkkis); RegisterSerpentShrineAI(boss_fathomguard_tidalvess); RegisterSerpentShrineAI(boss_fathomguard_caribdis); - new spell_karathress_power_of_caribdis(); + RegisterSpellScript(spell_karathress_power_of_tidalvess); + RegisterSpellScript(spell_karathress_power_of_caribdis); }