aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2025-01-25 11:27:37 +0100
committerOvahlord <dreadkiller@gmx.de>2025-01-25 11:27:37 +0100
commit3ec0ba7c830fa91d372a652173a2c5d53bd5dfb9 (patch)
tree88b6a3f902db34d5c5166dc80c81fd379cd1ad74 /src/server
parentaaec1db9f0899ff3f88a5d0fc2577326bb30f03d (diff)
Scripts/Spells: fixed Seal of Righteousness
Diffstat (limited to 'src/server')
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 1b338e81aee..2fc950bcd1d 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -22,7 +22,56 @@
*/
#include "ScriptMgr.h"
+#include "SpellDefines.h"
+#include "SpellScript.h"
+#include "Unit.h"
+
+namespace Scripts::Spells::Paladin
+{
+ enum PaladinSpells
+ {
+ SPELL_PAL_SEAL_OF_RIGHTEOUSNESS_DAMAGE = 25742
+ };
+
+ // 20154 - Seal of Righteousness
+ class spell_pal_seal_of_righteousness : public AuraScript
+ {
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_PAL_SEAL_OF_RIGHTEOUSNESS_DAMAGE });
+ }
+
+ bool CheckMeleeProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ {
+ if (!eventInfo.GetActionTarget() || !eventInfo.GetDamageInfo())
+ return false;
+
+ Unit* caster = eventInfo.GetActor();
+ WeaponAttackType attType = eventInfo.GetDamageInfo()->GetAttackType();
+
+ // Damage formula according to tooltip: ${$MWS*(0.011*$AP+0.022*$SPH)
+ _procBasePoints = static_cast<float>(caster->GetBaseAttackTime(attType)) / 1000.0f * (0.011f * caster->GetTotalAttackPowerValue(attType) + 0.022f * caster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY, true));
+
+ return _procBasePoints > 0;
+ }
+
+ void HandleMeleeProc(AuraEffect* aurEff, ProcEventInfo& eventInfo) const
+ {
+ eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_PAL_SEAL_OF_RIGHTEOUSNESS_DAMAGE, CastSpellExtraArgs(aurEff).AddSpellBP0(_procBasePoints));
+ }
+
+ void Register() override
+ {
+ DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_seal_of_righteousness::CheckMeleeProc, EFFECT_0, SPELL_AURA_DUMMY);
+ AfterEffectProc += AuraEffectProcFn(spell_pal_seal_of_righteousness::HandleMeleeProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ private:
+ int32 _procBasePoints = 0;
+ };
+}
void AddSC_paladin_spell_scripts()
{
+ using namespace Scripts::Spells::Paladin;
+ RegisterSpellScript(spell_pal_seal_of_righteousness);
}