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

Public Member Functions

 spell_hun_pet_scaling_01_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 bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 

Private Member Functions

 PrepareAuraScript (spell_hun_pet_scaling_01_AuraScript)
 
void CalculateStaminaAmount (AuraEffect const *, int32 &amount, bool &)
 
void ApplyEffect (AuraEffect const *, AuraEffectHandleModes)
 
void RemoveEffect (AuraEffect const *, AuraEffectHandleModes)
 
void CalculateAttackPowerAmount (AuraEffect const *, int32 &amount, bool &)
 
void CalculateDamageDoneAmount (AuraEffect const *, int32 &amount, bool &)
 
void Register () override
 

Private Attributes

uint32 _tempHealth
 

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_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::spell_hun_pet_scaling_01_AuraScript ( )
inline
889  {
890  _tempHealth = 0;
891  }

Member Function Documentation

void spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::ApplyEffect ( AuraEffect const ,
AuraEffectHandleModes   
)
inlineprivate
918  {
919  if (Unit* pet = GetUnitOwner())
920  if (_tempHealth)
921  pet->SetHealth(_tempHealth);
922  }
Unit * GetUnitOwner() const
Definition: SpellScript.cpp:1016
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::CalculateAttackPowerAmount ( AuraEffect const ,
int32 amount,
bool  
)
inlineprivate
931  {
932  if (Unit* pet = GetUnitOwner())
933  {
934  if (!pet->IsPet())
935  return;
936 
937  Unit* owner = pet->ToPet()->GetOwner();
938  if (!owner)
939  return;
940 
941  float mod = 1.0f; //Hunter contribution modifier
942  float bonusAP = 0.0f;
943 
944  PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
945  if (itr == pet->ToPet()->m_spells.end())
946  itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
947 
948  if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
949  {
950  SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
951  mod += CalculatePct(1.0f, spellInfo->GetEffect(EFFECT_1)->CalcValue());
952  }
953 
954  bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod;
955 
956  amount += bonusAP;
957  }
958  }
Definition: SharedDefines.h:29
Player * GetOwner() const
Definition: Pet.cpp:1913
Definition: SpellInfo.h:326
Definition: Unit.h:619
Pet * ToPet()
Definition: Unit.h:2200
Unit * GetUnitOwner() const
Definition: SpellScript.cpp:1016
#define sSpellMgr
Definition: SpellMgr.h:756
T CalculatePct(T base, U pct)
Definition: Util.h:92
SpellEffectInfo const * GetEffect(uint32 difficulty, uint32 index) const
Definition: SpellInfo.cpp:3348
int32 CalcValue(Unit const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:455
float GetTotalAttackPowerValue(WeaponAttackType attType) const
Definition: Unit.cpp:11491
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::CalculateDamageDoneAmount ( AuraEffect const ,
int32 amount,
bool  
)
inlineprivate
961  {
962  if (Unit* pet = GetUnitOwner())
963  {
964  if (!pet->IsPet())
965  return;
966 
967  Unit* owner = pet->ToPet()->GetOwner();
968  if (!owner)
969  return;
970 
971  float mod = 1.0f; //Hunter contribution modifier
972  float bonusDamage = 0.0f;
973 
974  PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
975  if (itr == pet->ToPet()->m_spells.end())
976  itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
977 
978  if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
979  {
980  SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
981  mod += CalculatePct(1.0f, spellInfo->GetEffect(EFFECT_1)->CalcValue());
982  }
983 
984  bonusDamage = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod;
985 
986  amount += bonusDamage;
987  }
988  }
Definition: SharedDefines.h:29
Player * GetOwner() const
Definition: Pet.cpp:1913
Definition: SpellInfo.h:326
Definition: Unit.h:619
Pet * ToPet()
Definition: Unit.h:2200
Unit * GetUnitOwner() const
Definition: SpellScript.cpp:1016
#define sSpellMgr
Definition: SpellMgr.h:756
T CalculatePct(T base, U pct)
Definition: Util.h:92
SpellEffectInfo const * GetEffect(uint32 difficulty, uint32 index) const
Definition: SpellInfo.cpp:3348
int32 CalcValue(Unit const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:455
float GetTotalAttackPowerValue(WeaponAttackType attType) const
Definition: Unit.cpp:11491
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::CalculateStaminaAmount ( AuraEffect const ,
int32 amount,
bool  
)
inlineprivate
895  {
896  if (Unit* pet = GetUnitOwner())
897  if (pet->IsPet())
898  if (Unit* owner = pet->ToPet()->GetOwner())
899  {
900  float mod = 0.45f;
901 
902  PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
903  if (itr == pet->ToPet()->m_spells.end())
904  itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
905 
906  if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
907  {
908  SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
909  AddPct(mod, spellInfo->GetEffect(EFFECT_0)->CalcValue());
910  }
911 
912  int32 const ownerBonus = owner->GetStat(STAT_STAMINA) * mod;
913  amount += ownerBonus;
914  }
915  }
Player * GetOwner() const
Definition: Pet.cpp:1913
Definition: SpellInfo.h:326
Definition: SharedDefines.h:28
Pet * ToPet()
Definition: Unit.h:2200
Definition: SharedDefines.h:239
Unit * GetUnitOwner() const
Definition: SpellScript.cpp:1016
#define sSpellMgr
Definition: SpellMgr.h:756
int32_t int32
Definition: Define.h:146
SpellEffectInfo const * GetEffect(uint32 difficulty, uint32 index) const
Definition: SpellInfo.cpp:3348
int32 CalcValue(Unit const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:455
T AddPct(T &base, U pct)
Definition: Util.h:98
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::PrepareAuraScript ( spell_hun_pet_scaling_01_AuraScript  )
private
void spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

991  {
997  }
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:692
Definition: SharedDefines.h:29
Definition: SpellAuraDefines.h:159
Definition: SharedDefines.h:28
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:722
void CalculateStaminaAmount(AuraEffect const *, int32 &amount, bool &)
Definition: spell_pet.cpp:894
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:704
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:699
void ApplyEffect(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_pet.cpp:917
Definition: SpellAuraDefines.h:73
void CalculateAttackPowerAmount(AuraEffect const *, int32 &amount, bool &)
Definition: spell_pet.cpp:930
void RemoveEffect(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_pet.cpp:924
Definition: SpellAuraDefines.h:89
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:693
Definition: SharedDefines.h:30
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:721
Definition: SpellAuraDefines.h:46
void CalculateDamageDoneAmount(AuraEffect const *, int32 &amount, bool &)
Definition: spell_pet.cpp:960

+ Here is the call graph for this function:

void spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::RemoveEffect ( AuraEffect const ,
AuraEffectHandleModes   
)
inlineprivate
925  {
926  if (Unit* pet = GetUnitOwner())
927  _tempHealth = pet->GetHealth();
928  }
Unit * GetUnitOwner() const
Definition: SpellScript.cpp:1016
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 spell_hun_pet_scaling_01::spell_hun_pet_scaling_01_AuraScript::_tempHealth
private

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