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
508 {
509 if (Creature* targetCreature = GetHitCreature())
510 {
511 if (targetCreature->IsPet())
512 {
513 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
514 switch (ci->family)
515 {
517 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
518 break;
520 {
521 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
522 int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
523 targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, nullptr, nullptr, true);
524 //unitTarget->CastSpell(unitTarget, 54441, true);
525 break;
526 }
528 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
529 break;
531 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
532 break;
534 targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
535 break;
536 }
537 }
538 }
539 }
std::int32_t int32
Definition: Define.h:104
#define sObjectMgr
Definition: ObjectMgr.h:1640
#define sSpellMgr
Definition: SpellMgr.h:818
@ 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:2646
@ CREATURE_FAMILY_IMP
Definition: SharedDefines.h:2640
@ CREATURE_FAMILY_VOIDWALKER
Definition: SharedDefines.h:2635
@ CREATURE_FAMILY_FELHUNTER
Definition: SharedDefines.h:2634
@ CREATURE_FAMILY_SUCCUBUS
Definition: SharedDefines.h:2636
Definition: Creature.h:46
Definition: CreatureData.h:176
uint32 family
Definition: CreatureData.h:210
Definition: SpellInfo.h:314
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.

542 {
544 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition: SharedDefines.h:827
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleScriptEffect(SpellEffIndex)
Definition: spell_warlock.cpp:507

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

◆ Validate()