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

◆ HandleTriggerSpell()

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

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.

176 {
178 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ SPELL_EFFECT_TRIGGER_SPELL
Definition: SharedDefines.h:814
HookList< EffectHandler > OnEffectLaunch
Definition: SpellScript.h:333
void HandleTriggerSpell(SpellEffIndex)
Definition: winter_veil.cpp:130

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