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
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
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< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- 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
1528 {
1529 /*
1530 Causes more damage per frenzy point:
1531 1 point : (Attack power * 40 * 0.01 + Attack power * 0.05)-(Attack power * 40 * 0.01 + Attack power * 0.10) damage
1532 2 points : (Attack power * 40 * 0.01 + Attack power * 0.10)-(Attack power * 40 * 0.01 + Attack power * 0.20) damage
1533 3 points : (Attack power * 40 * 0.01 + Attack power * 0.15)-(Attack power * 40 * 0.01 + Attack power * 0.30) damage
1534 4 points : (Attack power * 40 * 0.01 + Attack power * 0.20)-(Attack power * 40 * 0.01 + Attack power * 0.40) damage
1535 5 points : (Attack power * 40 * 0.01 + Attack power * 0.25)-(Attack power * 40 * 0.01 + Attack power * 0.50) damage
1536 */
1537
1538 if (Aura* frenzy = GetCaster()->GetAura(SPELL_GHOUL_FRENZY))
1539 {
1541 float fixedDamageBonus = APBonus * GetEffectValue() * 0.01f;
1542 APBonus *= 0.05f * frenzy->GetStackAmount();
1543
1544 SetEffectValue(fixedDamageBonus + urand(int32(APBonus), int32(APBonus * 2.f)));
1545
1546 if (Unit* caster = GetCaster())
1547 {
1548 caster->RemoveAurasDueToSpell(SPELL_GHOUL_FRENZY);
1549
1550 if (Unit* charmer = caster->GetCharmer())
1551 {
1552 charmer->RemoveAurasDueToSpell(SPELL_GHOUL_FRENZY);
1553 }
1554 }
1555 }
1556 }
std::int32_t int32
Definition Define.h:103
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ BASE_ATTACK
Definition Unit.h:209
Definition SpellAuras.h:87
void SetEffectValue(int32 value)
Definition SpellScript.cpp:610
int32 GetEffectValue() const
Definition SpellScript.cpp:600
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:636
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim=nullptr) const
Definition Unit.cpp:15480
Unit * GetCharmer() const
Definition Unit.cpp:10653
@ SPELL_GHOUL_FRENZY
Definition spell_dk.cpp:79

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.

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

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.

1523 {
1525 }
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: