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

◆ SpellIds

Enumerator
SPELL_SUMMON_WAVE_A_MOB 
SPELL_SUMMON_WAVE_B_MOB 
SPELL_SUMMON_WAVE_C_MOB 
SPELL_SUMMON_WAVE_D_MOB 
393 {
398 };
@ SPELL_SUMMON_WAVE_A_MOB
Definition: boss_lady_vashj.cpp:394
@ SPELL_SUMMON_WAVE_D_MOB
Definition: boss_lady_vashj.cpp:397
@ SPELL_SUMMON_WAVE_B_MOB
Definition: boss_lady_vashj.cpp:395
@ SPELL_SUMMON_WAVE_C_MOB
Definition: boss_lady_vashj.cpp:396

Member Function Documentation

◆ FilterTargets()

void spell_lady_vashj_summons::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
406 {
407 // Filter targets by distance depending on the spell
408 // Coilfang Elites/Striders spawns on top of the stairs. The others at the foot of the stairs.
410 float minDist = top ? 25.f : 60.f;
411 float maxDist = top ? 60.f : 100.f;
412
413 Unit* caster = GetCaster();
414 targets.remove(caster);
415 targets.remove_if([caster, minDist, maxDist](WorldObject const* target) -> bool
416 {
417 float dist = caster->GetExactDist2d(target);
418 return target->GetEntry() != NPC_TRIGGER || (dist < minDist || dist > maxDist);
419 });
420
422 }
@ NPC_TRIGGER
Definition: boss_lady_vashj.cpp:72
@ SPELL_SUMMON_COILFANG_ELITE
Definition: boss_lady_vashj.cpp:50
@ SPELL_SUMMON_COILFANG_STRIDER
Definition: boss_lady_vashj.cpp:51
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:79
uint32 GetEntry() const
Definition: Object.h:112
Definition: Object.h:405
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:166
Definition: Unit.h:630
uint32 Id
Definition: SpellInfo.h:320
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
Unit * GetCaster()
Definition: SpellScript.cpp:401

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
425 {
426 if (Unit* target = GetHitUnit())
427 {
428 switch (GetSpellInfo()->Id)
429 {
431 target->CastSpell(target, SPELL_SUMMON_WAVE_A_MOB, true);
432 break;
434 target->CastSpell(target, SPELL_SUMMON_WAVE_B_MOB, true);
435 break;
437 target->CastSpell(target, SPELL_SUMMON_WAVE_C_MOB, true);
438 break;
440 target->CastSpell(target, SPELL_SUMMON_WAVE_D_MOB, true);
441 break;
442 default:
443 break;
444 }
445 }
446 }
@ 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.

449 {
452 }
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
#define SpellHitFn(F)
Definition: SpellScript.h:349
@ TARGET_UNIT_SRC_AREA_ENTRY
Definition: SharedDefines.h:1416
#define EFFECT_ALL
Definition: SharedDefines.h:38
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:405
void HandleHit()
Definition: boss_lady_vashj.cpp:424

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

Reimplemented from _SpellScript.

401 {
403 }
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:125

References SPELL_SUMMON_WAVE_A_MOB, SPELL_SUMMON_WAVE_B_MOB, SPELL_SUMMON_WAVE_C_MOB, SPELL_SUMMON_WAVE_D_MOB, and _SpellScript::ValidateSpellInfo().