TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript Class Reference

Public Member Functions

 spell_gen_mixology_bonus_AuraScript ()
 
- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=NULL)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo constGetSpellInfo () 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 constGetTargetApplication () 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 ()
 

Private Member Functions

 PrepareAuraScript (spell_gen_mixology_bonus_AuraScript)
 
bool Validate (SpellInfo const *) override
 
bool Load () override
 
void SetBonusValueForEffect (SpellEffIndex effIndex, int32 value, AuraEffect const *aurEff)
 
void CalculateAmount (AuraEffect const *aurEff, int32 &amount, bool &)
 
void Register () override
 

Private Attributes

int32 bonus
 

Additional Inherited Members

- Public Attributes inherited from AuraScript
HookList< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList
< EffectUpdatePeriodicHandler
OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList
< EffectCalcPeriodicHandler
DoEffectCalcPeriodic
 
HookList
< EffectCalcSpellModHandler
DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string constm_scriptName
 
uint32 m_scriptSpellId
 

Constructor & Destructor Documentation

spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::spell_gen_mixology_bonus_AuraScript ( )
inline
3908  {
3909  bonus = 0;
3910  }

Member Function Documentation

void spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::CalculateAmount ( AuraEffect const aurEff,
int32 amount,
bool  
)
inlineprivate
3932  {
3933  if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetSpellInfo()->GetEffect(EFFECT_0)->TriggerSpell))
3934  {
3935  switch (GetId())
3936  {
3939  bonus = amount;
3940  break;
3944  bonus = CalculatePct(amount, 80);
3945  break;
3955  case SPELL_EARTHEN_ELIXIR:
3961  bonus = CalculatePct(amount, 50);
3962  break;
3964  bonus = 280;
3965  break;
3967  bonus = 200;
3968  break;
3971  bonus = 140;
3972  break;
3974  bonus = 100;
3975  break;
3977  bonus = 82;
3978  break;
3980  bonus = 70;
3981  break;
3983  bonus = 50;
3984  break;
3986  bonus = 47;
3987  break;
3988  case SPELL_WRATH_ELIXIR:
3989  bonus = 32;
3990  break;
3994  bonus = 29;
3995  break;
3997  bonus = 27;
3998  break;
4003  bonus = 23;
4004  break;
4016  bonus = 20;
4017  break;
4019  bonus = 17;
4020  break;
4023  bonus = 15;
4024  break;
4026  bonus = 13;
4027  break;
4028  case SPELL_ARCANE_ELIXIR:
4029  bonus = 12;
4030  break;
4033  bonus = 11;
4034  break;
4037  case SPELL_ELIXIR_OF_SAGES:
4040  bonus = 10;
4041  break;
4043  bonus = 9;
4044  break;
4046  case SPELL_GURUS_ELIXIR:
4047  bonus = 8;
4048  break;
4052  bonus = 6;
4053  break;
4058  bonus = 5;
4059  break;
4062  bonus = 4;
4063  break;
4065  bonus = -10;
4066  break;
4067  case SPELL_ADEPTS_ELIXIR:
4068  SetBonusValueForEffect(EFFECT_0, 13, aurEff);
4069  SetBonusValueForEffect(EFFECT_1, 13, aurEff);
4070  SetBonusValueForEffect(EFFECT_2, 8, aurEff);
4071  break;
4073  SetBonusValueForEffect(EFFECT_0, 160, aurEff);
4074  break;
4076  SetBonusValueForEffect(EFFECT_0, 116, aurEff);
4077  SetBonusValueForEffect(EFFECT_1, 6, aurEff);
4078  break;
4080  SetBonusValueForEffect(EFFECT_0, 40, aurEff);
4081  SetBonusValueForEffect(EFFECT_1, 40, aurEff);
4082  break;
4084  SetBonusValueForEffect(EFFECT_0, 210, aurEff);
4085  SetBonusValueForEffect(EFFECT_1, 5, aurEff);
4086  break;
4088  SetBonusValueForEffect(EFFECT_0, 19, aurEff);
4089  SetBonusValueForEffect(EFFECT_1, 19, aurEff);
4090  SetBonusValueForEffect(EFFECT_2, 5, aurEff);
4091  break;
4093  SetBonusValueForEffect(EFFECT_0, 5, aurEff);
4094  break;
4095  default:
4096  TC_LOG_ERROR("spells", "SpellId %u couldn't be processed in spell_gen_mixology_bonus", GetId());
4097  break;
4098  }
4099  amount += bonus;
4100  }
4101  }
Definition: spell_generic.cpp:3856
Definition: spell_generic.cpp:3874
Definition: spell_generic.cpp:3871
Definition: spell_generic.cpp:3886
Definition: spell_generic.cpp:3892
Definition: spell_generic.cpp:3833
Definition: spell_generic.cpp:3838
Definition: SharedDefines.h:29
Definition: spell_generic.cpp:3875
Definition: spell_generic.cpp:3868
Definition: spell_generic.cpp:3822
Definition: spell_generic.cpp:3849
Definition: spell_generic.cpp:3891
Definition: spell_generic.cpp:3825
Definition: SharedDefines.h:28
Definition: spell_generic.cpp:3841
Definition: spell_generic.cpp:3830
Definition: spell_generic.cpp:3861
Definition: spell_generic.cpp:3836
Definition: spell_generic.cpp:3889
Definition: spell_generic.cpp:3832
Definition: spell_generic.cpp:3845
AuraEffect * GetEffect(uint8 effIndex) const
Definition: SpellScript.cpp:1141
Definition: spell_generic.cpp:3893
Definition: spell_generic.cpp:3823
Definition: spell_generic.cpp:3843
uint32 GetId() const
Definition: SpellScript.cpp:996
Definition: spell_generic.cpp:3854
Definition: spell_generic.cpp:3881
Definition: spell_generic.cpp:3840
Definition: spell_generic.cpp:3877
Definition: spell_generic.cpp:3879
Definition: spell_generic.cpp:3824
Definition: spell_generic.cpp:3866
Definition: spell_generic.cpp:3867
Definition: spell_generic.cpp:3870
Definition: spell_generic.cpp:3848
Definition: spell_generic.cpp:3847
Definition: spell_generic.cpp:3860
Definition: spell_generic.cpp:3882
Definition: spell_generic.cpp:3876
Definition: spell_generic.cpp:3819
Definition: spell_generic.cpp:3834
Definition: spell_generic.cpp:3862
Definition: spell_generic.cpp:3858
Definition: spell_generic.cpp:3894
Definition: spell_generic.cpp:3839
void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const *aurEff)
Definition: spell_generic.cpp:3925
Definition: spell_generic.cpp:3844
Definition: spell_generic.cpp:3887
Definition: spell_generic.cpp:3826
Definition: spell_generic.cpp:3863
Definition: spell_generic.cpp:3873
Definition: spell_generic.cpp:3888
Definition: spell_generic.cpp:3817
SpellInfo const * GetSpellInfo() const
Definition: SpellScript.cpp:991
Definition: spell_generic.cpp:3853
Definition: spell_generic.cpp:3872
Definition: spell_generic.cpp:3864
Definition: spell_generic.cpp:3880
Definition: spell_generic.cpp:3850
Definition: spell_generic.cpp:3859
Definition: spell_generic.cpp:3883
Definition: spell_generic.cpp:3827
T CalculatePct(T base, U pct)
Definition: Util.h:92
Definition: spell_generic.cpp:3852
Definition: spell_generic.cpp:3885
Definition: spell_generic.cpp:3884
Definition: spell_generic.cpp:3890
Definition: spell_generic.cpp:3814
Definition: spell_generic.cpp:3818
Unit * GetCaster() const
Definition: SpellScript.cpp:1006
Definition: spell_generic.cpp:3821
Definition: spell_generic.cpp:3837
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: spell_generic.cpp:3842
Definition: spell_generic.cpp:3846
Definition: SharedDefines.h:30
Definition: spell_generic.cpp:3811
Definition: spell_generic.cpp:3855
Definition: spell_generic.cpp:3820
Definition: spell_generic.cpp:3813
Definition: spell_generic.cpp:3878
Definition: spell_generic.cpp:3816
Definition: spell_generic.cpp:3869
Definition: spell_generic.cpp:3815
Definition: spell_generic.cpp:3835
Definition: spell_generic.cpp:3865
Definition: spell_generic.cpp:3831
Definition: spell_generic.cpp:3857
Definition: spell_generic.cpp:3851
Definition: spell_generic.cpp:3828

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

