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

Private Member Functions

 PrepareSpellScript (spell_warl_demonic_empowerment)
 
bool Validate (SpellInfo const *) override
 
void HandleScriptEffect (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

◆ HandleScriptEffect()

void spell_warl_demonic_empowerment::HandleScriptEffect ( SpellEffIndex  )
inlineprivate
561 {
562 if (Creature* targetCreature = GetHitCreature())
563 {
564 if (targetCreature->IsPet())
565 {
566 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
567 switch (ci->family)
568 {
570 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
571 break;
573 {
574 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
575 int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
576 targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, nullptr, nullptr, true);
577 //unitTarget->CastSpell(unitTarget, 54441, true);
578 break;
579 }
581 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
582 break;
584 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
585 break;
587 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
588 break;
589 }
590 }
591 }
592 }
std::int32_t int32
Definition Define.h:103
#define sObjectMgr
Definition ObjectMgr.h:1731
@ CREATURE_FAMILY_FELGUARD
Definition SharedDefines.h:2668
@ CREATURE_FAMILY_IMP
Definition SharedDefines.h:2662
@ CREATURE_FAMILY_VOIDWALKER
Definition SharedDefines.h:2657
@ CREATURE_FAMILY_FELHUNTER
Definition SharedDefines.h:2656
@ CREATURE_FAMILY_SUCCUBUS
Definition SharedDefines.h:2658
#define sSpellMgr
Definition SpellMgr.h:847
Definition Creature.h:47
Definition SpellInfo.h:340
Creature * GetHitCreature()
Definition SpellScript.cpp:463
Unit * GetCaster()
Definition SpellScript.cpp:401
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS
Definition spell_warlock.cpp:45
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD
Definition spell_warlock.cpp:47
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER
Definition spell_warlock.cpp:48
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER
Definition spell_warlock.cpp:46
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP
Definition spell_warlock.cpp:49
Definition CreatureData.h:187
uint32 family
Definition CreatureData.h:217

References CREATURE_FAMILY_FELGUARD, CREATURE_FAMILY_FELHUNTER, CREATURE_FAMILY_IMP, CREATURE_FAMILY_SUCCUBUS, CREATURE_FAMILY_VOIDWALKER, CreatureTemplate::family, SpellScript::GetCaster(), SpellScript::GetHitCreature(), sObjectMgr, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, and sSpellMgr.

Referenced by Register().

◆ PrepareSpellScript()

spell_warl_demonic_empowerment::PrepareSpellScript ( spell_warl_demonic_empowerment  )
private

◆ Register()

void spell_warl_demonic_empowerment::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

595 {
597 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition SharedDefines.h:843
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectHitTarget
Definition SpellScript.h:336
void HandleScriptEffect(SpellEffIndex)
Definition spell_warlock.cpp:560

References EFFECT_0, HandleScriptEffect(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_SCRIPT_EFFECT, and SpellEffectFn.

◆ Validate()


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