mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Update Empowered Renew script to new version of the spell (#31422)
This commit is contained in:
@@ -85,7 +85,7 @@ enum PriestSpells
|
||||
SPELL_PRIEST_DIVINE_STAR_SHADOW_DAMAGE = 390845,
|
||||
SPELL_PRIEST_DIVINE_STAR_SHADOW_HEAL = 390981,
|
||||
SPELL_PRIEST_DIVINE_WRATH = 40441,
|
||||
SPELL_PRIEST_EMPOWERED_RENEW_HEAL = 391359,
|
||||
SPELL_PRIEST_EMPOWERED_RENEW = 391339,
|
||||
SPELL_PRIEST_EPIPHANY = 414553,
|
||||
SPELL_PRIEST_EPIPHANY_HIGHLIGHT = 414556,
|
||||
SPELL_PRIEST_ESSENCE_DEVOURER = 415479,
|
||||
@@ -1147,27 +1147,28 @@ private:
|
||||
std::vector<ObjectGuid> _affectedUnits;
|
||||
};
|
||||
|
||||
struct spell_pri_holy_words_base
|
||||
{
|
||||
static void ModifyCooldown(Unit* priest, SpellInfo const* spellInfo, Milliseconds cooldownMod)
|
||||
{
|
||||
priest->GetSpellHistory()->ModifyCooldown(spellInfo, cooldownMod, true);
|
||||
}
|
||||
};
|
||||
|
||||
// 391339 - Empowered Renew
|
||||
class spell_pri_empowered_renew : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_RENEW, SPELL_PRIEST_EMPOWERED_RENEW_HEAL })
|
||||
return ValidateSpellInfo({ SPELL_PRIEST_RENEW, SPELL_PRIEST_HOLY_WORD_SANCTIFY })
|
||||
&& ValidateSpellEffect({ { SPELL_PRIEST_RENEW, EFFECT_0 } })
|
||||
&& sSpellMgr->AssertSpellInfo(SPELL_PRIEST_RENEW, DIFFICULTY_NONE)->GetEffect(EFFECT_0).IsAura(SPELL_AURA_PERIODIC_HEAL);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect* aurEff, ProcEventInfo const& eventInfo) const
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
|
||||
{
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
|
||||
SpellInfo const* renewSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_RENEW, GetCastDifficulty());
|
||||
SpellEffectInfo const& renewEffect = renewSpellInfo->GetEffect(EFFECT_0);
|
||||
int32 estimatedTotalHeal = AuraEffect::CalculateEstimatedfTotalPeriodicAmount(caster, target, renewSpellInfo, renewEffect, renewEffect.CalcValue(caster), 1);
|
||||
int32 healAmount = CalculatePct(estimatedTotalHeal, aurEff->GetAmount());
|
||||
|
||||
caster->CastSpell(target, SPELL_PRIEST_EMPOWERED_RENEW_HEAL, CastSpellExtraArgs(aurEff).AddSpellBP0(healAmount));
|
||||
spell_pri_holy_words_base::ModifyCooldown(eventInfo.GetActor(), sSpellMgr->AssertSpellInfo(SPELL_PRIEST_HOLY_WORD_SANCTIFY, GetCastDifficulty()),
|
||||
Milliseconds(-aurEff->GetAmount()));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1176,6 +1177,27 @@ class spell_pri_empowered_renew : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 139 - Renew
|
||||
class spell_pri_empowered_renew_heal : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellEffect({ { SPELL_PRIEST_EMPOWERED_RENEW, EFFECT_1 } });
|
||||
}
|
||||
|
||||
void CalculateHealing(AuraEffect const* /*aurEff*/, Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (AuraEffect const* empRenew = caster->GetAuraEffect(SPELL_PRIEST_EMPOWERED_RENEW, EFFECT_1))
|
||||
AddPct(pctMod, empRenew->GetAmount());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcDamageAndHealing += AuraEffectCalcHealingFn(spell_pri_empowered_renew_heal::CalculateHealing, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 414553 - Epiphany
|
||||
class spell_pri_epiphany : public AuraScript
|
||||
{
|
||||
@@ -1481,7 +1503,7 @@ class spell_pri_holy_words : public AuraScript
|
||||
|
||||
SpellInfo const* targetSpellInfo = sSpellMgr->AssertSpellInfo(targetSpellId, GetCastDifficulty());
|
||||
int32 cdReduction = targetSpellInfo->GetEffect(cdReductionEffIndex).CalcValue(GetTarget());
|
||||
GetTarget()->GetSpellHistory()->ModifyCooldown(targetSpellInfo, Seconds(-cdReduction), true);
|
||||
spell_pri_holy_words_base::ModifyCooldown(GetTarget(), targetSpellInfo, Seconds(-cdReduction));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -3668,6 +3690,7 @@ void AddSC_priest_spell_scripts()
|
||||
RegisterAreaTriggerAI(areatrigger_pri_divine_star);
|
||||
RegisterSpellScript(spell_pri_divine_procession);
|
||||
RegisterSpellScript(spell_pri_empowered_renew);
|
||||
RegisterSpellScript(spell_pri_empowered_renew_heal);
|
||||
RegisterSpellScript(spell_pri_epiphany);
|
||||
RegisterSpellScript(spell_pri_essence_devourer_heal);
|
||||
RegisterSpellScript(spell_pri_evangelism);
|
||||
|
||||
Reference in New Issue
Block a user