Core/Spells: simplified spell script for Seal of Truth

This commit is contained in:
Ovahlord committed 2019-05-11 05:27:02 +02:00
1 parent 89b80de4eb
commit f3bd9627f1
1 file changed
+7 -14
+7 -14
View File
@@ -1404,23 +1404,16 @@ class spell_pal_seal_of_truth : public AuraScript
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{ {
PreventDefaultAction(); PreventDefaultAction();
Unit* actor = eventInfo.GetActor(); Unit* caster = GetTarget();
Unit* target = eventInfo.GetProcTarget(); Unit* target = eventInfo.GetProcTarget();
if (Aura* aura = target->GetAura(SPELL_PALADIN_CENSURE, actor->GetGUID())) if (Aura* aura = target->GetAura(SPELL_PALADIN_CENSURE, caster->GetGUID()))
if (aura->GetStackAmount() == 5) if (aura->GetStackAmount() == aura->GetSpellInfo()->StackAmount)
actor->CastSpell(target, SPELL_PALADIN_SEAL_OF_TRUTH_DAMAGE, true, nullptr, aurEff); caster->CastSpell(target, SPELL_PALADIN_SEAL_OF_TRUTH_DAMAGE, true, nullptr, aurEff);
float ap = eventInfo.GetActor()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.0270f; float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.0270f;
int32 holy = eventInfo.GetActor()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY); float holy = caster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY) * 0.01f;
holy += eventInfo.GetProcTarget()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); caster->CastCustomSpell(SPELL_PALADIN_CENSURE, SPELLVALUE_BASE_POINT0, int32(ap + holy), target, true, nullptr, aurEff);
holy *= 0.01f;
if (ap || holy)
{
int32 damage = int32(holy + ap);
actor->CastCustomSpell(target, SPELL_PALADIN_CENSURE, &damage, nullptr, nullptr, true, nullptr, aurEff);
}
} }
void Register() override void Register() override