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 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 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
 
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

◆ 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
586 {
587 if (aurEff->GetTickNumber() == 1)
588 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE2, true);
589 else if (aurEff->GetTickNumber() == 2)
590 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE3, true);
591 else if (aurEff->GetTickNumber() == 3)
592 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE4, true);
593 else if (aurEff->GetTickNumber() == 5)
594 GetTarget()->CastSpell(GetTarget(), SPELL_TELEPORT_VISUAL, true);
595 }
@ SPELL_CANNON_CHARGING_STATE2
Definition: spell_quest.cpp:498
@ SPELL_CANNON_CHARGING_STATE4
Definition: spell_quest.cpp:500
@ SPELL_TELEPORT_VISUAL
Definition: spell_quest.cpp:496
@ SPELL_CANNON_CHARGING_STATE3
Definition: spell_quest.cpp:499
GetTarget() -> CastSpell(GetTarget(), SPELL_CANNON_CHARGING_PORT, true)

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
574 {
575 if (aurEff->GetTickNumber() == 1)
576 {
577 GetTarget()->SummonCreature(NPC_CANNON_TARGET, 1919.99f, 5581.97f, 272.30f, 5.27f, TEMPSUMMON_TIMED_DESPAWN, 12000);
578 if (Creature* cannon = GetTarget()->FindNearestCreature(NPC_CANNON, 40.0f))
579 cannon->CastSpell(cannon, SPELL_CANNON_CHANNEL, false);
580 }
581 if (aurEff->GetTickNumber() == 6)
582 PerformKick();
583 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:47
@ SPELL_CANNON_CHANNEL
Definition: spell_quest.cpp:501
@ NPC_CANNON_TARGET
Definition: spell_quest.cpp:511
@ NPC_CANNON
Definition: spell_quest.cpp:510
Definition: Creature.h:46
void PerformKick()
Definition: spell_quest.cpp:538

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
539 {
540 if (Player* player = GetTarget()->ToPlayer())
541 {
542 Creature* shooter = player->FindNearestCreature(NPC_GNOME_SHOOTER, 20.0f);
543 if (!shooter)
544 return;
545
546 uint8 task = 0;
547 uint32 spellId = 0;
548 for (; task < 4; ++task)
549 if (shooter->GetDistance(ShooterPos[task]) < 1.0f)
550 break;
551
552 switch (task)
553 {
554 case 0:
555 spellId = SPELL_SOARING_10557;
556 break;
557 case 1:
558 spellId = SPELL_SOARING_10710;
559 break;
560 case 2:
561 spellId = SPELL_SOARING_10711;
562 break;
563 case 3:
564 spellId = SPELL_SOARING_10712;
565 break;
566 }
567
568 player->RemoveAurasDueToSpell(SPELL_CANNON_CHARGING_PORT);
569 shooter->CastSpell(player, spellId, true);
570 }
571 }
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
static Position ShooterPos[]
Definition: spell_quest.cpp:520
@ SPELL_SOARING_10710
Definition: spell_quest.cpp:505
@ SPELL_CANNON_CHARGING_PORT
Definition: spell_quest.cpp:497
@ NPC_GNOME_SHOOTER
Definition: spell_quest.cpp:512
@ SPELL_SOARING_10557
Definition: spell_quest.cpp:504
@ SPELL_SOARING_10712
Definition: spell_quest.cpp:507
@ SPELL_SOARING_10711
Definition: spell_quest.cpp:506
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
Definition: Player.h:1064
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:1168

References Unit::CastSpell(), WorldObject::FindNearestCreature(), WorldObject::GetDistance(), GetTarget(), NPC_GNOME_SHOOTER, 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.

598 {
600 {
601 OnEffectApply += AuraEffectApplyFn(spell_quest_test_flight_charging::OnApplySelf, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
603 }
604 else
606 }
@ 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
@ SPELL_CANNON_CHARGING_SELF
Definition: spell_quest.cpp:495
@ EFFECT_0
Definition: SharedDefines.h:31
uint32 m_scriptSpellId
Definition: SpellScript.h:107
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:759
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:738
void HandleEffectPeriodicSelf(AuraEffect const *aurEff)
Definition: spell_quest.cpp:573
void HandleEffectPeriodicPlatform(AuraEffect const *aurEff)
Definition: spell_quest.cpp:585

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)