3921  {
3922  return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3923  }
TypeID GetTypeId() const
Definition: Object.h:113
Definition: ObjectGuid.h:33
Unit * GetCaster() const
Definition: SpellScript.cpp:1006

+ Here is the call graph for this function:

spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::PrepareAuraScript ( spell_gen_mixology_bonus_AuraScript  )
private
void spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

4106  {
4108  }
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:722
#define SPELL_AURA_ANY
Definition: SpellScript.h:43
#define EFFECT_ALL
Definition: SharedDefines.h:64
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
Definition: spell_generic.cpp:3931
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:721

+ Here is the call graph for this function:

void spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::SetBonusValueForEffect ( SpellEffIndex  effIndex,
int32  value,
AuraEffect const aurEff 
)
inlineprivate
3926  {
3927  if (aurEff->GetEffIndex() == uint32(effIndex))
3928  bonus = value;
3929  }
const FieldDescriptor value
Definition: descriptor.h:1522
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::Validate ( SpellInfo const )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

3914  {
3915  if (!sSpellMgr->GetSpellInfo(SPELL_MIXOLOGY))
3916  return false;
3917  return true;
3918  }
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: spell_generic.cpp:3811

Member Data Documentation

int32 spell_gen_mixology_bonus::spell_gen_mixology_bonus_AuraScript::bonus
private

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