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

Private Types

enum  SpellIds : uint32 {
  SPELL_SUMMON_WAVE_A_MOB = 38019 ,
  SPELL_SUMMON_WAVE_B_MOB = 38247 ,
  SPELL_SUMMON_WAVE_C_MOB = 38242 ,
  SPELL_SUMMON_WAVE_D_MOB = 38244
}
 

Private Member Functions

 PrepareSpellScript (spell_lady_vashj_summons)
 
bool Validate (SpellInfo const *) override
 
void FilterTargets (std::list< WorldObject * > &targets)
 
void HandleHit ()
 
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 Enumeration Documentation

◆ SpellIds

Enumerator
SPELL_SUMMON_WAVE_A_MOB 
SPELL_SUMMON_WAVE_B_MOB 
SPELL_SUMMON_WAVE_C_MOB 
SPELL_SUMMON_WAVE_D_MOB 
342 {
347 };
@ SPELL_SUMMON_WAVE_A_MOB
Definition boss_lady_vashj.cpp:343
@ SPELL_SUMMON_WAVE_D_MOB
Definition boss_lady_vashj.cpp:346
@ SPELL_SUMMON_WAVE_B_MOB
Definition boss_lady_vashj.cpp:344
@ SPELL_SUMMON_WAVE_C_MOB
Definition boss_lady_vashj.cpp:345

Member Function Documentation

◆ FilterTargets()

void spell_lady_vashj_summons::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
355 {
356 // Filter targets by distance depending on the spell
357 // Coilfang Elites/Striders spawns on top of the stairs. The others at the foot of the stairs.
359 float minDist = top ? 25.f : 60.f;
360 float maxDist = top ? 60.f : 100.f;
361
362 Unit* caster = GetCaster();
363 targets.remove(caster);
364 targets.remove_if([caster, minDist, maxDist](WorldObject const* target) -> bool
365 {
366 float dist = caster->GetExactDist2d(target);
367 return target->GetEntry() != NPC_TRIGGER || (dist < minDist || dist > maxDist);
368 });
369
371 }
@ NPC_TRIGGER
Definition boss_lady_vashj.cpp:68
@ SPELL_SUMMON_COILFANG_ELITE
Definition boss_lady_vashj.cpp:50
@ SPELL_SUMMON_COILFANG_STRIDER
Definition boss_lady_vashj.cpp:51
uint32 GetEntry() const
Definition Object.h:115
uint32 Id
Definition SpellInfo.h:320
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:411
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:636
Definition Object.h:410
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:79
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170

References SpellScript::GetCaster(), Object::GetEntry(), Position::GetExactDist2d(), SpellScript::GetSpellInfo(), SpellInfo::Id, NPC_TRIGGER, Acore::Containers::RandomResize(), SPELL_SUMMON_COILFANG_ELITE, and SPELL_SUMMON_COILFANG_STRIDER.

Referenced by Register().

◆ HandleHit()

void spell_lady_vashj_summons::HandleHit ( )
inlineprivate
374 {
375 if (Unit* target = GetHitUnit())
376 {
377 switch (GetSpellInfo()->Id)
378 {
380 target->CastSpell(target, SPELL_SUMMON_WAVE_A_MOB, true);
381 break;
383 target->CastSpell(target, SPELL_SUMMON_WAVE_B_MOB, true);
384 break;
386 target->CastSpell(target, SPELL_SUMMON_WAVE_C_MOB, true);
387 break;
389 target->CastSpell(target, SPELL_SUMMON_WAVE_D_MOB, true);
390 break;
391 default:
392 break;
393 }
394 }
395 }
@ SPELL_SUMMON_ENCHANTED_ELEMENTAL
Definition boss_lady_vashj.cpp:49
@ SPELL_SUMMON_TAINTED_ELEMENTAL
Definition boss_lady_vashj.cpp:52
Unit * GetHitUnit()
Definition SpellScript.cpp:448

References SpellScript::GetHitUnit(), SpellScript::GetSpellInfo(), SPELL_SUMMON_COILFANG_ELITE, SPELL_SUMMON_COILFANG_STRIDER, SPELL_SUMMON_ENCHANTED_ELEMENTAL, SPELL_SUMMON_TAINTED_ELEMENTAL, SPELL_SUMMON_WAVE_A_MOB, SPELL_SUMMON_WAVE_B_MOB, SPELL_SUMMON_WAVE_C_MOB, and SPELL_SUMMON_WAVE_D_MOB.

Referenced by Register().

◆ PrepareSpellScript()

spell_lady_vashj_summons::PrepareSpellScript ( spell_lady_vashj_summons  )
private

◆ Register()

void spell_lady_vashj_summons::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

398 {
401 }
@ TARGET_UNIT_SRC_AREA_ENTRY
Definition SharedDefines.h:1416
#define EFFECT_ALL
Definition SharedDefines.h:38
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition SpellScript.h:354
#define SpellHitFn(F)
Definition SpellScript.h:349
HookList< HitHandler > OnHit
Definition SpellScript.h:345
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition SpellScript.h:353
void FilterTargets(std::list< WorldObject * > &targets)
Definition boss_lady_vashj.cpp:354
void HandleHit()
Definition boss_lady_vashj.cpp:373

References EFFECT_ALL, FilterTargets(), HandleHit(), SpellScript::OnHit, SpellScript::OnObjectAreaTargetSelect, SpellHitFn, SpellObjectAreaTargetSelectFn, and TARGET_UNIT_SRC_AREA_ENTRY.

◆ Validate()

bool spell_lady_vashj_summons::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

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