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
571 {
572 if (aurEff->GetTickNumber() == 1)
573 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE2, true);
574 else if (aurEff->GetTickNumber() == 2)
575 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE3, true);
576 else if (aurEff->GetTickNumber() == 3)
577 GetTarget()->CastSpell(GetTarget(), SPELL_CANNON_CHARGING_STATE4, true);
578 else if (aurEff->GetTickNumber() == 5)
579 GetTarget()->CastSpell(GetTarget(), SPELL_TELEPORT_VISUAL, true);
580 }
GetTarget() -> CastSpell(GetTarget(), SPELL_CANNON_CHARGING_PORT, true)
@ SPELL_CANNON_CHARGING_STATE2
Definition spell_quest.cpp:483
@ SPELL_CANNON_CHARGING_STATE4
Definition spell_quest.cpp:485
@ SPELL_TELEPORT_VISUAL
Definition spell_quest.cpp:481
@ SPELL_CANNON_CHARGING_STATE3
Definition spell_quest.cpp:484

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
559 {
560 if (aurEff->GetTickNumber() == 1)
561 {
562 GetTarget()->SummonCreature(NPC_CANNON_TARGET, 1919.99f, 5581.97f, 272.30f, 5.27f, TEMPSUMMON_TIMED_DESPAWN, 12000);
563 if (Creature* cannon = GetTarget()->FindNearestCreature(NPC_CANNON, 40.0f))
564 cannon->CastSpell(cannon, SPELL_CANNON_CHANNEL, false);
565 }
566 if (aurEff->GetTickNumber() == 6)
567 PerformKick();
568 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:50
Definition Creature.h:47
void PerformKick()
Definition spell_quest.cpp:523
@ SPELL_CANNON_CHANNEL
Definition spell_quest.cpp:486
@ NPC_CANNON_TARGET
Definition spell_quest.cpp:496
@ NPC_CANNON
Definition spell_quest.cpp:495

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
524 {
525 if (Player* player = GetTarget()->ToPlayer())
526 {
527 Creature* shooter = player->FindNearestCreature(NPC_GNOME_SHOOTER, 20.0f);
528 if (!shooter)
529 return;
530
531 uint8 task = 0;
532 uint32 spellId = 0;
533 for (; task < 4; ++task)
534 if (shooter->GetDistance(ShooterPos[task]) < 1.0f)
535 break;
536
537 switch (task)
538 {
539 case 0:
540 spellId = SPELL_SOARING_10557;
541 break;
542 case 1:
543 spellId = SPELL_SOARING_10710;
544 break;
545 case 2:
546 spellId = SPELL_SOARING_10711;
547 break;
548 case 3:
549 spellId = SPELL_SOARING_10712;
550 break;
551 }
552
554 shooter->CastSpell(player, spellId, true);
555 }
556 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
Definition Player.h:1071
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:5028
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2443
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1271
static Position ShooterPos[]
Definition spell_quest.cpp:505
@ SPELL_SOARING_10710
Definition spell_quest.cpp:490
@ SPELL_CANNON_CHARGING_PORT
Definition spell_quest.cpp:482
@ NPC_GNOME_SHOOTER
Definition spell_quest.cpp:497
@ SPELL_SOARING_10557
Definition spell_quest.cpp:489
@ SPELL_SOARING_10712
Definition spell_quest.cpp:492
@ SPELL_SOARING_10711
Definition spell_quest.cpp:491

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.

583 {
585 {
586 OnEffectApply += AuraEffectApplyFn(spell_quest_test_flight_charging::OnApplySelf, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
588 }
589 else
591 }
@ 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:558
void HandleEffectPeriodicPlatform(AuraEffect const *aurEff)
Definition spell_quest.cpp:570
@ SPELL_CANNON_CHARGING_SELF
Definition spell_quest.cpp:480

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: