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

Private Member Functions

 PrepareSpellScript (spell_dk_death_coil)
 
bool Validate (SpellInfo const *) override
 
void HandleDummy (SpellEffIndex)
 
SpellCastResult CheckCast ()
 
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

◆ CheckCast()

SpellCastResult spell_dk_death_coil::CheckCast ( )
inlineprivate
1413 {
1414 Unit* caster = GetCaster();
1415 if (Unit* target = GetExplTargetUnit())
1416 {
1417 if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
1419
1420 if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
1422 }
1423 else
1425
1426 return SPELL_CAST_OK;
1427 }
@ CREATURE_TYPE_UNDEAD
Definition SharedDefines.h:2627
@ SPELL_FAILED_UNIT_NOT_INFRONT
Definition SharedDefines.h:1071
@ SPELL_FAILED_BAD_TARGETS
Definition SharedDefines.h:949
@ SPELL_CAST_OK
Definition SharedDefines.h:1126
Unit * GetExplTargetUnit()
Definition SpellScript.cpp:438
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:667
bool IsFriendlyTo(Unit const *unit) const
Definition Unit.cpp:7043
bool isInFront(WorldObject const *target, float arc=M_PI) const
Definition Object.cpp:1557

References CREATURE_TYPE_UNDEAD, SpellScript::GetCaster(), SpellScript::GetExplTargetUnit(), Unit::IsFriendlyTo(), WorldObject::isInFront(), SPELL_CAST_OK, SPELL_FAILED_BAD_TARGETS, and SPELL_FAILED_UNIT_NOT_INFRONT.

Referenced by Register().

◆ HandleDummy()

void spell_dk_death_coil::HandleDummy ( SpellEffIndex  )
inlineprivate
1393 {
1394 int32 damage = GetEffectValue();
1395 Unit* caster = GetCaster();
1396 if (Unit* target = GetHitUnit())
1397 {
1398 if (caster->IsFriendlyTo(target))
1399 {
1400 int32 bp = int32(damage * 1.5f);
1401 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, nullptr, nullptr, true);
1402 }
1403 else
1404 {
1405 if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART, EFFECT_1))
1406 damage += auraEffect->GetBaseAmount();
1407 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, nullptr, nullptr, true);
1408 }
1409 }
1410 }
std::int32_t int32
Definition Define.h:103
@ EFFECT_1
Definition SharedDefines.h:32
Definition SpellAuraEffects.h:39
int32 GetEffectValue() const
Definition SpellScript.cpp:605
Unit * GetHitUnit()
Definition SpellScript.cpp:453
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1429
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5537
@ SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART
Definition spell_dk.cpp:65
@ SPELL_DK_DEATH_COIL_HEAL
Definition spell_dk.cpp:51
@ SPELL_DK_DEATH_COIL_DAMAGE
Definition spell_dk.cpp:50

References Unit::CastCustomSpell(), EFFECT_1, Unit::GetAuraEffect(), SpellScript::GetCaster(), SpellScript::GetEffectValue(), SpellScript::GetHitUnit(), Unit::IsFriendlyTo(), SPELL_DK_DEATH_COIL_DAMAGE, SPELL_DK_DEATH_COIL_HEAL, and SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART.

Referenced by Register().

◆ PrepareSpellScript()

spell_dk_death_coil::PrepareSpellScript ( spell_dk_death_coil  )
private

◆ Register()

void spell_dk_death_coil::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1430 {
1433 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition SharedDefines.h:769
#define SpellCheckCastFn(F)
Definition SpellScript.h:329
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< CheckCastHandler > OnCheckCast
Definition SpellScript.h:328
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
SpellCastResult CheckCast()
Definition spell_dk.cpp:1412
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:1392

References CheckCast(), EFFECT_0, HandleDummy(), SpellScript::OnCheckCast, SpellScript::OnEffectHitTarget, SPELL_EFFECT_DUMMY, SpellCheckCastFn, and SpellEffectFn.

◆ Validate()

bool spell_dk_death_coil::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

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

References SPELL_DK_DEATH_COIL_DAMAGE, SPELL_DK_DEATH_COIL_HEAL, and _SpellScript::ValidateSpellInfo().


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