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

◆ SpellIds

Enumerator
SPELL_SUMMON_WAVE_A_MOB 
SPELL_SUMMON_WAVE_B_MOB 
SPELL_SUMMON_WAVE_C_MOB 
SPELL_SUMMON_WAVE_D_MOB 
327 {
332 };
@ SPELL_SUMMON_WAVE_A_MOB
Definition boss_lady_vashj.cpp:328
@ SPELL_SUMMON_WAVE_D_MOB
Definition boss_lady_vashj.cpp:331
@ SPELL_SUMMON_WAVE_B_MOB
Definition boss_lady_vashj.cpp:329
@ SPELL_SUMMON_WAVE_C_MOB
Definition boss_lady_vashj.cpp:330

Member Function Documentation

◆ FilterTargets()

void spell_lady_vashj_summons::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
340 {
341 // Filter targets by distance depending on the spell
342 // Coilfang Elites/Striders spawns on top of the stairs. The others at the foot of the stairs.
344 float minDist = top ? 25.f : 60.f;
345 float maxDist = top ? 60.f : 100.f;
346
347 Unit* caster = GetCaster();
348 targets.remove(caster);
349 targets.remove_if([caster, minDist, maxDist](WorldObject const* target) -> bool
350 {
351 float dist = caster->GetExactDist2d(target);
352 return target->GetEntry() != NPC_TRIGGER || (dist < minDist || dist > maxDist);
353 });
354
356 }
@ 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:123
uint32 Id
Definition SpellInfo.h:344
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:416
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:665
Definition Object.h:482
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
359 {
360 if (Unit* target = GetHitUnit())
361 {
362 switch (GetSpellInfo()->Id)
363 {
365 target->CastSpell(target, SPELL_SUMMON_WAVE_A_MOB, true);
366 break;
368 target->CastSpell(target, SPELL_SUMMON_WAVE_B_MOB, true);
369 break;
371 target->CastSpell(target, SPELL_SUMMON_WAVE_C_MOB, true);
372 break;
374 target->CastSpell(target, SPELL_SUMMON_WAVE_D_MOB, true);
375 break;
376 default:
377 break;
378 }
379 }
380 }
@ 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:453

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.

383 {
386 }
@ TARGET_UNIT_SRC_AREA_ENTRY
Definition SharedDefines.h:1420
#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:339
void HandleHit()
Definition boss_lady_vashj.cpp:358

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: