Scripts/Spells: Fixed holy paladin talent Awakening

This commit is contained in:
Shauren
2022-02-10 22:58:56 +01:00
parent f1cde4cdac
commit d16f5ab777
2 changed files with 52 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);