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

Private Member Functions

 PrepareAuraScript (spell_gen_sober_up)
 
bool Validate (SpellInfo const *) override
 
void OnRemove (AuraEffect const *aurEff, 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 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
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ OnRemove()

void spell_gen_sober_up::OnRemove ( AuraEffect const *  aurEff,
AuraEffectHandleModes   
)
inlineprivate
5195 {
5196 Unit* target = GetTarget();
5197 if (!target && !target->ToPlayer())
5198 return;
5199
5200 SpellEffIndex InebriateEffIndex = EFFECT_0;
5201 if (Player* player = target->ToPlayer())
5202 {
5203 switch (GetSpellInfo()->Id)
5204 {
5205 case SPELL_DRUNKEN_HAZE:
5206 InebriateEffIndex = EFFECT_1;
5207 break;
5209 InebriateEffIndex = EFFECT_2;
5210 break;
5211 }
5212
5213 uint16 level = aurEff->GetSpellInfo()->Effects[InebriateEffIndex].CalcValue();
5214 player->SetDrunkValue(player->GetDrunkValue() - (level > 100 ? 100 : level)); // Some (maybe it's only 29690) spells can have over 100 inebriate points
5215 }
5216 }
std::uint16_t uint16
Definition Define.h:108
SpellEffIndex
Definition SharedDefines.h:30
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ EFFECT_2
Definition SharedDefines.h:33
SpellInfo const * GetSpellInfo() const
Definition SpellScript.cpp:1005
Unit * GetTarget() const
Definition SpellScript.cpp:1165
Player * ToPlayer()
Definition Object.h:201
Definition Player.h:1081
Definition Unit.h:636
@ SPELL_DRUNKEN_HAZE
Definition spell_generic.cpp:5181
@ SPELL_DRUNKEN_SKULL_CRACK
Definition spell_generic.cpp:5182

References EFFECT_0, EFFECT_1, EFFECT_2, SpellInfo::Effects, AuraEffect::GetSpellInfo(), AuraScript::GetSpellInfo(), AuraScript::GetTarget(), SPELL_DRUNKEN_HAZE, SPELL_DRUNKEN_SKULL_CRACK, and Object::ToPlayer().

Referenced by Register().

◆ PrepareAuraScript()

spell_gen_sober_up::PrepareAuraScript ( spell_gen_sober_up  )
private

◆ Register()

void spell_gen_sober_up::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

5219 {
5221 {
5223 }
5224 else
5225 {
5227 }
5228 }
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
#define SPELL_AURA_ANY
Definition SpellScript.h:43
#define AuraEffectRemoveFn(F, I, N, M)
Definition SpellScript.h:754
HookList< EffectApplyHandler > AfterEffectRemove
Definition SpellScript.h:753
uint32 m_scriptSpellId
Definition SpellScript.h:107
void OnRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
Definition spell_generic.cpp:5194

References AuraScript::AfterEffectRemove, AURA_EFFECT_HANDLE_REAL, AuraEffectRemoveFn, EFFECT_0, EFFECT_1, _SpellScript::m_scriptSpellId, OnRemove(), SPELL_AURA_ANY, and SPELL_DRUNKEN_HAZE.

◆ Validate()

bool spell_gen_sober_up::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

5190 {
5192 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SPELL_DRUNKEN_HAZE, SPELL_DRUNKEN_SKULL_CRACK, and _SpellScript::ValidateSpellInfo().


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