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
 
Unit * GetCaster () const
 
WorldObject * GetOwner () const
 
Unit * GetUnitOwner () const
 
DynamicObject * GetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
Aura * GetAura () 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
 
AuraEffect * GetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
Unit * GetTarget () 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< CheckAreaTargetHandler > DoCheckAreaTarget
 
HookList< AuraDispelHandler > OnDispel
 
HookList< AuraDispelHandler > AfterDispel
 
HookList< EffectApplyHandler > OnEffectApply
 
HookList< EffectApplyHandler > AfterEffectApply
 
HookList< EffectApplyHandler > OnEffectRemove
 
HookList< EffectApplyHandler > AfterEffectRemove
 
HookList< EffectPeriodicHandler > OnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandler > OnEffectAbsorb
 
HookList< EffectAbsorbHandler > AfterEffectAbsorb
 
HookList< EffectManaShieldHandler > OnEffectManaShield
 
HookList< EffectManaShieldHandler > AfterEffectManaShield
 
HookList< EffectSplitHandler > OnEffectSplit
 
HookList< CheckProcHandler > DoCheckProc
 
HookList< CheckEffectProcHandler > DoCheckEffectProc
 
HookList< AfterCheckProcHandler > DoAfterCheckProc
 
HookList< AuraProcHandler > DoPrepareProc
 
HookList< AuraProcHandler > OnProc
 
HookList< AuraProcHandler > AfterProc
 
HookList< EffectProcHandler > OnEffectProc
 
HookList< EffectProcHandler > AfterEffectProc
 
- 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
5352 {
5353 Unit* target = GetTarget();
5354 if (!target && !target->ToPlayer())
5355 return;
5356
5357 SpellEffIndex InebriateEffIndex = EFFECT_0;
5358 if (Player* player = target->ToPlayer())
5359 {
5360 switch (GetSpellInfo()->Id)
5361 {
5362 case SPELL_DRUNKEN_HAZE:
5363 InebriateEffIndex = EFFECT_1;
5364 break;
5366 InebriateEffIndex = EFFECT_2;
5367 break;
5368 }
5369
5370 uint16 level = aurEff->GetSpellInfo()->Effects[InebriateEffIndex].CalcValue();
5371 player->SetDrunkValue(player->GetDrunkValue() - (level > 100 ? 100 : level)); // Some (maybe it's only 29690) spells can have over 100 inebriate points
5372 }
5373 }
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:1025
Unit * GetTarget() const
Definition SpellScript.cpp:1185
Player * ToPlayer()
Definition Object.h:208
Definition Player.h:1086
Definition Unit.h:665
@ SPELL_DRUNKEN_HAZE
Definition spell_generic.cpp:5338
@ SPELL_DRUNKEN_SKULL_CRACK
Definition spell_generic.cpp:5339

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.

5376 {
5378 {
5380 }
5381 else
5382 {
5384 }
5385 }
@ 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:766
HookList< EffectApplyHandler > AfterEffectRemove
Definition SpellScript.h:765
uint32 m_scriptSpellId
Definition SpellScript.h:107
void OnRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
Definition spell_generic.cpp:5351

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.

5347 {
5349 }
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: