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

Private Member Functions

 PrepareSpellScript (spell_q12620_the_lifewarden_wrath)
 
bool Validate (SpellInfo const *) override
 
void HandleSendEvent (SpellEffIndex effIndex)
 
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

◆ HandleSendEvent()

void spell_q12620_the_lifewarden_wrath::HandleSendEvent ( SpellEffIndex  effIndex)
inlineprivate
1142 {
1143 PreventHitDefaultEffect(effIndex);
1144
1145 if (Unit* caster = GetCaster())
1146 {
1147 if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f))
1148 {
1149 presence->AI()->Talk(WHISPER_ACTIVATE, caster);
1150 presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants
1151 // Freya Dummy could be scripted with the following code
1152
1153 // Revive plants
1154 std::list<Creature*> servants;
1156 for (std::list<Creature*>::iterator itr = servants.begin(); itr != servants.end(); ++itr)
1157 {
1158 // Couldn't find a spell that does this
1159 if ((*itr)->isDead())
1160 (*itr)->Respawn(true);
1161
1162 (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true);
1163 (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false);
1164 (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false);
1165
1166 if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
1167 (*itr)->AI()->AttackStart(target);
1168 }
1169
1170 // Kill nearby enemies
1171 std::list<Creature*> saboteurs;
1172 caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f);
1173 for (std::list<Creature*>::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr)
1174 if ((*itr)->IsAlive())
1175 // Lifeforce has a cast duration, it should be cast at all saboteurs one by one
1176 presence->CastSpell((*itr), SPELL_LIFEFORCE, false);
1177 }
1178 }
1179 }
Definition Creature.h:43
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:590
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:636
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2513
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2459
@ NPC_SERVANT
Definition zone_sholazar_basin.cpp:1121
@ NPC_PRESENCE
Definition zone_sholazar_basin.cpp:1119
@ WHISPER_ACTIVATE
Definition zone_sholazar_basin.cpp:1123
@ SPELL_LASHER_EMERGE
Definition zone_sholazar_basin.cpp:1128
@ SPELL_WILD_GROWTH
Definition zone_sholazar_basin.cpp:1129
@ SPELL_FREYA_DUMMY
Definition zone_sholazar_basin.cpp:1125
@ SPELL_FREYA_DUMMY_TRIGGER
Definition zone_sholazar_basin.cpp:1127
@ NPC_SABOTEUR
Definition zone_sholazar_basin.cpp:1120
@ SPELL_LIFEFORCE
Definition zone_sholazar_basin.cpp:1126

References WorldObject::FindNearestCreature(), SpellScript::GetCaster(), WorldObject::GetCreatureListWithEntryInGrid(), NPC_PRESENCE, NPC_SABOTEUR, NPC_SERVANT, SpellScript::PreventHitDefaultEffect(), SPELL_FREYA_DUMMY, SPELL_FREYA_DUMMY_TRIGGER, SPELL_LASHER_EMERGE, SPELL_LIFEFORCE, SPELL_WILD_GROWTH, and WHISPER_ACTIVATE.

Referenced by Register().

◆ PrepareSpellScript()

spell_q12620_the_lifewarden_wrath::PrepareSpellScript ( spell_q12620_the_lifewarden_wrath  )
private

◆ Register()

void spell_q12620_the_lifewarden_wrath::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1182 {
1184 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SEND_EVENT
Definition SharedDefines.h:839
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectHit
Definition SpellScript.h:335
void HandleSendEvent(SpellEffIndex effIndex)
Definition zone_sholazar_basin.cpp:1141

References EFFECT_0, HandleSendEvent(), SpellScript::OnEffectHit, SPELL_EFFECT_SEND_EVENT, and SpellEffectFn.

◆ Validate()

bool spell_q12620_the_lifewarden_wrath::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

1137 {
1139 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition SpellScript.h:125

References SPELL_FREYA_DUMMY, SPELL_FREYA_DUMMY_TRIGGER, SPELL_LASHER_EMERGE, SPELL_LIFEFORCE, SPELL_WILD_GROWTH, and _SpellScript::ValidateSpellInfo().


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