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 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

◆ CheckCast()

SpellCastResult spell_dk_death_coil::CheckCast ( )
inlineprivate
1242 {
1243 Unit* caster = GetCaster();
1244 if (Unit* target = GetExplTargetUnit())
1245 {
1246 if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
1248
1249 if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
1251 }
1252 else
1254
1255 return SPELL_CAST_OK;
1256 }
@ 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
Unit * GetExplTargetUnit()
Definition SpellScript.cpp:433
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:620
bool IsFriendlyTo(Unit const *unit) const
Definition Unit.cpp:10282
bool isInFront(WorldObject const *target, float arc=M_PI) const
Definition Object.cpp:1503

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
1222 {
1223 int32 damage = GetEffectValue();
1224 Unit* caster = GetCaster();
1225 if (Unit* target = GetHitUnit())
1226 {
1227 if (caster->IsFriendlyTo(target))
1228 {
1229 int32 bp = int32(damage * 1.5f);
1230 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_HEAL, &bp, nullptr, nullptr, true);
1231 }
1232 else
1233 {
1234 if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART, EFFECT_1))
1235 damage += auraEffect->GetBaseAmount();
1236 caster->CastCustomSpell(target, SPELL_DK_DEATH_COIL_DAMAGE, &damage, nullptr, nullptr, true);
1237 }
1238 }
1239 }
std::int32_t int32
Definition Define.h:103
@ EFFECT_1
Definition SharedDefines.h:32
Definition SpellAuraEffects.h:39
int32 GetEffectValue() const
Definition SpellScript.cpp:600
Unit * GetHitUnit()
Definition SpellScript.cpp:448
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:1237
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5528
@ SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART
Definition spell_dk.cpp:65
@ SPELL_DK_DEATH_COIL_HEAL
Definition spell_dk.cpp:52
@ SPELL_DK_DEATH_COIL_DAMAGE
Definition spell_dk.cpp:51

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.

1259 {
1262 }
@ 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:1241
void HandleDummy(SpellEffIndex)
Definition spell_dk.cpp:1221

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.

1217 {
1219 }
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: