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
456 {
457 targets.remove_if([&](WorldObject const* target) -> bool
458 {
459 if (target->GetEntry() != NPC_QIRAJI_SCARAB && target->GetEntry() != NPC_QIRAJI_SCORPION)
460 return true;
461 if (Creature const* creature = target->ToCreature())
462 if (creature->HasAura(SPELL_EXPLODE_BUG) || creature->HasAura(SPELL_MUTATE_BUG))
463 return true;
464
465 return false;
466 });
467
469 }
@ NPC_QIRAJI_SCORPION
Definition: boss_twinemperors.cpp:78
@ NPC_QIRAJI_SCARAB
Definition: boss_twinemperors.cpp:77
@ SPELL_EXPLODE_BUG
Definition: boss_twinemperors.cpp:37
@ SPELL_MUTATE_BUG
Definition: boss_twinemperors.cpp:43
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
472 {
473 if (!GetHitUnit())
474 return;
475
476 Creature* target = GetHitUnit()->ToCreature();
477
478 if (!target)
479 return;
480
482 target->CastSpell(target, SPELL_VIRULENT_POISON_PROC, true);
485 target->SetInCombatWithZone();
486 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1025
@ FACTION_HOSTILE
Definition: boss_twinemperors.cpp:80
@ SPELL_VIRULENT_POISON_PROC
Definition: boss_twinemperors.cpp:45
void SetInCombatWithZone()
Definition: Creature.cpp:2723
void SetReactState(ReactStates st)
Definition: Creature.h:89
void SetFaction(uint32 faction)
Definition: Unit.cpp:10029
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.

489 {
492 }
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:354
#define SpellHitFn(F)
Definition: SpellScript.h:349
@ TARGET_UNIT_SRC_AREA_ENTRY
Definition: SharedDefines.h:1388
#define EFFECT_ALL
Definition: SharedDefines.h:37
HookList< HitHandler > OnHit
Definition: SpellScript.h:345
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:353
void HandleOnHit()
Definition: boss_twinemperors.cpp:471
void FilterTargets(std::list< WorldObject * > &targets)
Definition: boss_twinemperors.cpp:455

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