From 7618e7706edd949f0b2fc54535811cf07d49404f Mon Sep 17 00:00:00 2001 From: Asthalor <87535580+Asthalor@users.noreply.github.com> Date: Fri, 6 Aug 2021 11:13:45 +0200 Subject: [PATCH] fix(Scripts/Spell): combustion will now properly go on cooldown when the buff is manually cancelled (#7185) * fix(CORE/Spell): Combustion will now properly go on cooldown when the buff is manually cancelled * fix(DB/Scripts): Added the script for combustion * Update spell_mage.cpp * Update src/server/scripts/Spells/spell_mage.cpp Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- .../rev_1627725819856031500.sql | 4 +++ src/server/scripts/Spells/spell_mage.cpp | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1627725819856031500.sql diff --git a/data/sql/updates/pending_db_world/rev_1627725819856031500.sql b/data/sql/updates/pending_db_world/rev_1627725819856031500.sql new file mode 100644 index 000000000..9195923ea --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1627725819856031500.sql @@ -0,0 +1,4 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1627725819856031500'); + +DELETE FROM `spell_script_names` WHERE `scriptname`= "spell_mage_combustion_proc"; +INSERT INTO `spell_script_names` (`spell_id`,`scriptname`) VALUES (28682, "spell_mage_combustion_proc"); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index dd56bc972..332720a1a 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -23,6 +23,7 @@ enum MageSpells // Ours SPELL_MAGE_BURNOUT_TRIGGER = 44450, SPELL_MAGE_IMPROVED_BLIZZARD_CHILLED = 12486, + SPELL_MAGE_COMBUSTION = 11129, // Theirs SPELL_MAGE_COLD_SNAP = 11958, @@ -494,6 +495,37 @@ public: } }; +class spell_mage_combustion_proc : public SpellScriptLoader +{ +public: + spell_mage_combustion_proc() : SpellScriptLoader("spell_mage_combustion_proc") {} + + class spell_mage_combustion_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_combustion_proc_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_COMBUSTION }); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_MAGE_COMBUSTION); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_mage_combustion_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mage_combustion_proc_AuraScript(); + } +}; + // Theirs // Incanter's Absorbtion class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript @@ -1135,6 +1167,7 @@ void AddSC_mage_spell_scripts() new spell_mage_pet_scaling(); new spell_mage_brain_freeze(); new spell_mage_glyph_of_eternal_water(); + new spell_mage_combustion_proc(); // Theirs new spell_mage_blast_wave();