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
593 {
594 if (aurEff->GetTickNumber() == 1)
595 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE2, true);
596 else if (aurEff->GetTickNumber() == 2)
597 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE3, true);
598 else if (aurEff->GetTickNumber() == 3)
599 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE4, true);
600 else if (aurEff->GetTickNumber() == 5)
601 GetTarget()->CastSpell(GetTarget(), SPELL_TELEPORT_VISUAL, true);
602 }
GetTarget() -> CastSpell(GetTarget(), SPELL_CANNON_CHARGING_PORT, true)
@ SPELL_CANNON_CHARGING_STATE2
Definition spell_quest.cpp:505
@ SPELL_CANNON_CHARGING_STATE4
Definition spell_quest.cpp:507
@ SPELL_TELEPORT_VISUAL
Definition spell_quest.cpp:503
@ SPELL_CANNON_CHARGING_STATE3
Definition spell_quest.cpp:506

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
581 {
582 if (aurEff->GetTickNumber() == 1)
583 {
584 GetTarget()->SummonCreature(NPC_CANNON_TARGET, 1919.99f, 5581.97f, 272.30f, 5.27f, TEMPSUMMON_TIMED_DESPAWN, 12000);
585 if (Creature* cannon = GetTarget()->FindNearestCreature(NPC_CANNON, 40.0f))
586 cannon->CastSpell(cannon, SPELL_CANNON_CHANNEL, false);
587 }
588 if (aurEff->GetTickNumber() == 6)
589 PerformKick();
590 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:50
Definition Creature.h:43
void PerformKick()
Definition spell_quest.cpp:545
@ SPELL_CANNON_CHANNEL
Definition spell_quest.cpp:508
@ NPC_CANNON_TARGET
Definition spell_quest.cpp:518
@ NPC_CANNON
Definition spell_quest.cpp:517

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

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.

605 {
607 {
608 OnEffectApply += AuraEffectApplyFn(spell_quest_test_flight_charging::OnApplySelf, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
610 }
611 else
613 }
@ 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:580
void HandleEffectPeriodicPlatform(AuraEffect const *aurEff)
Definition spell_quest.cpp:592
@ SPELL_CANNON_CHARGING_SELF
Definition spell_quest.cpp:502

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: