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

Private Member Functions

 PrepareAuraScript (spell_botanica_shift_form_aura)
 
bool Load () override
 
bool CheckProc (ProcEventInfo &eventInfo)
 
void Register () override
 

Private Attributes

uint32 _lastSchool
 
uint32 _lastForm
 
uint32 _swapTime
 

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

◆ CheckProc()

bool spell_botanica_shift_form_aura::CheckProc ( ProcEventInfo eventInfo)
inlineprivate
101 {
102 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
103 {
104 if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime().count())
105 return false;
106
107 uint32 form = 0;
108 switch (GetFirstSchoolInMask(spellInfo->GetSchoolMask()))
109 {
111 form = SPELL_FIRE_FORM;
112 break;
114 form = SPELL_FROST_FORM;
115 break;
117 form = SPELL_ARCANE_FORM;
118 break;
120 form = SPELL_SHADOW_FORM;
121 break;
122 default:
123 break;
124 }
125
126 if (form)
127 {
128 _swapTime = GameTime::GetGameTime().count() + 6;
129 _lastSchool = spellInfo->GetSchoolMask();
131 _lastForm = form;
133 }
134 }
135
136 return false;
137 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_SHADOW_FORM
Definition: the_botanica.h:53
@ SPELL_ARCANE_FORM
Definition: the_botanica.h:50
@ SPELL_FROST_FORM
Definition: the_botanica.h:52
@ SPELL_FIRE_FORM
Definition: the_botanica.h:51
@ SPELL_SCHOOL_SHADOW
Definition: SharedDefines.h:288
@ SPELL_SCHOOL_FROST
Definition: SharedDefines.h:287
@ SPELL_SCHOOL_ARCANE
Definition: SharedDefines.h:289
@ SPELL_SCHOOL_FIRE
Definition: SharedDefines.h:285
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
Definition: SharedDefines.h:318
Seconds GetGameTime()
Definition: GameTime.cpp:38
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:184
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:1167
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
Definition: SpellInfo.h:316
Unit * GetUnitOwner() const
Definition: SpellScript.cpp:1030
uint32 _lastForm
Definition: instance_the_botanica.cpp:146
uint32 _swapTime
Definition: instance_the_botanica.cpp:147
uint32 _lastSchool
Definition: instance_the_botanica.cpp:145

References _lastForm, _lastSchool, _swapTime, Unit::CastSpell(), GetFirstSchoolInMask(), GameTime::GetGameTime(), ProcEventInfo::GetSpellInfo(), AuraScript::GetUnitOwner(), Unit::RemoveAurasDueToSpell(), SPELL_ARCANE_FORM, SPELL_FIRE_FORM, SPELL_FROST_FORM, SPELL_SCHOOL_ARCANE, SPELL_SCHOOL_FIRE, SPELL_SCHOOL_FROST, SPELL_SCHOOL_SHADOW, and SPELL_SHADOW_FORM.

Referenced by Register().

◆ Load()

bool spell_botanica_shift_form_aura::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

93 {
94 _lastSchool = 0;
95 _lastForm = 0;
96 _swapTime = 0;
97 return true;
98 }

References _lastForm, _lastSchool, and _swapTime.

◆ PrepareAuraScript()

spell_botanica_shift_form_aura::PrepareAuraScript ( spell_botanica_shift_form_aura  )
private

◆ Register()

void spell_botanica_shift_form_aura::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

140 {
142 }
#define AuraCheckProcFn(F)
Definition: SpellScript.h:818
HookList< CheckProcHandler > DoCheckProc
Definition: SpellScript.h:817
bool CheckProc(ProcEventInfo &eventInfo)
Definition: instance_the_botanica.cpp:100

References AuraCheckProcFn, CheckProc(), and AuraScript::DoCheckProc.

Member Data Documentation

◆ _lastForm

uint32 spell_botanica_shift_form_aura::_lastForm
private

Referenced by CheckProc(), and Load().

◆ _lastSchool

uint32 spell_botanica_shift_form_aura::_lastSchool
private

Referenced by CheckProc(), and Load().

◆ _swapTime

uint32 spell_botanica_shift_form_aura::_swapTime
private

Referenced by CheckProc(), and Load().