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

Private Member Functions

 PrepareSpellScript (spell_dk_ghoul_thrash)
 
bool Validate (SpellInfo const *) override
 
void CalcDamage (SpellEffIndex)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- 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 SpellScript
HookList< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ CalcDamage()

void spell_dk_ghoul_thrash::CalcDamage ( SpellEffIndex  )
inlineprivate
1710 {
1711 /*
1712 Causes more damage per frenzy point:
1713 1 point : (Attack power * 40 * 0.01 + Attack power * 0.05)-(Attack power * 40 * 0.01 + Attack power * 0.10) damage
1714 2 points : (Attack power * 40 * 0.01 + Attack power * 0.10)-(Attack power * 40 * 0.01 + Attack power * 0.20) damage
1715 3 points : (Attack power * 40 * 0.01 + Attack power * 0.15)-(Attack power * 40 * 0.01 + Attack power * 0.30) damage
1716 4 points : (Attack power * 40 * 0.01 + Attack power * 0.20)-(Attack power * 40 * 0.01 + Attack power * 0.40) damage
1717 5 points : (Attack power * 40 * 0.01 + Attack power * 0.25)-(Attack power * 40 * 0.01 + Attack power * 0.50) damage
1718 */
1719
1720 if (Aura* frenzy = GetCaster()->GetAura(SPELL_GHOUL_FRENZY))
1721 {
1723 float fixedDamageBonus = APBonus * GetEffectValue() * 0.01f;
1724 APBonus *= 0.05f * frenzy->GetStackAmount();
1725
1726 SetEffectValue(fixedDamageBonus + urand(int32(APBonus), int32(APBonus * 2.f)));
1727
1728 if (Unit* caster = GetCaster())
1729 {
1730 caster->RemoveAurasDueToSpell(SPELL_GHOUL_FRENZY);
1731
1732 if (Unit* charmer = caster->GetCharmer())
1733 {
1734 charmer->RemoveAurasDueToSpell(SPELL_GHOUL_FRENZY);
1735 }
1736 }
1737 }
1738 }
std::int32_t int32
Definition Define.h:103
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ BASE_ATTACK
Definition Unit.h:218
Definition SpellAuras.h:88
void SetEffectValue(int32 value)
Definition SpellScript.cpp:615
int32 GetEffectValue() const
Definition SpellScript.cpp:605
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:667
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim=nullptr) const
Definition Unit.cpp:11904
Unit * GetCharmer() const
Definition Unit.cpp:7495
@ SPELL_GHOUL_FRENZY
Definition spell_dk.cpp:83

References BASE_ATTACK, SpellScript::GetCaster(), Unit::GetCharmer(), SpellScript::GetEffectValue(), Unit::GetTotalAttackPowerValue(), SpellScript::SetEffectValue(), SPELL_GHOUL_FRENZY, and urand().

Referenced by Register().

◆ PrepareSpellScript()

spell_dk_ghoul_thrash::PrepareSpellScript ( spell_dk_ghoul_thrash  )
private

◆ Register()

void spell_dk_ghoul_thrash::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1741 {
1743 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition SharedDefines.h:768
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectLaunchTarget
Definition SpellScript.h:334
void CalcDamage(SpellEffIndex)
Definition spell_dk.cpp:1709

References CalcDamage(), EFFECT_0, SpellScript::OnEffectLaunchTarget, SPELL_EFFECT_SCHOOL_DAMAGE, and SpellEffectFn.

◆ Validate()

bool spell_dk_ghoul_thrash::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_GHOUL_FRENZY, and _SpellScript::ValidateSpellInfo().


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