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

Private Member Functions

 PrepareAuraScript (spell_valkyr_touchAuraScript) 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

◆ PrepareAuraScript()

spell_valkyr_touch::spell_valkyr_touchAuraScript::PrepareAuraScript ( spell_valkyr_touchAuraScript  ) const
inlineprivate
834 {
836 Unit* caster = GetCaster();
837 if (!caster)
838 return;
839 if (caster->GetMap()->GetId() == 649 )
840 {
842 Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
843 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
844 if (Player* plr = itr->GetSource())
845 if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
846 {
847 uint32 absorb = 0;
848 uint32 resist = 0;
850 int32 dmg = urand(2925, 3075) * (caster->GetMap()->GetDifficulty() - 1);
851 uint32 damage = dmg;
852 int32 resilienceReduction = damage;
853 if (caster->CanApplyResilience())
854 Unit::ApplyResilience(plr, nullptr, &dmg, false, CR_CRIT_TAKEN_SPELL);
855 resilienceReduction = damage - resilienceReduction;
856 damage -= resilienceReduction;
857 uint32 mitigated_damage = resilienceReduction;
858 DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
859 Unit::CalcAbsorbResist(dmgInfo);
860 Unit::DealDamageMods(plr, damage, &absorb);
861 int32 overkill = damage - plr->GetHealth();
862 if (overkill < 0)
863 overkill = 0;
864 SpellPeriodicAuraLogInfo pInfo(aurEff, damage, overkill, absorb, resist, 0.0f, false);
865 plr->SendPeriodicAuraLog(&pInfo);
866 Unit::DealDamage(caster, plr, damage, 0, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
867 }
868 }
869 }
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
@ SPELL_AURA_SPIRIT_OF_REDEMPTION
Definition: SpellAuraDefines.h:239
Definition: LinkedList.h:139
Map * GetMap() const
Definition: Object.h:531
Definition: Player.h:1064
Definition: Unit.h:315
Definition: Unit.h:330
Definition: Unit.h:512
Definition: Unit.h:630
bool CanApplyResilience() const
Definition: Unit.h:1736
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition: Unit.cpp:18883
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
Definition: Unit.cpp:2131
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition: Unit.cpp:801
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:811
uint32 GetId() const
Definition: Map.h:379
Difficulty GetDifficulty() const
Definition: Map.h:443
PlayerList const & GetPlayers() const
Definition: Map.h:486
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(), SPELL_AURA_SPIRIT_OF_REDEMPTION, and urand().

◆ Register()

void spell_valkyr_touch::spell_valkyr_touchAuraScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

872 {
873 OnEffectPeriodic += AuraEffectPeriodicFn(spell_valkyr_touchAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
874 }
@ SPELL_AURA_PERIODIC_DAMAGE
Definition: SpellAuraDefines.h:66
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:760
@ EFFECT_0
Definition: SharedDefines.h:31
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:759

References AuraEffectPeriodicFn, EFFECT_0, AuraScript::OnEffectPeriodic, and SPELL_AURA_PERIODIC_DAMAGE.