aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-02-10 22:58:56 +0100
committerShauren <shauren.trinity@gmail.com>2022-02-10 22:58:56 +0100
commitd16f5ab777ed8dc69df17db2ef80350f17b30dc9 (patch)
tree4b082c6d8388eb365d7c45eca2f63c4c501146a1
parentf1cde4cdacd85051baf1c88edc8ca730a0fcb898 (diff)
Scripts/Spells: Fixed holy paladin talent Awakening
-rw-r--r--sql/updates/world/master/2022_02_10_01_world.sql10
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp42
2 files changed, 52 insertions, 0 deletions
diff --git a/sql/updates/world/master/2022_02_10_01_world.sql b/sql/updates/world/master/2022_02_10_01_world.sql
new file mode 100644
index 00000000000..326f3268f76
--- /dev/null
+++ b/sql/updates/world/master/2022_02_10_01_world.sql
@@ -0,0 +1,10 @@
+DELETE FROM `spell_proc` WHERE `SpellId` IN (248033);
+INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
+(248033,0x00,10,0x00000000,0x00000000,0x00044000,0x00000000,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0,0,0,0); -- Awakening
+
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pal_awakening';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(248033,'spell_pal_awakening');
+
+DELETE FROM `spell_group` WHERE `id`=1107;
+DELETE FROM `spell_group_stack_rules` WHERE `group_id`=1107;
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 484b68fab16..45f1737bfc3 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -285,6 +285,47 @@ class spell_pal_ardent_defender : public SpellScriptLoader
};
*/
+// 248033 - Awakening
+class spell_pal_awakening : public AuraScript
+{
+ PrepareAuraScript(spell_pal_awakening);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ SPELL_PALADIN_AVENGING_WRATH })
+ && spellInfo->GetEffects().size() >= EFFECT_1;
+ }
+
+ bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ {
+ return roll_chance_i(aurEff->GetAmount());
+ }
+
+ void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
+ {
+ Milliseconds extraDuration = 0ms;
+ if (AuraEffect const* durationEffect = GetEffect(EFFECT_1))
+ extraDuration = Seconds(durationEffect->GetAmount());
+
+ if (Aura* avengingWrath = GetTarget()->GetAura(SPELL_PALADIN_AVENGING_WRATH))
+ {
+ avengingWrath->SetDuration(avengingWrath->GetDuration() + extraDuration.count());
+ avengingWrath->SetMaxDuration(avengingWrath->GetMaxDuration() + extraDuration.count());
+ }
+ else
+ GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_AVENGING_WRATH,
+ CastSpellExtraArgs(TriggerCastFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD))
+ .SetTriggeringSpell(eventInfo.GetProcSpell())
+ .AddSpellMod(SPELLVALUE_DURATION, extraDuration.count()));
+ }
+
+ void Register() override
+ {
+ DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_awakening::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectProc += AuraEffectProcFn(spell_pal_awakening::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+};
+
// 1022 - Blessing of Protection
// 204018 - Blessing of Spellwarding
class spell_pal_blessing_of_protection : public SpellScript
@@ -1506,6 +1547,7 @@ void AddSC_paladin_spell_scripts()
//new spell_pal_ardent_defender();
RegisterSpellScript(spell_pal_art_of_war);
RegisterAreaTriggerAI(areatrigger_pal_ashen_hallow);
+ RegisterSpellScript(spell_pal_awakening);
RegisterSpellScript(spell_pal_blessing_of_protection);
RegisterSpellScript(spell_pal_blinding_light);
RegisterSpellScript(spell_pal_crusader_might);