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

Private Member Functions

 PrepareAuraScript (spell_quest_test_flight_charging) void OnApplySelf(AuraEffect const *
 
 GetTarget () -> CastSpell(GetTarget(), SPELL_CANNON_CHARGING_PORT, true)
 
void PerformKick ()
 
void HandleEffectPeriodicSelf (AuraEffect const *aurEff)
 
void HandleEffectPeriodicPlatform (AuraEffect const *aurEff)
 
void Register () override
 

Private Attributes

 AuraEffectHandleModes
 

Additional Inherited Members

- 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
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
void Remove (uint32 removeMode=0)
 
AuraGetAura () 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
 
AuraEffectGetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
UnitGetTarget () 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 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 AuraScript
HookList< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandlerOnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandlerDoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandlerDoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ GetTarget()

spell_quest_test_flight_charging::GetTarget ( ) -> CastSpell(GetTarget(), SPELL_CANNON_CHARGING_PORT, true)
private

◆ HandleEffectPeriodicPlatform()

void spell_quest_test_flight_charging::HandleEffectPeriodicPlatform ( AuraEffect const *  aurEff)
inlineprivate
592 {
593 if (aurEff->GetTickNumber() == 1)
594 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE2, true);
595 else if (aurEff->GetTickNumber() == 2)
596 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE3, true);
597 else if (aurEff->GetTickNumber() == 3)
598 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE4, true);
599 else if (aurEff->GetTickNumber() == 5)
600 GetTarget()->CastSpell(GetTarget(), SPELL_TELEPORT_VISUAL, true);
601 }
GetTarget() -> CastSpell(GetTarget(), SPELL_CANNON_CHARGING_PORT, true)
@ SPELL_CANNON_CHARGING_STATE2
Definition spell_quest.cpp:504
@ SPELL_CANNON_CHARGING_STATE4
Definition spell_quest.cpp:506
@ SPELL_TELEPORT_VISUAL
Definition spell_quest.cpp:502
@ SPELL_CANNON_CHARGING_STATE3
Definition spell_quest.cpp:505

References GetTarget(), AuraEffect::GetTickNumber(), SPELL_CANNON_CHARGING_STATE2, SPELL_CANNON_CHARGING_STATE3, SPELL_CANNON_CHARGING_STATE4, and SPELL_TELEPORT_VISUAL.

Referenced by Register().

◆ HandleEffectPeriodicSelf()

void spell_quest_test_flight_charging::HandleEffectPeriodicSelf ( AuraEffect const *  aurEff)
inlineprivate
580 {
581 if (aurEff->GetTickNumber() == 1)
582 {
583 GetTarget()->SummonCreature(NPC_CANNON_TARGET, 1919.99f, 5581.97f, 272.30f, 5.27f, TEMPSUMMON_TIMED_DESPAWN, 12000);
584 if (Creature* cannon = GetTarget()->FindNearestCreature(NPC_CANNON, 40.0f))
585 cannon->CastSpell(cannon, SPELL_CANNON_CHANNEL, false);
586 }
587 if (aurEff->GetTickNumber() == 6)
588 PerformKick();
589 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:48
Definition Creature.h:43
void PerformKick()
Definition spell_quest.cpp:544
@ SPELL_CANNON_CHANNEL
Definition spell_quest.cpp:507
@ NPC_CANNON_TARGET
Definition spell_quest.cpp:517
@ NPC_CANNON
Definition spell_quest.cpp:516

References GetTarget(), AuraEffect::GetTickNumber(), NPC_CANNON, NPC_CANNON_TARGET, PerformKick(), SPELL_CANNON_CHANNEL, and TEMPSUMMON_TIMED_DESPAWN.

Referenced by Register().

◆ PerformKick()

void spell_quest_test_flight_charging::PerformKick ( )
inlineprivate
545 {
546 if (Player* player = GetTarget()->ToPlayer())
547 {
548 Creature* shooter = player->FindNearestCreature(NPC_GNOME_SHOOTER, 20.0f);
549 if (!shooter)
550 return;
551
552 uint8 task = 0;
553 uint32 spellId = 0;
554 for (; task < 4; ++task)
555 if (shooter->GetDistance(ShooterPos[task]) < 1.0f)
556 break;
557
558 switch (task)
559 {
560 case 0:
561 spellId = SPELL_SOARING_10557;
562 break;
563 case 1:
564 spellId = SPELL_SOARING_10710;
565 break;
566 case 2:
567 spellId = SPELL_SOARING_10711;
568 break;
569 case 3:
570 spellId = SPELL_SOARING_10712;
571 break;
572 }
573
575 shooter->CastSpell(player, spellId, true);
576 }
577 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
Definition Player.h:1081
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:1178
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4941
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2459
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1256
static Position ShooterPos[]
Definition spell_quest.cpp:526
@ SPELL_SOARING_10710
Definition spell_quest.cpp:511
@ SPELL_CANNON_CHARGING_PORT
Definition spell_quest.cpp:503
@ NPC_GNOME_SHOOTER
Definition spell_quest.cpp:518
@ SPELL_SOARING_10557
Definition spell_quest.cpp:510
@ SPELL_SOARING_10712
Definition spell_quest.cpp:513
@ SPELL_SOARING_10711
Definition spell_quest.cpp:512

References Unit::CastSpell(), WorldObject::FindNearestCreature(), WorldObject::GetDistance(), GetTarget(), NPC_GNOME_SHOOTER, Unit::RemoveAurasDueToSpell(), ShooterPos, SPELL_CANNON_CHARGING_PORT, SPELL_SOARING_10557, SPELL_SOARING_10710, SPELL_SOARING_10711, and SPELL_SOARING_10712.

Referenced by HandleEffectPeriodicSelf().

◆ PrepareAuraScript()

spell_quest_test_flight_charging::PrepareAuraScript ( spell_quest_test_flight_charging  ) const
private

◆ Register()

void spell_quest_test_flight_charging::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

604 {
606 {
607 OnEffectApply += AuraEffectApplyFn(spell_quest_test_flight_charging::OnApplySelf, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
609 }
610 else
612 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
Definition SpellAuraDefines.h:86
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:760
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:743
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:759
HookList< EffectApplyHandler > OnEffectApply
Definition SpellScript.h:738
uint32 m_scriptSpellId
Definition SpellScript.h:107
void HandleEffectPeriodicSelf(AuraEffect const *aurEff)
Definition spell_quest.cpp:579
void HandleEffectPeriodicPlatform(AuraEffect const *aurEff)
Definition spell_quest.cpp:591
@ SPELL_CANNON_CHARGING_SELF
Definition spell_quest.cpp:501

References AURA_EFFECT_HANDLE_REAL, AuraEffectApplyFn, AuraEffectPeriodicFn, EFFECT_0, HandleEffectPeriodicPlatform(), HandleEffectPeriodicSelf(), _SpellScript::m_scriptSpellId, AuraScript::OnEffectApply, AuraScript::OnEffectPeriodic, SPELL_AURA_PERIODIC_TRIGGER_SPELL, and SPELL_CANNON_CHARGING_SELF.

Member Data Documentation

◆ AuraEffectHandleModes

spell_quest_test_flight_charging::AuraEffectHandleModes
private
Initial value:
{
GetTarget()->CastSpell(GetTarget(), SPELL_TELEPORT_VISUAL, true)

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