Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SpellAuraControl.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "Battlefield.h"
7#include "BattlefieldMgr.h"
8#include "Battleground.h"
9#include "CellImpl.h"
10#include "Common.h"
11#include "Formulas.h"
12#include "GridNotifiers.h"
13#include "GridNotifiersImpl.h"
14#include "Log.h"
15#include "ObjectAccessor.h"
16#include "ObjectMgr.h"
17#include "Opcodes.h"
18#include "OutdoorPvPMgr.h"
19#include "Pet.h"
20#include "Player.h"
21#include "ReputationMgr.h"
22#include "ScriptMgr.h"
23#include "Spell.h"
24#include "SpellAuraEffects.h"
25#include "SpellMgr.h"
26#include "SpellValidation.h"
27#include "Unit.h"
28#include "Util.h"
29#include "Vehicle.h"
30#include "WeatherMgr.h"
31#include "WorldPacket.h"
32
33class Aura;
34
35void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const
36{
38 return;
39
40 Unit* target = aurApp->GetTarget();
41
42 if (apply)
43 {
44 uint32 creatureEntry = GetMiscValue();
45 uint32 displayId = 0;
46 uint32 vehicleId = 0;
47
48 // Festive Holiday Mount
49 if (target->HasAura(62061))
50 {
52 creatureEntry = 24906;
53 else
54 creatureEntry = 15665;
55 }
56
57 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
58 {
59 displayId = ObjectMgr::ChooseDisplayId(creatureInfo);
60 sObjectMgr->GetCreatureModelRandomGender(&displayId);
61
62 vehicleId = creatureInfo->VehicleId;
63
64 //some spell has one aura of mount and one of vehicle
65 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
66 if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON
67 && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue())
68 displayId = 0;
69 }
70
71 target->Mount(displayId, vehicleId, creatureEntry);
72
73 // cast speed aura
74 if (mode & AURA_EFFECT_HANDLE_REAL)
75 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
76 target->CastSpell(target, mountCapability->SpeedModSpell, true);
77 }
78 else
79 {
80 target->Dismount();
81 //some mounts like Headless Horseman's Mount or broom stick are skill based spell
82 // need to remove ALL arura related to mounts, this will stop client crash with broom stick
83 // and never endless flying after using Headless Horseman's Mount
84 if (mode & AURA_EFFECT_HANDLE_REAL)
85 {
87
88 // remove speed aura
89 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
90 target->RemoveAurasDueToSpell(mountCapability->SpeedModSpell, target->GetGUID());
91 }
92 }
93}
94
95void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const
96{
98 return;
99
100 Unit* target = aurApp->GetTarget();
101
102 if (!apply)
103 {
104 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
106 return;
107 }
108
109 target->SetCanFly(apply);
110
111 if (!apply && target->GetTypeId() == TypeID::TYPEID_UNIT && !target->IsLevitating())
112 target->GetMotionMaster()->MoveFall();
113}
114
115void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const
116{
118 return;
119
120 Unit* target = aurApp->GetTarget();
121
122 if (!apply)
123 {
124 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
125 if (target->HasAuraType(GetAuraType()))
126 return;
127 }
128
129 target->SetWaterWalking(apply);
130}
131
132void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const
133{
135 return;
136
137 Unit* target = aurApp->GetTarget();
138
139 if (!apply)
140 {
141 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
142 if (target->HasAuraType(GetAuraType()))
143 return;
144 }
145
146 target->SetFeatherFall(apply);
147
148 // start fall from current height
149 if (!apply && target->GetTypeId() == TypeID::TYPEID_PLAYER)
150 target->ToPlayer()->SetFallInformation(0, target->GetPositionZ());
151}
152
153void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const
154{
156 return;
157
158 Unit* target = aurApp->GetTarget();
159
160 if (!apply)
161 {
162 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
163 if (target->HasAuraType(GetAuraType()))
164 return;
165 }
166
167 target->SetHover(apply);
168}
169
170void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
171{
173 return;
174
175 Unit* target = aurApp->GetTarget();
176
177 // update timers in client
178 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
179 target->ToPlayer()->UpdateMirrorTimers();
180}
181
182void AuraEffect::HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const
183{
185 return;
186
187 Unit* target = aurApp->GetTarget();
188
189 if (apply)
191 else
192 {
193 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
194 if (target->HasAuraType(GetAuraType()))
195 return;
197 }
198}
199
200/****************************/
201/*** THREAT ***/
202/****************************/
203
204void AuraEffect::HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const
205{
207 return;
208
209 Unit* target = aurApp->GetTarget();
210 for (int8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
211 if (GetMiscValue() & (1 << i))
212 ApplyPercentModFloatVar(target->m_threatModifier[i], float(GetAmount()), apply);
213}
214
215void AuraEffect::HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const
216{
218 return;
219
220 Unit* target = aurApp->GetTarget();
221
222 if (!target->IsAlive() || target->GetTypeId() != TypeID::TYPEID_PLAYER)
223 return;
224
225 Unit* caster = GetCaster();
226 if (caster && caster->IsAlive())
227 target->getHostileRefManager().addTempThreat((float)GetAmount(), apply);
228}
229
230void AuraEffect::HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool apply) const
231{
232 if (!(mode & AURA_EFFECT_HANDLE_REAL))
233 return;
234
235 Unit* target = aurApp->GetTarget();
236
237 if (!target->IsAlive() || !target->CanHaveThreatList())
238 return;
239
240 Unit* caster = GetCaster();
241 if (!caster || !caster->IsAlive())
242 return;
243
244 if (apply)
245 target->TauntApply(caster);
246 else
247 {
248 // When taunt aura fades out, mob will switch to previous target if current has less than 1.1 * secondthreat
249 target->TauntFadeOut(caster);
250 }
251}
252
253/*****************************/
254/*** CONTROL ***/
255/*****************************/
256
257void AuraEffect::HandleModConfuse(AuraApplication const* aurApp, uint8 mode, bool apply) const
258{
259 if (!(mode & AURA_EFFECT_HANDLE_REAL))
260 return;
261
262 Unit* target = aurApp->GetTarget();
263
264 target->SetControlled(apply, UNIT_STATE_CONFUSED);
265}
266
267void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const
268{
269 if (!(mode & AURA_EFFECT_HANDLE_REAL))
270 return;
271
272 Unit* target = aurApp->GetTarget();
273
274 target->SetControlled(apply, UNIT_STATE_FLEEING);
275}
276
277void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const
278{
279 if (!(mode & AURA_EFFECT_HANDLE_REAL))
280 return;
281
282 Unit* target = aurApp->GetTarget();
283
284 target->SetControlled(apply, UNIT_STATE_STUNNED);
285}
286
287void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const
288{
289 if (!(mode & AURA_EFFECT_HANDLE_REAL))
290 return;
291
292 Unit* target = aurApp->GetTarget();
293
294 target->SetControlled(apply, UNIT_STATE_ROOT);
295}
296
297void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const
298{
299 if (!(mode & AURA_EFFECT_HANDLE_REAL))
300 return;
301
302 Unit* target = aurApp->GetTarget();
303
305 target->SetControlled(!(apply), UNIT_STATE_FLEEING);
306}
307
308/***************************/
309/*** CHARM ***/
310/***************************/
311
312void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const
313{
314 if (!(mode & AURA_EFFECT_HANDLE_REAL))
315 return;
316
317 Unit* target = aurApp->GetTarget();
318
319 Unit* caster = GetCaster();
320
321 // no support for posession AI yet
322 if (caster && caster->GetTypeId() == TypeID::TYPEID_UNIT)
323 {
324 HandleModCharm(aurApp, mode, apply);
325 return;
326 }
327
328 if (apply)
329 target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
330 else
331 target->RemoveCharmedBy(caster);
332}
333
334void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const
335{
336 // Used by spell "Eyes of the Beast"
337
338 if (!(mode & AURA_EFFECT_HANDLE_REAL))
339 return;
340
341 Unit* caster = GetCaster();
342 if (!caster || caster->GetTypeId() != TypeID::TYPEID_PLAYER)
343 return;
344
345 //seems it may happen that when removing it is no longer owner's pet
346 //if (caster->ToPlayer()->GetPet() != target)
347 // return;
348
349 Unit* target = aurApp->GetTarget();
350 if (target->GetTypeId() != TypeID::TYPEID_UNIT || !target->ToCreature()->IsPet())
351 return;
352
353 Pet* pet = target->ToPet();
354
355 if (apply)
356 {
357 if (caster->ToPlayer()->GetPet() != pet)
358 return;
359
360 // Must clear current motion or pet leashes back to owner after a few yards
361 // when under spell 'Eyes of the Beast'
362 pet->GetMotionMaster()->Clear();
363 pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
364 }
365 else
366 {
367 pet->RemoveCharmedBy(caster);
368
369 if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
370 pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
371 else
372 {
373 // Reinitialize the pet bar or it will appear greyed out
374 caster->ToPlayer()->PetSpellInitialize();
375
376 // Follow owner only if not fighting or owner didn't click "stay" at new location
377 // This may be confusing because pet bar shows "stay" when under the spell but it retains
378 // the "follow" flag. Player MUST click "stay" while under the spell.
379 if (!pet->GetVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
380 {
382 }
383 }
384 }
385}
386
387void AuraEffect::HandleModCharm(AuraApplication const* aurApp, uint8 mode, bool apply) const
388{
389 if (!(mode & AURA_EFFECT_HANDLE_REAL))
390 return;
391
392 Unit* target = aurApp->GetTarget();
393
394 Unit* caster = GetCaster();
395
396 if (apply)
397 target->SetCharmedBy(caster, CHARM_TYPE_CHARM, aurApp);
398 else
399 target->RemoveCharmedBy(caster);
400}
401
402void AuraEffect::HandleCharmConvert(AuraApplication const* aurApp, uint8 mode, bool apply) const
403{
404 if (!(mode & AURA_EFFECT_HANDLE_REAL))
405 return;
406
407 Unit* target = aurApp->GetTarget();
408
409 Unit* caster = GetCaster();
410
411 if (apply)
412 target->SetCharmedBy(caster, CHARM_TYPE_CONVERT, aurApp);
413 else
414 target->RemoveCharmedBy(caster);
415}
416
421
422void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const
423{
425 return;
426
427 Unit* target = aurApp->GetTarget();
428 if (!target->IsVehicle())
429 return;
430
431 Unit* caster = GetCaster();
432 if (!caster || caster == target)
433 return;
434
435 if (apply)
436 {
437 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
438 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
439 // so this break such spells or most of them.
440 // Current formula about m_amount: effect base points + dieside - 1
441 // TO DO: Reasearch more about 0/0 and fix it.
442 caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
443 }
444 else
445 {
446 // Remove pending passengers before exiting vehicle - might cause an Uninstall
448
449 if (GetId() == 53111) // Devour Humanoid
450 {
451 target->Kill(caster);
452 if (caster->GetTypeId() == TypeID::TYPEID_UNIT)
453 caster->ToCreature()->RemoveCorpse();
454 }
455
457 caster->_ExitVehicle();
458 else
459 target->GetVehicleKit()->RemovePassenger(caster); // Only remove passenger from vehicle without launching exit movement or despawning the vehicle
460
461 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
462 caster->RemoveAurasDueToSpell(GetId());
463 }
464}
465
466/*********************************************************/
467/*** MODIFY SPEED ***/
468/*********************************************************/
469
470void AuraEffect::HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
471{
473 return;
474
475 Unit* target = aurApp->GetTarget();
476
477 target->UpdateSpeed(MOVE_RUN, true);
478}
479
480void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
481{
482 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
483}
484
485void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
486{
488 return;
489
490 Unit* target = aurApp->GetTarget();
492 target->UpdateSpeed(MOVE_FLIGHT, true);
493
496 {
497 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
499 {
500 target->SetCanFly(apply);
501
502 if (!apply && target->GetTypeId() == TypeID::TYPEID_UNIT && !target->IsLevitating())
503 target->GetMotionMaster()->MoveFall();
504 }
505
507 if (mode & AURA_EFFECT_HANDLE_REAL)
508 {
509 //Players on flying mounts must be immune to polymorph
510 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
512
513 // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
514 if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID())
516 }
517 }
518}
519
520void AuraEffect::HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
521{
523 return;
524
525 Unit* target = aurApp->GetTarget();
526
527 target->UpdateSpeed(MOVE_SWIM, true);
528}
529
530void AuraEffect::HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
531{
533 return;
534
535 Unit* target = aurApp->GetTarget();
536
537 target->UpdateSpeed(MOVE_RUN, true);
538 target->UpdateSpeed(MOVE_SWIM, true);
539 target->UpdateSpeed(MOVE_FLIGHT, true);
540 target->UpdateSpeed(MOVE_RUN_BACK, true);
541 target->UpdateSpeed(MOVE_SWIM_BACK, true);
542 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
543}
544
545void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
546{
547 if (!(mode & AURA_EFFECT_HANDLE_REAL))
548 return;
549
550 Unit* target = aurApp->GetTarget();
551
552 target->UpdateSpeed(MOVE_RUN, true);
553 target->UpdateSpeed(MOVE_SWIM, true);
554 target->UpdateSpeed(MOVE_FLIGHT, true);
555}
556
557/*********************************************************/
558/*** IMMUNITY ***/
559/*********************************************************/
DBCStorage< MountCapabilityEntry > sMountCapabilityStore(MountCapabilityfmt)
#define MAX_SPELL_EFFECTS
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::int8_t int8
Definition Define.h:75
@ TYPEID_PLAYER
Definition Object.h:55
@ TYPEID_UNIT
Definition Object.h:54
#define sObjectMgr
Definition ObjectMgr.h:1617
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:25
#define PET_FOLLOW_DIST
Definition PetDefines.h:57
@ SPELL_EFFECT_SUMMON
@ IMMUNITY_MECHANIC
@ MECHANIC_POLYMORPH
#define MAX_SPELL_SCHOOL
@ SPELL_AURA_MOD_FEAR
@ SPELL_AURA_FLY
@ SPELL_AURA_MOD_FEAR_2
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_REAL
@ COMMAND_STAY
Definition Unit.h:1164
@ CHARM_TYPE_CHARM
Definition Unit.h:1217
@ CHARM_TYPE_POSSESS
Definition Unit.h:1218
@ CHARM_TYPE_CONVERT
Definition Unit.h:1220
@ UNIT_STATE_CONFUSED
Definition Unit.h:523
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ UNIT_STATE_FLEEING
Definition Unit.h:519
@ UNIT_STATE_STUNNED
Definition Unit.h:515
@ MOVE_FLIGHT
Definition Unit.h:561
@ MOVE_SWIM
Definition Unit.h:558
@ MOVE_FLIGHT_BACK
Definition Unit.h:562
@ MOVE_SWIM_BACK
Definition Unit.h:559
@ MOVE_RUN
Definition Unit.h:556
@ MOVE_RUN_BACK
Definition Unit.h:557
@ UNIT_FLAG2_FORCE_MOVEMENT
Definition Unit.h:669
@ UNIT_FIELD_FLAGS2
@ UNIT_FIELD_MOUNT_DISPLAY_ID
void ApplyPercentModFloatVar(float &var, float val, bool apply)
Definition Util.h:94
Unit * GetTarget() const
Definition SpellAuras.h:54
void HandleAuraModDecreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePreventFleeing(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModStun(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
void HandleModThreat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraFeatherFall(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModFear(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModPossessPet(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModTaunt(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseMountedSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModTotalThreat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraMounted(AuraApplication const *aurApp, uint8 mode, bool apply) const
uint32 GetId() const
void HandleAuraControlVehicle(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraAllowFlight(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleCharmConvert(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseSwimSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Unit * GetCaster() const
int32 GetMiscValue() const
void HandleModConfuse(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModRoot(AuraApplication const *aurApp, uint8 mode, bool apply) const
Aura * GetBase() const
void HandleModCharm(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleForceMoveForward(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleWaterBreathing(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModUseNormalSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraHover(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseFlightSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraWaterWalk(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetAmount() const
void HandleModPossess(AuraApplication const *aurApp, uint8 mode, bool apply) const
void RemoveCorpse(bool setSpawnTime=true)
Definition Creature.cpp:230
void addTempThreat(float threat, bool apply)
float GetVisibilityRange() const
Definition Map.h:267
float GetFollowAngle() const OVERRIDE
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MoveFall(uint32 id=0)
void Clear(bool reset=true)
uint64 GetGUID() const
Definition Object.h:119
Player * ToPlayer()
Definition Object.h:204
TypeID GetTypeId() const
Definition Object.h:131
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:1261
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:1280
Creature * ToCreature()
Definition Object.h:207
void SetUInt32Value(uint16 index, uint32 value)
Definition Object.cpp:1038
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=NULL)
Definition Pet.h:28
void Remove(PetSaveMode mode, bool returnreagent=false)
Definition Pet.cpp:697
void PetSpellInitialize()
Definition Player.cpp:15884
void SetFallInformation(uint32 time, float z)
Definition Player.cpp:20943
Pet * GetPet() const
Definition Player.cpp:15640
void UpdateMirrorTimers()
Definition Player.cpp:1201
Definition Unit.h:1367
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=NULL)
Definition Unit.cpp:8239
bool IsVehicle() const
Definition Unit.h:1523
void Kill(Unit *victim, bool durabilityLoss=true)
Definition Unit.cpp:6342
Pet * ToPet()
Definition Unit.h:2803
bool CanHaveThreatList() const
Definition Unit.cpp:4424
bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster=0) const
void SetControlled(bool apply, UnitState state)
Definition Unit.cpp:6669
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
MotionMaster * GetMotionMaster()
Definition Unit.h:2605
bool IsPet() const
Definition Unit.h:1511
void Dismount()
Definition Unit.cpp:3685
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=NULL)
Definition Unit.cpp:6878
void TauntApply(Unit *victim)
Definition Unit.cpp:4481
bool IsLevitating() const
Definition Unit.h:2003
bool IsAlive() const
Definition Unit.h:2032
CharmInfo * GetCharmInfo()
Definition Unit.h:2148
void TauntFadeOut(Unit *taunter)
Definition Unit.cpp:4509
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:3635
void _ExitVehicle(Position const *exitPosition=NULL)
Definition Unit.cpp:8325
bool SetHover(bool enable, bool packetOnly=false)
Definition Unit.cpp:9287
bool SetCanFly(bool enable)
Definition Unit.cpp:9219
bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition Unit.cpp:9266
bool HasAuraType(AuraType auraType) const
void RemoveCharmedBy(Unit *charmer)
Definition Unit.cpp:7029
HostileRefManager & getHostileRefManager()
Definition Unit.h:2466
void RemoveAurasByType(AuraType auraType, uint64 casterGUID=0, Aura *except=NULL, bool negative=true, bool positive=true)
Unit * GetVictim() const
Definition Unit.h:1468
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition Unit.cpp:3580
uint32 GetMountID() const
Definition Unit.h:1746
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition Unit.cpp:4173
Vehicle * GetVehicleKit() const
Definition Unit.h:2739
float m_threatModifier[MAX_SPELL_SCHOOL]
Definition Unit.h:2392
bool SetWaterWalking(bool enable, bool packetOnly=false)
Definition Unit.cpp:9245
Vehicle * RemovePassenger(Unit *passenger)
Removes the passenger from the vehicle.
Definition Vehicle.cpp:487
void RemovePendingEventsForPassenger(Unit *passenger)
Definition Vehicle.cpp:729
Map * GetMap() const
Definition Object.h:740
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1735
bool HasCommandState(CommandStates state) const
Definition Unit.h:1255
float GetPositionZ() const
Definition Object.h:330