132 {
136
137 std::list<Creature*> unitList;
138 Unit* target =
nullptr;
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();
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 {
164 }
165 else
166 {
171
173 }
174 }
@ 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
@ EFFECT_1
Definition: SharedDefines.h:32
@ EFFECT_0
Definition: SharedDefines.h:31
#define MAX_HEIGHT
Definition: Map.h:162
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
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:118
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
void Relocate(float x, float y)
Definition: Position.h:72
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:1167
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