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 
337 {
342 };
@ SPELL_SUMMON_WAVE_A_MOB
Definition boss_lady_vashj.cpp:338
@ SPELL_SUMMON_WAVE_D_MOB
Definition boss_lady_vashj.cpp:341
@ SPELL_SUMMON_WAVE_B_MOB
Definition boss_lady_vashj.cpp:339
@ SPELL_SUMMON_WAVE_C_MOB
Definition boss_lady_vashj.cpp:340

Member Function Documentation

◆ FilterTargets()

void spell_lady_vashj_summons::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
350 {
351 // Filter targets by distance depending on the spell
352 // Coilfang Elites/Striders spawns on top of the stairs. The others at the foot of the stairs.
354 float minDist = top ? 25.f : 60.f;
355 float maxDist = top ? 60.f : 100.f;
356
357 Unit* caster = GetCaster();
358 targets.remove(caster);
359 targets.remove_if([caster, minDist, maxDist](WorldObject const* target) -> bool
360 {
361 float dist = caster->GetExactDist2d(target);
362 return target->GetEntry() != NPC_TRIGGER || (dist < minDist || dist > maxDist);
363 });
364
366 }
@ 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:117
uint32 Id
Definition SpellInfo.h:344
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:411
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:664
Definition Object.h:475
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
369 {
370 if (Unit* target = GetHitUnit())
371 {
372 switch (GetSpellInfo()->Id)
373 {
375 target->CastSpell(target, SPELL_SUMMON_WAVE_A_MOB, true);
376 break;
378 target->CastSpell(target, SPELL_SUMMON_WAVE_B_MOB, true);
379 break;
381 target->CastSpell(target, SPELL_SUMMON_WAVE_C_MOB, true);
382 break;
384 target->CastSpell(target, SPELL_SUMMON_WAVE_D_MOB, true);
385 break;
386 default:
387 break;
388 }
389 }
390 }
@ 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.

393 {
396 }
@ TARGET_UNIT_SRC_AREA_ENTRY
Definition SharedDefines.h:1422
#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:349
void HandleHit()
Definition boss_lady_vashj.cpp:368

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: