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

Private Member Functions

 PrepareSpellScript (spell_mutate_explode_bug)
 
void FilterTargets (std::list< WorldObject * > &targets)
 
void HandleOnHit ()
 
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

◆ FilterTargets()

void spell_mutate_explode_bug::FilterTargets ( std::list< WorldObject * > &  targets)
inlineprivate
444 {
445 targets.remove_if([&](WorldObject const* target) -> bool
446 {
447 if (target->GetEntry() != NPC_QIRAJI_SCARAB && target->GetEntry() != NPC_QIRAJI_SCORPION)
448 return true;
449 if (Creature const* creature = target->ToCreature())
450 if (creature->HasAura(SPELL_EXPLODE_BUG) || creature->HasAura(SPELL_MUTATE_BUG))
451 return true;
452
453 return false;
454 });
455
457 }
@ NPC_QIRAJI_SCORPION
Definition: boss_twinemperors.cpp:79
@ NPC_QIRAJI_SCARAB
Definition: boss_twinemperors.cpp:78
@ SPELL_EXPLODE_BUG
Definition: boss_twinemperors.cpp:38
@ SPELL_MUTATE_BUG
Definition: boss_twinemperors.cpp:44
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:81
Definition: Creature.h:46
uint32 GetEntry() const
Definition: Object.h:109
Creature * ToCreature()
Definition: Object.h:197
Definition: Object.h:393

References Object::GetEntry(), NPC_QIRAJI_SCARAB, NPC_QIRAJI_SCORPION, Acore::Containers::RandomResize(), SPELL_EXPLODE_BUG, SPELL_MUTATE_BUG, and Object::ToCreature().

Referenced by Register().

◆ HandleOnHit()

void spell_mutate_explode_bug::HandleOnHit ( )
inlineprivate
460 {
461 if (!GetHitUnit())
462 return;
463
464 Creature* target = GetHitUnit()->ToCreature();
465
466 if (!target)
467 return;
468
470 target->CastSpell(target, SPELL_VIRULENT_POISON_PROC, true);
473 target->SetInCombatWithZone();
474 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
@ FACTION_HOSTILE
Definition: boss_twinemperors.cpp:81
@ SPELL_VIRULENT_POISON_PROC
Definition: boss_twinemperors.cpp:46
void SetInCombatWithZone()
Definition: Creature.cpp:2732
void SetReactState(ReactStates st)
Definition: Creature.h:90
void SetFaction(uint32 faction)
Definition: Unit.cpp:10064
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
uint32 m_scriptSpellId
Definition: SpellScript.h:107
Unit * GetHitUnit()
Definition: SpellScript.cpp:448

References Unit::CastSpell(), FACTION_HOSTILE, SpellScript::GetHitUnit(), _SpellScript::m_scriptSpellId, REACT_AGGRESSIVE, Unit::SetFaction(), Creature::SetInCombatWithZone(), Creature::SetReactState(), SPELL_MUTATE_BUG, SPELL_VIRULENT_POISON_PROC, and Object::ToCreature().

Referenced by Register().

◆ PrepareSpellScript()

spell_mutate_explode_bug::PrepareSpellScript ( spell_mutate_explode_bug  )
private

◆ Register()

void spell_mutate_explode_bug::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

477 {
480 }
#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 HandleOnHit()
Definition: boss_twinemperors.cpp:459
void FilterTargets(std::list< WorldObject * > &targets)
Definition: boss_twinemperors.cpp:443

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