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

Private Member Functions

 PrepareAuraScript (spell_gen_arena_drink)
 
bool Load () override
 
bool Validate (SpellInfo const *spellInfo) override
 
void CalcPeriodic (AuraEffect const *, bool &isPeriodic, int32 &)
 
void CalcAmount (AuraEffect const *, int32 &amount, bool &)
 
void UpdatePeriodic (AuraEffect *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 (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
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 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< CheckEffectProcHandlerDoCheckEffectProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CalcAmount()

void spell_gen_arena_drink::CalcAmount ( AuraEffect const *  ,
int32 amount,
bool &   
)
inlineprivate
104 {
106 if (!regen)
107 return;
108
109 // default case - not in arena
110 if (!GetCaster()->ToPlayer()->InArena())
111 regen->ChangeAmount(amount);
112 }
@ EFFECT_0
Definition SharedDefines.h:31
Definition SpellAuraEffects.h:39
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false)
Definition SpellAuraEffects.cpp:713
Unit * GetCaster() const
Definition SpellScript.cpp:1035
Aura * GetAura() const
Definition SpellScript.cpp:1060
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellAuras.h:176

References AuraEffect::ChangeAmount(), EFFECT_0, AuraScript::GetAura(), AuraScript::GetCaster(), and Aura::GetEffect().

Referenced by Register().

◆ CalcPeriodic()

void spell_gen_arena_drink::CalcPeriodic ( AuraEffect const *  ,
bool &  isPeriodic,
int32  
)
inlineprivate
93 {
95 if (!regen)
96 return;
97
98 // default case - not in arena
99 if (!GetCaster()->ToPlayer()->InArena())
100 isPeriodic = false;
101 }

References EFFECT_0, AuraScript::GetAura(), AuraScript::GetCaster(), and Aura::GetEffect().

Referenced by Register().

◆ Load()

bool spell_gen_arena_drink::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

77 {
78 return GetCaster() && GetCaster()->IsPlayer();
79 }
bool IsPlayer() const
Definition Object.h:201

References AuraScript::GetCaster(), and Object::IsPlayer().

◆ PrepareAuraScript()

spell_gen_arena_drink::PrepareAuraScript ( spell_gen_arena_drink  )
private

◆ Register()

void spell_gen_arena_drink::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

147 {
151 }
@ EFFECT_1
Definition SharedDefines.h:32
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
#define AuraEffectCalcAmountFn(F, I, N)
Definition SpellScript.h:783
#define AuraEffectUpdatePeriodicFn(F, I, N)
Definition SpellScript.h:777
#define AuraEffectCalcPeriodicFn(F, I, N)
Definition SpellScript.h:789
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
Definition SpellScript.h:788
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition SpellScript.h:782
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
Definition SpellScript.h:776
void CalcAmount(AuraEffect const *, int32 &amount, bool &)
Definition spell_generic.cpp:103
void CalcPeriodic(AuraEffect const *, bool &isPeriodic, int32 &)
Definition spell_generic.cpp:92
void UpdatePeriodic(AuraEffect *aurEff)
Definition spell_generic.cpp:114

References AuraEffectCalcAmountFn, AuraEffectCalcPeriodicFn, AuraEffectUpdatePeriodicFn, CalcAmount(), CalcPeriodic(), AuraScript::DoEffectCalcAmount, AuraScript::DoEffectCalcPeriodic, EFFECT_1, AuraScript::OnEffectUpdatePeriodic, SPELL_AURA_PERIODIC_DUMMY, and UpdatePeriodic().

◆ UpdatePeriodic()

void spell_gen_arena_drink::UpdatePeriodic ( AuraEffect aurEff)
inlineprivate
115 {
117 if (!regen)
118 return;
119
120 // This feature used only in arenas
121 // Here need increase mana regen per tick (6 second rule)
122 // on 0 tick - 0 (handled in 2 second)
123 // on 1 tick - 166% (handled in 4 second)
124 // on 2 tick - 133% (handled in 6 second)
125
126 // Apply bonus for 1 - 4 tick
127 switch (aurEff->GetTickNumber())
128 {
129 case 1: // 0%
130 regen->ChangeAmount(0);
131 break;
132 case 2: // 166%
133 regen->ChangeAmount(aurEff->GetAmount() * 5 / 3);
134 break;
135 case 3: // 133%
136 regen->ChangeAmount(aurEff->GetAmount() * 4 / 3);
137 break;
138 default: // 100% - normal regen
139 regen->ChangeAmount(aurEff->GetAmount());
140 // No need to update after 4th tick
141 aurEff->SetPeriodic(false);
142 break;
143 }
144 }
uint32 GetTickNumber() const
Definition SpellAuraEffects.h:87
void SetPeriodic(bool isPeriodic)
Definition SpellAuraEffects.h:93
int32 GetAmount() const
Definition SpellAuraEffects.h:64

References AuraEffect::ChangeAmount(), EFFECT_0, AuraEffect::GetAmount(), AuraScript::GetAura(), Aura::GetEffect(), AuraEffect::GetTickNumber(), and AuraEffect::SetPeriodic().

Referenced by Register().

◆ Validate()

bool spell_gen_arena_drink::Validate ( SpellInfo const *  spellInfo)
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

82 {
83 if (spellInfo->Effects[EFFECT_0].ApplyAuraName != SPELL_AURA_MOD_POWER_REGEN)
84 {
85 LOG_ERROR("spells", "Aura {} structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", spellInfo->Id);
86 return false;
87 }
88
89 return true;
90 }
#define LOG_ERROR(filterType__,...)
Definition Log.h:158
@ SPELL_AURA_MOD_POWER_REGEN
Definition SpellAuraDefines.h:148

References EFFECT_0, SpellInfo::Effects, SpellInfo::Id, LOG_ERROR, and SPELL_AURA_MOD_POWER_REGEN.


The documentation for this class was generated from the following file: