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
631 {
632 if (aurEff->GetTickNumber() == 1)
633 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE2, true);
634 else if (aurEff->GetTickNumber() == 2)
635 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE3, true);
636 else if (aurEff->GetTickNumber() == 3)
637 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE4, true);
638 else if (aurEff->GetTickNumber() == 5)
639 GetTarget()->CastSpell(GetTarget(), SPELL_TELEPORT_VISUAL, true);
640 }
@ SPELL_CANNON_CHARGING_STATE2
Definition: spell_quest.cpp:543
@ SPELL_CANNON_CHARGING_STATE4
Definition: spell_quest.cpp:545
@ SPELL_TELEPORT_VISUAL
Definition: spell_quest.cpp:541
@ SPELL_CANNON_CHARGING_STATE3
Definition: spell_quest.cpp:544
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
619 {
620 if (aurEff->GetTickNumber() == 1)
621 {
622 GetTarget()->SummonCreature(NPC_CANNON_TARGET, 1919.99f, 5581.97f, 272.30f, 5.27f, TEMPSUMMON_TIMED_DESPAWN, 12000);
623 if (Creature* cannon = GetTarget()->FindNearestCreature(NPC_CANNON, 40.0f))
624 cannon->CastSpell(cannon, SPELL_CANNON_CHANNEL, false);
625 }
626 if (aurEff->GetTickNumber() == 6)
627 PerformKick();
628 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ SPELL_CANNON_CHANNEL
Definition: spell_quest.cpp:546
@ NPC_CANNON_TARGET
Definition: spell_quest.cpp:556
@ NPC_CANNON
Definition: spell_quest.cpp:555
Definition: Creature.h:46
void PerformKick()
Definition: spell_quest.cpp:583

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
584 {
585 if (Player* player = GetTarget()->ToPlayer())
586 {
587 Creature* shooter = player->FindNearestCreature(NPC_GNOME_SHOOTER, 20.0f);
588 if (!shooter)
589 return;
590
591 uint8 task = 0;
592 uint32 spellId = 0;
593 for (; task < 4; ++task)
594 if (shooter->GetDistance(ShooterPos[task]) < 1.0f)
595 break;
596
597 switch (task)
598 {
599 case 0:
600 spellId = SPELL_SOARING_10557;
601 break;
602 case 1:
603 spellId = SPELL_SOARING_10710;
604 break;
605 case 2:
606 spellId = SPELL_SOARING_10711;
607 break;
608 case 3:
609 spellId = SPELL_SOARING_10712;
610 break;
611 }
612
613 player->RemoveAurasDueToSpell(SPELL_CANNON_CHARGING_PORT);
614 shooter->CastSpell(player, spellId, true);
615 }
616 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
static Position ShooterPos[]
Definition: spell_quest.cpp:565
@ SPELL_SOARING_10710
Definition: spell_quest.cpp:550
@ SPELL_CANNON_CHARGING_PORT
Definition: spell_quest.cpp:542
@ NPC_GNOME_SHOOTER
Definition: spell_quest.cpp:557
@ SPELL_SOARING_10557
Definition: spell_quest.cpp:549
@ SPELL_SOARING_10712
Definition: spell_quest.cpp:552
@ SPELL_SOARING_10711
Definition: spell_quest.cpp:551
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
Definition: Player.h:1056
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

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.

643 {
645 {
646 OnEffectApply += AuraEffectApplyFn(spell_quest_test_flight_charging::OnApplySelf, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
648 }
649 else
651 }
@ 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:540
@ 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:618
void HandleEffectPeriodicPlatform(AuraEffect const *aurEff)
Definition: spell_quest.cpp:630

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)