From eec3d280cd50bfe4cd990e513a85c1518e8ff9d7 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 11 May 2019 06:37:44 +0200 Subject: [PATCH] Core/Spells: move Pyroblast's Hot Streak spell script to spell bonus data and spell_proc --- .../custom/custom_2019_05_11_04_world.sql | 8 +++ src/server/scripts/Spells/spell_mage.cpp | 63 ------------------- 2 files changed, 8 insertions(+), 63 deletions(-) create mode 100644 sql/updates/world/custom/custom_2019_05_11_04_world.sql diff --git a/sql/updates/world/custom/custom_2019_05_11_04_world.sql b/sql/updates/world/custom/custom_2019_05_11_04_world.sql new file mode 100644 index 00000000000..1649b635d93 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_05_11_04_world.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_proc` WHERE `SpellId`= 48108; +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Chance`, `Cooldown`, `Charges`) VALUES +(48108, 0, 3, 0x00400000, 0, 0, 0x00010000, 1, 1, 0, 0, 100, 0, 1); + +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_mage_pyroblast'; +DELETE FROM `spell_bonus_data` WHERE `entry`= 92315; +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(92315, 1.545, 0.18, 0, 0, 'Mage - Pyroblast!'); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 4eb73890fe3..eaecef7d088 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -1932,68 +1932,6 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader } }; -// 92315 - Pyroblast! -class spell_mage_pyroblast : public SpellScriptLoader -{ - public: - spell_mage_pyroblast() : SpellScriptLoader("spell_mage_pyroblast") { } - - class spell_mage_pyroblast_SpellScript : public SpellScript - { - PrepareSpellScript(spell_mage_pyroblast_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo( - { - SPELL_MAGE_HOT_STREAK_TRIGGERED, - SPELL_MAGE_PYROBLAST - }); - } - - void HandleHotStreak(SpellEffIndex /*effIndex*/) - { - GetCaster()->RemoveAurasDueToSpell(SPELL_MAGE_HOT_STREAK_TRIGGERED); - } - - void HandleDamage(SpellEffIndex /*effIndex*/) - { - // Copy the spellpower coefficient from the original pyroblast spell - if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_MAGE_PYROBLAST)) - { - int32 damage = GetEffectValue(); - if (Unit* target = GetHitUnit()) - { - damage = GetCaster()->SpellDamageBonusDone(target, spell, uint32(damage), SPELL_DIRECT_DAMAGE, EFFECT_0); - damage = target->SpellDamageBonusTaken(GetCaster(), spell, uint32(damage), SPELL_DIRECT_DAMAGE); - } - SetHitDamage(damage); - } - } - - void ApplyDotBonus() - { - if (Unit* target = GetHitUnit()) - if (Unit* caster = GetCaster()) - if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_MAGE_PYROBLAST)) - if (Aura* aura = target->GetAura(GetSpellInfo()->Id)) - aura->GetEffect(EFFECT_1)->SetAmount(aura->GetEffect(EFFECT_1)->GetAmount() + caster->SpellDamageBonusDone(target, spell, 0, DOT, EFFECT_1)); - } - - void Register() override - { - OnEffectLaunch += SpellEffectFn(spell_mage_pyroblast_SpellScript::HandleHotStreak, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnEffectHitTarget += SpellEffectFn(spell_mage_pyroblast_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - AfterHit += SpellHitFn(spell_mage_pyroblast_SpellScript::ApplyDotBonus); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_mage_pyroblast_SpellScript(); - } -}; - // 55342 - Mirror Image class spell_mage_mirror_image : public SpellScript { @@ -2263,7 +2201,6 @@ void AddSC_mage_spell_scripts() new spell_mage_permafrost(); new spell_mage_polymorph(); new spell_mage_polymorph_cast_visual(); - new spell_mage_pyroblast(); RegisterAuraScript(spell_mage_pyromaniac); new spell_mage_replenish_mana(); new spell_mage_ring_of_frost();