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
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
void Remove (uint32 removeMode=0)
 
AuraGetAura () 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
 
AuraEffectGetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
UnitGetTarget () 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 void Register ()=0
 
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< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandlerOnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandlerDoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandlerDoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
virtual bool _Validate (SpellInfo const *entry)
 
- 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
823 {
825 Unit* caster = GetCaster();
826 if (!caster)
827 return;
828 if (caster->GetMap()->GetId() == 649 )
829 {
831 Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
832 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
833 if (Player* plr = itr->GetSource())
834 if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasSpiritOfRedemptionAura())
835 {
836 uint32 absorb = 0;
837 uint32 resist = 0;
839 int32 dmg = urand(2925, 3075) * (caster->GetMap()->GetDifficulty() - 1);
840 uint32 damage = dmg;
841 int32 resilienceReduction = damage;
842 if (caster->CanApplyResilience())
843 Unit::ApplyResilience(plr, nullptr, &dmg, false, CR_CRIT_TAKEN_SPELL);
844 resilienceReduction = damage - resilienceReduction;
845 damage -= resilienceReduction;
846 uint32 mitigated_damage = resilienceReduction;
847 DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
848 Unit::CalcAbsorbResist(dmgInfo);
849 Unit::DealDamageMods(plr, damage, &absorb);
850 int32 overkill = damage - plr->GetHealth();
851 if (overkill < 0)
852 overkill = 0;
853 SpellPeriodicAuraLogInfo pInfo(aurEff, damage, overkill, absorb, resist, 0.0f, false);
854 plr->SendPeriodicAuraLog(&pInfo);
855 Unit::DealDamage(caster, plr, damage, 0, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
856 }
857 }
858 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::int32_t int32
Definition: Define.h:103
std::uint32_t uint32
Definition: Define.h:107
@ BASE_ATTACK
Definition: Unit.h:209
@ CR_CRIT_TAKEN_SPELL
Definition: Unit.h:233
@ DOT
Definition: Unit.h:250
@ MELEE_HIT_NORMAL
Definition: Unit.h:286
Definition: LinkedList.h:139
Map * GetMap() const
Definition: Object.h:536
Definition: Player.h:1081
Definition: Unit.h:315
Definition: Unit.h:330
Definition: Unit.h:512
Definition: Unit.h:630
bool CanApplyResilience() const
Definition: Unit.h:1093
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition: Unit.cpp:18927
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
Definition: Unit.cpp:2147
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition: Unit.cpp:800
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)
Definition: Unit.cpp:810
uint32 GetId() const
Definition: Map.h:377
Difficulty GetDifficulty() const
Definition: Map.h:441
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
uint32 ExcludeTargetAuraSpell
Definition: SpellInfo.h:346
void PreventDefaultAction()
Definition: SpellScript.cpp:985
SpellInfo const * GetSpellInfo() const
Definition: SpellScript.cpp:1005
Unit * GetCaster() const
Definition: SpellScript.cpp:1020

References Unit::ApplyResilience(), BASE_ATTACK, MapRefMgr::begin(), Unit::CalcAbsorbResist(), Unit::CanApplyResilience(), CR_CRIT_TAKEN_SPELL, Unit::DealDamage(), Unit::DealDamageMods(), DOT, MapRefMgr::end(), SpellInfo::ExcludeTargetAuraSpell, AuraScript::GetCaster(), Map::GetDifficulty(), Map::GetId(), WorldObject::GetMap(), Map::GetPlayers(), AuraScript::GetSpellInfo(), MELEE_HIT_NORMAL, AuraScript::PreventDefaultAction(), 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.

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

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