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

Private Member Functions

 PrepareSpellScript (spell_winter_veil_racer_rocket_slam)
 
void HandleTriggerSpell (SpellEffIndex)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- 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 SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleTriggerSpell()

void spell_winter_veil_racer_rocket_slam::HandleTriggerSpell ( SpellEffIndex  )
inlineprivate
132 {
133 Unit* caster = GetCaster();
136
137 std::list<Creature*> unitList;
138 Unit* target = nullptr;
139 caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_BLUE_RACER);
140 if (!unitList.empty())
141 for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
142 if (caster->HasInLine((*itr), 1.0f) && (*itr)->GetGUID() != caster->GetGUID())
143 {
144 target = (*itr);
145 break;
146 }
147 if (!target)
148 {
149 unitList.clear();
150 caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_RED_RACER);
151 if (!unitList.empty())
152 for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
153 if (caster->HasInLine((*itr), 1.0f) && (*itr)->GetGUID() != caster->GetGUID())
154 {
155 target = (*itr);
156 break;
157 }
158 }
159
160 if (target)
161 {
162 caster->CastSpell(target, SPELL_RACER_CHARGE_TO_OBJECT, true);
163 caster->CastSpell(target, SPELL_RACER_SLAM_HIT, true);
164 }
165 else
166 {
167 Position pos;
168 float x = caster->GetPositionX() + 30 * cos(caster->GetOrientation());
169 float y = caster->GetPositionY() + 30 * std::sin(caster->GetOrientation());
170 pos.Relocate(x, y, caster->GetMap()->GetHeight(x, y, MAX_HEIGHT) + 0.5f);
171 //caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation());
173 }
174 }
#define MAX_HEIGHT
Definition GridTerrainData.h:26
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition Map.cpp:1194
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
void PreventHitEffect(SpellEffIndex effIndex)
Definition SpellScript.cpp:579
Unit * GetCaster()
Definition SpellScript.cpp:401
Definition Unit.h:636
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
Map * GetMap() const
Definition Object.h:536
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3097
Definition Position.h:27
bool HasInLine(Position const *pos, float width) const
Definition Position.cpp:43
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void Relocate(float x, float y)
Definition Position.h:77
@ SPELL_RACER_CHARGE_TO_OBJECT
Definition winter_veil.cpp:118
@ NPC_BLUE_RACER
Definition winter_veil.cpp:115
@ NPC_RED_RACER
Definition winter_veil.cpp:114
@ SPELL_RACER_SLAM_HIT
Definition winter_veil.cpp:120

References Unit::CastSpell(), EFFECT_0, EFFECT_1, SpellScript::GetCaster(), WorldObject::GetCreaturesWithEntryInRange(), Object::GetGUID(), Map::GetHeight(), WorldObject::GetMap(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Position::HasInLine(), MAX_HEIGHT, NPC_BLUE_RACER, NPC_RED_RACER, SpellScript::PreventHitEffect(), Position::Relocate(), SPELL_RACER_CHARGE_TO_OBJECT, and SPELL_RACER_SLAM_HIT.

Referenced by Register().

◆ PrepareSpellScript()

spell_winter_veil_racer_rocket_slam::PrepareSpellScript ( spell_winter_veil_racer_rocket_slam  )
private

◆ Register()

void spell_winter_veil_racer_rocket_slam::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

177 {
179 }
@ SPELL_EFFECT_TRIGGER_SPELL
Definition SharedDefines.h:842
#define SpellEffectFn(F, I, N)
Definition SpellScript.h:337
HookList< EffectHandler > OnEffectLaunch
Definition SpellScript.h:333
void HandleTriggerSpell(SpellEffIndex)
Definition winter_veil.cpp:131

References EFFECT_1, HandleTriggerSpell(), SpellScript::OnEffectLaunch, SPELL_EFFECT_TRIGGER_SPELL, and SpellEffectFn.


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