diff options
author | Ovahlord <dreadkiller@gmx.de> | 2025-01-26 16:44:36 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-26 16:44:36 +0100 |
commit | 977452c74be8bb7bd488cbdc99c1d70c15dfc327 (patch) | |
tree | 48de6b745033c0e393ada3bad5a7a72a893a7434 | |
parent | 59c61f7c153394998b4435b86accdc9ed48d9d3b (diff) |
Scripts/Spells: fixed Seal of Insight
-rw-r--r-- | sql/updates/world/cata_classic/2025_01_26_05_world.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 43 |
2 files changed, 47 insertions, 0 deletions
diff --git a/sql/updates/world/cata_classic/2025_01_26_05_world.sql b/sql/updates/world/cata_classic/2025_01_26_05_world.sql new file mode 100644 index 00000000000..75bb4e4dbbe --- /dev/null +++ b/sql/updates/world/cata_classic/2025_01_26_05_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_pal_seal_of_insight', 'spell_pal_seal_of_insight_triggered'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(20165, 'spell_pal_seal_of_insight'), +(20167, 'spell_pal_seal_of_insight_triggered'); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index a9ccc832622..036f9b4f1ad 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -224,6 +224,47 @@ namespace Scripts::Spells::Paladin CalcDamage += SpellCalcDamageFn(spell_pal_judgement_of_truth::CalculateDamage); } }; + + // 20165 - Seal of Insight + class spell_pal_seal_of_insight : public AuraScript + { + bool CheckMeleeProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + // Only single target spells are allowed to trigger the proc + if (eventInfo.GetSpellInfo() && (eventInfo.GetSpellInfo()->IsAffectingArea() || eventInfo.GetSpellInfo()->HasAttribute(SPELL_ATTR5_TREAT_AS_AREA_EFFECT))) + return false; + + // The proc chance is defined in the aura effect's amount + return roll_chance_i(aurEff->GetAmount()); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_seal_of_insight::CheckMeleeProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + // 20167 - Judgement of Truth + class spell_pal_seal_of_insight_triggered : public SpellScript + { + void CalculateEnergizeAmount(SpellEffIndex /*effIndex*/) + { + // Restores 4% of the caster's base mana + SetEffectValue(CalculatePct(GetCaster()->GetCreateMana(), GetEffectValue())); + } + + void CalculateHeal(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& healing, int32& /*flatMod*/, float& /*pctMod*/) + { + // Healing formula according to tooltip: ${0.15*$AP+0.15*$SPH} + healing = std::round(0.15f * GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) + 0.15f * GetCaster()->SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_HOLY, true)); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_pal_seal_of_insight_triggered::CalculateEnergizeAmount, EFFECT_1, SPELL_EFFECT_ENERGIZE); + CalcHealing += SpellCalcDamageFn(spell_pal_seal_of_insight_triggered::CalculateHeal); + } + }; } void AddSC_paladin_spell_scripts() @@ -232,6 +273,8 @@ void AddSC_paladin_spell_scripts() RegisterSpellScript(spell_pal_judgement); RegisterSpellScript(spell_pal_judgement_of_righteousness); RegisterSpellScript(spell_pal_judgement_of_truth); + RegisterSpellScript(spell_pal_seal_of_insight); + RegisterSpellScript(spell_pal_seal_of_insight_triggered); RegisterSpellScript(spell_pal_seal_of_justice); RegisterSpellScript(spell_pal_seal_of_righteousness); RegisterSpellScript(spell_pal_seal_of_truth); |