All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Unit Class Referenceabstract

#include <Unit.h>

Public Types

typedef std::set< Unit * > AttackerSet
typedef std::set< Unit * > ControlList
typedef std::multimap< uint32,
Aura * > 
typedef std::pair
< AuraMap::const_iterator,
AuraMap::const_iterator > 
typedef std::pair
< AuraMap::iterator,
AuraMap::iterator > 
typedef std::multimap< uint32,
AuraApplication * > 
typedef std::pair
< AuraApplicationMap::const_iterator,
AuraApplicationMap::const_iterator > 
typedef std::pair
< AuraApplicationMap::iterator,
AuraApplicationMap::iterator > 
typedef std::multimap
< AuraStateType,
AuraApplication * > 
typedef std::pair
< AuraStateAurasMap::const_iterator,
AuraStateAurasMap::const_iterator > 
typedef std::list< AuraEffect * > AuraEffectList
typedef std::list< Aura * > AuraList
typedef std::list
< AuraApplication * > 
typedef std::list
< DiminishingReturn
typedef std::map< uint8,
AuraApplication * > 
typedef std::set< PetAura const * > PetAuraSet

Public Member Functions

virtual ~Unit ()
UnitAIGetAI ()
void SetAI (UnitAI *newAI)
void AddToWorld () override
void RemoveFromWorld () override
void CleanupBeforeRemoveFromMap (bool finalCleanup)
void CleanupsBeforeDelete (bool finalCleanup=true) override
void SendCombatLogMessage (WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
DiminishingLevels GetDiminishing (DiminishingGroup group)
void IncrDiminishing (DiminishingGroup group)
float ApplyDiminishingToDuration (DiminishingGroup group, int32 &duration, Unit *caster, DiminishingLevels Level, int32 limitduration)
void ApplyDiminishingAura (DiminishingGroup group, bool apply)
void ClearDiminishings ()
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
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
float GetMeleeReach () const
bool IsWithinCombatRange (const Unit *obj, float dist2compare) const
bool IsWithinMeleeRange (const Unit *obj, float dist=MELEE_RANGE) const
void GetRandomContactPoint (const Unit *target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
void _addAttacker (Unit *pAttacker)
void _removeAttacker (Unit *pAttacker)
UnitgetAttackerForHelper () const
bool Attack (Unit *victim, bool meleeAttack)
void MustReacquireTarget ()
void CastStop (uint32 except_spellid=0)
bool AttackStop ()
void RemoveAllAttackers ()
AttackerSet constgetAttackers () const
bool isAttackingPlayer () const
UnitGetVictim () const
UnitEnsureVictim () const
void CombatStop (bool includingCast=false)
void CombatStopWithPets (bool includingCast=false)
void StopAttackFaction (uint32 faction_id)
UnitSelectNearbyTarget (Unit *exclude=NULL, float dist=NOMINAL_MELEE_RANGE) const
void SendMeleeAttackStop (Unit *victim=NULL)
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)
uint8 getRace () const
uint32 getRaceMask () const
uint8 getClass () const
uint32 getClassMask () const
uint8 getGender () const
float GetStat (Stats stat) const
void SetStat (Stats stat, int32 val)
uint32 GetArmor () const
void SetArmor (int32 val)
uint32 GetResistance (SpellSchools school) const
uint32 GetResistance (SpellSchoolMask mask) const
void SetResistance (SpellSchools school, int32 val)
uint32 GetHealth () const
uint32 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
uint32 CountPctFromMaxHealth (int32 pct) const
uint32 CountPctFromCurHealth (int32 pct) const
void SetHealth (uint32 val)
void SetMaxHealth (uint32 val)
void SetFullHealth ()
int32 ModifyHealth (int32 val)
int32 GetHealthGain (int32 dVal)
Powers getPowerType () const
void setPowerType (Powers power)
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)
void SetMaxPower (Powers power, int32 val)
int32 ModifyPower (Powers power, int32 val)
int32 ModifyPowerPct (Powers power, float pct, bool apply=true)
uint32 GetAttackTime (WeaponAttackType att) const
void SetAttackTime (WeaponAttackType att, uint32 val)
void ApplyAttackTimePercentMod (WeaponAttackType att, float val, bool apply)
void ApplyCastTimePercentMod (float val, bool apply)
SheathState GetSheath () const
virtual void SetSheath (SheathState sheathed)
uint32 getFaction () const
void setFaction (uint32 faction)
FactionTemplateEntry constGetFactionTemplateEntry () const
ReputationRank GetReactionTo (Unit const *target) const
bool IsHostileTo (Unit const *unit) const
bool IsHostileToPlayers () const
bool IsFriendlyTo (Unit const *unit) const
bool IsNeutralToAll () const
bool IsInPartyWith (Unit const *unit) const
bool IsInRaidWith (Unit const *unit) const
void GetPartyMembers (std::list< Unit * > &units)
bool IsContestedGuard () const
bool IsPvP () const
bool IsFFAPvP () const
virtual void SetPvP (bool state)
uint32 GetCreatureType () const
uint32 GetCreatureTypeMask () const
UnitStandStateType GetStandState () const
bool IsSitState () const
bool IsStandState () const
void SetStandState (UnitStandStateType state, uint32 animKitID=0)
void SetStandFlags (uint8 flags)
void RemoveStandFlags (uint8 flags)
bool IsMounted () const
uint32 GetMountID () const
void Mount (uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
void Dismount ()
MountCapabilityEntry constGetMountCapability (uint32 mountType) const
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=NULL) const
void DealDamageMods (Unit *victim, uint32 &damage, uint32 *absorb)
uint32 DealDamage (Unit *victim, uint32 damage, CleanDamage const *cleanDamage=NULL, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=NULL, bool durabilityLoss=true)
void Kill (Unit *victim, bool durabilityLoss=true)
void KillSelf (bool durabilityLoss=true)
int32 DealHeal (Unit *victim, uint32 addhealth)
void ProcDamageAndSpell (Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=BASE_ATTACK, SpellInfo const *procSpell=NULL, SpellInfo const *procAura=NULL)
void ProcDamageAndSpellFor (bool isVictim, Unit *target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const *procSpell, uint32 damage, SpellInfo const *procAura=NULL)
void GetProcAurasTriggeredOnEvent (AuraApplicationList &aurasTriggeringProc, AuraApplicationList *procAuras, ProcEventInfo eventInfo)
void TriggerAurasProcOnEvent (CalcDamageInfo &damageInfo)
void TriggerAurasProcOnEvent (AuraApplicationList *myProcAuras, AuraApplicationList *targetProcAuras, Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
void TriggerAurasProcOnEvent (ProcEventInfo &eventInfo, AuraApplicationList &procAuras)
void HandleEmoteCommand (uint32 anim_id)
void AttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
void CalculateMeleeDamage (Unit *victim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK)
void DealMeleeDamage (CalcDamageInfo *damageInfo, bool durabilityLoss)
void HandleProcExtraAttackFor (Unit *victim)
void CalculateSpellDamageTaken (SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
void DealSpellDamage (SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
uint32 GetDamageReduction (uint32 damage) const
void ApplyResilience (Unit const *victim, int32 *damage) const
float MeleeSpellMissChance (Unit const *victim, WeaponAttackType attType, uint32 spellId) const
SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellInfo const *spellInfo)
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellInfo const *spellInfo)
SpellMissInfo SpellHitResult (Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
float GetUnitDodgeChanceAgainst (Unit const *attacker) const
float GetUnitParryChanceAgainst (Unit const *attacker) const
float GetUnitBlockChanceAgainst (Unit const *attacker) const
float GetUnitMissChance (WeaponAttackType attType) const
float GetUnitCriticalChance (WeaponAttackType attackType, const Unit *victim) const
int32 GetMechanicResistChance (SpellInfo const *spellInfo) const
bool CanUseAttackType (uint8 attacktype) const
virtual uint32 GetBlockPercent () const
float GetWeaponProcChance () const
float GetPPMProcChance (uint32 WeaponSpeed, float PPM, const SpellInfo *spellProto) const
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const *victim, WeaponAttackType attType) const
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 IsServiceProvider () const
bool IsSpiritService () const
bool IsCritter () const
bool IsInFlight () const
bool IsInCombat () const
bool IsInCombatWith (Unit const *who) const
void CombatStart (Unit *target, bool initialAggro=true)
void SetInCombatState (bool PvP, Unit *enemy=NULL)
void SetInCombatWith (Unit *enemy)
void ClearInCombat ()
uint32 GetCombatTimer () const
bool HasAuraTypeWithFamilyFlags (AuraType auraType, uint32 familyName, uint32 familyFlags) const
virtual bool HasSpell (uint32) const
bool HasBreakableByDamageAuraType (AuraType type, uint32 excludeAura=0) const
bool HasBreakableByDamageCrowdControlAura (Unit *excludeCasterChannel=NULL) const
bool HasStealthAura () const
bool HasInvisibilityAura () const
bool isFeared () const
bool isInRoots () const
bool IsPolymorphed () const
bool isFrozen () const
bool isTargetableForAttack (bool checkFakeDeath=true) const
bool IsValidAttackTarget (Unit const *target) const
bool _IsValidAttackTarget (Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=NULL) const
bool IsValidAssistTarget (Unit const *target) const
bool _IsValidAssistTarget (Unit const *target, SpellInfo const *bySpell) const
virtual bool IsInWater () const
virtual bool IsUnderWater () const
virtual void UpdateUnderwaterState (Map *m, float x, float y, float z)
bool isInAccessiblePlaceFor (Creature const *c) const
void SendHealSpellLog (Unit *victim, uint32 spellID, uint32 health, uint32 overHeal, uint32 absorbed, bool crit=false)
int32 HealBySpell (Unit *victim, SpellInfo const *spellInfo, uint32 addHealth, bool critical=false)
void SendEnergizeSpellLog (Unit *victim, uint32 spellID, int32 damage, Powers powertype)
void EnergizeBySpell (Unit *victim, uint32 SpellID, int32 Damage, Powers powertype)
void CastSpell (SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastSpell (Unit *victim, uint32 spellId, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastSpell (Unit *victim, uint32 spellId, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastSpell (Unit *victim, SpellInfo const *spellInfo, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastSpell (Unit *victim, SpellInfo const *spellInfo, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastSpell (float x, float y, float z, uint32 spellId, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastSpell (GameObject *go, uint32 spellId, bool triggered, Item *castItem=NULL, AuraEffect *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastCustomSpell (Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastCustomSpell (uint32 spellId, SpellValueMod mod, int32 value, Unit *victim, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastCustomSpell (uint32 spellId, SpellValueMod mod, int32 value, Unit *victim=NULL, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
void CastCustomSpell (uint32 spellId, CustomSpellValues const &value, Unit *victim=NULL, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
AuraAddAura (uint32 spellId, Unit *target)
AuraAddAura (SpellInfo const *spellInfo, uint32 effMask, Unit *target)
void SetAuraStack (uint32 spellId, Unit *target, uint32 stack)
void SendPlaySpellVisualKit (uint32 id, uint32 type)
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 SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
void SendSpellDamageResist (Unit *target, uint32 spellId)
void SendSpellDamageImmune (Unit *target, uint32 spellId, bool isPeriodic)
void NearTeleportTo (float x, float y, float z, float orientation, bool casting=false)
void SendTeleportPacket (Position &pos)
virtual bool UpdatePosition (float x, float y, float z, float ang, bool teleport=false)
virtual bool UpdatePosition (const Position &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 (float x, float y, float speedXY, float speedZ)
void JumpTo (float speedXY, float speedZ, bool forward=true)
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)
void SendSetPlayHoverAnim (bool enable)
bool IsLevitating () const
bool IsWalking () const
bool IsHovering () const
bool SetWalk (bool enable)
bool SetDisableGravity (bool disable, bool packetOnly=false)
bool SetFall (bool enable)
bool SetSwim (bool enable)
bool SetCanFly (bool enable)
bool SetWaterWalking (bool enable, bool packetOnly=false)
bool SetFeatherFall (bool enable, bool packetOnly=false)
bool SetHover (bool enable, bool packetOnly=false)
bool SetCollision (bool disable)
void SendSetVehicleRecId (uint32 vehicleId)
void SetInFront (WorldObject const *target)
void SetFacingTo (float ori)
void SetFacingToObject (WorldObject const *object)
void SendChangeCurrentVictimOpcode (HostileReference *pHostileReference)
void SendClearThreatListOpcode ()
void SendRemoveFromThreatListOpcode (HostileReference *pHostileReference)
void SendThreatListUpdate ()
void SendClearTarget ()
bool IsAlive () const
bool isDying () const
bool isDead () const
DeathState getDeathState () const
virtual void setDeathState (DeathState s)
ObjectGuid GetOwnerGUID () const
void SetOwnerGUID (ObjectGuid owner)
ObjectGuid GetCreatorGUID () const
void SetCreatorGUID (ObjectGuid creator)
ObjectGuid GetMinionGUID () const
void SetMinionGUID (ObjectGuid guid)
ObjectGuid GetCharmerGUID () const
void SetCharmerGUID (ObjectGuid owner)
ObjectGuid GetCharmGUID () const
void SetPetGUID (ObjectGuid guid)
ObjectGuid GetPetGUID () const
void SetCritterGUID (ObjectGuid guid)
ObjectGuid GetCritterGUID () const
bool IsControlledByPlayer () const
ObjectGuid GetCharmerOrOwnerGUID () const
ObjectGuid GetCharmerOrOwnerOrOwnGUID () const
bool IsCharmedOwnedByPlayerOrPlayer () const
PlayerGetSpellModOwner () const
UnitGetOwner () const
GuardianGetGuardianPet () const
MinionGetFirstMinion () const
UnitGetCharmer () const
UnitGetCharm () const
UnitGetCharmerOrOwner () const
UnitGetCharmerOrOwnerOrSelf () const
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
PlayerGetAffectingPlayer () 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=NULL)
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 UpdateCharmAI ()
SharedVisionList constGetSharedVisionList ()
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)
Aura_TryStackingOrRefreshingExistingAura (SpellInfo const *newAura, uint32 effMask, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, ObjectGuid casterGUID=ObjectGuid::Empty, int32 castItemLevel=-1)
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 _RemoveNoStackAuraApplicationsDueToAura (Aura *aura)
void _RemoveNoStackAurasDueToAura (Aura *aura)
bool _IsNoStackAuraDueToAura (Aura *appliedAura, Aura *existingAura) const
void _RegisterAuraEffect (AuraEffect *aurEff, bool apply)
AuraMapGetOwnedAuras ()
AuraMap constGetOwnedAuras () 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=NULL) const
AuraApplicationMapGetAppliedAuras ()
AuraApplicationMap constGetAppliedAuras () 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)
void RemoveOwnedAuras (std::function< bool(Aura const *)> const &check)
void RemoveAppliedAuras (uint32 spellId, std::function< bool(AuraApplication const *)> const &check)
void RemoveOwnedAuras (uint32 spellId, std::function< bool(Aura const *)> const &check)
void RemoveAurasByType (AuraType auraType, std::function< bool(AuraApplication const *)> const &check)
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)
void RemoveAurasDueToSpellByDispel (uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit *dispeller, uint8 chargesRemoved=1)
void RemoveAurasDueToSpellBySteal (uint32 spellId, ObjectGuid casterGUID, Unit *stealer)
void RemoveAurasDueToItemSpell (uint32 spellId, ObjectGuid castItemGuid)
void RemoveAurasByType (AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=NULL, bool negative=true, bool positive=true)
void RemoveNotOwnSingleTargetAuras (uint32 newPhase=0x0, bool phaseid=false)
void RemoveAurasWithInterruptFlags (uint32 flag, uint32 except=0)
void RemoveAurasWithAttribute (uint32 flags)
void RemoveAurasWithFamily (SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID)
void RemoveAurasWithMechanic (uint32 mechanic_mask, AuraRemoveMode removemode=AURA_REMOVE_BY_DEFAULT, uint32 except=0)
void RemoveMovementImpairingAuras ()
void RemoveAreaAurasDueToLeaveWorld ()
void RemoveAllAuras ()
void RemoveArenaAuras ()
void RemoveAllAurasOnDeath ()
void RemoveAllAurasRequiringDeadTarget ()
void RemoveAllAurasExceptType (AuraType type)
void RemoveAllAurasExceptType (AuraType type1, AuraType type2)
void DelayOwnedAuras (uint32 spellId, ObjectGuid caster, int32 delaytime)
void _RemoveAllAuraStatMods ()
void _ApplyAllAuraStatMods ()
AuraEffectList constGetAuraEffectsByType (AuraType type) const
AuraListGetSingleCastAuras ()
AuraList constGetSingleCastAuras () 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 name, uint32 iconId, uint8 effIndex) const
AuraEffectGetAuraEffect (AuraType type, SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID=ObjectGuid::Empty) const
AuraEffectGetDummyAuraEffect (SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
AuraApplicationGetAuraApplication (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=NULL) const
AuraGetAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
AuraApplicationGetAuraApplicationOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=NULL) const
AuraGetAuraOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
void GetDispellableAuraList (Unit *caster, uint32 dispelMask, DispelChargesList &dispelList)
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 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 HasNegativeAuraWithInterruptFlag (uint32 flag, ObjectGuid guid=ObjectGuid::Empty) const
bool HasNegativeAuraWithAttribute (uint32 flag, ObjectGuid guid=ObjectGuid::Empty) const
bool HasAuraWithMechanic (uint32 mechanicMask) 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 GetTotalAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
float GetTotalAuraMultiplierByMiscMask (AuraType auratype, uint32 misc_mask) const
int32 GetMaxPositiveAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask, const AuraEffect *except=NULL) 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
float GetResistanceBuffMods (SpellSchools school, bool positive) const
void SetResistanceBuffMods (SpellSchools school, bool positive, float val)
void ApplyResistanceBuffModsMod (SpellSchools school, bool positive, float val, bool apply)
void ApplyResistanceBuffModsPercentMod (SpellSchools school, bool positive, float val, bool apply)
void InitStatBuffMods ()
void ApplyStatBuffMod (Stats stat, float val, bool apply)
void ApplyStatPercentBuffMod (Stats stat, float val, bool apply)
void SetCreateStat (Stats stat, float val)
void SetCreateHealth (uint32 val)
uint32 GetCreateHealth () const
void SetCreateMana (uint32 val)
uint32 GetCreateMana () const
uint32 GetPowerIndex (uint32 powerType) const
int32 GetCreatePowers (Powers power) const
float GetPosStat (Stats stat) const
float GetNegStat (Stats stat) const
float GetCreateStat (Stats stat) const
ObjectGuid GetChannelObjectGuid () const
void SetChannelObjectGuid (ObjectGuid guid)
void SetCurrentCastSpell (Spell *pSpell)
void InterruptSpell (CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
void FinishSpell (CurrentSpellTypes spellType, bool ok=true)
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 constGetCastSpellInfo (SpellInfo const *spellInfo) const
SpellHistoryGetSpellHistory ()
SpellHistory constGetSpellHistory () const
ShapeshiftForm GetShapeshiftForm () const
void SetShapeshiftForm (ShapeshiftForm form)
bool IsInFeralForm () const
bool IsInDisallowedMountForm () const
bool HandleStatModifier (UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
void SetModifierValue (UnitMods unitMod, UnitModifierType modifierType, float value)
float GetModifierValue (UnitMods unitMod, UnitModifierType modifierType) const
float GetTotalStatValue (Stats stat) const
float GetTotalAuraModValue (UnitMods unitMod) const
SpellSchools GetSpellSchoolByAuraGroup (UnitMods unitMod) const
Stats GetStatByAuraGroup (UnitMods unitMod) const
Powers GetPowerTypeByAuraGroup (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)=0
virtual void UpdateAllResistances ()
virtual void UpdateArmor ()=0
virtual void UpdateMaxHealth ()=0
virtual void UpdateMaxPower (Powers power)=0
virtual void UpdateAttackPowerAndDamage (bool ranged=false)=0
virtual void UpdateDamagePhysical (WeaponAttackType attType)
float GetTotalAttackPowerValue (WeaponAttackType attType) 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)=0
uint32 CalculateDamage (WeaponAttackType attType, bool normalized, bool addTotalPct)
float GetAPMultiplier (WeaponAttackType attType, bool normalized)
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)
bool SetInPhase (uint32 id, bool update, bool apply) override
void UpdateObjectVisibility (bool forced=true) override
bool CanHaveThreatList (bool skipAliveCheck=false) const
void AddThreat (Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
float ApplyTotalThreatModifier (float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL)
void DeleteThreatList ()
void TauntApply (Unit *victim)
void TauntFadeOut (Unit *taunter)
ThreatManagergetThreatManager ()
void addHatedBy (HostileReference *pHostileReference)
void removeHatedBy (HostileReference *)
HostileRefManagergetHostileRefManager ()
VisibleAuraMap constGetVisibleAuras ()
AuraApplicationGetVisibleAura (uint8 slot) const
void SetVisibleAura (uint8 slot, AuraApplication *aur)
void RemoveVisibleAura (uint8 slot)
uint32 GetInterruptMask () const
void AddInterruptMask (uint32 mask)
void UpdateInterruptMask ()
uint32 GetDisplayId () const
virtual void SetDisplayId (uint32 modelId)
uint32 GetNativeDisplayId () const
void RestoreDisplayId ()
void SetNativeDisplayId (uint32 modelId)
void setTransForm (uint32 spellid)
uint32 getTransForm () const
void _RegisterDynObject (DynamicObject *dynObj)
void _UnregisterDynObject (DynamicObject *dynObj)
DynamicObjectGetDynObject (uint32 spellId)
void RemoveDynObject (uint32 spellId)
void RemoveAllDynObjects ()
GameObjectGetGameObject (uint32 spellId) const
void AddGameObject (GameObject *gameObj)
void RemoveGameObject (GameObject *gameObj, bool del)
void RemoveGameObject (uint32 spellid, bool del)
void RemoveAllGameObjects ()
void ModifyAuraState (AuraStateType flag, bool apply)
uint32 BuildAuraStateUpdateForTarget (Unit *target) const
bool HasAuraState (AuraStateType flag, SpellInfo const *spellProto=NULL, Unit const *Caster=NULL) const
void UnsummonAllTotems ()
bool IsMagnet () const
UnitGetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
UnitGetMeleeHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo=NULL)
int32 SpellBaseDamageBonusDone (SpellSchoolMask schoolMask) const
int32 SpellBaseDamageBonusTaken (SpellSchoolMask schoolMask) const
uint32 SpellDamageBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const *effect, uint32 stack=1) const
float SpellDamagePctDone (Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype) const
uint32 SpellDamageBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const *effect, uint32 stack=1) const
int32 SpellBaseHealingBonusDone (SpellSchoolMask schoolMask) const
int32 SpellBaseHealingBonusTaken (SpellSchoolMask schoolMask) const
uint32 SpellHealingBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const *effect, uint32 stack=1) const
float SpellHealingPctDone (Unit *victim, SpellInfo const *spellProto) const
uint32 SpellHealingBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const *effect, uint32 stack=1) const
uint32 MeleeDamageBonusDone (Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto=NULL)
uint32 MeleeDamageBonusTaken (Unit *attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto=NULL)
bool isSpellBlocked (Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=BASE_ATTACK)
bool isBlockCritical ()
bool IsSpellCrit (Unit *victim, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
float GetUnitSpellCriticalChance (Unit *victim, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
uint32 SpellCriticalDamageBonus (SpellInfo const *spellProto, uint32 damage, Unit *victim)
uint32 SpellCriticalHealingBonus (SpellInfo const *spellProto, uint32 damage, Unit *victim)
void SetContestedPvP (Player *attackedPlayer=NULL)
uint32 GetCastingTimeForBonus (SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
float CalculateDefaultCoefficient (SpellInfo const *spellInfo, DamageEffectType damagetype) const
uint32 GetRemainingPeriodicAmount (ObjectGuid caster, uint32 spellId, AuraType auraType, uint8 effectIndex=0) const
void ApplySpellImmune (uint32 spellId, uint32 op, uint32 type, bool apply)
void ApplySpellDispelImmunity (const SpellInfo *spellProto, DispelType type, bool apply)
virtual bool IsImmunedToSpell (SpellInfo const *spellInfo) const
uint32 GetSchoolImmunityMask () const
uint32 GetMechanicImmunityMask () const
bool IsImmunedToDamage (SpellSchoolMask meleeSchoolMask) const
bool IsImmunedToDamage (SpellInfo const *spellInfo) const
virtual bool IsImmunedToSpellEffect (SpellInfo const *spellInfo, uint32 index) const
bool IsDamageReducedByArmor (SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=NULL, uint8 effIndex=MAX_SPELL_EFFECTS)
uint32 CalcArmorReducedDamage (Unit *victim, const uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=MAX_ATTACK)
uint32 CalcSpellResistance (Unit *victim, SpellSchoolMask schoolMask, SpellInfo const *spellInfo) const
void CalcAbsorbResist (Unit *victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32 *absorb, uint32 *resist, SpellInfo const *spellInfo=NULL)
void CalcHealAbsorb (Unit *victim, SpellInfo const *spellInfo, uint32 &healAmount, uint32 &absorb)
void UpdateSpeed (UnitMoveType mtype, bool forced)
float GetSpeed (UnitMoveType mtype) const
float GetSpeedRate (UnitMoveType mtype) const
void SetSpeed (UnitMoveType mtype, float rate, bool forced=false)
float ApplyEffectModifiers (SpellInfo const *spellProto, uint8 effect_index, float value) const
int32 CalculateSpellDamage (Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr, float *variance=nullptr, int32 itemLevel=-1) const
int32 CalcSpellDuration (SpellInfo const *spellProto)
int32 ModSpellDuration (SpellInfo const *spellProto, Unit const *target, int32 duration, bool positive, uint32 effectMask)
void ModSpellCastTime (SpellInfo const *spellProto, int32 &castTime, Spell *spell=NULL)
void ModSpellDurationTime (SpellInfo const *spellProto, int32 &castTime, Spell *spell=NULL)
float CalculateLevelPenalty (SpellInfo const *spellProto) const
void addFollower (FollowerReference *pRef)
void removeFollower (FollowerReference *)
MotionMasterGetMotionMaster ()
const MotionMasterGetMotionMaster () const
bool IsStopped () const
void StopMoving ()
 -------—End of Pet responses methods-------— More...
void AddUnitMovementFlag (uint32 f)
void RemoveUnitMovementFlag (uint32 f)
bool HasUnitMovementFlag (uint32 f) const
uint32 GetUnitMovementFlags () const
void SetUnitMovementFlags (uint32 f)
void AddExtraUnitMovementFlag (uint16 f)
void RemoveExtraUnitMovementFlag (uint16 f)
uint16 HasExtraUnitMovementFlag (uint16 f) const
uint16 GetExtraUnitMovementFlags () const
void SetExtraUnitMovementFlags (uint16 f)
bool IsSplineEnabled () const
float GetPositionZMinusOffset () const
void SetControlled (bool apply, UnitState state)
void SendPetActionFeedback (uint8 msg)
 -------—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 (uint8 slot)
bool CanProc () const
void SetCantProc (bool apply)
void AddPetAura (PetAura const *petSpell)
void RemovePetAura (PetAura const *petSpell)
uint32 GetModelForForm (ShapeshiftForm form) const
uint32 GetModelForTotem (PlayerTotemType totemType)
void SetRedirectThreat (ObjectGuid guid, uint32 pct)
void ResetRedirectThreat ()
void ModifyRedirectThreat (int32 amount)
uint32 GetRedirectThreatPercent () const
UnitGetRedirectThreatTarget ()
bool CreateVehicleKit (uint32 id, uint32 creatureEntry, bool loading=false)
void RemoveVehicleKit (bool onRemoveFromWorld=false)
VehicleGetVehicleKit () const
VehicleGetVehicle () const
void SetVehicle (Vehicle *vehicle)
bool IsOnVehicle (const Unit *vehicle) const
UnitGetVehicleBase () 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...
bool HandleSpellClick (Unit *clicker, int8 seatId=-1)
void EnterVehicle (Unit *base, int8 seatId=-1)
void ExitVehicle (Position const *exitPosition=NULL)
void ChangeSeat (int8 seatId, bool next=true)
void _ExitVehicle (Position const *exitPosition=NULL)
void _EnterVehicle (Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=NULL)
bool isMoving () const
bool isTurning () const
virtual bool CanFly () const =0
bool IsFlying () const
bool IsFalling () const
void RewardRage (uint32 baseRage, bool attacker)
virtual float GetFollowAngle () const
void OutDebugInfo () const
virtual bool IsLoading () const
bool IsDuringRemoveFromWorld () const
PetToPet ()
Pet constToPet () const
TotemToTotem ()
Totem constToTotem () const
TempSummonToTempSummon ()
TempSummon constToTempSummon () const
ObjectGuid GetTarget () const
virtual void SetTarget (ObjectGuid const &)=0
time_t GetLastDamagedTime () const
void SetLastDamagedTime (time_t val)
int32 GetHighestExclusiveSameEffectSpellGroupValue (AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
bool IsHighestExclusiveAura (Aura const *aura, bool removeOtherAuraApplications=false)
virtual void Talk (std::string const &text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
virtual void Say (std::string const &text, Language language, WorldObject const *target=nullptr)
virtual void Yell (std::string const &text, Language language, WorldObject const *target=nullptr)
virtual void TextEmote (std::string const &text, WorldObject const *target=nullptr, bool isBossEmote=false)
virtual void Whisper (std::string const &text, Language language, Player *target, bool isBossWhisper=false)
void Talk (uint32 textId, ChatMsg msgType, float textRange, WorldObject const *target)
void Say (uint32 textId, WorldObject const *target=nullptr)
void Yell (uint32 textId, WorldObject const *target=nullptr)
void TextEmote (uint32 textId, WorldObject const *target=nullptr, bool isBossEmote=false)
void Whisper (uint32 textId, Player *target, bool isBossWhisper=false)
uint32 GetVirtualItemId (uint32 slot) const
void SetVirtualItem (uint32 slot, uint32 itemId, uint16 appearanceModId=0)
- Public Member Functions inherited from WorldObject
virtual ~WorldObject ()
void GetNearPoint2D (float &x, float &y, float distance, float absAngle) const
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
void GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float angle=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
float GetObjectSize () const
void UpdateGroundPositionZ (float x, float y, float &z) const
void UpdateAllowedPositionZ (float x, float y, float &z) 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
virtual void SetPhaseMask (uint32 newPhaseMask, bool update)
void CopyPhaseFrom (WorldObject *obj, bool update=false)
void UpdateAreaPhase ()
void ClearPhases (bool update=false)
void RebuildTerrainSwaps ()
void RebuildWorldMapAreaSwaps ()
bool HasInPhaseList (uint32 phase)
uint32 GetPhaseMask () const
bool IsInPhase (uint32 phase) const
bool IsInPhase (WorldObject const *obj) const
bool IsInTerrainSwap (uint32 terrainSwap) const
std::set< uint32 > constGetPhases () const
std::set< uint32 > constGetTerrainSwaps () const
std::set< uint32 > constGetWorldMapAreaSwaps () const
int32 GetDBPhase () const
void SetDBPhase (int32 p)
uint32 GetZoneId () const
uint32 GetAreaId () const
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
InstanceScriptGetInstanceScript ()
std::string constGetName () const
void SetName (std::string const &newname)
virtual std::string constGetNameForLocaleIdx (LocaleConstant) const
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) const
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true) const
bool IsWithinLOS (float x, float y, float z) const
bool IsWithinLOSInMap (WorldObject const *obj) 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 (WorldObject const *obj1, WorldObject const *obj2, float size=0) const
virtual void SendMessageToSet (WorldPacket const *data, bool self)
virtual void SendMessageToSetInRange (WorldPacket const *data, float dist, bool self)
virtual void SendMessageToSet (WorldPacket const *data, Player const *skipped_rcvr)
void PlayDistanceSound (uint32 sound_id, Player *target=NULL)
void PlayDirectSound (uint32 sound_id, Player *target=NULL)
void SendObjectDeSpawnAnim (ObjectGuid guid)
virtual void SaveRespawnTime ()
void AddObjectToRemoveList ()
float GetGridActivationRange () const
float GetVisibilityRange () const
float GetSightRange (WorldObject const *target=NULL) const
bool CanSeeOrDetect (WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
virtual void SetMap (Map *map)
virtual void ResetMap ()
MapGetMap () const
MapFindMap () const
Map constGetBaseMap () const
void SetZoneScript ()
ZoneScriptGetZoneScript () const
TempSummonSummonCreature (uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
TempSummonSummonCreature (uint32 id, float x, float y, float z, float ang=0, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0) const
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
CreatureSummonTrigger (float x, float y, float z, float ang, uint32 dur, CreatureAI *(*GetAI)(Creature *)=NULL)
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=NULL)
CreatureFindNearestCreature (uint32 entry, float range, bool alive=true) const
GameObjectFindNearestGameObject (uint32 entry, float range) const
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
void GetGameObjectListWithEntryInGrid (std::list< GameObject * > &lList, uint32 uiEntry, float fMaxSearchRange) const
void GetCreatureListWithEntryInGrid (std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
void GetPlayerListInGrid (std::list< Player * > &lList, float fMaxSearchRange) const
void DestroyForNearbyPlayers ()
void BuildUpdate (UpdateDataMapType &) override
void AddToObjectUpdate () override
void RemoveFromObjectUpdate () override
void AddToNotify (uint16 f)
bool isNeedNotify (uint16 f) const
uint16 GetNotifyFlags () const
bool NotifyExecuted (uint16 f) const
void SetNotified (uint16 f)
void ResetAllNotifies ()
bool isActiveObject () const
void setActive (bool isActiveObject)
void SetWorldObject (bool apply)
bool IsPermanentWorldObject () const
bool IsWorldObject () const
template<class NOTIFIER >
void VisitNearbyObject (float const &radius, NOTIFIER &notifier) const
template<class NOTIFIER >
void VisitNearbyGridObject (float const &radius, NOTIFIER &notifier) const
template<class NOTIFIER >
void VisitNearbyWorldObject (float const &radius, NOTIFIER &notifier) const
TransportGetTransport () const
float GetTransOffsetX () const
float GetTransOffsetY () const
float GetTransOffsetZ () const
float GetTransOffsetO () const
uint32 GetTransTime () const
int8 GetTransSeat () const
void SetTransport (Transport *t)
virtual float GetStationaryX () const
virtual float GetStationaryY () const
virtual float GetStationaryZ () const
virtual float GetStationaryO () const
- Public Member Functions inherited from Object
virtual ~Object ()
bool IsInWorld () const
ObjectGuid constGetGUID () const
PackedGuid constGetPackGUID () const
uint32 GetEntry () const
void SetEntry (uint32 entry)
float GetObjectScale () const
virtual void SetObjectScale (float scale)
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 *target) const
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
int32 GetInt32Value (uint16 index) const
uint32 GetUInt32Value (uint16 index) const
uint64 GetUInt64Value (uint16 index) const
float GetFloatValue (uint16 index) const
uint8 GetByteValue (uint16 index, uint8 offset) const
uint16 GetUInt16Value (uint16 index, uint8 offset) const
ObjectGuid constGetGuidValue (uint16 index) const
void SetInt32Value (uint16 index, int32 value)
void SetUInt32Value (uint16 index, uint32 value)
void UpdateUInt32Value (uint16 index, uint32 value)
void SetUInt64Value (uint16 index, uint64 value)
void SetFloatValue (uint16 index, float value)
void SetByteValue (uint16 index, uint8 offset, uint8 value)
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
void SetGuidValue (uint16 index, ObjectGuid const &value)
void SetStatFloatValue (uint16 index, float value)
void SetStatInt32Value (uint16 index, int32 value)
bool AddGuidValue (uint16 index, ObjectGuid const &value)
bool RemoveGuidValue (uint16 index, ObjectGuid const &value)
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
void ApplyModUInt16Value (uint16 index, uint8 offset, int16 val, bool apply)
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
void ApplyPercentModFloatValue (uint16 index, float val, bool apply)
void SetFlag (uint16 index, uint32 newFlag)
void RemoveFlag (uint16 index, uint32 oldFlag)
void ToggleFlag (uint16 index, uint32 flag)
bool HasFlag (uint16 index, uint32 flag) const
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
void ToggleByteFlag (uint16 index, uint8 offset, uint8 flag)
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
void SetFlag64 (uint16 index, uint64 newFlag)
void RemoveFlag64 (uint16 index, uint64 oldFlag)
void ToggleFlag64 (uint16 index, uint64 flag)
bool HasFlag64 (uint16 index, uint64 flag) const
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
std::vector< uint32 > constGetDynamicValues (uint16 index) const
void AddDynamicValue (uint16 index, uint32 value)
void RemoveDynamicValue (uint16 index, uint32 value)
void ClearDynamicValue (uint16 index)
void SetDynamicValue (uint16 index, uint8 offset, uint32 value)
void ClearUpdateMask (bool remove)
uint16 GetValuesCount () const
virtual bool hasQuest (uint32) const
virtual bool hasInvolvedQuest (uint32) const
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
void SetFieldNotifyFlag (uint16 flag)
void RemoveFieldNotifyFlag (uint16 flag)
void ForceValuesUpdateAtIndex (uint32)
PlayerToPlayer ()
Player constToPlayer () const
CreatureToCreature ()
Creature constToCreature () const
UnitToUnit ()
Unit constToUnit () const
GameObjectToGameObject ()
GameObject constToGameObject () const
CorpseToCorpse ()
Corpse constToCorpse () const
DynamicObjectToDynObject ()
DynamicObject constToDynObject () const
AreaTriggerToAreaTrigger ()
AreaTrigger constToAreaTrigger () 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 (WorldLocation const &loc)
void WorldRelocate (WorldLocation const &loc)
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
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 Position (Position const &loc)
bool operator== (Position const &a)
bool operator!= (Position const &a)
void Relocate (float x, float y)
void Relocate (float x, float y, float z)
void Relocate (float x, float y, float z, float orientation)
void Relocate (Position const &pos)
void Relocate (Position const *pos)
void Relocate (G3D::Vector3 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
Position::PositionXYStreamer PositionXYStream ()
Position::PositionXYZStreamer PositionXYZStream ()
Position::PositionXYZOStreamer PositionXYZOStream ()
bool IsPositionValid () const
float GetExactDist2dSq (float x, float y) const
float GetExactDist2d (const float x, const float y) const
float GetExactDist2dSq (Position const *pos) const
float GetExactDist2d (Position const *pos) const
float GetExactDistSq (float x, float y, float z) const
float GetExactDist (float x, float y, float z) const
float GetExactDistSq (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 GetAngle (Position const *pos) const
float GetAngle (float x, float y) const
float GetRelativeAngle (Position const *pos) const
float GetRelativeAngle (float x, float y) const
void GetSinCos (float x, float y, float &vsin, float &vcos) 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 IsWithinBox (const Position &center, float xradius, float yradius, float zradius) const
bool HasInArc (float arcangle, Position const *pos, float border=2.0f) const
bool HasInLine (Position const *pos, float width) const
std::string ToString () const

Static Public Member Functions

static ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, Unit const *target)
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)

Public Attributes

uint32 m_extraAttacks
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
float m_threatModifier [MAX_SPELL_SCHOOL]
float m_modAttackSpeedPct [3]
EventProcessor m_Events
SpellImmuneList m_spellImmune [MAX_SPELL_IMMUNITY]
uint32 m_lastSanctuaryTime
PetAuraSet m_petAuras
bool IsAIEnabled
bool NeedChangeAI
ObjectGuid LastCharmerGUID
bool m_ControlledByPlayer
- Public Attributes inherited from WorldObject
FlaggedValuesArray32< int32,
uint32, StealthType,
FlaggedValuesArray32< int32,
uint32, StealthType,
FlaggedValuesArray32< int32,
uint32, InvisibilityType,
FlaggedValuesArray32< int32,
uint32, InvisibilityType,
FlaggedValuesArray32< int32,
FlaggedValuesArray32< int32,
uint32 LastUsedScriptID
MovementInfo m_movementInfo
- 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 * > 
typedef std::list< GameObject * > GameObjectList

Protected Member Functions

 Unit (bool isWorldObject)
void BuildValuesUpdate (uint8 updatetype, ByteBuffer *data, Player *target) const override
void DestroyForPlayer (Player *target) const override
void _UpdateSpells (uint32 time)
void _DeleteRemovedAuras ()
void _UpdateAutoRepeatSpell ()
virtual SpellSchoolMask GetMeleeDamageSchoolMask () const
bool IsAlwaysVisibleFor (WorldObject const *seer) const override
bool IsAlwaysDetectableFor (WorldObject const *seer) const override
void DisableSpline ()
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)
void SetLocationMapId (uint32 _mapId)
void SetLocationInstanceId (uint32 _instanceId)
virtual bool IsNeverVisible () const
virtual bool IsInvisibleDueToDespawn () const
- Protected Member Functions inherited from Object
 Object ()
void _InitValues ()
void _Create (ObjectGuid const &guid)
std::string _ConcatFields (uint16 startIndex, uint16 size) const
void _LoadIntoDataField (std::string const &data, uint32 startOffset, uint32 count)
uint32 GetUpdateFieldData (Player const *target, uint32 *&flags) const
uint32 GetDynamicUpdateFieldData (Player const *target, uint32 *&flags) const
void BuildMovementUpdate (ByteBuffer *data, uint32 flags) const
virtual void BuildDynamicValuesUpdate (uint8 updatetype, ByteBuffer *data, Player *target) const
void AddToObjectUpdateIfNeeded ()

Protected Attributes

bool m_AutoRepeatFirstCast
uint32 m_attackTimer [MAX_ATTACK]
float m_createStats [MAX_STATS]
AttackerSet m_attackers
bool m_shouldReacquireTarget
DeathState m_deathState
int32 m_procDeep
DynObjectList m_dynObj
GameObjectList m_gameObj
uint32 m_transform
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
uint32 m_interruptMask
float m_auraModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_END]
float m_weaponDamage [MAX_ATTACK][2]
bool m_canModifyStats
VisibleAuraMap m_visibleAuras
float m_speed_rate [MAX_MOVE_TYPE]
SharedVisionList m_sharedVision
uint32 m_reactiveTimer [MAX_REACTIVE]
uint32 m_regenTimer
ThreatManager m_ThreatManager
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
const bool m_isWorldObject
- Protected Attributes inherited from Object
uint16 m_objectType
TypeID m_objectTypeId
uint32 m_updateFlag
union {
   int32 *   m_int32Values
   uint32 *   m_uint32Values
   float *   m_floatValues
std::vector< uint32 > * _dynamicValues
UpdateMask _changesMask
UpdateMask _dynamicChangesMask
uint16 m_valuesCount
uint16 _dynamicValuesCount
uint16 _fieldNotifyFlags
bool m_objectUpdated

Private Member Functions

bool IsTriggeredAtSpellProcEvent (Unit *victim, Aura *aura, SpellInfo const *procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *&spellProcEvent)
bool HandleDummyAuraProc (Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
bool HandleAuraProc (Unit *victim, uint32 damage, Aura *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool *handled)
bool HandleProcTriggerSpell (Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
bool HandleOverrideClassScriptAuraProc (Unit *victim, uint32 damage, AuraEffect *triggeredByAura, SpellInfo const *procSpell, uint32 cooldown)
bool HandleAuraRaidProcFromChargeWithValue (AuraEffect *triggeredByAura)
bool HandleAuraRaidProcFromCharge (AuraEffect *triggeredByAura)
void UpdateSplineMovement (uint32 t_diff)
void UpdateSplinePosition ()
float GetCombatRatingReduction (CombatRating cr) const
uint32 GetCombatRatingDamageReduction (CombatRating cr, float rate, float cap, uint32 damage) const

Private Attributes

uint32 m_state
uint32 m_CombatTimer
TimeTrackerSmall m_movesplineTimer
Diminishing m_Diminishing
HostileRefManager m_HostileRefManager
FollowerRefManager m_FollowingRefManager
RedirectThreatInfo _redirectThreadInfo
bool m_cleanupDone
bool m_duringRemoveFromWorld
uint32 _oldFactionId
 faction before charm More...
bool _isWalkingBeforeCharm
 Are we walking before we were charmed? More...
uint16 _aiAnimKitId
uint16 _movementAnimKitId
uint16 _meleeAnimKitId
time_t _lastDamagedTime


class VehicleJoinEvent

Member Typedef Documentation

typedef std::set<Unit*> Unit::AttackerSet
typedef std::pair<AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator> Unit::AuraApplicationMapBounds
typedef std::pair<AuraApplicationMap::iterator, AuraApplicationMap::iterator> Unit::AuraApplicationMapBoundsNonConst
typedef std::list<AuraEffect*> Unit::AuraEffectList
typedef std::list<Aura*> Unit::AuraList
typedef std::multimap<uint32, Aura*> Unit::AuraMap
typedef std::pair<AuraMap::const_iterator, AuraMap::const_iterator> Unit::AuraMapBounds
typedef std::pair<AuraMap::iterator, AuraMap::iterator> Unit::AuraMapBoundsNonConst
typedef std::pair<AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator> Unit::AuraStateAurasMapBounds
typedef std::set<Unit*> Unit::ControlList
typedef std::list<DynamicObject*> Unit::DynObjectList
typedef std::list<GameObject*> Unit::GameObjectList
typedef std::set<PetAura const*> Unit::PetAuraSet

Constructor & Destructor Documentation

Unit::~Unit ( )
311 {
312  // set current spells as deletable
313  for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
314  if (m_currentSpells[i])
315  {
317  m_currentSpells[i] = NULL;
318  }
322  delete i_motionMaster;
323  delete m_charmInfo;
324  delete movespline;
325  delete _spellHistory;
329  ASSERT(m_attackers.empty());
330  ASSERT(m_sharedVision.empty());
331  ASSERT(m_Controlled.empty());
332  ASSERT(m_appliedAuras.empty());
333  ASSERT(m_ownedAuras.empty());
334  ASSERT(m_removedAuras.empty());
335  ASSERT(m_gameObj.empty());
336  ASSERT(m_dynObj.empty());
337 }
AuraList m_removedAuras
Definition: Unit.h:2275
AuraMap m_ownedAuras
Definition: Unit.h:2273
SpellHistory * _spellHistory
Definition: Unit.h:2364
bool m_duringRemoveFromWorld
Definition: Unit.h:2353
Movement::MoveSpline * movespline
Definition: Unit.h:2213
SharedVisionList m_sharedVision
Definition: Unit.h:2293
Spell * m_currentSpells[CURRENT_MAX_SPELL]
Definition: Unit.h:2271
CharmInfo * m_charmInfo
Definition: Unit.h:2292
arena_t NULL
Definition: jemalloc_internal.h:624
void _DeleteRemovedAuras()
Definition: Unit.cpp:2668
GameObjectList m_gameObj
Definition: Unit.h:2267
MotionMaster * i_motionMaster
Definition: Unit.h:2297
Unit * m_attacking
Definition: Unit.h:2256
ControlList m_Controlled
Definition: Unit.h:1738
Definition: Unit.h:1115
DynObjectList m_dynObj
Definition: Unit.h:2264
AttackerSet m_attackers
Definition: Unit.h:2255
uint8_t uint8
Definition: Define.h:152
#define ASSERT
Definition: Errors.h:55
void SetReferencedFromCurrent(bool yes)
Definition: Spell.h:601
AuraApplicationMap m_appliedAuras
Definition: Unit.h:2274

+ Here is the call graph for this function:

Unit::Unit ( bool  isWorldObject)
197  :
198  WorldObject(isWorldObject), m_movedPlayer(NULL), m_lastSanctuaryTime(0),
199  IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(),
206 {
219  m_extraAttacks = 0;
220  m_canDualWield = false;
222  m_movementCounter = 0;
224  m_state = 0;
227  for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
228  m_currentSpells[i] = NULL;
230  for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
231  m_SummonSlot[i].Clear();
233  for (uint8 i = 0; i < MAX_GAMEOBJECT_SLOT; ++i)
234  m_ObjectSlot[i].Clear();
238  m_interruptMask = 0;
239  m_transform = 0;
240  m_canModifyStats = false;
242  for (uint8 i = 0; i < MAX_SPELL_IMMUNITY; ++i)
243  m_spellImmune[i].clear();
245  for (uint8 i = 0; i < UNIT_MOD_END; ++i)
246  {
247  m_auraModifiersGroup[i][BASE_VALUE] = 0.0f;
249  m_auraModifiersGroup[i][BASE_PCT] = 1.0f;
251  m_auraModifiersGroup[i][TOTAL_PCT] = 1.0f;
252  }
253  // implement 50% base damage from offhand
256  for (uint8 i = 0; i < MAX_ATTACK; ++i)
257  {
260  }
262  for (uint8 i = 0; i < MAX_STATS; ++i)
263  m_createStats[i] = 0.0f;
265  m_attacking = nullptr;
266  m_shouldReacquireTarget = false;
267  if (GetTypeId() == TYPEID_PLAYER)
268  {
269  m_modMeleeHitChance = 7.5f;
270  m_modRangedHitChance = 7.5f;
271  m_modSpellHitChance = 15.0f;
272  }
273  else
274  {
275  m_modMeleeHitChance = 0.0f;
276  m_modRangedHitChance = 0.0f;
277  m_modSpellHitChance = 0.0f;
278  }
281  m_CombatTimer = 0;
283  for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
284  m_threatModifier[i] = 1.0f;
286  for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
287  m_speed_rate[i] = 1.0f;
289  m_charmInfo = nullptr;
293  // remove aurastates allowing special moves
294  for (uint8 i = 0; i < MAX_REACTIVE; ++i)
295  m_reactiveTimer[i] = 0;
297  m_cleanupDone = false;
298  m_duringRemoveFromWorld = false;
302  _lastLiquid = NULL;
304  _oldFactionId = 0;
305  _isWalkingBeforeCharm = false;
306 }
Definition: MoveSpline.h:49
Definition: Unit.h:620
Definition: Unit.h:200
uint32 m_removedAurasCount
Definition: Unit.h:2277
uint16 _meleeAnimKitId
Definition: Unit.h:2360
Definition: Unit.h:610
Definition: Unit.h:1287
bool m_ControlledByPlayer
Definition: Unit.h:2175
float m_modMeleeHitChance
Definition: Unit.h:1939
AuraMap m_ownedAuras
Definition: Unit.h:2273
Definition: Unit.h:444
SpellHistory * _spellHistory
Definition: Unit.h:2364
bool m_shouldReacquireTarget
Definition: Unit.h:2257
bool m_duringRemoveFromWorld
Definition: Unit.h:2353
Definition: Unit.h:1077
Definition: Unit.h:619
int32 m_baseSpellCritChance
Definition: Unit.h:1942
Movement::MoveSpline * movespline
Definition: Unit.h:2213
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:538
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT]
Definition: Unit.h:1929
Spell * m_currentSpells[CURRENT_MAX_SPELL]
Definition: Unit.h:2271
CharmInfo * m_charmInfo
Definition: Unit.h:2292
Definition: Unit.h:434
Vehicle * m_vehicleKit
Definition: Unit.h:2305
Definition: Unit.h:541
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:383
Definition: ObjectGuid.h:32
uint32 m_lastSanctuaryTime
Definition: Unit.h:1989
arena_t NULL
Definition: jemalloc_internal.h:624
uint16 _aiAnimKitId
Definition: Unit.h:2358
bool m_AutoRepeatFirstCast
Definition: Unit.h:2249
uint32 m_reactiveTimer[MAX_REACTIVE]
Definition: Unit.h:2299
float m_speed_rate[MAX_MOVE_TYPE]
Definition: Unit.h:2290
Vehicle * m_vehicle
Definition: Unit.h:2304
bool m_cleanupDone
Definition: Unit.h:2352
Definition: Unit.h:513
Definition: Unit.h:511
bool IsAIEnabled
Definition: Unit.h:2161
uint16 m_objectType
Definition: Object.h:227
uint32 m_transform
Definition: Unit.h:2269
Definition: SharedDefines.h:283
float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END]
Definition: Unit.h:2285
uint32 _oldFactionId
faction before charm
Definition: Unit.h:2355
time_t _lastDamagedTime
Definition: Unit.h:2362
uint32 m_state
Definition: Unit.h:2340
UnitAI * i_AI
Definition: Unit.h:2242
UnitAI * i_disabledAI
Definition: Unit.h:2242
Definition: SharedDefines.h:1749
Definition: SharedDefines.h:1869
#define MAX_STATS
Definition: SharedDefines.h:244
Definition: ObjectGuid.h:49
int32 m_procDeep
Definition: Unit.h:2261
float m_modSpellHitChance
Definition: Unit.h:1941
TypeID GetTypeId() const
Definition: Object.h:113
Definition: SpellHistory.h:42
TypeID m_objectTypeId
Definition: Object.h:229
Definition: Unit.h:618
Definition: MotionMaster.h:82
RedirectThreatInfo _redirectThreadInfo
Definition: Unit.h:2350
MotionMaster * i_motionMaster
Definition: Unit.h:2297
DeathState m_deathState
Definition: Unit.h:2259
Unit * m_attacking
Definition: Unit.h:2256
bool _isWalkingBeforeCharm
Are we walking before we were charmed?
Definition: Unit.h:2356
HostileRefManager m_HostileRefManager
Definition: Unit.h:2346
float m_modAttackSpeedPct[3]
Definition: Unit.h:1945
Definition: Unit.h:201
float m_createStats[MAX_STATS]
Definition: Unit.h:2253
uint32 m_movementCounter
Incrementing counter used in movement packets.
Definition: Unit.h:2336
bool NeedChangeAI
Definition: Unit.h:2161
Definition: Unit.h:1279
ThreatManager m_ThreatManager
Definition: Unit.h:2302
uint32 m_extraAttacks
Definition: Unit.h:1366
Definition: Unit.h:437
Definition: UpdateData.h:42
Definition: Unit.h:438
Definition: Unit.h:445
WorldObject(bool isWorldObject)
Definition: Object.cpp:1445
Definition: ObjectGuid.h:33
Definition: Unit.h:1115
ObjectGuid m_ObjectSlot[MAX_GAMEOBJECT_SLOT]
Definition: Unit.h:1930
Definition: Unit.h:435
uint16 _movementAnimKitId
Definition: Unit.h:2359
AuraMap::iterator m_auraUpdateIterator
Definition: Unit.h:2276
bool m_canDualWield
Definition: Unit.h:1367
uint32 m_unitTypeMask
Definition: Unit.h:2307
uint32 m_interruptMask
Definition: Unit.h:2283
uint32 m_CombatTimer
Definition: Unit.h:2341
float m_threatModifier[MAX_SPELL_SCHOOL]
Definition: Unit.h:1944
Definition: Unit.h:1285
uint8_t uint8
Definition: Define.h:152
Definition: SharedDefines.h:1742
float m_modRangedHitChance
Definition: Unit.h:1940
Definition: Unit.h:436
uint32 m_attackTimer[MAX_ATTACK]
Definition: Unit.h:2251
float m_weaponDamage[MAX_ATTACK][2]
Definition: Unit.h:2286
Definition: Unit.h:857
Player * m_movedPlayer
Definition: Unit.h:1753
LiquidTypeEntry const * _lastLiquid
Definition: Unit.h:2308
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]
Definition: Unit.h:1988
Definition: Unit.h:617
bool m_canModifyStats
Definition: Unit.h:2287
uint32 m_regenTimer
Definition: Unit.h:2300
uint32 m_updateFlag
Definition: Object.h:230
ObjectGuid LastCharmerGUID
Definition: Unit.h:2162

+ Here is the call graph for this function:

Member Function Documentation

void Unit::_addAttacker ( Unit pAttacker)
7202 {
7203  m_attackers.insert(pAttacker);
7204 }
AttackerSet m_attackers
Definition: Unit.h:2255

+ Here is the caller graph for this function:

void Unit::_AddAura ( UnitAura aura,
Unit caster 
3091 {
3093  m_ownedAuras.insert(AuraMap::value_type(aura->GetId(), aura));
3097  if (aura->IsRemoved())
3098  return;
3101  if (aura->IsSingleTarget())
3102  {
3103  ASSERT((IsInWorld() && !IsDuringRemoveFromWorld()) || (aura->GetCasterGUID() == GetGUID()) ||
3105  /* @HACK: Player is not in world during loading auras.
3106  * Single target auras are not saved or loaded from database
3107  * but may be created as a result of aura links (player mounts with passengers)
3108  */
3110  // register single target aura
3111  caster->GetSingleCastAuras().push_back(aura);
3112  // remove other single target auras
3113  Unit::AuraList& scAuras = caster->GetSingleCastAuras();
3114  for (Unit::AuraList::iterator itr = scAuras.begin(); itr != scAuras.end();)
3115  {
3116  if ((*itr) != aura &&
3117  (*itr)->IsSingleTargetWith(aura))
3118  {
3119  (*itr)->Remove();
3120  itr = scAuras.begin();
3121  }
3122  else
3123  ++itr;
3124  }
3125  }
3126 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
bool IsSingleTargetWith(Aura const *aura) const
Definition: SpellAuras.cpp:1090
AuraMap m_ownedAuras
Definition: Unit.h:2273
virtual bool IsLoading() const
Definition: Unit.h:2197
void SetIsSingleTarget(bool val)
Definition: SpellAuras.h:206
std::list< Aura * > AuraList
Definition: Unit.h:1323
bool IsSingleTarget() const
Definition: SpellAuras.h:204
bool m_cleanupDone
Definition: Unit.h:2352
void _RemoveNoStackAurasDueToAura(Aura *aura)
Definition: Unit.cpp:3316
Definition: SpellAuraDefines.h:296
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:2198
bool IsRemoved() const
Definition: SpellAuras.h:201
AuraList & GetSingleCastAuras()
Definition: Unit.h:1833
bool HasEffectType(AuraType type) const
Definition: SpellAuras.cpp:1186
ObjectGuid const & GetGUID() const
Definition: Object.h:105
bool IsSingleTarget() const
Definition: SpellInfo.cpp:1596
#define ASSERT
Definition: Errors.h:55
bool IsInWorld() const
Definition: Object.h:100
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Unit::_ApplyAllAuraStatMods ( )
4066 {
4067  for (AuraApplicationMap::iterator i = m_appliedAuras.begin(); i != m_appliedAuras.end(); ++i)
4068  (*i).second->GetBase()->HandleAllEffects(i->second, AURA_EFFECT_HANDLE_STAT, true);
4069 }
Definition: SpellAuraDefines.h:43
AuraApplicationMap m_appliedAuras
Definition: Unit.h:2274
void Unit::_ApplyAura ( AuraApplication aurApp,
uint32  effMask 
3181 {
3182  Aura* aura = aurApp->GetBase();
3186  if (aurApp->GetRemoveMode())
3187  return;
3189  // Update target aura state flag
3190  if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState(GetMap()->GetDifficultyID()))
3191  ModifyAuraState(aState, true);
3193  if (aurApp->GetRemoveMode())
3194  return;
3196  // Sitdown on apply aura req seated
3200  Unit* caster = aura->GetCaster();
3202  if (aurApp->GetRemoveMode())
3203  return;
3205  aura->HandleAuraSpecificMods(aurApp, caster, true, false);
3206  aura->HandleAuraSpecificPeriodics(aurApp, caster);
3208  // apply effects of the aura
3209  for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3210  {
3211  if (effMask & 1 << i && (!aurApp->GetRemoveMode()))
3212  aurApp->_HandleEffect(i, true);
3213  }
3214 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
Definition: Unit.h:208
void ModifyAuraState(AuraStateType flag, bool apply)
Definition: Unit.cpp:7422
Map * GetMap() const
Definition: Object.h:543
bool IsSitState() const
Definition: Unit.cpp:12757
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
void HandleAuraSpecificMods(AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
Definition: SpellAuras.cpp:1238
Aura * GetBase() const
Definition: SpellAuras.h:75
Definition: SharedDefines.h:1754
AuraStateType GetAuraState(uint32 difficulty) const
Definition: SpellInfo.cpp:2221
uint32 AuraInterruptFlags
Definition: SpellInfo.h:368
void HandleAuraSpecificPeriodics(AuraApplication const *aurApp, Unit *caster)
Definition: SpellAuras.cpp:1584
void _HandleEffect(uint8 effIndex, bool apply)
Definition: SpellAuras.cpp:161
void _RemoveNoStackAurasDueToAura(Aura *aura)
Definition: Unit.cpp:3316
Definition: Unit.h:72
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:12772
uint8_t uint8
Definition: Define.h:152
Definition: DBCStructure.h:1026
Definition: SpellAuras.h:116
Definition: Unit.h:1305
AuraRemoveMode GetRemoveMode() const
Definition: SpellAuras.h:86

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Unit::_ApplyAuraEffect ( Aura aura,
uint8  effIndex 
3167 {
3168  ASSERT(aura);
3169  ASSERT(aura->HasEffect(effIndex));
3170  AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID());
3171  ASSERT(aurApp);
3172  if (!aurApp->GetEffectMask())
3173  _ApplyAura(aurApp, 1 << effIndex);
3174  else
3175  aurApp->_HandleEffect(effIndex, true);
3176 }
Definition: SpellAuras.h:50
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:233
void _ApplyAura(AuraApplication *aurApp, uint32 effMask)
Definition: Unit.cpp:3180
bool HasEffect(uint8 effIndex) const
Definition: SpellAuras.h:223
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

AuraApplication * Unit::_CreateAuraApplication ( Aura aura,
uint32  effMask 
3131 {
3132  // can't apply aura on unit which is going to be deleted - to not create a memory leak
3134  // aura musn't be removed
3135  ASSERT(!aura->IsRemoved());
3137  // aura mustn't be already applied on target
3138  ASSERT (!aura->IsAppliedOnTarget(GetGUID()) && "Unit::_CreateAuraApplication: aura musn't be applied on target");
3140  SpellInfo const* aurSpellInfo = aura->GetSpellInfo();
3141  uint32 aurId = aurSpellInfo->Id;
3143  // ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
3144  if (!IsAlive() && !aurSpellInfo->IsDeathPersistent() &&
3145  (GetTypeId() != TYPEID_PLAYER || !ToPlayer()->GetSession()->PlayerLoading()))
3146  return NULL;
3148  Unit* caster = aura->GetCaster();
3150  AuraApplication * aurApp = new AuraApplication(this, caster, aura, effMask);
3151  m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3153  if (aurSpellInfo->AuraInterruptFlags)
3154  {
3155  m_interruptableAuras.push_back(aurApp);
3156  AddInterruptMask(aurSpellInfo->AuraInterruptFlags);
3157  }
3159  if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState(GetMap()->GetDifficultyID()))
3160  m_auraStateAuras.insert(AuraStateAurasMap::value_type(aState, aurApp));
3162  aura->_ApplyForTarget(this, caster, aurApp);
3163  return aurApp;
3164 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
uint32 Id
Definition: SpellInfo.h:329
Map * GetMap() const
Definition: Object.h:543
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
Definition: SpellInfo.h:326
Definition: SharedDefines.h:1754
AuraStateAurasMap m_auraStateAuras
Definition: Unit.h:2282
Definition: SpellAuras.h:50
AuraStateType GetAuraState(uint32 difficulty) const
Definition: SpellInfo.cpp:2221
arena_t NULL
Definition: jemalloc_internal.h:624
bool m_cleanupDone
Definition: Unit.h:2352
AuraApplicationList m_interruptableAuras
Definition: Unit.h:2281
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
bool IsAlive() const
Definition: Unit.h:1692
bool IsRemoved() const
Definition: SpellAuras.h:201
uint32_t uint32
Definition: Define.h:150
virtual void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
Definition: SpellAuras.cpp:461
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
bool IsAppliedOnTarget(ObjectGuid guid) const
Definition: SpellAuras.h:235
#define ASSERT
Definition: Errors.h:55
void AddInterruptMask(uint32 mask)
Definition: Unit.h:2009
Definition: Unit.h:1305
AuraApplicationMap m_appliedAuras
Definition: Unit.h:2274

+ Here is the call graph for this function:

void Unit::_DeleteRemovedAuras ( )
2669 {
2670  while (!m_removedAuras.empty())
2671  {
2672  delete m_removedAuras.front();
2673  m_removedAuras.pop_front();
2674  }
2675 }
AuraList m_removedAuras
Definition: Unit.h:2275

+ Here is the caller graph for this function:

void Unit::_EnterVehicle ( Vehicle vehicle,
int8  seatId,
AuraApplication const aurApp = NULL 
15255 {
15256  // Must be called only from aura handler
15257  ASSERT(aurApp);
15259  if (!IsAlive() || GetVehicleKit() == vehicle || vehicle->GetBase()->IsOnVehicle(this))
15260  return;
15262  if (m_vehicle)
15263  {
15264  if (m_vehicle != vehicle)
15265  {
15266  TC_LOG_DEBUG("entities.vehicle", "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry());
15267  ExitVehicle();
15268  }
15269  else if (seatId >= 0 && seatId == GetTransSeat())
15270  return;
15271  }
15273  if (aurApp->GetRemoveMode())
15274  return;
15276  if (Player* player = ToPlayer())
15277  {
15278  if (vehicle->GetBase()->GetTypeId() == TYPEID_PLAYER && player->IsInCombat())
15279  {
15280  vehicle->GetBase()->RemoveAura(const_cast<AuraApplication*>(aurApp));
15281  return;
15282  }
15283  }
15285  ASSERT(!m_vehicle);
15286  (void)vehicle->AddPassenger(this, seatId);
15287 }
bool IsOnVehicle(const Unit *vehicle) const
Definition: Unit.cpp:14336
bool AddPassenger(Unit *passenger, int8 seatId=-1)
Attempts to add a passenger to the vehicle on 'seatId'.
Definition: Vehicle.cpp:394
Vehicle * m_vehicle
Definition: Unit.h:2304
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3442
Player * ToPlayer()
Definition: Object.h:191
void ExitVehicle(Position const *exitPosition=NULL)
Definition: Unit.cpp:15321
TypeID GetTypeId() const
Definition: Object.h:113
bool IsAlive() const
Definition: Unit.h:1692
int8 GetTransSeat() const
Definition: Object.h:608
Definition: ObjectGuid.h:33
#define ASSERT
Definition: Errors.h:55
uint32 GetEntry() const
Definition: Object.h:107
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:49
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Unit::_ExitVehicle ( Position const exitPosition = NULL)

It's possible m_vehicle is NULL, when this function is called indirectly from ::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.

15341 {
15345  if (!m_vehicle)
15346  return;
15348  // This should be done before dismiss, because there may be some aura removal
15349  Vehicle* vehicle = m_vehicle->RemovePassenger(this);
15351  Player* player = ToPlayer();
15353  // If the player is on mounted duel and exits the mount, he should immediatly lose the duel
15354  if (player && player->duel && player->duel->isMounted)
15355  player->DuelComplete(DUEL_FLED);
15359  Position pos;
15360  if (!exitPosition) // Exit position not specified
15361  pos = vehicle->GetBase()->GetPosition(); // This should use passenger's current position, leaving it as it is now
15362  // because we calculate positions incorrect (sometimes under map)
15363  else
15364  pos = *exitPosition;
15368  if (player)
15369  player->SetFallInformation(0, GetPositionZ());
15371  float height = pos.GetPositionZ();
15373  Movement::MoveSplineInit init(this);
15375  // Creatures without inhabit type air should begin falling after exiting the vehicle
15376  if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
15377  init.SetFall();
15379  init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false);
15380  init.SetFacing(GetOrientation());
15381  init.SetTransportExit();
15382  init.Launch();
15384  if (player)
15385  player->ResummonPetTemporaryUnSummonedIfAny();
15387  if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION) && vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
15388  if (((Minion*)vehicle->GetBase())->GetOwner() == this)
15389  vehicle->GetBase()->ToCreature()->DespawnOrUnsummon(1);
15392  {
15393  // Vehicle just died, we die too
15394  if (vehicle->GetBase()->getDeathState() == JUST_DIED)
15396  // If for other reason we as minion are exiting the vehicle (ejected, master dismounted) - unsummon
15397  else
15398  ToTempSummon()->UnSummon(2000); // Approximation
15399  }
15400 }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Definition: Vehicle.h:32
Map * GetMap() const
Definition: Object.h:543
Definition: SharedDefines.h:4728
void AddUnitState(uint32 f)
Definition: Unit.h:1394
Definition: Unit.h:542
Definition: Unit.h:867
Definition: ObjectGuid.h:32
Vehicle * m_vehicle
Definition: Unit.h:2304
Definition: Unit.h:859
Player * ToPlayer()
Definition: Object.h:191
TempSummon * ToTempSummon()
Definition: Unit.h:2206
virtual void UnSummon(uint32 msTime=0)
Definition: TemporarySummon.cpp:237
TypeID GetTypeId() const
Definition: Object.h:113
Definition: TemporarySummon.h:66
Definition: Unit.h:569
float GetOrientation() const
Definition: Position.h:107
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:13808
float GetPositionY() const
Definition: Position.h:105
void GetPosition(float &x, float &y) const
Definition: Position.h:109
float GetPositionZ() const
Definition: Position.h:106
Vehicle * RemovePassenger(Unit *passenger)
Removes the passenger from the vehicle.
Definition: Vehicle.cpp:466
virtual void setDeathState(DeathState s)
Definition: Unit.cpp:10593
Unit * GetOwner() const
Definition: Unit.cpp:7542
Creature * ToCreature()
Definition: Object.h:194
Definition: Unit.h:560
uint32 HasUnitTypeMask(uint32 mask) const
Definition: Unit.h:1399
Definition: Position.h:27
virtual bool CanFly() const =0
Definition: MoveSplineInit.h:52
float GetPositionX() const
Definition: Position.h:104
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:49
DeathState getDeathState() const
Definition: Unit.h:1695

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Unit::_IsNoStackAuraDueToAura ( Aura appliedAura,
Aura existingAura 
) const
bool Unit::_IsValidAssistTarget ( Unit const target,
SpellInfo const bySpell 
) const
10130 {
10131  ASSERT(target);
10133  // can assist to self
10134  if (this == target)
10135  return true;
10137  // can't assist unattackable units or GMs
10138  if (target->HasUnitState(UNIT_STATE_UNATTACKABLE)
10139  || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster()))
10140  return false;
10142  // can't assist own vehicle or passenger
10143  if (m_vehicle)
10144  if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
10145  return false;
10147  // can't assist invisible
10148  if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea(GetMap()->GetDifficultyID())))
10149  return false;
10151  // can't assist dead
10152  if ((!bySpell || !bySpell->IsAllowingDeadTarget()) && !target->IsAlive())
10153  return false;
10155  // can't assist untargetable
10156  if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_UNTARGETABLE))
10158  return false;
10160  if (!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG))
10161  {
10163  {
10164  if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
10165  return false;
10166  }
10167  else
10168  {
10169  if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
10170  return false;
10171  }
10172  }
10174  // can't assist non-friendly targets
10175  if (GetReactionTo(target) < REP_NEUTRAL
10176  && target->GetReactionTo(this) < REP_NEUTRAL
10178  return false;
10180  // PvP case
10182  {
10183  Player const* targetPlayerOwner = target->GetAffectingPlayer();
10185  {
10186  Player const* selfPlayerOwner = GetAffectingPlayer();
10187  if (selfPlayerOwner && targetPlayerOwner)
10188  {
10189  // can't assist player which is dueling someone
10190  if (selfPlayerOwner != targetPlayerOwner
10191  && targetPlayerOwner->duel)
10192  return false;
10193  }
10194  // can't assist player in ffa_pvp zone from outside
10195  if ((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP)
10197  return false;
10198  // can't assist player out of sanctuary from sanctuary if has pvp enabled
10199  if (target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP)
10201  return false;
10202  }
10203  }
10204  // PvC case - player can assist creature only if has specific type flags
10207  && (!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG))
10208  && !((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP)))
10209  {
10210  if (Creature const* creatureTarget = target->ToCreature())
10211  return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_TREAT_AS_RAID_UNIT || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_CAN_ASSIST;
10212  }
10213  return true;
10214 }
bool IsOnVehicle(const Unit *vehicle) const
Definition: Unit.cpp:14336
ReputationRank GetReactionTo(Unit const *target) const
Definition: Unit.cpp:7035
Definition: UpdateFields.h:146
Map * GetMap() const
Definition: Object.h:543
Definition: Unit.h:584
Definition: Unit.h:310
Vehicle * m_vehicle
Definition: Unit.h:2304
Definition: Creature.h:467
Definition: Unit.h:681
Definition: SharedDefines.h:216
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:558
Definition: SharedDefines.h:3668
Player * GetAffectingPlayer() const
Definition: Unit.cpp:7569
Definition: SharedDefines.h:575
Definition: SharedDefines.h:596
Definition: SharedDefines.h:585
Definition: Unit.h:308
Definition: Unit.h:676
Definition: Unit.h:682
Definition: ObjectGuid.h:33
Definition: UpdateFields.h:109
Creature * ToCreature()
Definition: Object.h:194
#define ASSERT
Definition: Errors.h:55
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:1239
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1940
Definition: Unit.h:311
Definition: Unit.h:698
Definition: SharedDefines.h:3682
uint8 GetByteValue(uint16 index, uint8 offset) const
Definition: Object.cpp:318
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:49
uint32 type_flags
Definition: Creature.h:117

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Unit::_IsValidAttackTarget ( Unit const target,
SpellInfo const bySpell,
WorldObject const obj = NULL 
) const
10009 {
10010  ASSERT(target);
10012  // can't attack self
10013  if (this == target)
10014  return false;
10016  // can't attack unattackable units or GMs
10017  if (target->HasUnitState(UNIT_STATE_UNATTACKABLE)
10018  || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster()))
10019  return false;
10021  // can't attack own vehicle or passenger
10022  if (m_vehicle)
10023  if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))
10024  return false;
10026  // can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. Ignore stealth if target is player and unit in combat with same player
10027  if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea(GetMap()->GetDifficultyID())) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea(GetMap()->GetDifficultyID())) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target)))))
10028  return false;
10030  // can't attack dead
10031  if ((!bySpell || !bySpell->IsAllowingDeadTarget()) && !target->IsAlive())
10032  return false;
10034  // can't attack untargetable
10035  if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_UNTARGETABLE))
10037  return false;
10039  if (Player const* playerAttacker = ToPlayer())
10040  {
10041  if (playerAttacker->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_UBER))
10042  return false;
10043  }
10045  // check flags
10049  return false;
10051  if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG))
10053  // check if this is a world trigger cast - GOs are using world triggers to cast their spells, so we need to ignore their immunity flag here, this is a temp workaround, needs removal when go cast is implemented properly
10054  && GetEntry() != WORLD_TRIGGER)
10055  return false;
10057  // CvC case - can attack each other only when one of them is hostile
10059  return GetReactionTo(target) <= REP_HOSTILE || target->GetReactionTo(this) <= REP_HOSTILE;
10061  // PvP, PvC, CvP case
10062  // can't attack friendly targets
10063  if ( GetReactionTo(target) > REP_NEUTRAL
10064  || target->GetReactionTo(this) > REP_NEUTRAL)
10065  return false;
10067  // Not all neutral creatures can be attacked (even some unfriendly faction does not react aggresive to you, like Sporaggar)
10068  if (GetReactionTo(target) == REP_NEUTRAL &&
10069  target->GetReactionTo(this) <= REP_NEUTRAL)
10070  {
10071  if (!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
10072  !(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT))
10073  {
10074  Player const* player = target->GetTypeId() == TYPEID_PLAYER ? target->ToPlayer() : ToPlayer();
10075  Unit const* creature = target->GetTypeId() == TYPEID_UNIT ? target : this;
10077  if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
10078  {
10079  if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
10080  if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction))
10081  if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
10082  if (!(repState->Flags & FACTION_FLAG_AT_WAR))
10083  return false;
10085  }
10086  }
10087  }
10089  Creature const* creatureAttacker = ToCreature();
10090  if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_TREAT_AS_RAID_UNIT)
10091  return false;
10093  Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL;
10094  Player const* playerAffectingTarget = target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? target->GetAffectingPlayer() : NULL;
10096  // check duel - before sanctuary checks
10097  if (playerAffectingAttacker && playerAffectin