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

◆ HandleScriptEffect()

void spell_warl_demonic_empowerment::HandleScriptEffect ( SpellEffIndex  )
inlineprivate
531 {
532 if (Creature* targetCreature = GetHitCreature())
533 {
534 if (targetCreature->IsPet())
535 {
536 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
537 switch (ci->family)
538 {
540 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
541 break;
543 {
544 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
545 int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
546 targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, nullptr, nullptr, true);
547 //unitTarget->CastSpell(unitTarget, 54441, true);
548 break;
549 }
551 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
552 break;
554 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
555 break;
557 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
558 break;
559 }
560 }
561 }
562 }
std::int32_t int32
Definition: Define.h:103
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS
Definition: spell_warlock.cpp:41
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD
Definition: spell_warlock.cpp:43
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER
Definition: spell_warlock.cpp:44
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER
Definition: spell_warlock.cpp:42
@ SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP
Definition: spell_warlock.cpp:45
@ CREATURE_FAMILY_FELGUARD
Definition: SharedDefines.h:2674
@ CREATURE_FAMILY_IMP
Definition: SharedDefines.h:2668
@ CREATURE_FAMILY_VOIDWALKER
Definition: SharedDefines.h:2663
@ CREATURE_FAMILY_FELHUNTER
Definition: SharedDefines.h:2662
@ CREATURE_FAMILY_SUCCUBUS
Definition: SharedDefines.h:2664
#define sObjectMgr
Definition: ObjectMgr.h:1635
#define sSpellMgr
Definition: SpellMgr.h:825
Definition: Creature.h:43
Definition: CreatureData.h:186
uint32 family
Definition: CreatureData.h:217
Definition: SpellInfo.h:316
Creature * GetHitCreature()
Definition: SpellScript.cpp:458
Unit * GetCaster()
Definition: SpellScript.cpp:401

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.

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

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

◆ Validate()