AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_valkyr_touch_aura Class Reference
Inheritance diagram for spell_valkyr_touch_aura:
AuraScript _SpellScript

Private Member Functions

 PrepareAuraScript (spell_valkyr_touch_aura)
 
void HandleEffectPeriodic (AuraEffect const *aurEff)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCasterGUID () const
 
Unit * GetCaster () const
 
GameObject * GetGObjCaster () const
 
WorldObject * GetOwner () const
 
Unit * GetUnitOwner () const
 
DynamicObject * GetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
Aura * GetAura () const
 
AuraObjectType GetType () const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration ()
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool HasEffect (uint8 effIndex) const
 
AuraEffect * GetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
Unit * GetTarget () const
 
AuraApplication const * GetTargetApplication () const
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
virtual void _Register ()
 
virtual void _Unload ()
 
virtual void _Init (std::string const *scriptname, uint32 spellId)
 
std::string const * _GetScriptName () const
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from AuraScript
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
 
HookList< AuraDispelHandler > OnDispel
 
HookList< AuraDispelHandler > AfterDispel
 
HookList< EffectApplyHandler > OnEffectApply
 
HookList< EffectApplyHandler > AfterEffectApply
 
HookList< EffectApplyHandler > OnEffectRemove
 
HookList< EffectApplyHandler > AfterEffectRemove
 
HookList< EffectPeriodicHandler > OnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandler > OnEffectAbsorb
 
HookList< EffectAbsorbHandler > AfterEffectAbsorb
 
HookList< EffectManaShieldHandler > OnEffectManaShield
 
HookList< EffectManaShieldHandler > AfterEffectManaShield
 
HookList< EffectSplitHandler > OnEffectSplit
 
HookList< CheckProcHandler > DoCheckProc
 
HookList< CheckEffectProcHandler > DoCheckEffectProc
 
HookList< AuraProcHandler > DoPrepareProc
 
HookList< AuraProcHandler > OnProc
 
HookList< AuraProcHandler > AfterProc
 
HookList< EffectProcHandler > OnEffectProc
 
HookList< EffectProcHandler > AfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleEffectPeriodic()

void spell_valkyr_touch_aura::HandleEffectPeriodic ( AuraEffect const *  aurEff)
inlineprivate
834 {
836 Unit* caster = GetCaster();
837 // Only the touched player takes damage, and the matching essence absorbs it
838 Unit* target = GetTarget();
839 if (!caster || !caster->GetMap()->IsHeroic() || !target->IsAlive() || target->HasSpiritOfRedemptionAura())
840 return;
841
842 int32 dmg = urand(2925, 3075) * (caster->GetMap()->GetDifficulty() - 1);
843 uint32 damage = dmg;
844 int32 resilienceReduction = damage;
845 if (caster->CanApplyResilience())
846 Unit::ApplyResilience(target, nullptr, &dmg, false, CR_CRIT_TAKEN_SPELL);
847 resilienceReduction = damage - resilienceReduction;
848 damage -= resilienceReduction;
849 uint32 mitigated_damage = resilienceReduction;
850 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
851 Unit::CalcAbsorbResist(dmgInfo);
852 uint32 absorb = dmgInfo.GetAbsorb();
853 uint32 resist = dmgInfo.GetResist();
854 damage = dmgInfo.GetDamage();
855 Unit::DealDamageMods(target, damage, &absorb);
856 int32 overkill = damage - target->GetHealth();
857 if (overkill < 0)
858 overkill = 0;
859 SpellPeriodicAuraLogInfo pInfo(aurEff, damage, overkill, absorb, resist, 0.0f, false);
860 target->SendPeriodicAuraLog(&pInfo);
861 Unit::DealDamage(caster, target, damage, 0, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
862 }
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ CR_CRIT_TAKEN_SPELL
Definition Unit.h:247
@ DOT
Definition Unit.h:264
void PreventDefaultAction()
Definition SpellScript.cpp:991
SpellInfo const * GetSpellInfo() const
Definition SpellScript.cpp:1011
Unit * GetCaster() const
Definition SpellScript.cpp:1026
Unit * GetTarget() const
Definition SpellScript.cpp:1178
Definition Unit.h:344
Difficulty GetDifficulty() const
Definition Map.h:294
bool IsHeroic() const
Definition Map.h:303
Definition Unit.h:670
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true, bool allowGM=false, Spell const *spell=nullptr, bool skipCombat=false)
Definition Unit.cpp:990
bool IsAlive() const
Definition Unit.h:1812
bool CanApplyResilience() const
Definition Unit.h:1186
uint32 GetHealth() const
Definition Unit.h:1122
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition Unit.cpp:14889
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:6624
bool HasSpiritOfRedemptionAura() const
Definition Unit.h:1823
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition Unit.cpp:980
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false, uint8 casterLevel=0)
Definition Unit.cpp:2344
Map * GetMap() const
Definition Object.h:637
Definition Unit.h:539

References Unit::ApplyResilience(), Unit::CalcAbsorbResist(), Unit::CanApplyResilience(), CR_CRIT_TAKEN_SPELL, Unit::DealDamage(), Unit::DealDamageMods(), DOT, DamageInfo::GetAbsorb(), AuraScript::GetCaster(), DamageInfo::GetDamage(), Map::GetDifficulty(), Unit::GetHealth(), WorldObject::GetMap(), DamageInfo::GetResist(), AuraScript::GetSpellInfo(), AuraScript::GetTarget(), Unit::HasSpiritOfRedemptionAura(), Unit::IsAlive(), Map::IsHeroic(), AuraScript::PreventDefaultAction(), Unit::SendPeriodicAuraLog(), and urand().

Referenced by Register().

◆ PrepareAuraScript()

spell_valkyr_touch_aura::PrepareAuraScript ( spell_valkyr_touch_aura  )
private

◆ Register()

void spell_valkyr_touch_aura::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

865 {
867 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_DAMAGE
Definition SpellAuraDefines.h:66
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:761
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:760
void HandleEffectPeriodic(AuraEffect const *aurEff)
Definition boss_twin_valkyr.cpp:833

References AuraEffectPeriodicFn, EFFECT_0, HandleEffectPeriodic(), AuraScript::OnEffectPeriodic, and SPELL_AURA_PERIODIC_DAMAGE.


The documentation for this class was generated from the following file: