AzeorthCore 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< CheckProcHandlerDoCheckAfterProc
 
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
836 {
838 Unit* caster = GetCaster();
839 if( !caster )
840 return;
841 if( caster->GetMap()->GetId() == 649 )
842 {
844 Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
845 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
846 if( Player* plr = itr->GetSource() )
847 if( plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) )
848 {
849 uint32 absorb = 0;
850 uint32 resist = 0;
852 int32 dmg = urand(2925, 3075) * (caster->GetMap()->GetDifficulty() - 1);
853 uint32 damage = dmg;
854 int32 resilienceReduction = damage;
855 if (caster->CanApplyResilience())
856 Unit::ApplyResilience(plr, nullptr, &dmg, false, CR_CRIT_TAKEN_SPELL);
857 resilienceReduction = damage - resilienceReduction;
858 damage -= resilienceReduction;
859 uint32 mitigated_damage = resilienceReduction;
860 DamageInfo dmgInfo(caster, plr, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, mitigated_damage);
861 Unit::CalcAbsorbResist(dmgInfo);
862 Unit::DealDamageMods(plr, damage, &absorb);
863 int32 overkill = damage - plr->GetHealth();
864 if (overkill < 0)
865 overkill = 0;
866 SpellPeriodicAuraLogInfo pInfo(aurEff, damage, overkill, absorb, resist, 0.0f, false);
867 plr->SendPeriodicAuraLog(&pInfo);
868 Unit::DealDamage(caster, plr, damage, 0, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
869 }
870 }
871 }
std::int32_t int32
Definition: Define.h:104
std::uint32_t uint32
Definition: Define.h:108
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ BASE_ATTACK
Definition: Unit.h:396
@ CR_CRIT_TAKEN_SPELL
Definition: Unit.h:420
@ MELEE_HIT_NORMAL
Definition: Unit.h:717
@ DOT
Definition: Unit.h:437
@ SPELL_AURA_SPIRIT_OF_REDEMPTION
Definition: SpellAuraDefines.h:239
Definition: LinkedList.h:139
Map * GetMap() const
Definition: Object.h:517
Definition: Player.h:1046
Definition: Unit.h:746
Definition: Unit.h:761
Definition: Unit.h:931
Definition: Unit.h:1290
bool CanApplyResilience() const
Definition: Unit.h:2695
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition: Unit.cpp:19815
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
Definition: Unit.cpp:2515
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition: Unit.cpp:1046
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:1056
uint32 GetId() const
Definition: Map.h:378
Difficulty GetDifficulty() const
Definition: Map.h:442
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:344
void PreventDefaultAction()
Definition: SpellScript.cpp:975
SpellInfo const * GetSpellInfo() const
Definition: SpellScript.cpp:995
Unit * GetCaster() const
Definition: SpellScript.cpp:1010

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.

874 {
875 OnEffectPeriodic += AuraEffectPeriodicFn(spell_valkyr_touchAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
876 }
@ SPELL_AURA_PERIODIC_DAMAGE
Definition: SpellAuraDefines.h:66
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:750
@ EFFECT_0
Definition: SharedDefines.h:30
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:749

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