Core/Spells: fixed Inquisition duration increase based on Holy Power and Divine Purpose

This commit is contained in:
Ovahlord
2018-07-27 12:04:23 +02:00
parent ed099e8600
commit 447f9da201
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_pal_inquisition';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(84963, 'spell_pal_inquisition');

View File

@@ -1753,6 +1753,37 @@ class spell_pal_divine_purpose : public AuraScript
}
};
class spell_pal_inquisition : public SpellScript
{
PrepareSpellScript(spell_pal_inquisition);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_DIVINE_PURPOSE_PROC });
}
void ChangeDuration()
{
Unit* caster = GetCaster();
if (!caster)
return;
if (Aura* aura = caster->GetAura(GetSpellInfo()->Id))
{
uint8 power = caster->HasAura(SPELL_PALADIN_DIVINE_PURPOSE_PROC) ? 2 : caster->GetPower(POWER_HOLY_POWER);
int32 duration = aura->GetDuration();
duration += duration * power;
aura->SetDuration(duration);
}
}
void Register() override
{
AfterHit += SpellHitFn(spell_pal_inquisition::ChangeDuration);
}
};
void AddSC_paladin_spell_scripts()
{
//new spell_pal_ardent_defender();
@@ -1778,6 +1809,7 @@ void AddSC_paladin_spell_scripts()
new spell_pal_improved_aura_effect("spell_pal_improved_concentraction_aura_effect");
new spell_pal_improved_aura_effect("spell_pal_improved_devotion_aura_effect");
new spell_pal_improved_aura_effect("spell_pal_sanctified_retribution_effect");
RegisterSpellScript(spell_pal_inquisition);
new spell_pal_item_healing_discount();
new spell_pal_judgement();
RegisterAuraScript(spell_pal_judgements);