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
 
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 void Register ()=0
 
virtual bool Validate (SpellInfo 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
 
virtual bool _Validate (SpellInfo const *entry)
 
- 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
1231 {
1232 Unit* caster = GetCaster();
1233 if (Unit* target = GetExplTargetUnit())
1234 {
1235 if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
1237
1238 if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
1240 }
1241 else
1243
1244 return SPELL_CAST_OK;
1245 }
@ CREATURE_TYPE_UNDEAD
Definition: SharedDefines.h:2633
@ SPELL_FAILED_UNIT_NOT_INFRONT
Definition: SharedDefines.h:1083
@ SPELL_FAILED_BAD_TARGETS
Definition: SharedDefines.h:961
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
bool isInFront(WorldObject const *target, float arc=M_PI) const
Definition: Object.cpp:1503
Definition: Unit.h:630
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10241
Unit * GetExplTargetUnit()
Definition: SpellScript.cpp:433
Unit * GetCaster()
Definition: SpellScript.cpp:401

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
1211 {
1212 int32 damage = GetEffectValue();
1213 Unit* caster = GetCaster();
1214 if (Unit* target = GetHitUnit())
1215 {
1216 if (caster->IsFriendlyTo(target))
1217 {
1218 int32 bp = int32(damage * 1.5f);
1219 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, nullptr, nullptr, true);
1220 }
1221 else
1222 {
1223 if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART, EFFECT_1))
1224 damage += auraEffect->GetBaseAmount();
1225 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, nullptr, nullptr, true);
1226 }
1227 }
1228 }
std::int32_t int32
Definition: Define.h:103
@ SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART
Definition: spell_dk.cpp:64
@ SPELL_DK_DEATH_COIL_HEAL
Definition: spell_dk.cpp:51
@ SPELL_DK_DEATH_COIL_DAMAGE
Definition: spell_dk.cpp:50
@ EFFECT_1
Definition: SharedDefines.h:32
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:1224
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:5494
Definition: SpellAuraEffects.h:39
int32 GetEffectValue() const
Definition: SpellScript.cpp:600
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

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.

1248 {
1251 }
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:781
#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:1230
void HandleDummy(SpellEffIndex)
Definition: spell_dk.cpp:1210

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.

1206 {
1208 }
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().