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

Private Member Functions

 PrepareAuraScript (spell_sha_earthbind_totem)
 
bool Validate (SpellInfo const *) override
 
void HandleEffectPeriodic (AuraEffect const *)
 
void Apply (AuraEffect const *, AuraEffectHandleModes)
 
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

◆ Apply()

void spell_sha_earthbind_totem::Apply ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
594 {
595 if (!GetCaster())
596 return;
598 if (!owner)
599 return;
600 // Storm, Earth and Fire
602 {
603 if (roll_chance_i(aurEff->GetAmount()))
605 }
606 }
bool roll_chance_i(int chance)
Definition: Random.h:59
@ SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB
Definition: spell_shaman.cpp:56
@ SPELL_SHAMAN_STORM_EARTH_AND_FIRE
Definition: spell_shaman.cpp:55
@ EFFECT_1
Definition: SharedDefines.h:31
Definition: Player.h:1046
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10576
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:5426
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
Definition: SpellAuraEffects.h:39
Unit * GetCaster() const
Definition: SpellScript.cpp:1020

References Unit::CastSpell(), EFFECT_1, Unit::GetAuraEffectOfRankedSpell(), AuraScript::GetCaster(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), roll_chance_i(), SPELL_SHAMAN_STORM_EARTH_AND_FIRE, and SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB.

Referenced by Register().

◆ HandleEffectPeriodic()

void spell_sha_earthbind_totem::HandleEffectPeriodic ( AuraEffect const *  )
inlineprivate
584 {
585 if (!GetCaster())
586 return;
587 if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
588 if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
589 if (roll_chance_i(aur->GetBaseAmount()))
591 }
@ SPELL_SHAMAN_TOTEM_EARTHEN_POWER
Definition: spell_shaman.cpp:58
@ SPELLFAMILY_SHAMAN
Definition: SharedDefines.h:3511
Definition: Unit.h:1290
Unit * GetTarget() const
Definition: SpellScript.cpp:1165

References Unit::CastSpell(), AuraScript::GetCaster(), AuraScript::GetTarget(), roll_chance_i(), SPELL_SHAMAN_TOTEM_EARTHEN_POWER, and SPELLFAMILY_SHAMAN.

Referenced by Register().

◆ PrepareAuraScript()

spell_sha_earthbind_totem::PrepareAuraScript ( spell_sha_earthbind_totem  )
private

◆ Register()

void spell_sha_earthbind_totem::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

609 {
612 }
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
Definition: SpellAuraDefines.h:86
@ AURA_EFFECT_HANDLE_REAL
Definition: SpellAuraDefines.h:42
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:760
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:743
@ EFFECT_0
Definition: SharedDefines.h:30
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:759
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:738
void HandleEffectPeriodic(AuraEffect const *)
Definition: spell_shaman.cpp:583
void Apply(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_shaman.cpp:593

References Apply(), AURA_EFFECT_HANDLE_REAL, AuraEffectApplyFn, AuraEffectPeriodicFn, EFFECT_0, HandleEffectPeriodic(), AuraScript::OnEffectApply, AuraScript::OnEffectPeriodic, and SPELL_AURA_PERIODIC_TRIGGER_SPELL.

◆ Validate()

bool spell_sha_earthbind_totem::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

579 {
581 }
@ SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM
Definition: spell_shaman.cpp:57
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:125

References SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM, SPELL_SHAMAN_TOTEM_EARTHEN_POWER, and _SpellScript::ValidateSpellInfo().