Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Core/Spells: use the consecration summon as target instead of storing…
Browse files Browse the repository at this point in the history
… the position of the dynobject
  • Loading branch information
Ovahlord committed Oct 25, 2023
1 parent ce4b80f commit d52cdee
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/server/scripts/Spells/spell_paladin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "SpellMgr.h"
#include "Spell.h"
#include "TemporarySummon.h"
#include "NewTemporarySummon.h"

enum PaladinSpells
{
Expand Down Expand Up @@ -271,13 +272,6 @@ class spell_pal_blessing_of_faith : public SpellScript
// 26573 - Consecration
class spell_pal_consecration : public AuraScript
{
bool Load() override
{
// Store the position of the initial Consecration cast for triggering the damage
castPos = GetCaster()->GetPosition();
return true;
}

bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PALADIN_CONSECRATION_TRIGGERED });
Expand All @@ -289,16 +283,14 @@ class spell_pal_consecration : public AuraScript
if (GetTarget() != GetCaster())
return;

if (Unit* caster = GetCaster())
caster->CastSpell({ castPos.GetPositionX(), castPos.GetPositionY(), castPos.GetPositionZ() }, SPELL_PALADIN_CONSECRATION_TRIGGERED, aurEff);
if (NewTemporarySummon* consecration = GetTarget()->GetSummonInSlot(SummonPropertiesSlot::Totem1))
GetTarget()->CastSpell(consecration, SPELL_PALADIN_CONSECRATION_TRIGGERED, aurEff);
}

void Register() override
{
OnEffectPeriodic.Register(&spell_pal_consecration::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
private:
Position castPos;
};

// 64205 - Divine Sacrifice
Expand Down

0 comments on commit d52cdee

Please sign in to comment.