No Matches
Unit Class Referenceabstract

#include <Unit.h>


struct  ValuesUpdateForPlayerWithMaskSender
struct  VisibleAuraSlotCompare

Public Types

typedef std::set< Unit * > AttackerSet
typedef std::set< Unit * > ControlList
typedef std::vector< Unit * > UnitVector
typedef std::multimap< uint32, Aura * > AuraMap
typedef std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
typedef std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
typedef std::multimap< uint32, AuraApplication * > AuraApplicationMap
typedef std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
typedef std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
typedef std::multimap< AuraStateType, AuraApplication * > AuraStateAurasMap
typedef std::pair< AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator > AuraStateAurasMapBounds
typedef std::list< AuraEffect * > AuraEffectList
typedef std::list< Aura * > AuraList
typedef std::list< AuraApplication * > AuraApplicationList
typedef std::array< DiminishingReturn, DIMINISHING_MAXDiminishing
typedef std::vector< std::pair< uint32, AuraApplication * > > AuraApplicationProcContainer
typedef std::set< AuraApplication *, VisibleAuraSlotCompareVisibleAuraContainer

Public Member Functions

virtual ~Unit ()
bool IsAIEnabled () const
void AIUpdateTick (uint32 diff)
UnitAIGetAI () const
void ScheduleAIChange ()
void PushAI (UnitAI *newAI)
bool PopAI ()
void AddToWorld () override
void RemoveFromWorld () override
void CleanupBeforeRemoveFromMap (bool finalCleanup)
void CleanupsBeforeDelete (bool finalCleanup=true) override
virtual bool IsAffectedByDiminishingReturns () const
DiminishingLevels GetDiminishing (DiminishingGroup group) const
void IncrDiminishing (SpellInfo const *auraSpellInfo)
bool ApplyDiminishingToDuration (SpellInfo const *auraSpellInfo, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
void ApplyDiminishingAura (DiminishingGroup group, bool apply)
void ClearDiminishings ()
virtual void Update (uint32 time) override
void setAttackTimer (WeaponAttackType type, uint32 time)
void resetAttackTimer (WeaponAttackType type=BASE_ATTACK)
uint32 getAttackTimer (WeaponAttackType type) const
bool isAttackReady (WeaponAttackType type=BASE_ATTACK) const
bool haveOffhandWeapon () const
bool CanDualWield () const
virtual void SetCanDualWield (bool value)
float GetCombatReach () const override
void SetCombatReach (float combatReach)
float GetBoundingRadius () const
void SetBoundingRadius (float boundingRadius)
bool IsWithinCombatRange (Unit const *obj, float dist2compare) const
bool IsWithinMeleeRange (Unit const *obj) const
bool IsWithinMeleeRangeAt (Position const &pos, Unit const *obj) const
float GetMeleeRange (Unit const *target) const
virtual SpellSchoolMask GetMeleeDamageSchoolMask (WeaponAttackType attackType=BASE_ATTACK) const =0
bool IsWithinBoundaryRadius (const Unit *obj) const
void _addAttacker (Unit *pAttacker)
void _removeAttacker (Unit *pAttacker)
UnitgetAttackerForHelper () const
bool Attack (Unit *victim, bool meleeAttack)
void CastStop (uint32 except_spellid=0)
bool AttackStop ()
void RemoveAllAttackers ()
AttackerSet const & getAttackers () const
bool isAttackingPlayer () const
UnitGetVictim () const
UnitEnsureVictim () const
void ValidateAttackersAndOwnTarget ()
void CombatStop (bool includingCast=false, bool mutualPvP=true)
void CombatStopWithPets (bool includingCast=false)
void StopAttackFaction (uint32 faction_id)
UnitSelectNearbyTarget (Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
void SendMeleeAttackStop (Unit *victim=nullptr)
void SendMeleeAttackStart (Unit *victim)
void AddUnitState (uint32 f)
bool HasUnitState (const uint32 f) const
void ClearUnitState (uint32 f)
bool CanFreeMove () const
uint32 HasUnitTypeMask (uint32 mask) const
void AddUnitTypeMask (uint32 mask)
bool IsSummon () const
bool IsGuardian () const
bool IsPet () const
bool IsHunterPet () const
bool IsTotem () const
bool IsVehicle () const
uint8 GetLevel () const
uint8 GetLevelForTarget (WorldObject const *) const override
void SetLevel (uint8 lvl, bool sendUpdate=true)
uint8 GetRace () const
void SetRace (uint8 race)
uint64 GetRaceMask () const
uint8 GetClass () const
void SetClass (uint8 classId)
uint32 GetClassMask () const
Gender GetGender () const
void SetGender (Gender gender)
virtual Gender GetNativeGender () const
virtual void SetNativeGender (Gender gender)
float GetStat (Stats stat) const
void SetStat (Stats stat, int32 val)
uint32 GetArmor () const
void SetArmor (int32 val, int32 bonusVal)
int32 GetResistance (SpellSchools school) const
int32 GetBonusResistanceMod (SpellSchools school) const
int32 GetResistance (SpellSchoolMask mask) const
void SetResistance (SpellSchools school, int32 val)
void SetBonusResistanceMod (SpellSchools school, int32 val)
uint64 GetHealth () const
uint64 GetMaxHealth () const
bool IsFullHealth () const
bool HealthBelowPct (int32 pct) const
bool HealthBelowPctDamaged (int32 pct, uint32 damage) const
bool HealthAbovePct (int32 pct) const
bool HealthAbovePctHealed (int32 pct, uint32 heal) const
float GetHealthPct () const
uint64 CountPctFromMaxHealth (int32 pct) const
uint64 CountPctFromCurHealth (int32 pct) const
void SetHealth (uint64 val)
void SetMaxHealth (uint64 val)
void SetFullHealth ()
int64 ModifyHealth (int64 val)
int64 GetHealthGain (int64 dVal)
void TriggerOnHealthChangeAuras (uint64 oldVal, uint64 newVal)
virtual float GetHealthMultiplierForTarget (WorldObject const *) const
virtual float GetDamageMultiplierForTarget (WorldObject const *) const
virtual float GetArmorMultiplierForTarget (WorldObject const *) const
Powers GetPowerType () const
void SetPowerType (Powers power, bool sendUpdate=true)
void SetOverrideDisplayPowerId (uint32 powerDisplayId)
void UpdateDisplayPower ()
int32 GetPower (Powers power) const
int32 GetMinPower (Powers power) const
int32 GetMaxPower (Powers power) const
float GetPowerPct (Powers power) const
int32 CountPctFromMaxPower (Powers power, int32 pct) const
void SetPower (Powers power, int32 val, bool withPowerUpdate=true)
void SetMaxPower (Powers power, int32 val)
void TriggerOnPowerChangeAuras (Powers power, int32 oldVal, int32 newVal)
void SetFullPower (Powers power)
int32 ModifyPower (Powers power, int32 val, bool withPowerUpdate=true)
void ApplyModManaCostMultiplier (float manaCostMultiplier, bool apply)
void ApplyModManaCostModifier (SpellSchools school, int32 mod, bool apply)
uint32 GetBaseAttackTime (WeaponAttackType att) const
void SetBaseAttackTime (WeaponAttackType att, uint32 val)
void UpdateAttackTimeField (WeaponAttackType att)
void ApplyAttackTimePercentMod (WeaponAttackType att, float val, bool apply)
void ApplyCastTimePercentMod (float val, bool apply)
void SetModCastingSpeed (float castingSpeed)
void SetModSpellHaste (float spellHaste)
void SetModHaste (float haste)
void SetModRangedHaste (float rangedHaste)
void SetModHasteRegen (float hasteRegen)
void SetModTimeRate (float timeRate)
bool HasUnitFlag (UnitFlags flags) const
void SetUnitFlag (UnitFlags flags)
void RemoveUnitFlag (UnitFlags flags)
void ReplaceAllUnitFlags (UnitFlags flags)
bool HasUnitFlag2 (UnitFlags2 flags) const
void SetUnitFlag2 (UnitFlags2 flags)
void RemoveUnitFlag2 (UnitFlags2 flags)
void ReplaceAllUnitFlags2 (UnitFlags2 flags)
bool HasUnitFlag3 (UnitFlags3 flags) const
void SetUnitFlag3 (UnitFlags3 flags)
void RemoveUnitFlag3 (UnitFlags3 flags)
void ReplaceAllUnitFlags3 (UnitFlags3 flags)
void SetCreatedBySpell (int32 spellId)
void SetNameplateAttachToGUID (ObjectGuid guid)
Emote GetEmoteState () const
void SetEmoteState (Emote emote)
SheathState GetSheath () const
void SetSheath (SheathState sheathed)
uint32 GetFaction () const override
void SetFaction (uint32 faction) override
bool IsInPartyWith (Unit const *unit) const
bool IsInRaidWith (Unit const *unit) const
void GetPartyMembers (std::list< Unit * > &units)
bool IsContestedGuard () const
UnitPVPStateFlags GetPvpFlags () const
bool HasPvpFlag (UnitPVPStateFlags flags) const
void SetPvpFlag (UnitPVPStateFlags flags)
void RemovePvpFlag (UnitPVPStateFlags flags)
void ReplaceAllPvpFlags (UnitPVPStateFlags flags)
bool IsInSanctuary () const
bool IsPvP () const
bool IsFFAPvP () const
virtual void SetPvP (bool state)
UnitPetFlag GetPetFlags () const
bool HasPetFlag (UnitPetFlag flags) const
void SetPetFlag (UnitPetFlag flags)
void RemovePetFlag (UnitPetFlag flags)
void ReplaceAllPetFlags (UnitPetFlag flags)
uint32 GetCreatureType () const
uint32 GetCreatureTypeMask () const
UnitStandStateType GetStandState () const
bool IsSitState () const
bool IsStandState () const
void SetStandState (UnitStandStateType state, uint32 animKitID=0)
void SetVisFlag (UnitVisFlags flags)
void RemoveVisFlag (UnitVisFlags flags)
void ReplaceAllVisFlags (UnitVisFlags flags)
AnimTier GetAnimTier () const
void SetAnimTier (AnimTier animTier, bool notifyClient=true)
bool IsMounted () const
uint32 GetMountDisplayId () const
void SetMountDisplayId (uint32 mountDisplayId)
uint32 GetCosmeticMountDisplayId () const
void SetCosmeticMountDisplayId (uint32 mountDisplayId)
void Mount (uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
void Dismount ()
MountCapabilityEntry const * GetMountCapability (uint32 mountType) const
void UpdateMountCapability ()
void SendDurabilityLoss (Player *receiver, uint32 percent)
void PlayOneShotAnimKitId (uint16 animKitId)
void SetAIAnimKitId (uint16 animKitId)
uint16 GetAIAnimKitId () const override
void SetMovementAnimKitId (uint16 animKitId)
uint16 GetMovementAnimKitId () const override
void SetMeleeAnimKitId (uint16 animKitId)
uint16 GetMeleeAnimKitId () const override
uint16 GetMaxSkillValueForLevel (Unit const *target=nullptr) const
void KillSelf (bool durabilityLoss=true, bool skipSettingDeathState=false)
void GetProcAurasTriggeredOnEvent (AuraApplicationProcContainer &aurasTriggeringProc, AuraApplicationList *procAuras, ProcEventInfo &eventInfo)
void TriggerAurasProcOnEvent (AuraApplicationList *myProcAuras, AuraApplicationList *targetProcAuras, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
void TriggerAurasProcOnEvent (ProcEventInfo &eventInfo, AuraApplicationProcContainer &procAuras)
void HandleEmoteCommand (Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
void AttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
void CalculateMeleeDamage (Unit *victim, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK)
void DealMeleeDamage (CalcDamageInfo *damageInfo, bool durabilityLoss)
void HandleProcExtraAttackFor (Unit *victim, uint32 count)
void SetLastExtraAttackSpell (uint32 spellId)
uint32 GetLastExtraAttackSpell () const
void AddExtraAttacks (uint32 count)
void SetLastDamagedTargetGuid (ObjectGuid guid)
ObjectGuid GetLastDamagedTargetGuid () const
void CalculateSpellDamageTaken (SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
void DealSpellDamage (SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
uint32 GetDamageReduction (uint32 damage) const
virtual bool CanApplyResilience () const
int32 CalculateAOEAvoidance (int32 damage, uint32 schoolMask, ObjectGuid const &casterGuid) const
float MeleeSpellMissChance (Unit const *victim, WeaponAttackType attType, SpellInfo const *spellInfo) const override
SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const override
float GetUnitDodgeChance (WeaponAttackType attType, Unit const *victim) const
float GetUnitParryChance (WeaponAttackType attType, Unit const *victim) const
float GetUnitBlockChance (WeaponAttackType attType, Unit const *victim) const
float GetUnitMissChance () const
float GetUnitCriticalChanceDone (WeaponAttackType attackType) const
float GetUnitCriticalChanceTaken (Unit const *attacker, WeaponAttackType attackType, float critDone) const
float GetUnitCriticalChanceAgainst (WeaponAttackType attackType, Unit const *victim) const
int32 GetMechanicResistChance (SpellInfo const *spellInfo) const
bool CanUseAttackType (uint8 attacktype) const
virtual float GetBlockPercent (uint8) const
float GetWeaponProcChance () const
float GetPPMProcChance (uint32 WeaponSpeed, float PPM, SpellInfo const *spellProto) const
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const *victim, WeaponAttackType attType) const
NPCFlags GetNpcFlags () const
bool HasNpcFlag (NPCFlags flags) const
void SetNpcFlag (NPCFlags flags)
void RemoveNpcFlag (NPCFlags flags)
void ReplaceAllNpcFlags (NPCFlags flags)
NPCFlags2 GetNpcFlags2 () const
bool HasNpcFlag2 (NPCFlags2 flags) const
void SetNpcFlag2 (NPCFlags2 flags)
void RemoveNpcFlag2 (NPCFlags2 flags)
void ReplaceAllNpcFlags2 (NPCFlags2 flags)
bool IsVendor () const
bool IsTrainer () const
bool IsQuestGiver () const
bool IsGossip () const
bool IsTaxi () const
bool IsGuildMaster () const
bool IsBattleMaster () const
bool IsBanker () const
bool IsInnkeeper () const
bool IsSpiritHealer () const
bool IsSpiritGuide () const
bool IsTabardDesigner () const
bool IsAuctioner () const
bool IsArmorer () const
bool IsWildBattlePet () const
bool IsServiceProvider () const
bool IsSpiritService () const
bool IsCritter () const
bool IsInFlight () const
bool CanHaveThreatList () const
 ====================== THREAT & COMBAT ==================== More...
virtual bool IsEngaged () const
bool IsEngagedBy (Unit const *who) const
void EngageWithTarget (Unit *who)
CombatManagerGetCombatManager ()
CombatManager const & GetCombatManager () const
void AtTargetAttacked (Unit *target, bool canInitialAggro)
bool IsImmuneToAll () const
void SetImmuneToAll (bool apply, bool keepCombat)
virtual void SetImmuneToAll (bool apply)
bool IsImmuneToPC () const
void SetImmuneToPC (bool apply, bool keepCombat)
virtual void SetImmuneToPC (bool apply)
bool IsImmuneToNPC () const
void SetImmuneToNPC (bool apply, bool keepCombat)
virtual void SetImmuneToNPC (bool apply)
bool IsInCombat () const
bool IsInCombatWith (Unit const *who) const
void SetInCombatWith (Unit *enemy, bool addSecondUnitSuppressed=false)
void ClearInCombat ()
void UpdatePetCombatState ()
bool IsThreatened () const
bool IsThreatenedBy (Unit const *who) const
ThreatManagerGetThreatManager ()
ThreatManager const & GetThreatManager () const
void SendClearTarget ()
bool HasAuraTypeWithFamilyFlags (AuraType auraType, uint32 familyName, flag128 familyFlags) const
virtual bool HasSpell (uint32) const
bool HasBreakableByDamageAuraType (AuraType type, uint32 excludeAura=0) const
bool HasBreakableByDamageCrowdControlAura (Unit *excludeCasterChannel=nullptr) const
bool HasStealthAura () const
bool HasInvisibilityAura () const
bool IsFeared () const
bool HasRootAura () const
bool IsPolymorphed () const
bool IsFrozen () const
bool isTargetableForAttack (bool checkFakeDeath=true) const
bool IsInWater () const
bool IsUnderWater () const
bool isInAccessiblePlaceFor (Creature const *c) const
void SendHealSpellLog (HealInfo &healInfo, bool critical=false)
int32 HealBySpell (HealInfo &healInfo, bool critical=false)
void SendEnergizeSpellLog (Unit *victim, uint32 spellId, int32 damage, int32 overEnergize, Powers powerType)
void EnergizeBySpell (Unit *victim, SpellInfo const *spellInfo, int32 damage, Powers powerType)
AuraAddAura (uint32 spellId, Unit *target)
AuraAddAura (SpellInfo const *spellInfo, uint32 effMask, Unit *target)
void SetAuraStack (uint32 spellId, Unit *target, uint32 stack)
void SendPlaySpellVisual (Unit *target, uint32 spellVisualId, uint16 missReason, uint16 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
void SendPlaySpellVisual (Position const &targetPosition, uint32 spellVisualId, uint16 missReason, uint16 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
void SendCancelSpellVisual (uint32 id)
void SendPlaySpellVisualKit (uint32 id, uint32 type, uint32 duration) const
void SendCancelSpellVisualKit (uint32 id)
void CancelSpellMissiles (uint32 spellId, bool reverseMissile=false)
void DeMorph ()
void SendAttackStateUpdate (CalcDamageInfo *damageInfo)
void SendAttackStateUpdate (uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
void SendSpellNonMeleeDamageLog (SpellNonMeleeDamage const *log)
void SendPeriodicAuraLog (SpellPeriodicAuraLogInfo *pInfo)
void SendSpellDamageResist (Unit *target, uint32 spellId)
void SendSpellDamageImmune (Unit *target, uint32 spellId, bool isPeriodic)
void NearTeleportTo (Position const &pos, bool casting=false)
void NearTeleportTo (float x, float y, float z, float orientation, bool casting=false)
void SendTeleportPacket (Position const &pos)
virtual bool UpdatePosition (float x, float y, float z, float ang, bool teleport=false)
virtual bool UpdatePosition (Position const &pos, bool teleport=false)
void UpdateOrientation (float orientation)
 Only server-side orientation update, does not broadcast to client. More...
void UpdateHeight (float newZ)
 Only server-side height update, does not broadcast to client. More...
void SendMoveKnockBack (Player *player, float speedXY, float speedZ, float vcos, float vsin)
void KnockbackFrom (Position const &origin, float speedXY, float speedZ, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void JumpTo (float speedXY, float speedZ, float angle, Optional< Position > dest={})
void JumpTo (WorldObject *obj, float speedZ, bool withOrientation=false)
void MonsterMoveWithSpeed (float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
bool IsPlayingHoverAnim () const
void SetPlayHoverAnim (bool enable)
void SetHoverHeight (float hoverHeight)
bool IsGravityDisabled () const
bool IsWalking () const
bool IsHovering () const
bool SetWalk (bool enable)
bool SetDisableGravity (bool disable, bool updateAnimTier=true)
bool SetFall (bool enable)
bool SetSwim (bool enable)
bool SetCanFly (bool enable)
bool SetWaterWalking (bool enable)
bool SetFeatherFall (bool enable)
bool SetHover (bool enable, bool updateAnimTier=true)
bool SetCollision (bool disable)
bool SetCanTransitionBetweenSwimAndFly (bool enable)
bool SetCanTurnWhileFalling (bool enable)
bool SetCanDoubleJump (bool enable)
bool SetDisableInertia (bool disable)
void SendSetVehicleRecId (uint32 vehicleId)
MovementForces const * GetMovementForces () const
void ApplyMovementForce (ObjectGuid id, Position origin, float magnitude, MovementForceType type, Position direction={}, ObjectGuid transportGuid=ObjectGuid::Empty)
void RemoveMovementForce (ObjectGuid id)
bool SetIgnoreMovementForces (bool ignore)
void UpdateMovementForcesModMagnitude ()
void SetInFront (WorldObject const *target)
void SetFacingTo (float const ori, bool force=true)
void SetFacingToObject (WorldObject const *object, bool force=true)
void SetFacingToPoint (Position const &point, bool force=true)
bool IsAlive () const
bool isDying () const
bool isDead () const
DeathState getDeathState () const
virtual void setDeathState (DeathState s)
ObjectGuid GetOwnerGUID () const override
void SetOwnerGUID (ObjectGuid owner)
ObjectGuid GetCreatorGUID () const
void SetCreatorGUID (ObjectGuid creator)
ObjectGuid GetMinionGUID () const
void SetMinionGUID (ObjectGuid guid)
ObjectGuid GetPetGUID () const
void SetPetGUID (ObjectGuid guid)
ObjectGuid GetCritterGUID () const
void SetCritterGUID (ObjectGuid guid)
ObjectGuid GetBattlePetCompanionGUID () const
void SetBattlePetCompanionGUID (ObjectGuid guid)
ObjectGuid GetDemonCreatorGUID () const
void SetDemonCreatorGUID (ObjectGuid guid)
ObjectGuid GetCharmerGUID () const
UnitGetCharmer () const
ObjectGuid GetCharmedGUID () const
UnitGetCharmed () const
bool IsControlledByPlayer () const
PlayerGetControllingPlayer () const
ObjectGuid GetCharmerOrOwnerGUID () const override
bool IsCharmedOwnedByPlayerOrPlayer () const
GuardianGetGuardianPet () const
MinionGetFirstMinion () const
UnitGetCharmerOrOwner () const
void SetMinion (Minion *minion, bool apply)
void GetAllMinionsByEntry (std::list< TempSummon * > &Minions, uint32 entry)
void RemoveAllMinionsByEntry (uint32 entry)
void SetCharm (Unit *target, bool apply)
UnitGetNextRandomRaidMemberOrPet (float radius)
bool SetCharmedBy (Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
void RemoveCharmedBy (Unit *charmer)
void RestoreFaction ()
UnitGetFirstControlled () const
void RemoveAllControlled ()
bool IsCharmed () const
bool isPossessed () const
bool isPossessedByPlayer () const
bool isPossessing () const
bool isPossessing (Unit *u) const
CharmInfoGetCharmInfo ()
CharmInfoInitCharmInfo ()
void DeleteCharmInfo ()
void SetPetNumberForClient (uint32 petNumber)
void SetPetNameTimestamp (uint32 timestamp)
void SetMovedUnit (Unit *target)
UnitGetUnitBeingMoved () const
PlayerGetPlayerMovingMe () const
SharedVisionList const & GetSharedVisionList ()
void AddPlayerToVision (Player *player)
void RemovePlayerFromVision (Player *player)
bool HasSharedVision () const
void RemoveBindSightAuras ()
void RemoveCharmAuras ()
PetCreateTamedPetFrom (Creature *creatureTarget, uint32 spell_id=0)
PetCreateTamedPetFrom (uint32 creatureEntry, uint32 spell_id=0)
bool InitTamedPet (Pet *pet, uint8 level, uint32 spell_id)
uint32 GetBattlePetCompanionNameTimestamp () const
void SetBattlePetCompanionNameTimestamp (uint32 timestamp)
uint32 GetBattlePetCompanionExperience () const
void SetBattlePetCompanionExperience (uint32 experience)
uint32 GetWildBattlePetLevel () const
void SetWildBattlePetLevel (uint32 wildBattlePetLevel)
Aura_TryStackingOrRefreshingExistingAura (AuraCreateInfo &createInfo)
void _AddAura (UnitAura *aura, Unit *caster)
AuraApplication_CreateAuraApplication (Aura *aura, uint32 effMask)
void _ApplyAuraEffect (Aura *aura, uint8 effIndex)
void _ApplyAura (AuraApplication *aurApp, uint32 effMask)
void _UnapplyAura (AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
void _UnapplyAura (AuraApplication *aurApp, AuraRemoveMode removeMode)
void _RemoveNoStackAurasDueToAura (Aura *aura)
void _RegisterAuraEffect (AuraEffect *aurEff, bool apply)
AuraMapGetOwnedAuras ()
AuraMap const & GetOwnedAuras () const
void RemoveOwnedAura (AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveOwnedAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveOwnedAura (Aura *aura, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraGetOwnedAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, Aura *except=nullptr) const
AuraApplicationMapGetAppliedAuras ()
AuraApplicationMap const & GetAppliedAuras () const
void RemoveAura (AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void RemoveAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAura (AuraApplication *aurApp, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void RemoveAura (Aura *aur, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void RemoveAppliedAuras (std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveOwnedAuras (std::function< bool(Aura const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAppliedAuras (uint32 spellId, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveOwnedAuras (uint32 spellId, std::function< bool(Aura const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAurasByType (AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAurasDueToSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAuraFromStack (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint16 num=1)
void RemoveAurasDueToSpellByDispel (uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, WorldObject *dispeller, uint8 chargesRemoved=1)
void RemoveAurasDueToSpellBySteal (uint32 spellId, ObjectGuid casterGUID, WorldObject *stealer, int32 stolenCharges=1)
void RemoveAurasDueToItemSpell (uint32 spellId, ObjectGuid castItemGuid)
void RemoveAurasByType (AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
void RemoveNotOwnSingleTargetAuras (bool onPhaseChange=false)
template<typename InterruptFlags >
void RemoveAurasWithInterruptFlags (InterruptFlags flag, SpellInfo const *source=nullptr)
void RemoveAurasWithAttribute (uint32 flags)
void RemoveAurasWithFamily (SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID)
void RemoveAurasWithMechanic (uint64 mechanicMaskToRemove, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId=0, bool withEffectMechanics=false)
void RemoveMovementImpairingAuras (bool withRoot)
void RemoveAurasByShapeShift ()
void RemoveAreaAurasDueToLeaveWorld ()
void RemoveAllAuras ()
void RemoveArenaAuras ()
void RemoveAurasOnEvade ()
void RemoveAllAurasOnDeath ()
void RemoveAllAurasRequiringDeadTarget ()
void RemoveAllAurasExceptType (AuraType type)
void RemoveAllAurasExceptType (AuraType type1, AuraType type2)
void RemoveAllGroupBuffsFromCaster (ObjectGuid casterGUID)
void DelayOwnedAuras (uint32 spellId, ObjectGuid caster, int32 delaytime)
void _RemoveAllAuraStatMods ()
void _ApplyAllAuraStatMods ()
AuraEffectList const & GetAuraEffectsByType (AuraType type) const
AuraEffectListGetAuraEffectsByType (AuraType type)
AuraListGetSingleCastAuras ()
AuraList const & GetSingleCastAuras () const
AuraEffectGetAuraEffect (uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
AuraEffectGetAuraEffectOfRankedSpell (uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
AuraEffectGetAuraEffect (AuraType type, SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID=ObjectGuid::Empty) const
AuraApplicationGetAuraApplication (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
AuraApplicationGetAuraApplication (uint32 spellId, std::function< bool(AuraApplication const *)> const &predicate) const
AuraApplicationGetAuraApplication (uint32 spellId, std::function< bool(Aura const *)> const &predicate) const
AuraApplicationGetAuraApplication (std::function< bool(AuraApplication const *)> const &predicate) const
AuraApplicationGetAuraApplication (std::function< bool(Aura const *)> const &predicate) const
AuraGetAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
AuraGetAura (uint32 spellId, std::function< bool(Aura const *)> const &predicate) const
AuraGetAura (std::function< bool(Aura const *)> const &predicate) const
AuraApplicationGetAuraApplicationOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
AuraGetAuraOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
void GetDispellableAuraList (WorldObject const *caster, uint32 dispelMask, DispelChargesList &dispelList, bool isReflect=false) const
bool HasAuraEffect (uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
uint32 GetAuraCount (uint32 spellId) const
bool HasAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
bool HasAura (std::function< bool(Aura const *)> const &predicate) const
bool HasAuraType (AuraType auraType) const
bool HasAuraTypeWithCaster (AuraType auraType, ObjectGuid caster) const
bool HasAuraTypeWithMiscvalue (AuraType auraType, int32 miscValue) const
bool HasAuraTypeWithAffectMask (AuraType auraType, SpellInfo const *affectedSpell) const
bool HasAuraTypeWithValue (AuraType auraType, int32 value) const
bool HasAuraTypeWithTriggerSpell (AuraType auratype, uint32 triggerSpell) const
template<typename InterruptFlags >
bool HasNegativeAuraWithInterruptFlag (InterruptFlags flag, ObjectGuid guid=ObjectGuid::Empty) const
bool HasAuraWithMechanic (uint64 mechanicMask) const
bool HasStrongerAuraWithDR (SpellInfo const *auraSpellInfo, Unit *caster) const
AuraEffectIsScriptOverriden (SpellInfo const *spell, int32 script) const
uint32 GetDiseasesByCaster (ObjectGuid casterGUID, bool remove=false)
uint32 GetDoTsByCaster (ObjectGuid casterGUID) const
int32 GetTotalAuraModifier (AuraType auraType) const
float GetTotalAuraMultiplier (AuraType auraType) const
int32 GetMaxPositiveAuraModifier (AuraType auraType) const
int32 GetMaxNegativeAuraModifier (AuraType auraType) const
int32 GetTotalAuraModifier (AuraType auraType, std::function< bool(AuraEffect const *)> const &predicate) const
float GetTotalAuraMultiplier (AuraType auraType, std::function< bool(AuraEffect const *)> const &predicate) const
int32 GetMaxPositiveAuraModifier (AuraType auraType, std::function< bool(AuraEffect const *)> const &predicate) const
int32 GetMaxNegativeAuraModifier (AuraType auraType, std::function< bool(AuraEffect const *)> const &predicate) const
int32 GetTotalAuraModifierByMiscMask (AuraType auraType, uint32 misc_mask) const
float GetTotalAuraMultiplierByMiscMask (AuraType auraType, uint32 misc_mask) const
int32 GetMaxPositiveAuraModifierByMiscMask (AuraType auraType, uint32 misc_mask, AuraEffect const *except=nullptr) const
int32 GetMaxNegativeAuraModifierByMiscMask (AuraType auraType, uint32 misc_mask) const
int32 GetTotalAuraModifierByMiscValue (AuraType auraType, int32 misc_value) const
float GetTotalAuraMultiplierByMiscValue (AuraType auraType, int32 misc_value) const
int32 GetMaxPositiveAuraModifierByMiscValue (AuraType auraType, int32 misc_value) const
int32 GetMaxNegativeAuraModifierByMiscValue (AuraType auraType, int32 misc_value) const
int32 GetTotalAuraModifierByAffectMask (AuraType auraType, SpellInfo const *affectedSpell) const
float GetTotalAuraMultiplierByAffectMask (AuraType auraType, SpellInfo const *affectedSpell) const
int32 GetMaxPositiveAuraModifierByAffectMask (AuraType auraType, SpellInfo const *affectedSpell) const
int32 GetMaxNegativeAuraModifierByAffectMask (AuraType auraType, SpellInfo const *affectedSpell) const
void InitStatBuffMods ()
void UpdateStatBuffMod (Stats stat)
void UpdateStatBuffModForClient (Stats stat)
void SetCreateStat (Stats stat, float val)
void SetCreateHealth (uint32 val)
uint32 GetCreateHealth () const
void SetCreateMana (uint32 val)
uint32 GetCreateMana () const
int32 GetCreatePowerValue (Powers power) const
float GetPosStat (Stats stat) const
float GetNegStat (Stats stat) const
float GetCreateStat (Stats stat) const
uint32 GetChannelSpellId () const
void SetChannelSpellId (uint32 channelSpellId)
uint32 GetChannelSpellXSpellVisualId () const
uint32 GetChannelScriptVisualId () const
void SetChannelVisual (SpellCastVisual channelVisual)
void AddChannelObject (ObjectGuid guid)
void SetChannelObject (uint32 slot, ObjectGuid guid)
void RemoveChannelObject (ObjectGuid guid)
void ClearChannelObjects ()
void SetCurrentCastSpell (Spell *pSpell)
void InterruptSpell (CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
void FinishSpell (CurrentSpellTypes spellType, SpellCastResult result=SPELL_CAST_OK)
bool IsNonMeleeSpellCast (bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void InterruptNonMeleeSpells (bool withDelayed, uint32 spellid=0, bool withInstant=true)
SpellGetCurrentSpell (CurrentSpellTypes spellType) const
SpellGetCurrentSpell (uint32 spellType) const
SpellFindCurrentSpellBySpellId (uint32 spell_id) const
int32 GetCurrentSpellCastTime (uint32 spell_id) const
virtual SpellInfo const * GetCastSpellInfo (SpellInfo const *spellInfo) const
uint32 GetCastSpellXSpellVisualId (SpellInfo const *spellInfo) const override
virtual bool HasSpellFocus (Spell const *=nullptr) const
virtual bool IsMovementPreventedByCasting () const
bool CanCastSpellWhileMoving (SpellInfo const *spellInfo) const
bool IsSilenced (SpellSchoolMask schoolMask) const
void SetSilencedSchoolMask (SpellSchoolMask schoolMask)
void ReplaceAllSilencedSchoolMask (SpellSchoolMask schoolMask)
SpellHistoryGetSpellHistory ()
SpellHistory const * GetSpellHistory () const
ShapeshiftForm GetShapeshiftForm () const
void SetShapeshiftForm (ShapeshiftForm form)
bool IsInFeralForm () const
bool IsInDisallowedMountForm () const
bool IsDisallowedMountForm (uint32 spellId, ShapeshiftForm form, uint32 displayId) const
void HandleStatFlatModifier (UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
void ApplyStatPctModifier (UnitMods unitMod, UnitModifierPctType modifierType, float amount)
void SetStatFlatModifier (UnitMods unitMod, UnitModifierFlatType modifierType, float val)
void SetStatPctModifier (UnitMods unitMod, UnitModifierPctType modifierType, float val)
float GetFlatModifierValue (UnitMods unitMod, UnitModifierFlatType modifierType) const
float GetPctModifierValue (UnitMods unitMod, UnitModifierPctType modifierType) const
void UpdateUnitMod (UnitMods unitMod)
virtual bool CheckAttackFitToAuraRequirement (WeaponAttackType, AuraEffect const *) const
virtual void UpdateDamageDoneMods (WeaponAttackType attackType, int32 skipEnchantSlot=-1)
void UpdateAllDamageDoneMods ()
void UpdateDamagePctDoneMods (WeaponAttackType attackType)
void UpdateAllDamagePctDoneMods ()
float GetTotalStatValue (Stats stat) const
float GetTotalAuraModValue (UnitMods unitMod) const
SpellSchools GetSpellSchoolByAuraGroup (UnitMods unitMod) const
Stats GetStatByAuraGroup (UnitMods unitMod) const
bool CanModifyStats () const
void SetCanModifyStats (bool modifyStats)
virtual bool UpdateStats (Stats stat)=0
virtual bool UpdateAllStats ()=0
virtual void UpdateResistances (uint32 school)
virtual void UpdateAllResistances ()
virtual void UpdateArmor ()=0
virtual void UpdateMaxHealth ()=0
virtual void UpdateMaxPower (Powers power)=0
virtual uint32 GetPowerIndex (Powers power) const =0
virtual void UpdateAttackPowerAndDamage (bool ranged=false)=0
void SetAttackPower (int32 attackPower)
void SetAttackPowerModPos (int32 attackPowerMod)
void SetAttackPowerModNeg (int32 attackPowerMod)
void SetAttackPowerMultiplier (float attackPowerMult)
void SetRangedAttackPower (int32 attackPower)
void SetRangedAttackPowerModPos (int32 attackPowerMod)
void SetRangedAttackPowerModNeg (int32 attackPowerMod)
void SetRangedAttackPowerMultiplier (float attackPowerMult)
void SetMainHandWeaponAttackPower (int32 attackPower)
void SetOffHandWeaponAttackPower (int32 attackPower)
void SetRangedWeaponAttackPower (int32 attackPower)
virtual void UpdateDamagePhysical (WeaponAttackType attType)
float GetTotalAttackPowerValue (WeaponAttackType attType, bool includeWeapon=true) const
float GetWeaponDamageRange (WeaponAttackType attType, WeaponDamageRange type) const
void SetBaseWeaponDamage (WeaponAttackType attType, WeaponDamageRange damageRange, float value)
virtual void CalculateMinMaxDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage) const =0
uint32 CalculateDamage (WeaponAttackType attType, bool normalized, bool addTotalPct) const
float GetAPMultiplier (WeaponAttackType attType, bool normalized) const
bool isInFrontInMap (Unit const *target, float distance, float arc=float(M_PI)) const
bool isInBackInMap (Unit const *target, float distance, float arc=float(M_PI)) const
bool IsVisible () const
void SetVisible (bool x)
virtual void OnPhaseChange ()
void UpdateObjectVisibility (bool forced=true) override
VisibleAuraContainer const & GetVisibleAuras () const
bool HasVisibleAura (AuraApplication *aurApp) const
void SetVisibleAura (AuraApplication *aurApp)
void SetVisibleAuraUpdate (AuraApplication *aurApp)
void RemoveVisibleAura (AuraApplication *aurApp)
bool HasInterruptFlag (SpellAuraInterruptFlags flags) const
bool HasInterruptFlag (SpellAuraInterruptFlags2 flags) const
void AddInterruptMask (SpellAuraInterruptFlags flags, SpellAuraInterruptFlags2 flags2)
void UpdateInterruptMask ()
virtual float GetNativeObjectScale () const
virtual void RecalculateObjectScale ()
uint32 GetDisplayId () const
virtual void SetDisplayId (uint32 modelId, float displayScale=1.f)
uint32 GetNativeDisplayId () const
float GetNativeDisplayScale () const
void RestoreDisplayId (bool ignorePositiveAurasPreventingMounting=false)
void SetNativeDisplayId (uint32 displayId, float displayScale=1.f)
void SetTransformSpell (uint32 spellid)
uint32 GetTransformSpell () const
void _RegisterDynObject (DynamicObject *dynObj)
void _UnregisterDynObject (DynamicObject *dynObj)
DynamicObjectGetDynObject (uint32 spellId) const
std::vector< DynamicObject * > GetDynObjects (uint32 spellId) const
void RemoveDynObject (uint32 spellId)
void RemoveAllDynObjects ()
GameObjectGetGameObject (uint32 spellId) const
std::vector< GameObject * > GetGameObjects (uint32 spellId) const
void AddGameObject (GameObject *gameObj)
void RemoveGameObject (GameObject *gameObj, bool del)
void RemoveGameObject (uint32 spellid, bool del)
void RemoveAllGameObjects ()
void _RegisterAreaTrigger (AreaTrigger *areaTrigger)
void _UnregisterAreaTrigger (AreaTrigger *areaTrigger)
AreaTriggerGetAreaTrigger (uint32 spellId) const
std::vector< AreaTrigger * > GetAreaTriggers (uint32 spellId) const
void RemoveAreaTrigger (uint32 spellId)
void RemoveAreaTrigger (AuraEffect const *aurEff)
void RemoveAllAreaTriggers ()
void ModifyAuraState (AuraStateType flag, bool apply)
uint32 BuildAuraStateUpdateForTarget (Unit const *target) const
bool HasAuraState (AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
void UnsummonAllTotems ()
bool IsMagnet () const
UnitGetMeleeHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo=nullptr)
int32 SpellBaseDamageBonusDone (SpellSchoolMask schoolMask) const
uint32 SpellDamageBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1) const
float SpellDamagePctDone (Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo) const
uint32 SpellDamageBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype) const
int32 SpellBaseHealingBonusDone (SpellSchoolMask schoolMask) const
uint32 SpellHealingBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1) const
float SpellHealingPctDone (Unit *victim, SpellInfo const *spellProto) const
uint32 SpellHealingBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype) const
uint32 MeleeDamageBonusDone (Unit *pVictim, uint32 damage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellEffectInfo const *spellEffectInfo=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
uint32 MeleeDamageBonusTaken (Unit *attacker, uint32 pdamage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
bool IsBlockCritical ()
float SpellCritChanceDone (Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
float SpellCritChanceTaken (Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
void ApplySpellImmune (uint32 spellId, uint32 op, uint32 type, bool apply)
bool IsImmunedToSpell (SpellInfo const *spellInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
uint32 GetSchoolImmunityMask () const
uint32 GetDamageImmunityMask () const
uint64 GetMechanicImmunityMask () const
bool IsImmunedToDamage (SpellSchoolMask meleeSchoolMask) const
bool IsImmunedToDamage (SpellInfo const *spellInfo) const
virtual bool IsImmunedToSpellEffect (SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
void UpdateSpeed (UnitMoveType mtype)
float GetSpeed (UnitMoveType mtype) const
float GetSpeedRate (UnitMoveType mtype) const
void SetSpeed (UnitMoveType mtype, float newValue)
void SetSpeedRate (UnitMoveType mtype, float rate)
void FollowerAdded (AbstractFollower *f)
void FollowerRemoved (AbstractFollower *f)
void RemoveAllFollowers ()
MotionMasterGetMotionMaster ()
MotionMaster const * GetMotionMaster () const
virtual MovementGeneratorType GetDefaultMovementType () const
bool IsStopped () const
void StopMoving ()
void PauseMovement (uint32 timer=0, uint8 slot=0, bool forced=true)
void ResumeMovement (uint32 timer=0, uint8 slot=0)
void AddUnitMovementFlag (uint32 f)
void RemoveUnitMovementFlag (uint32 f)
bool HasUnitMovementFlag (uint32 f) const
uint32 GetUnitMovementFlags () const
void SetUnitMovementFlags (uint32 f)
void AddExtraUnitMovementFlag (uint32 f)
void RemoveExtraUnitMovementFlag (uint32 f)
bool HasExtraUnitMovementFlag (uint32 f) const
uint32 GetExtraUnitMovementFlags () const
void SetExtraUnitMovementFlags (uint32 f)
void AddExtraUnitMovementFlag2 (uint32 f)
void RemoveExtraUnitMovementFlag2 (uint32 f)
bool HasExtraUnitMovementFlag2 (uint32 f) const
uint32 GetExtraUnitMovementFlags2 () const
void SetExtraUnitMovementFlags2 (uint32 f)
bool IsSplineEnabled () const
void SetControlled (bool apply, UnitState state)
void ApplyControlStatesIfNeeded ()
uint32 GetComboPoints () const
 --------—Combo point system----------------— More...
void AddComboPoints (int8 count, Spell *spell=nullptr)
void GainSpellComboPoints (int8 count)
void ClearComboPoints ()
void SendPetActionFeedback (PetActionFeedback msg, uint32 spellId)
 -------—Pet responses methods--------------— More...
void SendPetTalk (uint32 pettalk)
void SendPetAIReaction (ObjectGuid guid)
void PropagateSpeedChange ()
 -------—End of Pet responses methods-------— More...
void ClearAllReactives ()
void StartReactiveTimer (ReactiveType reactive)
void UpdateReactives (uint32 p_time)
void UpdateAuraForGroup ()
bool CanProc () const
void SetCantProc (bool apply)
uint32 GetModelForForm (ShapeshiftForm form, uint32 spellId) const
bool CreateVehicleKit (uint32 id, uint32 creatureEntry, bool loading=false)
void RemoveVehicleKit (bool onRemoveFromWorld=false)
VehicleGetVehicleKit () const
VehicleGetVehicle () const
void SetVehicle (Vehicle *vehicle)
bool IsOnVehicle (Unit const *vehicle) const
UnitGetVehicleBase () const
UnitGetVehicleRoot () const
CreatureGetVehicleCreatureBase () const
ObjectGuid GetTransGUID () const override
TransportBaseGetDirectTransport () const
 Returns the transport this unit is on directly (if on vehicle and transport, return vehicle) More...
void HandleSpellClick (Unit *clicker, int8 seatId=-1)
void EnterVehicle (Unit *base, int8 seatId=-1)
virtual void ExitVehicle (Position const *exitPosition=nullptr)
void ChangeSeat (int8 seatId, bool next=true)
void _ExitVehicle (Position const *exitPosition=nullptr)
void _EnterVehicle (Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
bool isMoving () const
bool isTurning () const
virtual bool CanFly () const =0
bool IsFlying () const
bool IsFalling () const
virtual bool CanEnterWater () const =0
virtual bool CanSwim () const
float GetHoverOffset () const
void RewardRage (uint32 baseRage)
virtual float GetFollowAngle () const
void OutDebugInfo () const
virtual bool IsLoading () const
bool IsDuringRemoveFromWorld () const
PetToPet ()
Pet const * ToPet () const
TotemToTotem ()
Totem const * ToTotem () const
TempSummonToTempSummon ()
TempSummon const * ToTempSummon () const
ObjectGuid GetTarget () const
virtual void SetTarget (ObjectGuid const &)=0
void SetInstantCast (bool set)
bool CanInstantCast () const
int32 GetHighestExclusiveSameEffectSpellGroupValue (AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
bool IsHighestExclusiveAura (Aura const *aura, bool removeOtherAuraApplications=false)
bool IsHighestExclusiveAuraEffect (SpellInfo const *spellInfo, AuraType auraType, int32 effectAmount, uint32 auraEffectMask, bool removeOtherAuraApplications=false)
virtual void Talk (std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
virtual void Say (std::string_view text, Language language, WorldObject const *target=nullptr)
virtual void Yell (std::string_view text, Language language, WorldObject const *target=nullptr)
virtual void TextEmote (std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
virtual void Whisper (std::string_view text, Language language, Player *target, bool isBossWhisper=false)
virtual void Talk (uint32 textId, ChatMsg msgType, float textRange, WorldObject const *target)
virtual void Say (uint32 textId, WorldObject const *target=nullptr)
virtual void Yell (uint32 textId, WorldObject const *target=nullptr)
virtual void TextEmote (uint32 textId, WorldObject const *target=nullptr, bool isBossEmote=false)
virtual void Whisper (uint32 textId, Player *target, bool isBossWhisper=false)
float GetCollisionHeight () const override
uint32 GetVirtualItemId (uint32 slot) const
uint16 GetVirtualItemAppearanceMod (uint32 slot) const
void SetVirtualItem (uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
bool IsCombatDisallowed () const
void SetIsCombatDisallowed (bool apply)
void AddWorldEffect (int32 worldEffectId)
void RemoveWorldEffect (int32 worldEffectId)
void ClearWorldEffects ()
std::string GetDebugInfo () const override
void BuildValuesUpdateWithFlag (ByteBuffer *data, UF::UpdateFieldFlag flags, Player const *target) const override
void BuildValuesUpdateForPlayerWithMask (UpdateData *data, UF::ObjectData::Mask const &requestedObjectMask, UF::UnitData::Mask const &requestedUnitMask, Player const *target) const
- Public Member Functions inherited from WorldObject
virtual ~WorldObject ()
virtual void Update (uint32 diff)
void AddToWorld () override
void RemoveFromWorld () override
void GetNearPoint2D (WorldObject const *searcher, float &x, float &y, float distance, float absAngle) const
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float distance2d, float absAngle) const
void GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0) const
void MovePosition (Position &pos, float dist, float angle)
Position GetNearPosition (float dist, float angle)
void MovePositionToFirstCollision (Position &pos, float dist, float angle)
Position GetFirstCollisionPosition (float dist, float angle)
Position GetRandomNearPosition (float radius)
void GetContactPoint (WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
virtual float GetCombatReach () const
void UpdateGroundPositionZ (float x, float y, float &z) const
void UpdateAllowedPositionZ (float x, float y, float &z, float *groundZ=nullptr) const
void GetRandomPoint (Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Position GetRandomPoint (Position const &srcPos, float distance) const
uint32 GetInstanceId () const
PhaseShiftGetPhaseShift ()
PhaseShift const & GetPhaseShift () const
PhaseShiftGetSuppressedPhaseShift ()
PhaseShift const & GetSuppressedPhaseShift () const
bool InSamePhase (PhaseShift const &phaseShift) const
bool InSamePhase (WorldObject const *obj) const
int32 GetDBPhase () const
void SetDBPhase (int32 p)
uint32 GetZoneId () const
uint32 GetAreaId () const
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
bool IsInWorldPvpZone () const
bool IsOutdoors () const
ZLiquidStatus GetLiquidStatus () const
InstanceScriptGetInstanceScript () const
std::string const & GetName () const
void SetName (std::string newname)
std::string GetNameForLocaleIdx (LocaleConstant) const override
float GetDistance (WorldObject const *obj) const
float GetDistance (Position const &pos) const
float GetDistance (float x, float y, float z) const
float GetDistance2d (WorldObject const *obj) const
float GetDistance2d (float x, float y) const
float GetDistanceZ (WorldObject const *obj) const
bool IsSelfOrInSameMap (WorldObject const *obj) const
bool IsInMap (WorldObject const *obj) const
bool IsWithinDist3d (float x, float y, float z, float dist) const
bool IsWithinDist3d (Position const *pos, float dist) const
bool IsWithinDist2d (float x, float y, float dist) const
bool IsWithinDist2d (Position const *pos, float dist) const
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsWithinLOS (float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
bool IsWithinLOSInMap (WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
Position GetHitSpherePointFor (Position const &dest) const
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z) const
bool GetDistanceOrder (WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
bool IsInRange (WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
bool IsInRange2d (float x, float y, float minRange, float maxRange) const
bool IsInRange3d (float x, float y, float z, float minRange, float maxRange) const
bool isInFront (WorldObject const *target, float arc=float(M_PI)) const
bool isInBack (WorldObject const *target, float arc=float(M_PI)) const
bool IsInBetween (Position const &pos1, Position const &pos2, float size=0) const
bool IsInBetween (WorldObject const *obj1, WorldObject const *obj2, float size=0) const
virtual void CleanupsBeforeDelete (bool finalCleanup=true)
virtual void SendMessageToSet (WorldPacket const *data, bool self) const
virtual void SendMessageToSetInRange (WorldPacket const *data, float dist, bool self) const
virtual void SendMessageToSet (WorldPacket const *data, Player const *skipped_rcvr) const
void SendCombatLogMessage (WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
virtual uint8 GetLevelForTarget (WorldObject const *) const
void PlayDistanceSound (uint32 soundId, Player *target=nullptr)
void PlayDirectSound (uint32 soundId, Player *target=nullptr, uint32 broadcastTextId=0)
void PlayDirectMusic (uint32 musicId, Player *target=nullptr)
void AddObjectToRemoveList ()
float GetGridActivationRange () const
float GetVisibilityRange () const
float GetSightRange (WorldObject const *target=nullptr) const
bool CanSeeOrDetect (WorldObject const *obj, bool implicitDetect=false, bool distanceCheck=false, bool checkAlert=false) const
virtual void SetMap (Map *map)
virtual void ResetMap ()
MapGetMap () const
MapFindMap () const
void SetZoneScript ()
ZoneScriptFindZoneScript () const
ZoneScriptGetZoneScript () const
ScenarioGetScenario () const
TempSummonSummonCreature (uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
TempSummonSummonCreature (uint32 entry, float x, float y, float z, float o=0, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
TempSummonSummonPersonalClone (Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, Player *privateObjectOwner=nullptr)
GameObjectSummonGameObject (uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
CreatureSummonTrigger (float x, float y, float z, float ang, Milliseconds despawnTime, CreatureAI *(*GetAI)(Creature *)=nullptr)
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=nullptr)
CreatureFindNearestCreature (uint32 entry, float range, bool alive=true) const
CreatureFindNearestCreatureWithOptions (float range, FindCreatureOptions const &options) const
GameObjectFindNearestGameObject (uint32 entry, float range, bool spawnedOnly=true) const
GameObjectFindNearestUnspawnedGameObject (uint32 entry, float range) const
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
PlayerSelectNearestPlayer (float distance) const
virtual ObjectGuid GetOwnerGUID () const =0
virtual ObjectGuid GetCharmerOrOwnerGUID () const
ObjectGuid GetCharmerOrOwnerOrOwnGUID () const
UnitGetOwner () const
UnitGetCharmerOrOwner () const
UnitGetCharmerOrOwnerOrSelf () const
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
PlayerGetAffectingPlayer () const
PlayerGetSpellModOwner () const
int32 CalculateSpellDamage (Unit const *target, SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
double ApplyEffectModifiers (SpellInfo const *spellInfo, uint8 effIndex, double value) const
int32 CalcSpellDuration (SpellInfo const *spellInfo) const
int32 ModSpellDuration (SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
void ModSpellCastTime (SpellInfo const *spellInfo, int32 &castTime, Spell *spell=nullptr) const
void ModSpellDurationTime (SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
virtual float MeleeSpellMissChance (Unit const *victim, WeaponAttackType attType, SpellInfo const *spellInfo) const
virtual SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const
SpellMissInfo SpellHitResult (Unit *victim, SpellInfo const *spellInfo, bool canReflect=false) const
void SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
virtual uint32 GetFaction () const =0
virtual void SetFaction (uint32)
FactionTemplateEntry const * GetFactionTemplateEntry () const
ReputationRank GetReactionTo (WorldObject const *target) const
bool IsHostileTo (WorldObject const *target) const
bool IsHostileToPlayers () const
bool IsFriendlyTo (WorldObject const *target) const
bool IsNeutralToAll () const
SpellCastResult CastSpell (CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
void SendPlayOrphanSpellVisual (ObjectGuid const &target, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
void SendPlayOrphanSpellVisual (Position const &targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
void SendCancelOrphanSpellVisual (uint32 id)
bool IsValidAttackTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
bool IsValidAssistTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
UnitGetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
virtual uint32 GetCastSpellXSpellVisualId (SpellInfo const *spellInfo) const
template<typename Container >
void GetGameObjectListWithEntryInGrid (Container &gameObjectContainer, uint32 entry, float maxSearchRange=250.0f) const
template<typename Container >
void GetCreatureListWithEntryInGrid (Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
template<typename Container >
void GetCreatureListWithOptionsInGrid (Container &creatureContainer, float maxSearchRange, FindCreatureOptions const &options) const
template<typename Container >
void GetPlayerListInGrid (Container &playerContainer, float maxSearchRange, bool alive=true) const
void DestroyForNearbyPlayers ()
virtual void UpdateObjectVisibility (bool forced=true)
virtual void UpdateObjectVisibilityOnCreate ()
virtual void UpdateObjectVisibilityOnDestroy ()
void UpdatePositionData ()
void BuildUpdate (UpdateDataMapType &) override
bool AddToObjectUpdate () override
void RemoveFromObjectUpdate () override
void AddToNotify (uint16 f)
bool isNeedNotify (uint16 f) const
uint16 GetNotifyFlags () const
void ResetAllNotifies ()
bool isActiveObject () const
void setActive (bool isActiveObject)
bool IsFarVisible () const
void SetFarVisible (bool on)
bool IsVisibilityOverridden () const
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
void SetWorldObject (bool apply)
bool IsPermanentWorldObject () const
bool IsWorldObject () const
TransportBaseGetTransport () const
float GetTransOffsetX () const
float GetTransOffsetY () const
float GetTransOffsetZ () const
float GetTransOffsetO () const
Position const & GetTransOffset () const
uint32 GetTransTime () const
int8 GetTransSeat () const
virtual ObjectGuid GetTransGUID () const
void SetTransport (TransportBase *t)
virtual float GetStationaryX () const
virtual float GetStationaryY () const
virtual float GetStationaryZ () const
virtual float GetStationaryO () const
float GetFloorZ () const
virtual float GetCollisionHeight () const
float GetMapWaterOrGroundLevel (float x, float y, float z, float *ground=nullptr) const
float GetMapHeight (float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
std::string GetDebugInfo () const override
virtual uint16 GetAIAnimKitId () const
virtual uint16 GetMovementAnimKitId () const
virtual uint16 GetMeleeAnimKitId () const
bool IsPrivateObject () const
ObjectGuid GetPrivateObjectOwner () const
void SetPrivateObjectOwner (ObjectGuid const &owner)
bool CheckPrivateObjectOwnerVisibility (WorldObject const *seer) const
SmoothPhasingGetOrCreateSmoothPhasing ()
SmoothPhasingGetSmoothPhasing ()
SmoothPhasing const * GetSmoothPhasing () const
- Public Member Functions inherited from Object
virtual ~Object ()
bool IsInWorld () const
virtual void AddToWorld ()
virtual void RemoveFromWorld ()
ObjectGuid const & GetGUID () const
uint32 GetEntry () const
void SetEntry (uint32 entry)
float GetObjectScale () const
virtual void SetObjectScale (float scale)
uint32 GetDynamicFlags () const
bool HasDynamicFlag (uint32 flag) const
void SetDynamicFlag (uint32 flag)
void RemoveDynamicFlag (uint32 flag)
void ReplaceAllDynamicFlags (uint32 flag)
TypeID GetTypeId () const
bool isType (uint16 mask) const
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const
void SendUpdateToPlayer (Player *player)
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player const *target) const
void BuildValuesUpdateBlockForPlayerWithFlag (UpdateData *data, UF::UpdateFieldFlag flags, Player const *target) const
void BuildDestroyUpdateBlock (UpdateData *data) const
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
ByteBufferPrepareValuesUpdateBuffer (UpdateData *data) const
virtual void DestroyForPlayer (Player *target) const
void SendOutOfRangeForPlayer (Player *target) const
virtual void ClearUpdateMask (bool remove)
virtual std::string GetNameForLocaleIdx (LocaleConstant locale) const =0
virtual bool hasQuest (uint32) const
virtual bool hasInvolvedQuest (uint32) const
void SetIsNewObject (bool enable)
bool IsDestroyedObject () const
void SetDestroyedObject (bool destroyed)
virtual void BuildUpdate (UpdateDataMapType &)
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
bool IsPlayer () const
PlayerToPlayer ()
Player const * ToPlayer () const
bool IsCreature () const
CreatureToCreature ()
Creature const * ToCreature () const
bool IsUnit () const
UnitToUnit ()
Unit const * ToUnit () const
bool IsGameObject () const
GameObjectToGameObject ()
GameObject const * ToGameObject () const
bool IsCorpse () const
CorpseToCorpse ()
Corpse const * ToCorpse () const
bool IsDynObject () const
DynamicObjectToDynObject ()
DynamicObject const * ToDynObject () const
bool IsAreaTrigger () const
AreaTriggerToAreaTrigger ()
AreaTrigger const * ToAreaTrigger () const
bool IsSceneObject () const
SceneObjectToSceneObject ()
SceneObject const * ToSceneObject () const
bool IsConversation () const
ConversationToConversation ()
Conversation const * ToConversation () const
template<typename T >
void ForceUpdateFieldChange (UF::UpdateFieldSetter< T > const &)
virtual std::string GetDebugInfo () const
virtual LootGetLootForPlayer (Player const *player) const
virtual void BuildValuesUpdateWithFlag (ByteBuffer *data, UF::UpdateFieldFlag flags, Player const *target) const
- Public Member Functions inherited from WorldLocation
 WorldLocation (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 WorldLocation (uint32 mapId, Position const &position)
void WorldRelocate (WorldLocation const &loc)
void WorldRelocate (WorldLocation const *loc)
void WorldRelocate (uint32 mapId, Position const &pos)
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
WorldLocation GetWorldLocation () const
uint32 GetMapId () const
std::string GetDebugInfo () const
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
bool operator== (Position const &a) const
bool operator!= (Position const &a) const
void Relocate (float x, float y)
void Relocate (float x, float y, float z)
void Relocate (float x, float y, float z, float o)
void Relocate (Position const &pos)
void Relocate (Position const *pos)
void RelocateOffset (Position const &offset)
void SetOrientation (float orientation)
float GetPositionX () const
float GetPositionY () const
float GetPositionZ () const
float GetOrientation () const
void GetPosition (float &x, float &y) const
void GetPosition (float &x, float &y, float &z) const
void GetPosition (float &x, float &y, float &z, float &o) const
Position GetPosition () const
Streamer< XY > PositionXYStream ()
ConstStreamer< XY > PositionXYStream () const
Streamer< XYZ > PositionXYZStream ()
ConstStreamer< XYZ > PositionXYZStream () const
Streamer< XYZO > PositionXYZOStream ()
ConstStreamer< XYZO > PositionXYZOStream () const
Streamer< PackedXYZ > PositionPackedXYZStream ()
ConstStreamer< PackedXYZ > PositionPackedXYZStream () const
bool IsPositionValid () const
float GetExactDist2dSq (const float x, const float y) const
float GetExactDist2dSq (Position const &pos) const
float GetExactDist2dSq (Position const *pos) const
float GetExactDist2d (const float x, const float y) const
float GetExactDist2d (Position const &pos) const
float GetExactDist2d (Position const *pos) const
float GetExactDistSq (float x, float y, float z) const
float GetExactDistSq (Position const &pos) const
float GetExactDistSq (Position const *pos) const
float GetExactDist (float x, float y, float z) const
float GetExactDist (Position const &pos) const
float GetExactDist (Position const *pos) const
void GetPositionOffsetTo (Position const &endPos, Position &retOffset) const
Position GetPositionWithOffset (Position const &offset) const
float GetAbsoluteAngle (float x, float y) const
float GetAbsoluteAngle (Position const &pos) const
float GetAbsoluteAngle (Position const *pos) const
float ToAbsoluteAngle (float relAngle) const
float ToRelativeAngle (float absAngle) const
float GetRelativeAngle (float x, float y) const
float GetRelativeAngle (Position const &pos) const
float GetRelativeAngle (Position const *pos) const
bool IsInDist2d (float x, float y, float dist) const
bool IsInDist2d (Position const *pos, float dist) const
bool IsInDist (float x, float y, float z, float dist) const
bool IsInDist (Position const &pos, float dist) const
bool IsInDist (Position const *pos, float dist) const
bool IsWithinBox (Position const &center, float xradius, float yradius, float zradius) const
bool IsWithinDoubleVerticalCylinder (Position const *center, float radius, float height) const
bool HasInArc (float arcangle, Position const *pos, float border=2.0f) const
bool HasInLine (Position const *pos, float objSize, float width) const
std::string ToString () const

Static Public Member Functions

static float CalculateAverageResistReduction (WorldObject const *caster, SpellSchoolMask schoolMask, Unit const *victim, SpellInfo const *spellInfo=nullptr)
static void DealDamageMods (Unit const *attacker, Unit const *victim, uint32 &damage, uint32 *absorb)
static uint32 DealDamage (Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
static void Kill (Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
static void DealHeal (HealInfo &healInfo)
static void ProcSkillsAndAuras (Unit *actor, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
static void ApplyResilience (Unit const *victim, int32 *damage)
static uint32 SpellCriticalDamageBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
static uint32 SpellCriticalHealingBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
static bool IsDamageReducedByArmor (SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr)
static uint32 CalcArmorReducedDamage (Unit const *attacker, Unit *victim, uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=MAX_ATTACK, uint8 attackerLevel=0)
static uint32 CalcSpellResistedDamage (Unit const *attacker, Unit *victim, uint32 damage, SpellSchoolMask schoolMask, SpellInfo const *spellInfo)
static void CalcAbsorbResist (DamageInfo &damageInfo, Spell *spell=nullptr)
static void CalcHealAbsorb (HealInfo &healInfo)
- Static Public Member Functions inherited from WorldObject
static bool InSamePhase (WorldObject const *a, WorldObject const *b)
static ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, WorldObject const *target)
- Static Public Member Functions inherited from Object
static ObjectGuid GetGUID (Object const *o)
static PlayerToPlayer (Object *o)
static Player const * ToPlayer (Object const *o)
static CreatureToCreature (Object *o)
static Creature const * ToCreature (Object const *o)
static UnitToUnit (Object *o)
static Unit const * ToUnit (Object const *o)
static GameObjectToGameObject (Object *o)
static GameObject const * ToGameObject (Object const *o)
static CorpseToCorpse (Object *o)
static Corpse const * ToCorpse (Object const *o)
static DynamicObjectToDynObject (Object *o)
static DynamicObject const * ToDynObject (Object const *o)
static AreaTriggerToAreaTrigger (Object *o)
static AreaTrigger const * ToAreaTrigger (Object const *o)
static SceneObjectToSceneObject (Object *o)
static SceneObject const * ToSceneObject (Object const *o)
static ConversationToConversation (Object *o)
static Conversation const * ToConversation (Object const *o)
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)

Public Attributes

bool m_canDualWield
ControlList m_Controlled
ObjectGuid m_SummonSlot [MAX_SUMMON_SLOT]
ObjectGuid m_ObjectSlot [MAX_GAMEOBJECT_SLOT]
float m_modMeleeHitChance
float m_modRangedHitChance
float m_modSpellHitChance
int32 m_baseSpellCritChance
uint32 m_baseAttackSpeed [MAX_ATTACK]
float m_modAttackSpeedPct [MAX_ATTACK]
uint32 m_attackTimer [MAX_ATTACK]
SpellImmuneContainer m_spellImmune [MAX_SPELL_IMMUNITY]
uint32 m_lastSanctuaryTime
ObjectGuid LastCharmerGUID
UF::UpdateField< UF::UnitData, 0, TYPEID_UNITm_unitData
- Public Attributes inherited from WorldObject
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealth
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealthDetect
FlaggedValuesArray32< int32, uint64, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibility
FlaggedValuesArray32< int32, uint64, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibilityDetect
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibility
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibilityDetect
uint32 LastUsedScriptID
MovementInfo m_movementInfo
EventProcessor m_Events
- Public Attributes inherited from Object
UF::UpdateFieldHolder m_values
UF::UpdateField< UF::ObjectData, 0, TYPEID_OBJECTm_objectData
- Public Attributes inherited from WorldLocation
uint32 m_mapId
- Public Attributes inherited from Position
float m_positionX
float m_positionY
float m_positionZ

Protected Types

typedef std::list< DynamicObject * > DynObjectList
typedef std::list< GameObject * > GameObjectList
typedef std::vector< AreaTrigger * > AreaTriggerList

Protected Member Functions

void SetAI (UnitAI *newAI)
UnitAIGetTopAI () const
void RefreshAI ()
UnitAIGetScheduledChangeAI ()
bool HasScheduledAIChange () const
 Unit (bool isWorldObject)
UF::UpdateFieldFlag GetUpdateFieldFlagsFor (Player const *target) const override
void BuildValuesCreate (ByteBuffer *data, Player const *target) const override
void BuildValuesUpdate (ByteBuffer *data, Player const *target) const override
void DestroyForPlayer (Player *target) const override
void ClearUpdateMask (bool remove) override
void _UpdateSpells (uint32 time)
void _DeleteRemovedAuras ()
void _UpdateAutoRepeatSpell ()
bool IsAlwaysVisibleFor (WorldObject const *seer) const override
bool IsAlwaysDetectableFor (WorldObject const *seer) const override
void DisableSpline ()
void ProcessPositionDataChanged (PositionFullTerrainStatus const &data) override
virtual void ProcessTerrainStatusUpdate (ZLiquidStatus oldLiquidStatus, Optional< LiquidData > const &newLiquidData)
virtual void AtEnterCombat ()
virtual void AtExitCombat ()
virtual void AtEngage (Unit *)
virtual void AtDisengage ()
void SetFeared (bool apply)
void SetConfused (bool apply)
void SetStunned (bool apply)
void SetRooted (bool apply, bool packetOnly=false)
- Protected Member Functions inherited from WorldObject
 WorldObject (bool isWorldObject)
virtual void ProcessPositionDataChanged (PositionFullTerrainStatus const &data)
void SetLocationMapId (uint32 _mapId)
void SetLocationInstanceId (uint32 _instanceId)
virtual bool CanNeverSee (WorldObject const *obj) const
virtual bool CanAlwaysSee (WorldObject const *) const
virtual bool IsNeverVisibleFor (WorldObject const *seer, bool allowServersideObjects=false) const
virtual bool IsAlwaysVisibleFor (WorldObject const *seer) const
virtual bool IsInvisibleDueToDespawn (WorldObject const *seer) const
virtual bool IsAlwaysDetectableFor (WorldObject const *seer) const
- Protected Member Functions inherited from Object
 Object ()
void _Create (ObjectGuid const &guid)
template<typename T >
void SetUpdateFieldValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
template<typename T >
void SetUpdateFieldFlagValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
template<typename T >
void RemoveUpdateFieldFlagValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result AddDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter)
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result InsertDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
template<typename T >
void RemoveDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
template<typename T >
void ClearDynamicUpdateFieldValues (UF::DynamicUpdateFieldSetter< T > setter)
template<typename T >
void RemoveOptionalUpdateFieldValue (UF::OptionalUpdateFieldSetter< T > setter)
template<typename T >
void SetUpdateFieldStatValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
template<typename T >
void ApplyModUpdateFieldValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type mod, bool apply)
template<typename T >
void ApplyPercentModUpdateFieldValue (UF::UpdateFieldSetter< T > setter, float percent, bool apply)
template<typename Action >
void DoWithSuppressingObjectUpdates (Action &&action)
void BuildMovementUpdate (ByteBuffer *data, CreateObjectBits flags, Player *target) const
virtual UF::UpdateFieldFlag GetUpdateFieldFlagsFor (Player const *target) const
virtual void BuildValuesCreate (ByteBuffer *data, Player const *target) const =0
virtual void BuildValuesUpdate (ByteBuffer *data, Player const *target) const =0
virtual bool AddToObjectUpdate ()=0
virtual void RemoveFromObjectUpdate ()=0
void AddToObjectUpdateIfNeeded ()

Protected Attributes

bool m_ControlledByPlayer
float m_createStats [MAX_STATS]
float m_floatStatPosBuff [MAX_STATS]
float m_floatStatNegBuff [MAX_STATS]
AttackerSet m_attackers
DeathState m_deathState
int32 m_procDeep
DynObjectList m_dynObj
GameObjectList m_gameObj
AreaTriggerList m_areaTrigger
uint32 m_transformSpell
Spellm_currentSpells [CURRENT_MAX_SPELL]
AuraMap m_ownedAuras
AuraApplicationMap m_appliedAuras
AuraList m_removedAuras
AuraMap::iterator m_auraUpdateIterator
uint32 m_removedAurasCount
AuraEffectList m_modAuras [TOTAL_AURAS]
AuraList m_scAuras
AuraApplicationList m_interruptableAuras
AuraStateAurasMap m_auraStateAuras
EnumFlag< SpellAuraInterruptFlagsm_interruptMask
EnumFlag< SpellAuraInterruptFlags2m_interruptMask2
float m_auraFlatModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_FLAT_END]
float m_auraPctModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_PCT_END]
float m_weaponDamage [MAX_ATTACK][2]
bool m_canModifyStats
VisibleAuraContainer m_visibleAuras
Trinity::Containers::FlatSet< AuraApplication *, VisibleAuraSlotComparem_visibleAurasToUpdate
float m_speed_rate [MAX_MOVE_TYPE]
SharedVisionList m_sharedVision
uint32 m_reactiveTimer [MAX_REACTIVE]
uint32 m_regenTimer
uint32 m_unitTypeMask
LiquidTypeEntry const * _lastLiquid
uint32 m_movementCounter
 Incrementing counter used in movement packets. More...
- Protected Attributes inherited from WorldObject
std::string m_name
bool m_isActive
bool m_isFarVisible
Optional< float > m_visibilityDistanceOverride
bool const m_isWorldObject
uint32 m_zoneId
uint32 m_areaId
float m_staticFloorZ
bool m_outdoors
ZLiquidStatus m_liquidStatus
- Protected Attributes inherited from Object
uint16 m_objectType
TypeID m_objectTypeId
CreateObjectBits m_updateFlag
bool m_objectUpdated

Private Types

typedef std::stack< std::shared_ptr< UnitAI > > UnitAIStack

Private Member Functions

void UpdateSplineMovement (uint32 t_diff)
void UpdateSplinePosition ()
void InterruptMovementBasedAuras ()
float GetCombatRatingReduction (CombatRating cr) const
uint32 GetCombatRatingDamageReduction (CombatRating cr, float rate, float cap, uint32 damage) const
void ProcSkillsAndReactives (bool isVictim, Unit *procTarget, ProcFlagsInit const &typeMask, ProcFlagsHit hitMask, WeaponAttackType attType)
void UpdateCharmAI ()
void RestoreDisabledAI ()

Private Attributes

uint32 m_state
TimeTracker m_splineSyncTimer
Diminishing m_Diminishing
CombatManager m_combatManager
ThreatManager m_threatManager
UnitAIStack i_AIs
std::shared_ptr< UnitAIi_AI
bool m_aiLocked
std::unordered_set< AbstractFollower * > m_followingMe
uint32 _lastExtraAttackSpell
std::unordered_map< ObjectGuid, uint32extraAttacksTargets
ObjectGuid _lastDamagedTargetGuid
bool m_cleanupDone
bool m_duringRemoveFromWorld
bool _instantCast
uint32 _oldFactionId
 faction before charm More...
bool _isWalkingBeforeCharm
 Are we walking before we were charmed? More...
bool _playHoverAnim
uint16 _aiAnimKitId
uint16 _movementAnimKitId
uint16 _meleeAnimKitId
std::unique_ptr< MovementForces_movementForces
PositionUpdateInfo _positionUpdateInfo
bool _isCombatDisallowed


class VehicleJoinEvent
class CombatManager
class ThreatManager

Member Typedef Documentation

◆ AreaTriggerList

typedef std::vector<AreaTrigger*> Unit::AreaTriggerList

◆ AttackerSet

typedef std::set<Unit*> Unit::AttackerSet

◆ AuraApplicationList

◆ AuraApplicationMap

◆ AuraApplicationMapBounds

typedef std::pair<AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator> Unit::AuraApplicationMapBounds

◆ AuraApplicationMapBoundsNonConst

typedef std::pair<AuraApplicationMap::iterator, AuraApplicationMap::iterator> Unit::AuraApplicationMapBoundsNonConst

◆ AuraApplicationProcContainer

typedef std::vector<std::pair<uint32 , AuraApplication*> > Unit::AuraApplicationProcContainer

◆ AuraEffectList

typedef std::list<AuraEffect*> Unit::AuraEffectList

◆ AuraList

typedef std::list<Aura*> Unit::AuraList

◆ AuraMap

typedef std::multimap<uint32, Aura*> Unit::AuraMap

◆ AuraMapBounds

typedef std::pair<AuraMap::const_iterator, AuraMap::const_iterator> Unit::AuraMapBounds

◆ AuraMapBoundsNonConst

typedef std::pair<AuraMap::iterator, AuraMap::iterator> Unit::AuraMapBoundsNonConst

◆ AuraStateAurasMap

◆ AuraStateAurasMapBounds

typedef std::pair<AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator> Unit::AuraStateAurasMapBounds

◆ ControlList

typedef std::set<Unit*> Unit::ControlList

◆ Diminishing

◆ DynObjectList

typedef std::list<DynamicObject*> Unit::DynObjectList

◆ GameObjectList

typedef std::list<GameObject*> Unit::GameObjectList

◆ UnitAIStack

typedef std::stack<std::shared_ptr<UnitAI> > Unit::UnitAIStack

◆ UnitVector

typedef std::vector<Unit*> Unit::UnitVector

◆ VisibleAuraContainer

Constructor & Destructor Documentation

◆ ~Unit()

Unit::~Unit ( )
412 // set current spells as deletable
413 for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
414 if (m_currentSpells[i])
415 {
417 m_currentSpells[i] = nullptr;
418 }
424 delete i_motionMaster;
425 delete m_charmInfo;
426 delete movespline;
427 delete _spellHistory;
431 ASSERT(m_attackers.empty());
432 ASSERT(m_sharedVision.empty());
433 ASSERT(m_Controlled.empty());
434 ASSERT(m_appliedAuras.empty());
435 ASSERT(m_ownedAuras.empty());
436 ASSERT(m_removedAuras.empty());
437 ASSERT(m_gameObj.empty());
438 ASSERT(m_dynObj.empty());
uint8_t uint8
Definition: Define.h:145
#define ASSERT
Definition: Errors.h:68
Definition: Unit.h:585
void KillAllEvents(bool force)
Definition: EventProcessor.cpp:82
void SetReferencedFromCurrent(bool yes)
Definition: Spell.h:608
bool m_duringRemoveFromWorld
Definition: Unit.h:2063
Spell * m_currentSpells[CURRENT_MAX_SPELL]
Definition: Unit.h:1958
Unit * m_unitMovedByMe
Definition: Unit.h:1983
AuraList m_removedAuras
Definition: Unit.h:1962
Movement::MoveSpline * movespline
Definition: Unit.h:1862
SpellHistory * _spellHistory
Definition: Unit.h:2075
CharmInfo * m_charmInfo
Definition: Unit.h:1987
MotionMaster * i_motionMaster
Definition: Unit.h:1990
ControlList m_Controlled
Definition: Unit.h:1298
void _DeleteRemovedAuras()
Definition: Unit.cpp:2740
DynObjectList m_dynObj
Definition: Unit.h:1948
AttackerSet m_attackers
Definition: Unit.h:1940
Unit * m_attacking
Definition: Unit.h:1941
GameObjectList m_gameObj
Definition: Unit.h:1951
AuraMap m_ownedAuras
Definition: Unit.h:1960
AuraApplicationMap m_appliedAuras
Definition: Unit.h:1961
SharedVisionList m_sharedVision
Definition: Unit.h:1988
Player * m_playerMovingMe
Definition: Unit.h:1984
EventProcessor m_Events
Definition: Object.h:759
+ Here is the call graph for this function:

◆ Unit()

Unit::Unit ( bool  isWorldObject)
303 :
306 m_removedAurasCount(0), m_interruptMask(SpellAuraInterruptFlags::None), m_interruptMask2(SpellAuraInterruptFlags2::None),
307 m_unitMovedByMe(nullptr), m_playerMovingMe(nullptr), m_charmer(nullptr), m_charmed(nullptr),
308 i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_vehicle(nullptr),
311 _spellHistory(new SpellHistory(this))
318 for (uint32 i = 0; i < MAX_ATTACK; ++i)
319 {
320 m_baseAttackSpeed[i] = 0;
321 m_modAttackSpeedPct[i] = 1.0f;
322 m_attackTimer[i] = 0;
323 }
325 m_canDualWield = false;
329 m_state = 0;
332 for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
333 m_currentSpells[i] = nullptr;
335 for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
336 m_SummonSlot[i].Clear();
338 for (uint8 i = 0; i < MAX_GAMEOBJECT_SLOT; ++i)
339 m_ObjectSlot[i].Clear();
343 m_canModifyStats = false;
345 for (uint8 i = 0; i < UNIT_MOD_END; ++i)
346 {
352 }
353 // implement 50% base damage from offhand
356 for (uint8 i = 0; i < MAX_ATTACK; ++i)
357 {
360 }
362 for (uint8 i = 0; i < MAX_STATS; ++i)
363 {
364 m_createStats[i] = 0.0f;
365 m_floatStatPosBuff[i] = 0.0f;
366 m_floatStatNegBuff[i] = 0.0f;
367 }
369 m_attacking = nullptr;
370 if (GetTypeId() == TYPEID_PLAYER)
371 {
372 m_modMeleeHitChance = 7.5f;
374 m_modSpellHitChance = 15.0f;
375 }
376 else
377 {
378 m_modMeleeHitChance = 0.0f;
380 m_modSpellHitChance = 0.0f;
381 }
384 for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
385 m_speed_rate[i] = 1.0f;
387 m_charmInfo = nullptr;
389 // remove aurastates allowing special moves
390 for (uint8 i = 0; i < MAX_REACTIVE; ++i)
391 m_reactiveTimer[i] = 0;
393 m_cleanupDone = false;
398 _lastLiquid = nullptr;
400 _oldFactionId = 0;
401 _isWalkingBeforeCharm = false;
402 _instantCast = false;
403 _isCombatDisallowed = false;
uint32_t uint32
Definition: Define.h:143
Definition: ObjectGuid.h:38
Definition: ObjectGuid.h:39
Definition: ObjectGuid.h:58
Definition: SharedDefines.h:2439
#define MAX_STATS
Definition: SharedDefines.h:272
Definition: SharedDefines.h:6044
Definition: SharedDefines.h:6790
Definition: SharedDefines.h:2446
Definition: SharedDefines.h:6048
Definition: UnitDefines.h:123
Definition: UnitDefines.h:29
Definition: UnitDefines.h:28
Definition: Unit.h:147
Definition: Unit.h:149
Definition: Unit.h:148
Definition: Unit.h:338
Definition: Unit.h:162
Definition: Unit.h:163
Definition: Unit.h:203
Definition: Unit.h:205
Definition: Unit.h:235
Definition: Unit.h:719
Definition: Unit.h:156
Definition: Unit.h:155
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:427
Definition: MotionMaster.h:97
Definition: MoveSpline.h:52
uint16 m_objectType
Definition: Object.h:385
TypeID GetTypeId() const
Definition: Object.h:171
CreateObjectBits m_updateFlag
Definition: Object.h:388
TypeID m_objectTypeId
Definition: Object.h:387
Definition: SpellHistory.h:47
uint32 m_reactiveTimer[MAX_REACTIVE]
Definition: Unit.h:1992
EnumFlag< SpellAuraInterruptFlags2 > m_interruptMask2
Definition: Unit.h:1971
uint32 m_lastSanctuaryTime
Definition: Unit.h:1634
LiquidTypeEntry const * _lastLiquid
Definition: Unit.h:1999
bool m_canModifyStats
Definition: Unit.h:1976
bool _isCombatDisallowed
Definition: Unit.h:2080
Diminishing m_Diminishing
Definition: Unit.h:2041
uint32 m_regenTimer
Definition: Unit.h:1993
uint32 m_state
Definition: Unit.h:2038
Vehicle * m_vehicle
Definition: Unit.h:1995
float m_weaponDamage[MAX_ATTACK][2]
Definition: Unit.h:1975
uint32 _lastExtraAttackSpell
Definition: Unit.h:2058
bool _instantCast
Definition: Unit.h:2064
ObjectGuid m_ObjectSlot[MAX_GAMEOBJECT_SLOT]
Definition: Unit.h:1548
float m_createStats[MAX_STATS]
Definition: Unit.h:1936
float m_auraFlatModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_FLAT_END]
Definition: Unit.h:1973
float m_modRangedHitChance
Definition: Unit.h:1559
DeathState m_deathState
Definition: Unit.h:1943
uint32 m_unitTypeMask
Definition: Unit.h:1998
uint32 m_removedAurasCount
Definition: Unit.h:1964
uint32 m_movementCounter
Incrementing counter used in movement packets.
Definition: Unit.h:2034
AuraMap::iterator m_auraUpdateIterator
Definition: Unit.h:1963
uint32 m_attackTimer[MAX_ATTACK]
Definition: Unit.h:1565
bool m_ControlledByPlayer
Definition: Unit.h:1934
ThreatManager m_threatManager
Definition: Unit.h:2047
uint32 _oldFactionId
faction before charm
Definition: Unit.h:2066
int32 m_baseSpellCritChance
Definition: Unit.h:1561
Unit * m_charmed
Definition: Unit.h:1986
float m_modMeleeHitChance
Definition: Unit.h:1558
uint32 m_transformSpell
Definition: Unit.h:1956
Vehicle * m_vehicleKit
Definition: Unit.h:1996
bool m_aiLocked
Definition: Unit.h:2054
uint16 _movementAnimKitId
Definition: Unit.h:2072
uint16 _meleeAnimKitId
Definition: Unit.h:2073
bool _playHoverAnim
Definition: Unit.h:2069
float m_floatStatNegBuff[MAX_STATS]
Definition: Unit.h:1938
float m_modAttackSpeedPct[MAX_ATTACK]
Definition: Unit.h:1564
Unit * m_charmer
Definition: Unit.h:1985
bool m_canDualWield
Definition: Unit.h:814
uint16 _aiAnimKitId
Definition: Unit.h:2071
ObjectGuid LastCharmerGUID
Definition: Unit.h:1802
float m_floatStatPosBuff[MAX_STATS]
Definition: Unit.h:1937
int32 m_procDeep
Definition: Unit.h:1945
CombatManager m_combatManager
Definition: Unit.h:2045
float m_speed_rate[MAX_MOVE_TYPE]
Definition: Unit.h:1981
float m_modSpellHitChance
Definition: Unit.h:1560
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT]
Definition: Unit.h:1547
bool m_cleanupDone
Definition: Unit.h:2062
EnumFlag< SpellAuraInterruptFlags > m_interruptMask
Definition: Unit.h:1970
bool _isWalkingBeforeCharm
Are we walking before we were charmed?
Definition: Unit.h:2067
uint32 m_baseAttackSpeed[MAX_ATTACK]
Definition: Unit.h:1563
float m_auraPctModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_PCT_END]
Definition: Unit.h:1974
Definition: Object.h:483
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:606
bool MovementUpdate
Definition: Object.h:84
+ Here is the call graph for this function:

Member Function Documentation

◆ _addAttacker()

void Unit::_addAttacker ( Unit pAttacker)
5507 m_attackers.insert(pAttacker);
+ Here is the caller graph for this function:

◆ _AddAura()

void Unit::_AddAura ( UnitAura aura,
Unit caster 
3196 m_ownedAuras.emplace(aura->GetId(), aura);
3200 if (aura->IsRemoved())
3201 return;
3203 aura->SetIsSingleTarget(caster && aura->GetSpellInfo()->IsSingleTarget());
3204 if (aura->IsSingleTarget())
3205 {
3207 /* @HACK: Player is not in world during loading auras.
3208 * Single target auras are not saved or loaded from database
3209 * but may be created as a result of aura links.
3210 */
3212 // register single target aura
3213 caster->GetSingleCastAuras().push_back(aura);
3215 std::queue<Aura*> aurasSharingLimit;
3216 // remove other single target auras
3217 for (Aura* scAura : caster->GetSingleCastAuras())
3218 if (scAura != aura && scAura->IsSingleTargetWith(aura))
3219 aurasSharingLimit.push(scAura);
3221 uint32 maxOtherAuras = aura->GetSpellInfo()->MaxAffectedTargets - 1;
3222 while (aurasSharingLimit.size() > maxOtherAuras)
3223 {
3224 aurasSharingLimit.front()->Remove();
3225 aurasSharingLimit.pop();
3226 }
3227 }
Definition: SpellAuras.h:123
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:143
bool IsRemoved() const
Definition: SpellAuras.h:209
uint32 GetId() const
Definition: SpellAuras.h:139
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:138
void SetIsSingleTarget(bool val)
Definition: SpellAuras.h:213
bool IsSingleTarget() const
Definition: SpellAuras.h:211
ObjectGuid const & GetGUID() const
Definition: Object.h:158
bool IsInWorld() const
Definition: Object.h:152
uint32 MaxAffectedTargets
Definition: SpellInfo.h:408
bool IsSingleTarget() const
Definition: SpellInfo.cpp:1857
void _RemoveNoStackAurasDueToAura(Aura *aura)
Definition: Unit.cpp:3446
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:1844
AuraList & GetSingleCastAuras()
Definition: Unit.h:1410
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _ApplyAllAuraStatMods()

void Unit::_ApplyAllAuraStatMods ( )
4340 for (AuraApplicationMap::iterator i = m_appliedAuras.begin(); i != m_appliedAuras.end(); ++i)
4341 (*i).second->GetBase()->HandleAllEffects(i->second, AURA_EFFECT_HANDLE_STAT, true);
Definition: SpellAuraDefines.h:54
+ Here is the caller graph for this function:

◆ _ApplyAura()

void Unit::_ApplyAura ( AuraApplication aurApp,
uint32  effMask 
3290 Aura* aura = aurApp->GetBase();
3294 if (aurApp->GetRemoveMode())
3295 return;
3297 // Update target aura state flag
3298 if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState())
3299 {
3300 uint32 aStateMask = (1 << (aState - 1));
3301 // force update so the new caster registers it
3302 if ((aStateMask & PER_CASTER_AURA_STATE_MASK) && *m_unitData->AuraState & aStateMask)
3304 else
3305 ModifyAuraState(aState, true);
3306 }
3308 if (aurApp->GetRemoveMode())
3309 return;
3311 // Sitdown on apply aura req seated
3312 if (aura->GetSpellInfo()->HasAuraInterruptFlag(SpellAuraInterruptFlags::Standing) && !IsSitState())
3315 Unit* caster = aura->GetCaster();
3317 if (aurApp->GetRemoveMode())
3318 return;
3320 aura->HandleAuraSpecificMods(aurApp, caster, true, false);
3322 // apply effects of the aura
3323 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3324 {
3325 if (effMask & 1 << i && (!aurApp->GetRemoveMode()))
3326 aurApp->_HandleEffect(i, true);
3327 }
3329 if (Player* player = ToPlayer())
3330 if (sConditionMgr->IsSpellUsedInSpellClickConditions(aurApp->GetBase()->GetId()))
3331 player->UpdateVisibleGameobjectsOrSpellClicks();
#define sConditionMgr
Definition: ConditionMgr.h:351
Definition: DBCEnums.h:1752
Definition: SharedDefines.h:2482
Definition: SharedDefines.h:2453
Definition: UnitDefines.h:38
void _HandleEffect(uint8 effIndex, bool apply)
Definition: SpellAuras.cpp:154
Aura * GetBase() const
Definition: SpellAuras.h:77
AuraRemoveMode GetRemoveMode() const
Definition: SpellAuras.h:90
Unit * GetCaster() const
Definition: SpellAuras.cpp:511
void HandleAuraSpecificMods(AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
Definition: SpellAuras.cpp:1328
Player * ToPlayer()
Definition: Object.h:201
UF::UpdateFieldHolder m_values
Definition: Object.h:252
void ForceUpdateFieldChange(UF::UpdateFieldSetter< T > const &)
Definition: Object.h:256
Definition: Player.h:1125
AuraStateType GetAuraState() const
Definition: SpellInfo.cpp:2477
bool HasAuraInterruptFlag(SpellAuraInterruptFlags flag) const
Definition: SpellInfo.h:465
MutableFieldReference< T, false > ModifyValue(UpdateField< T, BlockBit, Bit >(Derived::*field))
Definition: UpdateField.h:673
Definition: Unit.h:739
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:10101
UF::UpdateField< UF::UnitData, 0, TYPEID_UNIT > m_unitData
Definition: Unit.h:1900
void ModifyAuraState(AuraStateType flag, bool apply)
Definition: Unit.cpp:5758
bool IsSitState() const
Definition: Unit.cpp:10086
UpdateField< uint32, 32, 47 > AuraState
Definition: UpdateFields.h:310
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _ApplyAuraEffect()

void Unit::_ApplyAuraEffect ( Aura aura,
uint8  effIndex 
3276 ASSERT(aura);
3277 ASSERT(aura->HasEffect(effIndex));
3279 ASSERT(aurApp);
3280 if (!aurApp->GetEffectMask())
3281 _ApplyAura(aurApp, 1 << effIndex);
3282 else
3283 aurApp->_HandleEffect(effIndex, true);
Definition: SpellAuras.h:56
uint32 GetEffectMask() const
Definition: SpellAuras.h:81
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:240
bool HasEffect(uint8 effIndex) const
Definition: SpellAuras.h:229
void _ApplyAura(AuraApplication *aurApp, uint32 effMask)
Definition: Unit.cpp:3288
+ Here is the call graph for this function:

◆ _CreateAuraApplication()

AuraApplication * Unit::_CreateAuraApplication ( Aura aura,
uint32  effMask 
3234 // can't apply aura on unit which is going to be deleted - to not create a memory leak
3237 // just return if the aura has been already removed
3238 // this can happen if OnEffectHitTarget() script hook killed the unit or the aura owner (which can be different)
3239 if (aura->IsRemoved())
3240 {
3241 TC_LOG_ERROR("spells", "Unit::_CreateAuraApplication() called with a removed aura. Check if OnEffectHitTarget() is triggering any spell with apply aura effect (that's not allowed!)\nUnit: {}\nAura: {}", GetDebugInfo(), aura->GetDebugInfo());
3242 return nullptr;
3243 }
3245 // aura mustn't be already applied on target
3246 ASSERT (!aura->IsAppliedOnTarget(GetGUID()) && "Unit::_CreateAuraApplication: aura musn't be applied on target");
3248 SpellInfo const* aurSpellInfo = aura->GetSpellInfo();
3249 uint32 aurId = aurSpellInfo->Id;
3251 // ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
3252 if (!IsAlive() && !aurSpellInfo->IsDeathPersistent() &&
3253 (GetTypeId() != TYPEID_PLAYER || !ToPlayer()->GetSession()->PlayerLoading()))
3254 return nullptr;
3256 Unit* caster = aura->GetCaster();
3258 AuraApplication * aurApp = new AuraApplication(this, caster, aura, effMask);
3259 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3261 if (aurSpellInfo->HasAnyAuraInterruptFlag())
3262 {
3263 m_interruptableAuras.push_back(aurApp);
3264 AddInterruptMask(aurSpellInfo->AuraInterruptFlags, aurSpellInfo->AuraInterruptFlags2);
3265 }
3267 if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState())
3268 m_auraStateAuras.insert(AuraStateAurasMap::value_type(aState, aurApp));
3270 aura->_ApplyForTarget(this, caster, aurApp);
3271 return aurApp;
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
virtual std::string GetDebugInfo() const
Definition: SpellAuras.cpp:2430
bool IsAppliedOnTarget(ObjectGuid guid) const
Definition: SpellAuras.h:242
virtual void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
Definition: SpellAuras.cpp:540
Definition: SpellInfo.h:322
uint32 const Id
Definition: SpellInfo.h:326
EnumFlag< SpellAuraInterruptFlags2 > AuraInterruptFlags2
Definition: SpellInfo.h:374
bool IsDeathPersistent() const
Definition: SpellInfo.cpp:1625
bool HasAnyAuraInterruptFlag() const
Definition: SpellInfo.cpp:1432
EnumFlag< SpellAuraInterruptFlags > AuraInterruptFlags
Definition: SpellInfo.h:373
std::string GetDebugInfo() const override
Definition: Unit.cpp:13698
bool IsAlive() const
Definition: Unit.h:1253
AuraApplicationList m_interruptableAuras
Definition: Unit.h:1968
void AddInterruptMask(SpellAuraInterruptFlags flags, SpellAuraInterruptFlags2 flags2)
Definition: Unit.h:1644
AuraStateAurasMap m_auraStateAuras
Definition: Unit.h:1969
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _DeleteRemovedAuras()

void Unit::_DeleteRemovedAuras ( )
2742 while (!m_removedAuras.empty())
2743 {
2744 delete m_removedAuras.front();
2745 m_removedAuras.pop_front();
2746 }
+ Here is the caller graph for this function:

◆ _EnterVehicle()

void Unit::_EnterVehicle ( Vehicle vehicle,
int8  seatId,
AuraApplication const *  aurApp = nullptr 
12149 // Must be called only from aura handler
12150 ASSERT(aurApp);
12152 if (!IsAlive() || GetVehicleKit() == vehicle || vehicle->GetBase()->IsOnVehicle(this))
12153 return;
12155 if (m_vehicle)
12156 {
12157 if (m_vehicle != vehicle)
12158 {
12159 TC_LOG_DEBUG("entities.vehicle", "EnterVehicle: {} exit {} and enter {}.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry());
12160 ExitVehicle();
12161 }
12162 else if (seatId >= 0 && seatId == GetTransSeat())
12163 return;
12164 else
12165 {
12166 //Exit the current vehicle because unit will reenter in a new seat.
12168 }
12169 }
12171 if (aurApp->GetRemoveMode())
12172 return;
12174 if (Player* player = ToPlayer())
12175 {
12176 if (vehicle->GetBase()->GetTypeId() == TYPEID_PLAYER && player->IsInCombat())
12177 {
12178 vehicle->GetBase()->RemoveAura(const_cast<AuraApplication*>(aurApp));
12179 return;
12180 }
12182 if (vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
12183 {
12184 // If a player entered a vehicle that is part of a formation, remove it from said formation
12185 if (CreatureGroup* creatureGroup = vehicle->GetBase()->ToCreature()->GetFormation())
12186 creatureGroup->RemoveMember(vehicle->GetBase()->ToCreature());
12187 }
12188 }
12190 ASSERT(!m_vehicle);
12191 (void)vehicle->AddVehiclePassenger(this, seatId);
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
Definition: SpellAuraDefines.h:330
Definition: CreatureGroups.h:69
CreatureGroup * GetFormation()
Definition: Creature.h:346
static Creature * ToCreature(Object *o)
Definition: Object.h:205
uint32 GetEntry() const
Definition: Object.h:159
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3692
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3565
bool IsOnVehicle(Unit const *vehicle) const
Definition: Unit.cpp:11486
Vehicle * GetVehicleKit() const
Definition: Unit.h:1805
virtual void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:12226
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:52
bool AddVehiclePassenger(Unit *unit, int8 seatId=-1)
Definition: Vehicle.cpp:420
int8 GetTransSeat() const
Definition: Object.h:739
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _ExitVehicle()

void Unit::_ExitVehicle ( Position const *  exitPosition = nullptr)

It's possible m_vehicle is NULL, when this function is called indirectly from @VehicleJoinEvent::Abort. In that case it was not possible to add the passenger to the vehicle. The vehicle aura has already been removed from the target in the aforementioned function and we don't need to do anything else at this point.

12250 if (!m_vehicle)
12251 return;
12253 // This should be done before dismiss, because there may be some aura removal
12255 Vehicle* vehicle = m_vehicle->RemovePassenger(this);
12257 if (!vehicle)
12258 {
12259 TC_LOG_ERROR("entities.vehicle", "RemovePassenger() couldn't remove current unit from vehicle. Debug info: {}", GetDebugInfo());
12260 return;
12261 }
12263 Player* player = ToPlayer();
12265 // If the player is on mounted duel and exits the mount, he should immediatly lose the duel
12266 if (player && player->duel && player->duel->IsMounted)
12267 player->DuelComplete(DUEL_FLED);
12273 if (player)
12274 player->SetFallInformation(0, GetPositionZ());
12276 Position pos;
12277 // If we ask for a specific exit position, use that one. Otherwise allow scripts to modify it
12278 if (exitPosition)
12279 pos = *exitPosition;
12280 else
12281 {
12282 // Set exit position to vehicle position and use the current orientation
12283 pos = vehicle->GetBase()->GetPosition();
12286 // Change exit position based on seat entry addon data
12287 if (seatAddon)
12288 {
12289 if (seatAddon->ExitParameter == VehicleExitParameters::VehicleExitParamOffset)
12290 pos.RelocateOffset({ seatAddon->ExitParameterX, seatAddon->ExitParameterY, seatAddon->ExitParameterZ, seatAddon->ExitParameterO });
12291 else if (seatAddon->ExitParameter == VehicleExitParameters::VehicleExitParamDest)
12292 pos.Relocate({ seatAddon->ExitParameterX, seatAddon->ExitParameterY, seatAddon->ExitParameterZ, seatAddon->ExitParameterO });
12293 }
12294 }
12296 std::function<void(Movement::MoveSplineInit&)> initializer = [=, this, vehicleCollisionHeight = vehicle->GetBase()->GetCollisionHeight()](Movement::MoveSplineInit& init)
12297 {
12298 float height = pos.GetPositionZ() + vehicleCollisionHeight;
12300 // Creatures without inhabit type air should begin falling after exiting the vehicle
12301 if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + vehicleCollisionHeight, &height))
12302 init.SetFall();
12304 init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false);
12305 init.SetFacing(pos.GetOrientation());
12306 init.SetTransportExit();
12307 };
12310 if (player)
12313 if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION) && vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
12314 if (((Minion*)vehicle->GetBase())->GetOwner() == this)
12315 vehicle->GetBase()->ToCreature()->DespawnOrUnsummon(vehicle->GetDespawnDelay());
12318 {
12319 // Vehicle just died, we die too
12320 if (vehicle->GetBase()->getDeathState() == JUST_DIED)
12322 // If for other reason we as minion are exiting the vehicle (ejected, master dismounted) - unsummon
12323 else
12324 ToTempSummon()->UnSummon(2000); // Approximation
12325 }
Definition: MovementDefines.h:62
Definition: SharedDefines.h:6062
Definition: SharedDefines.h:6483
Definition: Unit.h:348
Definition: Unit.h:340
Definition: Unit.h:236
Definition: Unit.h:254
Definition: Unit.h:264
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2334
float GetWaterOrGroundLevel(PhaseShift const &phaseShift, float x, float y, float z, float *ground=nullptr, bool swim=false, float collisionHeight=2.03128f)
Definition: Map.cpp:1742
Definition: TemporarySummon.h:83
void LaunchMoveSpline(std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE)
Definition: MotionMaster.cpp:1119
Definition: MoveSplineInit.h:47
void DuelComplete(DuelCompleteType type)
Definition: Player.cpp:7664
void SetFallInformation(uint32 time, float z)
Definition: Player.cpp:26106
std::unique_ptr< DuelInfo > duel
Definition: Player.h:1975
void ResummonPetTemporaryUnSummonedIfAny()
Definition: Player.cpp:26576
virtual void UnSummon(uint32 msTime=0)
Definition: TemporarySummon.cpp:315
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:10917
float GetCollisionHeight() const override
Definition: Unit.cpp:13672
virtual bool CanFly() const =0
MotionMaster * GetMotionMaster()
Definition: Unit.h:1741
TempSummon * ToTempSummon()
Definition: Unit.h:1852
void AddUnitState(uint32 f)
Definition: Unit.h:841
DeathState getDeathState() const
Definition: Unit.h:1256
uint32 HasUnitTypeMask(uint32 mask) const
Definition: Unit.h:846
virtual void setDeathState(DeathState s)
Definition: Unit.cpp:8391
Definition: Vehicle.h:31
Vehicle * RemovePassenger(WorldObject *passenger) override
Removes the passenger from the vehicle.
Definition: Vehicle.cpp:491
VehicleSeatAddon const * GetSeatAddonForSeatOfPassenger(Unit const *passenger) const
Gets the vehicle seat addon data for the seat of a passenger.
Definition: Vehicle.cpp:354
Milliseconds GetDespawnDelay()
Definition: Vehicle.cpp:959
Map * GetMap() const
Definition: Object.h:611
PhaseShift & GetPhaseShift()
Definition: Object.h:513
Definition: Position.h:28
float GetPositionZ() const
Definition: Position.h:79
float GetOrientation() const
Definition: Position.h:80
void SetOrientation(float orientation)
Definition: Position.h:72
float GetPositionX() const
Definition: Position.h:77
void GetPosition(float &x, float &y) const
Definition: Position.h:82
float GetPositionY() const
Definition: Position.h:78
void RelocateOffset(Position const &offset)
Definition: Position.cpp:34
void Relocate(float x, float y)
Definition: Position.h:64
Definition: VehicleDefines.h:104
float ExitParameterO
Definition: VehicleDefines.h:114
float ExitParameterX
Definition: VehicleDefines.h:111
float ExitParameterY
Definition: VehicleDefines.h:112
float ExitParameterZ
Definition: VehicleDefines.h:113
VehicleExitParameters ExitParameter
Definition: VehicleDefines.h:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _RegisterAreaTrigger()

void Unit::_RegisterAreaTrigger ( AreaTrigger areaTrigger)
5199 m_areaTrigger.push_back(areaTrigger);
5200 if (GetTypeId() == TYPEID_UNIT && IsAIEnabled())
5201 ToCreature()->AI()->JustRegisteredAreaTrigger(areaTrigger);
virtual void JustRegisteredAreaTrigger(AreaTrigger *)
Definition: CreatureAI.h:123
CreatureAI * AI() const
Definition: Creature.h:183
Creature * ToCreature()
Definition: Object.h:207
AreaTriggerList m_areaTrigger
Definition: Unit.h:1954
bool IsAIEnabled() const
Definition: Unit.h:768
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _RegisterAuraEffect()

void Unit::_RegisterAuraEffect ( AuraEffect aurEff,
bool  apply 
3481 if (apply)
3482 m_modAuras[aurEff->GetAuraType()].push_back(aurEff);
3483 else
3484 m_modAuras[aurEff->GetAuraType()].remove(aurEff);
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
AuraEffectList m_modAuras[TOTAL_AURAS]
Definition: Unit.h:1966
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _RegisterDynObject()

void Unit::_RegisterDynObject ( DynamicObject dynObj)
5032 m_dynObj.push_back(dynObj);
5033 if (GetTypeId() == TYPEID_UNIT && IsAIEnabled())
virtual void JustRegisteredDynObject(DynamicObject *)
Definition: CreatureAI.h:119
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _RemoveAllAuraStatMods()

void Unit::_RemoveAllAuraStatMods ( )
4334 for (AuraApplicationMap::iterator i = m_appliedAuras.begin(); i != m_appliedAuras.end(); ++i)
4335 (*i).second->GetBase()->HandleAllEffects(i->second, AURA_EFFECT_HANDLE_STAT, false);
+ Here is the caller graph for this function:

◆ _removeAttacker()

void Unit::_removeAttacker ( Unit pAttacker)
5512 m_attackers.erase(pAttacker);
+ Here is the caller graph for this function:

◆ _RemoveNoStackAurasDueToAura()

void Unit::_RemoveNoStackAurasDueToAura ( Aura aura)
3448 SpellInfo const* spellProto = aura->GetSpellInfo();
3450 // passive spell special case (only non stackable with ranks)
3451 if (spellProto->IsPassiveStackableWithRanks())
3452 return;
3454 if (!IsHighestExclusiveAura(aura))
3455 {
3456 aura->Remove();
3457 return;
3458 }
3460 bool remove = false;
3461 for (AuraApplicationMap::iterator i = m_appliedAuras.begin(); i != m_appliedAuras.end(); ++i)
3462 {
3463 if (remove)
3464 {
3465 remove = false;
3466 i = m_appliedAuras.begin();
3467 }
3469 if (aura->CanStackWith(i->second->GetBase()))
3470 continue;
3473 if (i == m_appliedAuras.end())
3474 break;
3475 remove = true;
3476 }
Definition: SpellAuraDefines.h:65
bool CanStackWith(Aura const *existingAura) const
Definition: SpellAuras.cpp:1578
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
bool IsPassiveStackableWithRanks() const
Definition: SpellInfo.cpp:1600
bool IsHighestExclusiveAura(Aura const *aura, bool removeOtherAuraApplications=false)
Definition: Unit.cpp:13463
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _TryStackingOrRefreshingExistingAura()

Aura * Unit::_TryStackingOrRefreshingExistingAura ( AuraCreateInfo createInfo)
3135 ASSERT(!createInfo.CasterGUID.IsEmpty() || createInfo.Caster);
3137 // Check if these can stack anyway
3138 if (!createInfo.CasterGUID && !createInfo.GetSpellInfo()->IsStackableOnOneSlotWithDifferentCasters())
3139 createInfo.CasterGUID = createInfo.Caster->GetGUID();
3141 // passive and Incanter's Absorption and auras with different type can stack with themselves any number of times
3142 if (!createInfo.GetSpellInfo()->IsMultiSlotAura())
3143 {
3144 // check if cast item changed
3145 ObjectGuid castItemGUID = createInfo.CastItemGUID;
3147 // find current aura from spell and change it's stackamount, or refresh it's duration
3148 if (Aura* foundAura = GetOwnedAura(createInfo.GetSpellInfo()->Id, createInfo.GetSpellInfo()->IsStackableOnOneSlotWithDifferentCasters() ? ObjectGuid::Empty : createInfo.CasterGUID, createInfo.GetSpellInfo()->HasAttribute(SPELL_ATTR0_CU_ENCHANT_PROC) ? castItemGUID : ObjectGuid::Empty, 0))
3149 {
3150 // effect masks do not match
3151 // extremely rare case
3152 // let's just recreate aura
3153 if (createInfo.GetAuraEffectMask() != foundAura->GetEffectMask())
3154 return nullptr;
3156 // update basepoints with new values - effect amount will be recalculated in ModStackAmount
3157 for (SpellEffectInfo const& spellEffectInfo : createInfo.GetSpellInfo()->GetEffects())
3158 {
3159 AuraEffect const* auraEff = foundAura->GetEffect(spellEffectInfo.EffectIndex);
3160 if (!auraEff)
3161 continue;
3163 int32 bp;
3164 if (createInfo.BaseAmount)
3165 bp = *(createInfo.BaseAmount + spellEffectInfo.EffectIndex);
3166 else
3167 bp = spellEffectInfo.BasePoints;
3169 int32* oldBP = const_cast<int32*>(&(auraEff->m_baseAmount)); // todo 6.x review GetBaseAmount and GetCastItemGUID in this case
3170 *oldBP = bp;
3171 }
3173 // correct cast item guid if needed
3174 if (castItemGUID != foundAura->GetCastItemGUID())
3175 {
3176 ObjectGuid* oldGUID = const_cast<ObjectGuid*>(&foundAura->m_castItemGuid);
3177 *oldGUID = castItemGUID;
3178 uint32* oldItemId = const_cast<uint32*>(&foundAura->m_castItemId);
3179 *oldItemId = createInfo.CastItemId;
3180 int32* oldItemLevel = const_cast<int32*>(&foundAura->m_castItemLevel);
3181 *oldItemLevel = createInfo.CastItemLevel;
3182 }
3184 // try to increase stack amount
3185 foundAura->ModStackAmount(1, AURA_REMOVE_BY_DEFAULT, createInfo.ResetPeriodicTimer);
3186 return foundAura;
3187 }
3188 }
3190 return nullptr;
int32_t int32
Definition: Define.h:139
Definition: SpellInfo.h:148
Definition: SpellAuraEffects.h:29
int32 const m_baseAmount
Definition: SpellAuraEffects.h:114
Definition: ObjectGuid.h:258
static ObjectGuid const Empty
Definition: ObjectGuid.h:264
bool IsEmpty() const
Definition: ObjectGuid.h:309
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:157
Definition: SpellInfo.h:213
bool IsStackableOnOneSlotWithDifferentCasters() const
Definition: SpellInfo.cpp:1610
bool IsMultiSlotAura() const
Definition: SpellInfo.cpp:1605
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:445
std::vector< SpellEffectInfo > const & GetEffects() const
Definition: SpellInfo.h:573
Aura * GetOwnedAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, Aura *except=nullptr) const
Definition: Unit.cpp:3549
Unit * Caster
Definition: SpellAuraDefines.h:706
ObjectGuid CasterGUID
Definition: SpellAuraDefines.h:705
int32 const * BaseAmount
Definition: SpellAuraDefines.h:707
ObjectGuid CastItemGUID
Definition: SpellAuraDefines.h:708
uint32 CastItemId
Definition: SpellAuraDefines.h:709
int32 CastItemLevel
Definition: SpellAuraDefines.h:710
uint32 GetAuraEffectMask() const
Definition: SpellAuraDefines.h:703
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraDefines.h:702
bool ResetPeriodicTimer
Definition: SpellAuraDefines.h:712
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _UnapplyAura() [1/2]

void Unit::_UnapplyAura ( AuraApplication aurApp,
AuraRemoveMode  removeMode 
3427 // aura can be removed from unit only if it's applied on it, shouldn't happen
3428 ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
3430 uint32 spellId = aurApp->GetBase()->GetId();
3431 AuraApplicationMapBoundsNonConst range = m_appliedAuras.equal_range(spellId);
3433 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3434 {
3435 if (iter->second == aurApp)
3436 {
3437 _UnapplyAura(iter, removeMode);
3438 return;
3439 }
3440 else
3441 ++iter;
3442 }
3443 ABORT();
#define ABORT
Definition: Errors.h:74
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
Definition: Unit.h:751
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
Definition: Unit.cpp:3335
+ Here is the call graph for this function:

◆ _UnapplyAura() [2/2]

void Unit::_UnapplyAura ( AuraApplicationMap::iterator &  i,
AuraRemoveMode  removeMode 
3337 AuraApplication * aurApp = i->second;
3338 ASSERT(aurApp);
3339 ASSERT(!aurApp->GetRemoveMode());
3340 ASSERT(aurApp->GetTarget() == this);
3342 aurApp->SetRemoveMode(removeMode);
3343 Aura* aura = aurApp->GetBase();
3344 TC_LOG_DEBUG("spells", "Aura {} now is remove mode {}", aura->GetId(), removeMode);
3346 // dead loop is killing the server probably
3347 ASSERT(m_removedAurasCount < 0xFFFFFFFF);
3351 Unit* caster = aura->GetCaster();
3353 // Remove all pointers from lists here to prevent possible pointer invalidation on spellcast/auraapply/auraremove
3354 m_appliedAuras.erase(i);
3357 {
3358 m_interruptableAuras.remove(aurApp);
3360 }
3362 bool auraStateFound = false;
3363 AuraStateType auraState = aura->GetSpellInfo()->GetAuraState();
3364 if (auraState)
3365 {
3366 bool canBreak = false;
3367 // Get mask of all aurastates from remaining auras
3368 for (AuraStateAurasMap::iterator itr = m_auraStateAuras.lower_bound(auraState); itr != m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
3369 {
3370 if (itr->second == aurApp)
3371 {
3372 m_auraStateAuras.erase(itr);
3373 itr = m_auraStateAuras.lower_bound(auraState);
3374 canBreak = true;
3375 continue;
3376 }
3377 auraStateFound = true;
3378 ++itr;
3379 }
3380 }
3382 aurApp->_Remove();
3383 aura->_UnapplyForTarget(this, caster, aurApp);
3385 // remove effects of the spell - needs to be done after removing aura from lists
3386 for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr)
3387 {
3388 if (aurApp->HasEffect(itr))
3389 aurApp->_HandleEffect(itr, false);
3390 }
3392 // all effect mustn't be applied
3393 ASSERT(!aurApp->GetEffectMask());
3395 // Remove totem at next update if totem loses its aura
3396 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && IsTotem())
3397 {
3398 if (ToTotem()->GetSpell() == aura->GetId() && ToTotem()->GetTotemType() == TOTEM_PASSIVE)
3400 }
3402 // Remove aurastates only if needed and were not found
3403 if (auraState)
3404 {
3405 if (!auraStateFound)
3406 ModifyAuraState(auraState, false);
3407 else
3408 {
3409 // update for casters, some shouldn't 'see' the aura state
3410 uint32 aStateMask = (1 << (auraState - 1));
3411 if ((aStateMask & PER_CASTER_AURA_STATE_MASK) != 0)
3413 }
3414 }
3416 aura->HandleAuraSpecificMods(aurApp, caster, false, false);
3418 if (Player* player = ToPlayer())
3419 if (sConditionMgr->IsSpellUsedInSpellClickConditions(aurApp->GetBase()->GetId()))
3420 player->UpdateVisibleGameobjectsOrSpellClicks();
3422 i = m_appliedAuras.begin();
Definition: SpellAuraDefines.h:69
Definition: Totem.h:25
Unit * GetTarget() const
Definition: SpellAuras.h:76
void SetRemoveMode(AuraRemoveMode mode)
Definition: SpellAuras.h:89
void _Remove()
Definition: SpellAuras.cpp:98
bool HasEffect(uint8 effect) const
Definition: SpellAuras.h:82
virtual void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
Definition: SpellAuras.cpp:560
void setDeathState(DeathState s) override
Definition: TemporarySummon.cpp:411
Totem * ToTotem()
Definition: Unit.h:1849
void UpdateInterruptMask()
Definition: Unit.cpp:678
bool IsTotem() const
Definition: Unit.h:852
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _UnregisterAreaTrigger()

void Unit::_UnregisterAreaTrigger ( AreaTrigger areaTrigger)
5206 m_areaTrigger.erase(std::remove(m_areaTrigger.begin(), m_areaTrigger.end(), areaTrigger));
5207 if (GetTypeId() == TYPEID_UNIT && IsAIEnabled())
5208 ToCreature()->AI()->JustUnregisteredAreaTrigger(areaTrigger);
virtual void JustUnregisteredAreaTrigger(AreaTrigger *)
Definition: CreatureAI.h:124
+ Here is the call graph for this function:

◆ _UnregisterDynObject()

void Unit::_UnregisterDynObject ( DynamicObject dynObj)
5039 m_dynObj.remove(dynObj);
5040 if (GetTypeId() == TYPEID_UNIT && IsAIEnabled())
virtual void JustUnregisteredDynObject(DynamicObject *)
Definition: CreatureAI.h:120
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _UpdateAutoRepeatSpell()

void Unit::_UpdateAutoRepeatSpell ( )
2814 SpellInfo const* autoRepeatSpellInfo = m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo;
2816 // check "realtime" interrupts
2817 // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect
2818 if ((isMoving() && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->CheckMovement() != SPELL_CAST_OK) || IsNonMeleeSpellCast(false, false, true, autoRepeatSpellInfo->Id == 75))
2819 {
2820 // cancel wand shoot
2821 if (autoRepeatSpellInfo->Id != 75)
2823 return;
2824 }
2826 // castroutine
2828 {
2829 // Check if able to cast
2831 if (result != SPELL_CAST_OK)
2832 {
2833 if (autoRepeatSpellInfo->Id != 75)
2835 else if (GetTypeId() == TYPEID_PLAYER)
2836 Spell::SendCastResult(ToPlayer(), autoRepeatSpellInfo, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_SpellVisual, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_castId, result);
2838 return;
2839 }
2841 // we want to shoot
2842 Spell* spell = new Spell(this, autoRepeatSpellInfo, TRIGGERED_IGNORE_GCD);
2844 }
Definition: SharedDefines.h:6789
Definition: SharedDefines.h:1439
Definition: SharedDefines.h:1762
Not triggered.
Definition: SpellDefines.h:242
Definition: Spell.h:219
Definition: Unit.h:581
Definition: Spell.h:239
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
Definition: Spell.cpp:4526
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
Definition: Spell.cpp:3291
SpellCastResult CheckCast(bool strict, int32 *param1=nullptr, int32 *param2=nullptr)
Definition: Spell.cpp:5437
SpellInfo const *const m_spellInfo
Definition: Spell.h:543
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:2965
bool isMoving() const
Definition: Unit.h:1825
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:800
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:2923
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _UpdateSpells()

void Unit::_UpdateSpells ( uint32  time)