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

Public Member Functions

 spell_hadronox_summon_periodic_aura (int32 delay, uint32 spellEntry, uint32 lowerDoorSpellEntry)
 
bool Validate (SpellInfo const *) override
 
void HandlePeriodic (AuraEffect const *aurEff)
 
void OnApply (AuraEffect const *auraEffect, AuraEffectHandleModes)
 
void Register () override
 
- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCasterGUID () const
 
Unit * GetCaster () const
 
GameObject * GetGObjCaster () const
 
WorldObject * GetOwner () const
 
Unit * GetUnitOwner () const
 
DynamicObject * GetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
Aura * GetAura () const
 
AuraObjectType GetType () const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration ()
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool HasEffect (uint8 effIndex) const
 
AuraEffect * GetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
Unit * GetTarget () const
 
AuraApplication const * GetTargetApplication () const
 
- 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 Attributes

static constexpr int32 SUMMON_PERIOD = 15'000
 

Private Member Functions

 PrepareAuraScript (spell_hadronox_summon_periodic_aura)
 

Private Attributes

int32 _delay
 
uint32 _spellEntry
 
uint32 _lowerDoorSpellEntry
 

Additional Inherited Members

- 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 AuraScript
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
 
HookList< AuraDispelHandler > OnDispel
 
HookList< AuraDispelHandler > AfterDispel
 
HookList< EffectApplyHandler > OnEffectApply
 
HookList< EffectApplyHandler > AfterEffectApply
 
HookList< EffectApplyHandler > OnEffectRemove
 
HookList< EffectApplyHandler > AfterEffectRemove
 
HookList< EffectPeriodicHandler > OnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandler > OnEffectAbsorb
 
HookList< EffectAbsorbHandler > AfterEffectAbsorb
 
HookList< EffectManaShieldHandler > OnEffectManaShield
 
HookList< EffectManaShieldHandler > AfterEffectManaShield
 
HookList< EffectSplitHandler > OnEffectSplit
 
HookList< CheckProcHandler > DoCheckProc
 
HookList< CheckEffectProcHandler > DoCheckEffectProc
 
HookList< AuraProcHandler > DoPrepareProc
 
HookList< AuraProcHandler > OnProc
 
HookList< AuraProcHandler > AfterProc
 
HookList< EffectProcHandler > OnEffectProc
 
HookList< EffectProcHandler > AfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Constructor & Destructor Documentation

◆ spell_hadronox_summon_periodic_aura()

spell_hadronox_summon_periodic_aura::spell_hadronox_summon_periodic_aura ( int32  delay,
uint32  spellEntry,
uint32  lowerDoorSpellEntry 
)
inline
661: _delay(delay), _spellEntry(spellEntry), _lowerDoorSpellEntry(lowerDoorSpellEntry) { }
uint32 _spellEntry
Definition boss_hadronox.cpp:699
uint32 _lowerDoorSpellEntry
Definition boss_hadronox.cpp:700
int32 _delay
Definition boss_hadronox.cpp:698

Member Function Documentation

◆ HandlePeriodic()

void spell_hadronox_summon_periodic_aura::HandlePeriodic ( AuraEffect const *  aurEff)
inline
669 {
671 // The three auras start 5s apart (see OnApply) and each repeats every 15s, so a door spawns one add per 5s.
672 // The core re-arms the timer with the DBC amplitude before each tick, so pin the period here.
673 GetAura()->GetEffect(aurEff->GetEffIndex())->SetPeriodicTimer(SUMMON_PERIOD);
674
675 Unit* owner = GetUnitOwner();
676 if (InstanceScript* instance = owner->GetInstanceScript())
677 if (!instance->IsBossDone(DATA_HADRONOX) != NOT_STARTED)
678 {
679 if (!owner->HasAura(SPELL_WEB_FRONT_DOORS))
680 owner->CastSpell(owner, owner->GetDistance(LowerDoorPosition) < 5.0f ? _lowerDoorSpellEntry : _spellEntry, true);
681 else if (!instance->IsEncounterInProgress())
683 }
684 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ DATA_HADRONOX
Definition azjol_nerub.h:30
@ SPELL_WEB_FRONT_DOORS
Definition boss_hadronox.cpp:42
static Position const LowerDoorPosition
Definition boss_hadronox.cpp:130
void SetPeriodicTimer(int32 periodicTimer)
Definition SpellAuraEffects.h:69
void PreventDefaultAction()
Definition SpellScript.cpp:991
Aura * GetAura() const
Definition SpellScript.cpp:1058
Unit * GetUnitOwner() const
Definition SpellScript.cpp:1043
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellAuras.h:178
Definition InstanceScript.h:143
Definition Unit.h:670
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5798
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:1378
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4969
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1304
static constexpr int32 SUMMON_PERIOD
Definition boss_hadronox.cpp:659

References _lowerDoorSpellEntry, _spellEntry, Unit::CastSpell(), DATA_HADRONOX, AuraScript::GetAura(), WorldObject::GetDistance(), Aura::GetEffect(), AuraEffect::GetEffIndex(), WorldObject::GetInstanceScript(), AuraScript::GetUnitOwner(), Unit::HasAura(), LowerDoorPosition, NOT_STARTED, AuraScript::PreventDefaultAction(), Unit::RemoveAurasDueToSpell(), AuraEffect::SetPeriodicTimer(), SPELL_WEB_FRONT_DOORS, and SUMMON_PERIOD.

Referenced by Register().

◆ OnApply()

void spell_hadronox_summon_periodic_aura::OnApply ( AuraEffect const *  auraEffect,
AuraEffectHandleModes   
)
inline

◆ PrepareAuraScript()

spell_hadronox_summon_periodic_aura::PrepareAuraScript ( spell_hadronox_summon_periodic_aura  )
private

◆ Register()

void spell_hadronox_summon_periodic_aura::Register ( )
inlineoverridevirtual

Implements _SpellScript.

692 {
695 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:761
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:744
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:760
HookList< EffectApplyHandler > OnEffectApply
Definition SpellScript.h:739
void OnApply(AuraEffect const *auraEffect, AuraEffectHandleModes)
Definition boss_hadronox.cpp:686
void HandlePeriodic(AuraEffect const *aurEff)
Definition boss_hadronox.cpp:668

References AURA_EFFECT_HANDLE_REAL, AuraEffectApplyFn, AuraEffectPeriodicFn, EFFECT_0, HandlePeriodic(), OnApply(), AuraScript::OnEffectApply, AuraScript::OnEffectPeriodic, and SPELL_AURA_PERIODIC_DUMMY.

◆ Validate()

bool spell_hadronox_summon_periodic_aura::Validate ( SpellInfo const *  )
inlineoverridevirtual

Reimplemented from _SpellScript.

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

References _lowerDoorSpellEntry, _spellEntry, SPELL_WEB_FRONT_DOORS, and _SpellScript::ValidateSpellInfo().

Member Data Documentation

◆ _delay

int32 spell_hadronox_summon_periodic_aura::_delay
private

Referenced by OnApply().

◆ _lowerDoorSpellEntry

uint32 spell_hadronox_summon_periodic_aura::_lowerDoorSpellEntry
private

Referenced by HandlePeriodic(), and Validate().

◆ _spellEntry

uint32 spell_hadronox_summon_periodic_aura::_spellEntry
private

Referenced by HandlePeriodic(), and Validate().

◆ SUMMON_PERIOD

constexpr int32 spell_hadronox_summon_periodic_aura::SUMMON_PERIOD = 15'000
staticconstexpr

Referenced by HandlePeriodic().


The documentation for this class was generated from the following file: