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

Private Member Functions

 PrepareSpellScript (spell_q12620_the_lifewarden_wrath_SpellScript)
 
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 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

◆ HandleSendEvent()

void spell_q12620_the_lifewarden_wrath::spell_q12620_the_lifewarden_wrath_SpellScript::HandleSendEvent ( SpellEffIndex  effIndex)
inlineprivate
1150 {
1151 PreventHitDefaultEffect(effIndex);
1152
1153 if (Unit* caster = GetCaster())
1154 {
1155 if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f))
1156 {
1157 presence->AI()->Talk(WHISPER_ACTIVATE, caster);
1158 presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants
1159 // Freya Dummy could be scripted with the following code
1160
1161 // Revive plants
1162 std::list<Creature*> servants;
1164 for (std::list<Creature*>::iterator itr = servants.begin(); itr != servants.end(); ++itr)
1165 {
1166 // Couldn't find a spell that does this
1167 if ((*itr)->isDead())
1168 (*itr)->Respawn(true);
1169
1170 (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true);
1171 (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false);
1172 (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false);
1173
1174 if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
1175 (*itr)->AI()->AttackStart(target);
1176 }
1177
1178 // Kill nearby enemies
1179 std::list<Creature*> saboteurs;
1180 caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f);
1181 for (std::list<Creature*>::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr)
1182 if ((*itr)->IsAlive())
1183 // Lifeforce has a cast duration, it should be cast at all saboteurs one by one
1184 presence->CastSpell((*itr), SPELL_LIFEFORCE, false);
1185 }
1186 }
1187 }
@ NPC_SERVANT
Definition: zone_sholazar_basin.cpp:1129
@ NPC_PRESENCE
Definition: zone_sholazar_basin.cpp:1127
@ WHISPER_ACTIVATE
Definition: zone_sholazar_basin.cpp:1131
@ SPELL_LASHER_EMERGE
Definition: zone_sholazar_basin.cpp:1136
@ SPELL_WILD_GROWTH
Definition: zone_sholazar_basin.cpp:1137
@ SPELL_FREYA_DUMMY
Definition: zone_sholazar_basin.cpp:1133
@ SPELL_FREYA_DUMMY_TRIGGER
Definition: zone_sholazar_basin.cpp:1135
@ NPC_SABOTEUR
Definition: zone_sholazar_basin.cpp:1128
@ SPELL_LIFEFORCE
Definition: zone_sholazar_basin.cpp:1134
Definition: Creature.h:46
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2448
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2394
Definition: Unit.h:1290
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetCaster()
Definition: SpellScript.cpp:401

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::spell_q12620_the_lifewarden_wrath_SpellScript::PrepareSpellScript ( spell_q12620_the_lifewarden_wrath_SpellScript  )
private

◆ Register()

void spell_q12620_the_lifewarden_wrath::spell_q12620_the_lifewarden_wrath_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1190 {
1192 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SEND_EVENT
Definition: SharedDefines.h:811
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void HandleSendEvent(SpellEffIndex effIndex)
Definition: zone_sholazar_basin.cpp:1149

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