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

Private Member Functions

 PrepareSpellScript (spell_pagles_point_cast)
 
void OnEffect (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

◆ OnEffect()

void spell_pagles_point_cast::OnEffect ( SpellEffIndex  )
inlineprivate
166 {
167 if (Unit* caster = GetCaster())
168 {
169 if (InstanceScript* instanceScript = caster->GetInstanceScript())
170 {
171 if (!instanceScript->GetData(DATA_GAHZRANKA) && !caster->FindNearestCreature(NPC_GAHZRANKA, 50.0f))
172 {
173 caster->m_Events.AddEventAtOffset([caster]()
174 {
175 if (GameObject* lure = caster->SummonGameObject(GAMEOBJECT_MUDSKUNK_LURE, -11688.5f, -1737.74f, 10.409842f, 1.f, 0.f, 0.f, 0.f, 0.f, 30 * IN_MILLISECONDS))
176 {
177 lure->DespawnOrUnsummon(5s);
178 caster->m_Events.AddEventAtOffset([caster]()
179 {
180 if (!caster->FindNearestCreature(NPC_GAHZRANKA, 50.0f))
181 {
182 caster->CastSpell(caster, SPELL_SPLASH, true);
183 caster->SummonCreature(NPC_GAHZRANKA, -11688.5f, -1723.74f, -5.78f, 0.f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5 * DAY * IN_MILLISECONDS);
184 }
185 }, 5s);
186 }
187 }, 2s);
188 }
189 }
190 }
191 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
@ GAMEOBJECT_MUDSKUNK_LURE
Definition: boss_gahzranka.cpp:48
@ NPC_GAHZRANKA
Definition: zulgurub.h:68
@ DATA_GAHZRANKA
Definition: zulgurub.h:39
Definition: GameObject.h:122
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2332
Definition: Unit.h:1290
Definition: InstanceScript.h:140
Unit * GetCaster()
Definition: SpellScript.cpp:401

References DATA_GAHZRANKA, GAMEOBJECT_MUDSKUNK_LURE, SpellScript::GetCaster(), IN_MILLISECONDS, NPC_GAHZRANKA, and WorldObject::SummonGameObject().

Referenced by Register().

◆ PrepareSpellScript()

spell_pagles_point_cast::PrepareSpellScript ( spell_pagles_point_cast  )
private

◆ Register()

void spell_pagles_point_cast::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

194 {
196 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_1
Definition: SharedDefines.h:31
@ SPELL_EFFECT_SEND_EVENT
Definition: SharedDefines.h:811
HookList< EffectHandler > OnEffectLaunch
Definition: SpellScript.h:333
void OnEffect(SpellEffIndex)
Definition: boss_gahzranka.cpp:165

References EFFECT_1, OnEffect(), SPELL_EFFECT_SEND_EVENT, and SpellEffectFn.