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

◆ HandleSendEvent()

void spell_q12620_the_lifewarden_wrath::HandleSendEvent ( SpellEffIndex  effIndex)
inlineprivate
888 {
889 PreventHitDefaultEffect(effIndex);
890
891 if (Unit* caster = GetCaster())
892 {
893 if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f))
894 {
895 presence->AI()->Talk(WHISPER_ACTIVATE, caster);
896 presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants
897 // Freya Dummy could be scripted with the following code
898
899 // Revive plants
900 std::list<Creature*> servants;
902 for (std::list<Creature*>::iterator itr = servants.begin(); itr != servants.end(); ++itr)
903 {
904 // Couldn't find a spell that does this
905 if ((*itr)->isDead())
906 (*itr)->Respawn(true);
907
908 (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true);
909 (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false);
910 (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false);
911
912 if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
913 (*itr)->AI()->AttackStart(target);
914 }
915
916 // Kill nearby enemies
917 std::list<Creature*> saboteurs;
918 caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f);
919 for (std::list<Creature*>::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr)
920 if ((*itr)->IsAlive())
921 // Lifeforce has a cast duration, it should be cast at all saboteurs one by one
922 presence->CastSpell((*itr), SPELL_LIFEFORCE, false);
923 }
924 }
925 }
Definition Creature.h:47
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:595
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:667
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2619
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2558
@ NPC_SERVANT
Definition zone_sholazar_basin.cpp:867
@ NPC_PRESENCE
Definition zone_sholazar_basin.cpp:865
@ WHISPER_ACTIVATE
Definition zone_sholazar_basin.cpp:869
@ SPELL_LASHER_EMERGE
Definition zone_sholazar_basin.cpp:874
@ SPELL_WILD_GROWTH
Definition zone_sholazar_basin.cpp:875
@ SPELL_FREYA_DUMMY
Definition zone_sholazar_basin.cpp:871
@ SPELL_FREYA_DUMMY_TRIGGER
Definition zone_sholazar_basin.cpp:873
@ NPC_SABOTEUR
Definition zone_sholazar_basin.cpp:866
@ SPELL_LIFEFORCE
Definition zone_sholazar_basin.cpp:872

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.

928 {
930 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_SEND_EVENT
Definition SharedDefines.h:827
#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:887

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.

883 {
885 }
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: