TrinityCore
Creature Class Reference

#include <Creature.h>

Public Member Functions

 Creature (bool isWorldObject=false)
 
virtual ~Creature ()
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void SetObjectScale (float scale) override
 
void SetDisplayId (uint32 displayId, float displayScale=1.f) override
 
void SetDisplayFromModel (uint32 modelIdx)
 
void DisappearAndDie ()
 
bool Create (ObjectGuid::LowType guidlow, Map *map, uint32 entry, Position const &pos, CreatureData const *data, uint32 vehId, bool dynamic=false)
 
bool LoadCreaturesAddon ()
 
void SelectLevel ()
 
void UpdateLevelDependantStats ()
 
void LoadEquipment (int8 id=1, bool force=false)
 
void SetSpawnHealth ()
 
ObjectGuid::LowType GetSpawnId () const
 
void Update (uint32 time) override
 
void GetRespawnPosition (float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
 
bool IsSpawnedOnTransport () const
 
void SetCorpseDelay (uint32 delay)
 
uint32 GetCorpseDelay () const
 
bool IsRacialLeader () const
 
bool IsCivilian () const
 
bool IsTrigger () const
 
bool IsGuard () const
 
CreatureMovementData const & GetMovementTemplate () const
 
bool CanWalk () const
 
bool CanSwim () const override
 
bool CanFly () const override
 
bool CanHover () const
 
bool IsDungeonBoss () const
 
bool IsAffectedByDiminishingReturns () const override
 
UnitSelectVictim ()
 
void SetReactState (ReactStates st)
 
ReactStates GetReactState () const
 
bool HasReactState (ReactStates state) const
 
void InitializeReactState ()
 
void SetImmuneToAll (bool apply) override
 
void SetImmuneToPC (bool apply) override
 
void SetImmuneToNPC (bool apply) override
 
bool isCanInteractWithBattleMaster (Player *player, bool msg) const
 
bool CanResetTalents (Player *player) const
 
bool CanCreatureAttack (Unit const *victim, bool force=true) const
 
void LoadTemplateImmunities ()
 
bool IsImmunedToSpell (SpellInfo const *spellInfo, WorldObject const *caster) const override
 
bool IsImmunedToSpellEffect (SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster) const override
 
bool isElite () const
 
bool isWorldBoss () const
 
bool HasScalableLevels () const
 
uint8 GetLevelForTarget (WorldObject const *target) const override
 
uint64 GetMaxHealthByLevel (uint8 level) const
 
float GetHealthMultiplierForTarget (WorldObject const *target) const override
 
float GetBaseDamageForLevel (uint8 level) const
 
float GetDamageMultiplierForTarget (WorldObject const *target) const override
 
float GetBaseArmorForLevel (uint8 level) const
 
float GetArmorMultiplierForTarget (WorldObject const *target) const override
 
bool IsInEvadeMode () const
 
bool IsEvadingAttacks () const
 
bool AIM_Destroy ()
 
bool AIM_Create (CreatureAI *ai=nullptr)
 
void AI_InitializeAndEnable ()
 
bool AIM_Initialize (CreatureAI *ai=nullptr)
 
void Motion_Initialize ()
 
CreatureAIAI () const
 
SpellSchoolMask GetMeleeDamageSchoolMask (WeaponAttackType=BASE_ATTACK) const override
 
void SetMeleeDamageSchool (SpellSchools school)
 
bool HasSpell (uint32 spellID) const override
 
bool UpdateEntry (uint32 entry, CreatureData const *data=nullptr, bool updateLevel=true)
 
void UpdateMovementFlags ()
 
bool UpdateStats (Stats stat) override
 
bool UpdateAllStats () override
 
void UpdateArmor () override
 
void UpdateMaxHealth () override
 
void UpdateMaxPower (Powers power) override
 
uint32 GetPowerIndex (Powers power) const override
 
void UpdateAttackPowerAndDamage (bool ranged=false) override
 
void CalculateMinMaxDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage) const override
 
void SetCanDualWield (bool value) override
 
int8 GetOriginalEquipmentId () const
 
uint8 GetCurrentEquipmentId () const
 
void SetCurrentEquipmentId (uint8 id)
 
float GetSpellDamageMod (int32 Rank) const
 
VendorItemData const * GetVendorItems () const
 
uint32 GetVendorItemCurrentCount (VendorItem const *vItem)
 
uint32 UpdateVendorItemCurrentCount (VendorItem const *vItem, uint32 used_count)
 
CreatureTemplate const * GetCreatureTemplate () const
 
CreatureData const * GetCreatureData () const
 
CreatureAddon const * GetCreatureAddon () const
 
std::string const & GetAIName () const
 
std::string GetScriptName () const
 
uint32 GetScriptId () const
 
std::string GetNameForLocaleIdx (LocaleConstant locale) const override
 
void setDeathState (DeathState s) override
 
bool LoadFromDB (ObjectGuid::LowType spawnId, Map *map, bool addToMap, bool allowDuplicate)
 
void SaveToDB ()
 
virtual void SaveToDB (uint32 mapid, std::vector< Difficulty > const &spawnDifficulties)
 
virtual void DeleteFromDB ()
 
void StartPickPocketRefillTimer ()
 
void ResetPickPocketRefillTimer ()
 
bool CanGeneratePickPocketLoot () const
 
ObjectGuid GetLootRecipientGUID () const
 
PlayerGetLootRecipient () const
 
GroupGetLootRecipientGroup () const
 
bool hasLootRecipient () const
 
bool isTappedBy (Player const *player) const
 
void SetLootRecipient (Unit *unit, bool withGroup=true)
 
void AllLootRemovedFromCorpse ()
 
uint16 GetLootMode () const
 
bool HasLootMode (uint16 lootMode)
 
void SetLootMode (uint16 lootMode)
 
void AddLootMode (uint16 lootMode)
 
void RemoveLootMode (uint16 lootMode)
 
void ResetLootMode ()
 
bool CanStartAttack (Unit const *u, bool force) const
 
float GetAttackDistance (Unit const *player) const
 
float GetAggroRange (Unit const *target) const
 
void SendAIReaction (AiReaction reactionType)
 
UnitSelectNearestTarget (float dist=0, bool playerOnly=false) const
 
UnitSelectNearestTargetInAttackDistance (float dist=0) const
 
UnitSelectNearestHostileUnitInAggroRange (bool useLOS=false) const
 
void DoFleeToGetAssistance ()
 
void CallForHelp (float fRadius)
 
void CallAssistance ()
 
void SetNoCallAssistance (bool val)
 
void SetNoSearchAssistance (bool val)
 
bool HasSearchedAssistance () const
 
bool CanAssistTo (Unit const *u, Unit const *enemy, bool checkfaction=true) const
 
bool _IsTargetAcceptable (Unit const *target) const
 
MovementGeneratorType GetDefaultMovementType () const
 
void SetDefaultMovementType (MovementGeneratorType mgt)
 
void RemoveCorpse (bool setSpawnTime=true, bool destroyForNearbyPlayers=true)
 
void DespawnOrUnsummon (uint32 msTimeToDespawn=0, Seconds const &forceRespawnTime=Seconds(0))
 
void DespawnOrUnsummon (Milliseconds const &time, Seconds const &forceRespawnTime=Seconds(0))
 
time_t const & GetRespawnTime () const
 
time_t GetRespawnTimeEx () const
 
void SetRespawnTime (uint32 respawn)
 
void Respawn (bool force=false)
 
void SaveRespawnTime (uint32 forceDelay=0, bool savetodb=true) override
 
uint32 GetRespawnDelay () const
 
void SetRespawnDelay (uint32 delay)
 
float GetRespawnRadius () const
 
void SetRespawnRadius (float dist)
 
void DoImmediateBoundaryCheck ()
 
uint32 GetCombatPulseDelay () const
 
void SetCombatPulseDelay (uint32 delay)
 
void SendZoneUnderAttackMessage (Player *attacker)
 Send a message to LocalDefense channel for players opposition team in the zone. More...
 
bool hasQuest (uint32 quest_id) const override
 
bool hasInvolvedQuest (uint32 quest_id) const override
 
bool CanRegenerateHealth () const
 
void SetRegenerateHealth (bool value)
 
virtual uint8 GetPetAutoSpellSize () const
 
virtual uint32 GetPetAutoSpellOnPos (uint8 pos) const
 
float GetPetChaseDistance () const
 
void SetCannotReachTarget (bool cannotReach)
 
bool CanNotReachTarget () const
 
void SetHomePosition (float x, float y, float z, float o)
 
void SetHomePosition (Position const &pos)
 
void GetHomePosition (float &x, float &y, float &z, float &ori) const
 
Position const & GetHomePosition () const
 
void SetTransportHomePosition (float x, float y, float z, float o)
 
void SetTransportHomePosition (Position const &pos)
 
void GetTransportHomePosition (float &x, float &y, float &z, float &ori) const
 
Position const & GetTransportHomePosition () const
 
uint32 GetWaypointPath () const
 
void LoadPath (uint32 pathid)
 
std::pair< uint32, uint32GetCurrentWaypointInfo () const
 
void UpdateCurrentWaypointInfo (uint32 nodeId, uint32 pathId)
 
bool IsReturningHome () const
 
void SearchFormation ()
 
CreatureGroupGetFormation ()
 
void SetFormation (CreatureGroup *formation)
 
bool IsFormationLeader () const
 
void SignalFormationMovement (Position const &destination, uint32 id=0, uint32 moveType=0, bool orientation=false)
 
bool IsFormationLeaderMoveAllowed () const
 
void SetDisableReputationGain (bool disable)
 
bool IsReputationGainDisabled () const
 
bool IsDamageEnoughForLootingAndReward () const
 
void LowerPlayerDamageReq (uint64 unDamage)
 
void ResetPlayerDamageReq ()
 
uint32 GetOriginalEntry () const
 
void SetOriginalEntry (uint32 entry)
 
void SetRespawnCompatibilityMode (bool mode=true)
 
bool GetRespawnCompatibilityMode ()
 
void SetTarget (ObjectGuid const &guid) override
 
void MustReacquireTarget ()
 
void DoNotReacquireTarget ()
 
void FocusTarget (Spell const *focusSpell, WorldObject const *target)
 
bool IsFocusing (Spell const *focusSpell=nullptr, bool withDelay=false) override
 
void ReleaseFocus (Spell const *focusSpell=nullptr, bool withDelay=true)
 
bool IsMovementPreventedByCasting () const override
 
time_t GetLastDamagedTime () const
 
void SetLastDamagedTime (time_t val)
 
CreatureTextRepeatIds GetTextRepeatGroup (uint8 textGroup)
 
void SetTextRepeatId (uint8 textGroup, uint8 id)
 
void ClearTextRepeatGroup (uint8 textGroup)
 
bool IsEscortNPC (bool onlyIfActive=true)
 
bool CanGiveExperience () const
 
void AtEnterCombat () override
 
void AtExitCombat () override
 
- Public Member Functions inherited from Unit
virtual ~Unit ()
 
UnitAIGetAI ()
 
void SetAI (UnitAI *newAI)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void CleanupBeforeRemoveFromMap (bool finalCleanup)
 
void CleanupsBeforeDelete (bool finalCleanup=true) override
 
DiminishingLevels GetDiminishing (DiminishingGroup group) const
 
void IncrDiminishing (SpellInfo const *auraSpellInfo)
 
bool ApplyDiminishingToDuration (SpellInfo const *auraSpellInfo, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
 
void ApplyDiminishingAura (DiminishingGroup group, bool apply)
 
void ClearDiminishings ()
 
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
 
float GetCombatReach () const override
 
void SetCombatReach (float combatReach)
 
float GetBoundingRadius () const
 
void SetBoundingRadius (float boundingRadius)
 
bool IsWithinCombatRange (Unit const *obj, float dist2compare) const
 
bool IsWithinMeleeRange (Unit const *obj) const
 
float GetMeleeRange (Unit const *target) const
 
bool IsWithinBoundaryRadius (const Unit *obj) const
 
void GetRandomContactPoint (Unit const *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 CastStop (uint32 except_spellid=0)
 
bool AttackStop ()
 
void RemoveAllAttackers ()
 
AttackerSet const & getAttackers () const
 
bool isAttackingPlayer () const
 
UnitGetVictim () const
 
UnitEnsureVictim () const
 
void ValidateAttackersAndOwnTarget ()
 
void CombatStop (bool includingCast=false, bool mutualPvP=true)
 
void CombatStopWithPets (bool includingCast=false)
 
void StopAttackFaction (uint32 faction_id)
 
UnitSelectNearbyTarget (Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
 
void SendMeleeAttackStop (Unit *victim=nullptr)
 
void SendMeleeAttackStart (Unit *victim)
 
void AddUnitState (uint32 f)
 
bool HasUnitState (const uint32 f) const
 
void ClearUnitState (uint32 f)
 
bool CanFreeMove () const
 
uint32 HasUnitTypeMask (uint32 mask) const
 
void AddUnitTypeMask (uint32 mask)
 
bool IsSummon () const
 
bool IsGuardian () const
 
bool IsPet () const
 
bool IsHunterPet () const
 
bool IsTotem () const
 
bool IsVehicle () const
 
uint8 getLevel () const
 
uint8 GetLevelForTarget (WorldObject const *) const override
 
void SetLevel (uint8 lvl)
 
uint8 getRace () const
 
void SetRace (uint8 race)
 
uint64 getRaceMask () const
 
uint8 getClass () const
 
void SetClass (uint8 classId)
 
uint32 getClassMask () const
 
uint8 getGender () const
 
void SetGender (uint8 sex)
 
float GetStat (Stats stat) const
 
void SetStat (Stats stat, int32 val)
 
uint32 GetArmor () const
 
void SetArmor (int32 val, int32 bonusVal)
 
int32 GetResistance (SpellSchools school) const
 
int32 GetBonusResistanceMod (SpellSchools school) const
 
int32 GetResistance (SpellSchoolMask mask) const
 
void SetResistance (SpellSchools school, int32 val)
 
void SetBonusResistanceMod (SpellSchools school, int32 val)
 
uint64 GetHealth () const
 
uint64 GetMaxHealth () const
 
bool IsFullHealth () const
 
bool HealthBelowPct (int32 pct) const
 
bool HealthBelowPctDamaged (int32 pct, uint32 damage) const
 
bool HealthAbovePct (int32 pct) const
 
bool HealthAbovePctHealed (int32 pct, uint32 heal) const
 
float GetHealthPct () const
 
uint64 CountPctFromMaxHealth (int32 pct) const
 
uint64 CountPctFromCurHealth (int32 pct) const
 
void SetHealth (uint64 val)
 
void SetMaxHealth (uint64 val)
 
void SetFullHealth ()
 
int64 ModifyHealth (int64 val)
 
int64 GetHealthGain (int64 dVal)
 
Powers GetPowerType () const
 
void SetPowerType (Powers power)
 
void SetOverrideDisplayPowerId (uint32 powerDisplayId)
 
void UpdateDisplayPower ()
 
int32 GetPower (Powers power) const
 
int32 GetMinPower (Powers power) const
 
int32 GetMaxPower (Powers power) const
 
float GetPowerPct (Powers power) const
 
int32 CountPctFromMaxPower (Powers power, int32 pct) const
 
void SetPower (Powers power, int32 val, bool withPowerUpdate=true)
 
void SetMaxPower (Powers power, int32 val)
 
void TriggerOnPowerChangeAuras (Powers power, int32 oldVal, int32 newVal)
 
void SetFullPower (Powers power)
 
int32 ModifyPower (Powers power, int32 val, bool withPowerUpdate=true)
 
void ApplyModManaCostMultiplier (float manaCostMultiplier, bool apply)
 
void ApplyModManaCostModifier (SpellSchools school, int32 mod, bool apply)
 
uint32 GetBaseAttackTime (WeaponAttackType att) const
 
void SetBaseAttackTime (WeaponAttackType att, uint32 val)
 
void UpdateAttackTimeField (WeaponAttackType att)
 
void ApplyAttackTimePercentMod (WeaponAttackType att, float val, bool apply)
 
void ApplyCastTimePercentMod (float val, bool apply)
 
void SetModCastingSpeed (float castingSpeed)
 
void SetModSpellHaste (float spellHaste)
 
void SetModHaste (float haste)
 
void SetModRangedHaste (float rangedHaste)
 
void SetModHasteRegen (float hasteRegen)
 
void SetModTimeRate (float timeRate)
 
bool HasUnitFlag (UnitFlags flags) const
 
void AddUnitFlag (UnitFlags flags)
 
void RemoveUnitFlag (UnitFlags flags)
 
void SetUnitFlags (UnitFlags flags)
 
bool HasUnitFlag2 (UnitFlags2 flags) const
 
void AddUnitFlag2 (UnitFlags2 flags)
 
void RemoveUnitFlag2 (UnitFlags2 flags)
 
void SetUnitFlags2 (UnitFlags2 flags)
 
bool HasUnitFlag3 (UnitFlags3 flags) const
 
void AddUnitFlag3 (UnitFlags3 flags)
 
void RemoveUnitFlag3 (UnitFlags3 flags)
 
void SetUnitFlags3 (UnitFlags3 flags)
 
void SetCreatedBySpell (int32 spellId)
 
Emote GetEmoteState () const
 
void SetEmoteState (Emote emote)
 
SheathState GetSheath () const
 
void SetSheath (SheathState sheathed)
 
uint32 GetFaction () const override
 
void SetFaction (uint32 faction) override
 
bool IsInPartyWith (Unit const *unit) const
 
bool IsInRaidWith (Unit const *unit) const
 
void GetPartyMembers (std::list< Unit *> &units)
 
bool IsContestedGuard () const
 
UnitPVPStateFlags GetPvpFlags () const
 
bool HasPvpFlag (UnitPVPStateFlags flags) const
 
void AddPvpFlag (UnitPVPStateFlags flags)
 
void RemovePvpFlag (UnitPVPStateFlags flags)
 
void SetPvpFlags (UnitPVPStateFlags flags)
 
bool IsInSanctuary () const
 
bool IsPvP () const
 
bool IsFFAPvP () const
 
virtual void SetPvP (bool state)
 
UnitPetFlag GetPetFlags () const
 
bool HasPetFlag (UnitPetFlag flags) const
 
void AddPetFlag (UnitPetFlag flags)
 
void RemovePetFlag (UnitPetFlag flags)
 
void SetPetFlags (UnitPetFlag flags)
 
uint32 GetCreatureType () const
 
uint32 GetCreatureTypeMask () const
 
UnitStandStateType GetStandState () const
 
bool IsSitState () const
 
bool IsStandState () const
 
void SetStandState (UnitStandStateType state, uint32 animKitID=0)
 
void AddVisFlags (UnitVisFlags flags)
 
void RemoveVisFlags (UnitVisFlags flags)
 
void SetVisFlags (UnitVisFlags flags)
 
void SetAnimTier (UnitBytes1_Flags animTier, bool notifyClient)
 
bool IsMounted () const
 
uint32 GetMountDisplayId () const
 
void SetMountDisplayId (uint32 mountDisplayId)
 
void Mount (uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
 
void Dismount ()
 
MountCapabilityEntry const * GetMountCapability (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=nullptr) const
 
void KillSelf (bool durabilityLoss=true, bool skipSettingDeathState=false)
 
void GetProcAurasTriggeredOnEvent (AuraApplicationProcContainer &aurasTriggeringProc, AuraApplicationList *procAuras, ProcEventInfo &eventInfo)
 
void TriggerAurasProcOnEvent (AuraApplicationList *myProcAuras, AuraApplicationList *targetProcAuras, Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
 
void TriggerAurasProcOnEvent (ProcEventInfo &eventInfo, AuraApplicationProcContainer &procAuras)
 
void HandleEmoteCommand (uint32 anim_id, Trinity::IteratorPair< int32 const *> spellVisualKitIds={})
 
void AttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
 
void FakeAttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK)
 
void CalculateMeleeDamage (Unit *victim, 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
 
virtual bool CanApplyResilience () const
 
int32 CalculateAOEAvoidance (int32 damage, uint32 schoolMask, ObjectGuid const &casterGuid) const
 
float MeleeSpellMissChance (Unit const *victim, WeaponAttackType attType, SpellInfo const *spellInfo) const override
 
SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const override
 
float GetUnitDodgeChance (WeaponAttackType attType, Unit const *victim) const
 
float GetUnitParryChance (WeaponAttackType attType, Unit const *victim) const
 
float GetUnitBlockChance (WeaponAttackType attType, Unit const *victim) const
 
float GetUnitMissChance () const
 
float GetUnitCriticalChanceDone (WeaponAttackType attackType) const
 
float GetUnitCriticalChanceTaken (Unit const *attacker, WeaponAttackType attackType, float critDone) const
 
float GetUnitCriticalChanceAgainst (WeaponAttackType attackType, Unit const *victim) const
 
int32 GetMechanicResistChance (SpellInfo const *spellInfo) const
 
bool CanUseAttackType (uint8 attacktype) const
 
virtual float GetBlockPercent (uint8) const
 
float GetWeaponProcChance () const
 
float GetPPMProcChance (uint32 WeaponSpeed, float PPM, SpellInfo const *spellProto) const
 
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const *victim, WeaponAttackType attType) const
 
bool HasNpcFlag (NPCFlags flags) const
 
void AddNpcFlag (NPCFlags flags)
 
void RemoveNpcFlag (NPCFlags flags)
 
void SetNpcFlags (NPCFlags flags)
 
bool HasNpcFlag2 (NPCFlags2 flags) const
 
void AddNpcFlag2 (NPCFlags2 flags)
 
void RemoveNpcFlag2 (NPCFlags2 flags)
 
void SetNpcFlags2 (NPCFlags2 flags)
 
bool IsVendor () const
 
bool IsTrainer () const
 
bool IsQuestGiver () const
 
bool IsGossip () const
 
bool IsTaxi () const
 
bool IsGuildMaster () const
 
bool IsBattleMaster () const
 
bool IsBanker () const
 
bool IsInnkeeper () const
 
bool IsSpiritHealer () const
 
bool IsSpiritGuide () const
 
bool IsTabardDesigner () const
 
bool IsAuctioner () const
 
bool IsArmorer () const
 
bool IsServiceProvider () const
 
bool IsSpiritService () const
 
bool IsCritter () const
 
bool IsInFlight () const
 
bool CanHaveThreatList () const
 ====================== THREAT & COMBAT ==================== More...
 
bool IsEngaged () const
 
bool IsEngagedBy (Unit const *who) const
 
void EngageWithTarget (Unit *who)
 
CombatManagerGetCombatManager ()
 
CombatManager const & GetCombatManager () const
 
void AttackedTarget (Unit *target, bool canInitialAggro)
 
bool IsImmuneToAll () const
 
void SetImmuneToAll (bool apply, bool keepCombat)
 
bool IsImmuneToPC () const
 
void SetImmuneToPC (bool apply, bool keepCombat)
 
bool IsImmuneToNPC () const
 
void SetImmuneToNPC (bool apply, bool keepCombat)
 
bool IsInCombat () const
 
bool IsInCombatWith (Unit const *who) const
 
void SetInCombatWith (Unit *enemy)
 
void ClearInCombat ()
 
void UpdatePetCombatState ()
 
bool IsThreatened () const
 
bool IsThreatenedBy (Unit const *who) const
 
ThreatManagerGetThreatManager ()
 
ThreatManager const & GetThreatManager () const
 
void SendClearTarget ()
 
void SendThreatListUpdate ()
 
bool HasAuraTypeWithFamilyFlags (AuraType auraType, uint32 familyName, flag128 familyFlags) const
 
bool HasBreakableByDamageAuraType (AuraType type, uint32 excludeAura=0) const
 
bool HasBreakableByDamageCrowdControlAura (Unit *excludeCasterChannel=nullptr) const
 
bool HasStealthAura () const
 
bool HasInvisibilityAura () const
 
bool isFeared () const
 
bool IsPolymorphed () const
 
bool isFrozen () const
 
bool isTargetableForAttack (bool checkFakeDeath=true) const
 
virtual bool IsInWater () const
 
virtual bool IsUnderWater () const
 
bool isInAccessiblePlaceFor (Creature const *c) const
 
void SendHealSpellLog (HealInfo &healInfo, bool critical=false)
 
int32 HealBySpell (HealInfo &healInfo, bool critical=false)
 
void SendEnergizeSpellLog (Unit *victim, uint32 spellId, int32 damage, int32 overEnergize, Powers powerType)
 
void EnergizeBySpell (Unit *victim, SpellInfo const *spellInfo, int32 damage, Powers powerType)
 
AuraAddAura (uint32 spellId, Unit *target)
 
AuraAddAura (SpellInfo const *spellInfo, uint32 effMask, Unit *target)
 
void SetAuraStack (uint32 spellId, Unit *target, uint32 stack)
 
void SendCancelOrphanSpellVisual (uint32 id)
 
void SendPlayOrphanSpellVisual (ObjectGuid const &target, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
 
void SendPlayOrphanSpellVisual (Position const &targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
 
void SendCancelSpellVisual (uint32 id)
 
void SendPlaySpellVisual (ObjectGuid const &target, uint32 spellVisualId, uint16 missReason, uint16 reflectStatus, float travelSpeed, bool speedAsTime=false)
 
void SendPlaySpellVisual (Position const &targetPosition, float o, uint32 spellVisualId, uint16 missReason, uint16 reflectStatus, float travelSpeed, bool speedAsTime=false)
 
void SendCancelSpellVisualKit (uint32 id)
 
void SendPlaySpellVisualKit (uint32 id, uint32 type, uint32 duration) const
 
void CancelSpellMissiles (uint32 spellId, bool reverseMissile=false)
 
void DeMorph ()
 
void SendAttackStateUpdate (CalcDamageInfo *damageInfo)
 
void SendAttackStateUpdate (uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
 
void SendSpellNonMeleeDamageLog (SpellNonMeleeDamage const *log)
 
void SendPeriodicAuraLog (SpellPeriodicAuraLogInfo *pInfo)
 
void SendSpellDamageResist (Unit *target, uint32 spellId)
 
void SendSpellDamageImmune (Unit *target, uint32 spellId, bool isPeriodic)
 
void NearTeleportTo (Position const &pos, bool casting=false)
 
void NearTeleportTo (float x, float y, float z, float orientation, bool casting=false)
 
void SendTeleportPacket (Position const &pos)
 
virtual bool UpdatePosition (float x, float y, float z, float ang, bool teleport=false)
 
virtual bool UpdatePosition (Position const &pos, bool teleport=false)
 
void UpdateOrientation (float orientation)
 Only server-side orientation update, does not broadcast to client. More...
 
void UpdateHeight (float newZ)
 Only server-side height update, does not broadcast to client. More...
 
void SendMoveKnockBack (Player *player, float speedXY, float speedZ, float vcos, float vsin)
 
void KnockbackFrom (float x, float y, float speedXY, float speedZ, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
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)
 
void SetHoverHeight (float hoverHeight)
 
bool IsLevitating () const
 
bool IsWalking () const
 
bool IsHovering () const
 
bool SetWalk (bool enable)
 
bool SetDisableGravity (bool disable)
 
bool SetFall (bool enable)
 
bool SetSwim (bool enable)
 
bool SetCanFly (bool enable)
 
bool SetWaterWalking (bool enable)
 
bool SetFeatherFall (bool enable)
 
bool SetHover (bool enable)
 
bool SetCollision (bool disable)
 
bool SetCanTransitionBetweenSwimAndFly (bool enable)
 
bool SetCanTurnWhileFalling (bool enable)
 
bool SetCanDoubleJump (bool enable)
 
void SendSetVehicleRecId (uint32 vehicleId)
 
MovementForces const * GetMovementForces () const
 
void ApplyMovementForce (ObjectGuid id, Position origin, float magnitude, uint8 type, Position direction={}, ObjectGuid transportGuid=ObjectGuid::Empty)
 
void RemoveMovementForce (ObjectGuid id)
 
bool SetIgnoreMovementForces (bool ignore)
 
void UpdateMovementForcesModMagnitude ()
 
void SetInFront (WorldObject const *target)
 
void SetFacingTo (float const ori, bool force=true)
 
void SetFacingToObject (WorldObject const *object, bool force=true)
 
bool IsAlive () const
 
bool isDying () const
 
bool isDead () const
 
DeathState getDeathState () const
 
ObjectGuid GetOwnerGUID () const override
 
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 SetCharmGUID (ObjectGuid charm)
 
ObjectGuid GetPetGUID () const
 
void SetPetGUID (ObjectGuid guid)
 
ObjectGuid GetCritterGUID () const
 
void SetCritterGUID (ObjectGuid guid)
 
ObjectGuid GetBattlePetCompanionGUID () const
 
void SetBattlePetCompanionGUID (ObjectGuid guid)
 
ObjectGuid GetDemonCreatorGUID () const
 
void SetDemonCreatorGUID (ObjectGuid guid)
 
bool IsControlledByPlayer () const
 
ObjectGuid GetCharmerOrOwnerGUID () const override
 
bool IsCharmedOwnedByPlayerOrPlayer () const
 
GuardianGetGuardianPet () const
 
MinionGetFirstMinion () const
 
UnitGetCharmer () const
 
UnitGetCharm () const
 
UnitGetCharmerOrOwner () const
 
void SetMinion (Minion *minion, bool apply)
 
void GetAllMinionsByEntry (std::list< TempSummon *> &Minions, uint32 entry)
 
void RemoveAllMinionsByEntry (uint32 entry)
 
void SetCharm (Unit *target, bool apply)
 
UnitGetNextRandomRaidMemberOrPet (float radius)
 
bool SetCharmedBy (Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
 
void RemoveCharmedBy (Unit *charmer)
 
void RestoreFaction ()
 
UnitGetFirstControlled () const
 
void RemoveAllControlled ()
 
bool IsCharmed () const
 
bool isPossessed () const
 
bool isPossessedByPlayer () const
 
bool isPossessing () const
 
bool isPossessing (Unit *u) const
 
CharmInfoGetCharmInfo ()
 
CharmInfoInitCharmInfo ()
 
void DeleteCharmInfo ()
 
void SetPetNumberForClient (uint32 petNumber)
 
void SetPetNameTimestamp (uint32 timestamp)
 
void UpdateCharmAI ()
 
UnitGetUnitBeingMoved () const
 
PlayerGetPlayerBeingMoved () const
 
PlayerGetPlayerMovingMe () const
 
SharedVisionList const & GetSharedVisionList ()
 
void AddPlayerToVision (Player *player)
 
void RemovePlayerFromVision (Player *player)
 
bool HasSharedVision () const
 
void RemoveBindSightAuras ()
 
void RemoveCharmAuras ()
 
PetCreateTamedPetFrom (Creature *creatureTarget, uint32 spell_id=0)
 
PetCreateTamedPetFrom (uint32 creatureEntry, uint32 spell_id=0)
 
bool InitTamedPet (Pet *pet, uint8 level, uint32 spell_id)
 
Aura_TryStackingOrRefreshingExistingAura (AuraCreateInfo &createInfo)
 
void _AddAura (UnitAura *aura, Unit *caster)
 
AuraApplication_CreateAuraApplication (Aura *aura, uint32 effMask)
 
void _ApplyAuraEffect (Aura *aura, uint8 effIndex)
 
void _ApplyAura (AuraApplication *aurApp, uint32 effMask)
 
void _UnapplyAura (AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
 
void _UnapplyAura (AuraApplication *aurApp, AuraRemoveMode removeMode)
 
void _RemoveNoStackAurasDueToAura (Aura *aura)
 
void _RegisterAuraEffect (AuraEffect *aurEff, bool apply)
 
AuraMapGetOwnedAuras ()
 
AuraMap const & GetOwnedAuras () const
 
void RemoveOwnedAura (AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveOwnedAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveOwnedAura (Aura *aura, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
AuraGetOwnedAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, Aura *except=nullptr) const
 
AuraApplicationMapGetAppliedAuras ()
 
AuraApplicationMap const & GetAppliedAuras () const
 
void RemoveAura (AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAura (AuraApplication *aurApp, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAura (Aura *aur, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAppliedAuras (std::function< bool(AuraApplication const *)> const &check)
 
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, uint16 num=1)
 
void RemoveAurasDueToSpellByDispel (uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, WorldObject *dispeller, uint8 chargesRemoved=1)
 
void RemoveAurasDueToSpellBySteal (uint32 spellId, ObjectGuid casterGUID, WorldObject *stealer)
 
void RemoveAurasDueToItemSpell (uint32 spellId, ObjectGuid castItemGuid)
 
void RemoveAurasByType (AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
 
void RemoveNotOwnSingleTargetAuras (bool onPhaseChange=false)
 
template<typename InterruptFlags >
void RemoveAurasWithInterruptFlags (InterruptFlags flag, 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 (bool withRoot)
 
void RemoveAurasByShapeShift ()
 
void RemoveAreaAurasDueToLeaveWorld ()
 
void RemoveAllAuras ()
 
void RemoveArenaAuras ()
 
void RemoveAurasOnEvade ()
 
void RemoveAllAurasOnDeath ()
 
void RemoveAllAurasRequiringDeadTarget ()
 
void RemoveAllAurasExceptType (AuraType type)
 
void RemoveAllAurasExceptType (AuraType type1, AuraType type2)
 
void RemoveAllGroupBuffsFromCaster (ObjectGuid casterGUID)
 
void DelayOwnedAuras (uint32 spellId, ObjectGuid caster, int32 delaytime)
 
void _RemoveAllAuraStatMods ()
 
void _ApplyAllAuraStatMods ()
 
AuraEffectList const & GetAuraEffectsByType (AuraType type) const
 
AuraEffectListGetAuraEffectsByType (AuraType type)
 
AuraListGetSingleCastAuras ()
 
AuraList const & GetSingleCastAuras () const
 
AuraEffectGetAuraEffect (uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
 
AuraEffectGetAuraEffectOfRankedSpell (uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
 
AuraEffectGetAuraEffect (AuraType type, SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID=ObjectGuid::Empty) const
 
AuraApplicationGetAuraApplication (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
 
AuraApplicationGetAuraApplication (uint32 spellId, std::function< bool(AuraApplication const *)> const &predicate) const
 
AuraApplicationGetAuraApplication (uint32 spellId, std::function< bool(Aura const *)> const &predicate) const
 
AuraApplicationGetAuraApplication (std::function< bool(AuraApplication const *)> const &predicate) const
 
AuraApplicationGetAuraApplication (std::function< bool(Aura const *)> const &predicate) const
 
AuraGetAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
 
AuraGetAura (uint32 spellId, std::function< bool(Aura const *)> const &predicate) const
 
AuraGetAura (std::function< bool(Aura const *)> const &predicate) const
 
AuraApplicationGetAuraApplicationOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
 
AuraGetAuraOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
 
void GetDispellableAuraList (WorldObject const *caster, uint32 dispelMask, DispelChargesList &dispelList, bool isReflect=false) const
 
bool HasAuraEffect (uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
 
uint32 GetAuraCount (uint32 spellId) const
 
bool HasAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
 
bool HasAura (std::function< bool(Aura const *)> const &predicate) const
 
bool HasAuraType (AuraType auraType) const
 
bool HasAuraTypeWithCaster (AuraType auratype, ObjectGuid caster) const
 
bool HasAuraTypeWithMiscvalue (AuraType auratype, int32 miscvalue) const
 
bool HasAuraTypeWithAffectMask (AuraType auratype, SpellInfo const *affectedSpell) const
 
bool HasAuraTypeWithValue (AuraType auratype, int32 value) const
 
template<typename InterruptFlags >
bool HasNegativeAuraWithInterruptFlag (InterruptFlags flag, ObjectGuid guid=ObjectGuid::Empty) const
 
bool HasAuraWithMechanic (uint32 mechanicMask) const
 
bool HasStrongerAuraWithDR (SpellInfo const *auraSpellInfo, Unit *caster) const
 
AuraEffectIsScriptOverriden (SpellInfo const *spell, int32 script) const
 
uint32 GetDiseasesByCaster (ObjectGuid casterGUID, bool remove=false)
 
uint32 GetDoTsByCaster (ObjectGuid casterGUID) const
 
int32 GetTotalAuraModifier (AuraType auratype) const
 
float GetTotalAuraMultiplier (AuraType auratype) const
 
int32 GetMaxPositiveAuraModifier (AuraType auratype) const
 
int32 GetMaxNegativeAuraModifier (AuraType auratype) const
 
int32 GetTotalAuraModifier (AuraType auratype, std::function< bool(AuraEffect const *)> const &predicate) const
 
float GetTotalAuraMultiplier (AuraType auratype, std::function< bool(AuraEffect const *)> const &predicate) const
 
int32 GetMaxPositiveAuraModifier (AuraType auratype, std::function< bool(AuraEffect const *)> const &predicate) const
 
int32 GetMaxNegativeAuraModifier (AuraType auratype, std::function< bool(AuraEffect const *)> const &predicate) const
 
int32 GetTotalAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
float GetTotalAuraMultiplierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
int32 GetMaxPositiveAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask, AuraEffect const *except=nullptr) const
 
int32 GetMaxNegativeAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
int32 GetTotalAuraModifierByMiscValue (AuraType auratype, int32 misc_value) const
 
float GetTotalAuraMultiplierByMiscValue (AuraType auratype, int32 misc_value) const
 
int32 GetMaxPositiveAuraModifierByMiscValue (AuraType auratype, int32 misc_value) const
 
int32 GetMaxNegativeAuraModifierByMiscValue (AuraType auratype, int32 misc_value) const
 
int32 GetTotalAuraModifierByAffectMask (AuraType auratype, SpellInfo const *affectedSpell) const
 
float GetTotalAuraMultiplierByAffectMask (AuraType auratype, SpellInfo const *affectedSpell) const
 
int32 GetMaxPositiveAuraModifierByAffectMask (AuraType auratype, SpellInfo const *affectedSpell) const
 
int32 GetMaxNegativeAuraModifierByAffectMask (AuraType auratype, SpellInfo const *affectedSpell) const
 
void InitStatBuffMods ()
 
void UpdateStatBuffMod (Stats stat)
 
void UpdateStatBuffModForClient (Stats stat)
 
void SetCreateStat (Stats stat, float val)
 
void SetCreateHealth (uint32 val)
 
uint32 GetCreateHealth () const
 
void SetCreateMana (uint32 val)
 
uint32 GetCreateMana () const
 
int32 GetCreatePowers (Powers power) const
 
float GetPosStat (Stats stat) const
 
float GetNegStat (Stats stat) const
 
float GetCreateStat (Stats stat) const
 
uint32 GetChannelSpellId () const
 
void SetChannelSpellId (uint32 channelSpellId)
 
uint32 GetChannelSpellXSpellVisualId () const
 
uint32 GetChannelScriptVisualId () const
 
void SetChannelVisual (SpellCastVisual channelVisual)
 
void AddChannelObject (ObjectGuid guid)
 
void SetChannelObject (uint32 slot, ObjectGuid guid)
 
void RemoveChannelObject (ObjectGuid guid)
 
void ClearChannelObjects ()
 
void SetCurrentCastSpell (Spell *pSpell)
 
void InterruptSpell (CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
 
void FinishSpell (CurrentSpellTypes spellType, 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 const * GetCastSpellInfo (SpellInfo const *spellInfo) const
 
uint32 GetCastSpellXSpellVisualId (SpellInfo const *spellInfo) const override
 
SpellHistoryGetSpellHistory ()
 
SpellHistory const * GetSpellHistory () const
 
ShapeshiftForm GetShapeshiftForm () const
 
void SetShapeshiftForm (ShapeshiftForm form)
 
bool IsInFeralForm () const
 
bool IsInDisallowedMountForm () const
 
bool IsDisallowedMountForm (uint32 spellId, ShapeshiftForm form, uint32 displayId) const
 
void HandleStatFlatModifier (UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
 
void ApplyStatPctModifier (UnitMods unitMod, UnitModifierPctType modifierType, float amount)
 
void SetStatFlatModifier (UnitMods unitMod, UnitModifierFlatType modifierType, float val)
 
void SetStatPctModifier (UnitMods unitMod, UnitModifierPctType modifierType, float val)
 
float GetFlatModifierValue (UnitMods unitMod, UnitModifierFlatType modifierType) const
 
float GetPctModifierValue (UnitMods unitMod, UnitModifierPctType modifierType) const
 
void UpdateUnitMod (UnitMods unitMod)
 
virtual bool CheckAttackFitToAuraRequirement (WeaponAttackType, AuraEffect const *) const
 
virtual void UpdateDamageDoneMods (WeaponAttackType attackType)
 
void UpdateAllDamageDoneMods ()
 
void UpdateDamagePctDoneMods (WeaponAttackType attackType)
 
void UpdateAllDamagePctDoneMods ()
 
float GetTotalStatValue (Stats stat) const
 
float GetTotalAuraModValue (UnitMods unitMod) const
 
SpellSchools GetSpellSchoolByAuraGroup (UnitMods unitMod) const
 
Stats GetStatByAuraGroup (UnitMods unitMod) const
 
bool CanModifyStats () const
 
void SetCanModifyStats (bool modifyStats)
 
virtual void UpdateResistances (uint32 school)
 
virtual void UpdateAllResistances ()
 
void SetAttackPower (int32 attackPower)
 
void SetAttackPowerModPos (int32 attackPowerMod)
 
void SetAttackPowerModNeg (int32 attackPowerMod)
 
void SetAttackPowerMultiplier (float attackPowerMult)
 
void SetRangedAttackPower (int32 attackPower)
 
void SetRangedAttackPowerModPos (int32 attackPowerMod)
 
void SetRangedAttackPowerModNeg (int32 attackPowerMod)
 
void SetRangedAttackPowerMultiplier (float attackPowerMult)
 
void SetMainHandWeaponAttackPower (int32 attackPower)
 
void SetOffHandWeaponAttackPower (int32 attackPower)
 
void SetRangedWeaponAttackPower (int32 attackPower)
 
virtual void UpdateDamagePhysical (WeaponAttackType attType)
 
float GetTotalAttackPowerValue (WeaponAttackType attType, bool includeWeapon=true) const
 
float GetWeaponDamageRange (WeaponAttackType attType, WeaponDamageRange type) const
 
void SetBaseWeaponDamage (WeaponAttackType attType, WeaponDamageRange damageRange, float value)
 
uint32 CalculateDamage (WeaponAttackType attType, bool normalized, bool addTotalPct) const
 
float GetAPMultiplier (WeaponAttackType attType, bool normalized) const
 
bool isInFrontInMap (Unit const *target, float distance, float arc=float(M_PI)) const
 
bool isInBackInMap (Unit const *target, float distance, float arc=float(M_PI)) const
 
bool IsVisible () const
 
void SetVisible (bool x)
 
void OnPhaseChange ()
 
void UpdateObjectVisibility (bool forced=true) override
 
VisibleAuraContainer const & GetVisibleAuras () const
 
bool HasVisibleAura (AuraApplication *aurApp) const
 
void SetVisibleAura (AuraApplication *aurApp)
 
void SetVisibleAuraUpdate (AuraApplication *aurApp)
 
void RemoveVisibleAura (AuraApplication *aurApp)
 
bool HasInterruptFlag (SpellAuraInterruptFlags flags) const
 
bool HasInterruptFlag (SpellAuraInterruptFlags2 flags) const
 
void AddInterruptMask (SpellAuraInterruptFlags flags, SpellAuraInterruptFlags2 flags2)
 
void UpdateInterruptMask ()
 
uint32 GetDisplayId () const
 
uint32 GetNativeDisplayId () const
 
float GetNativeDisplayScale () const
 
void RestoreDisplayId (bool ignorePositiveAurasPreventingMounting=false)
 
void SetNativeDisplayId (uint32 displayId, float displayScale=1.f)
 
void setTransForm (uint32 spellid)
 
uint32 getTransForm () const
 
void _RegisterDynObject (DynamicObject *dynObj)
 
void _UnregisterDynObject (DynamicObject *dynObj)
 
DynamicObjectGetDynObject (uint32 spellId) const
 
std::vector< DynamicObject * > GetDynObjects (uint32 spellId) const
 
void RemoveDynObject (uint32 spellId)
 
void RemoveAllDynObjects ()
 
GameObjectGetGameObject (uint32 spellId) const
 
std::vector< GameObject * > GetGameObjects (uint32 spellId) const
 
void AddGameObject (GameObject *gameObj)
 
void RemoveGameObject (GameObject *gameObj, bool del)
 
void RemoveGameObject (uint32 spellid, bool del)
 
void RemoveAllGameObjects ()
 
void _RegisterAreaTrigger (AreaTrigger *areaTrigger)
 
void _UnregisterAreaTrigger (AreaTrigger *areaTrigger)
 
AreaTriggerGetAreaTrigger (uint32 spellId) const
 
std::vector< AreaTrigger * > GetAreaTriggers (uint32 spellId) const
 
void RemoveAreaTrigger (uint32 spellId)
 
void RemoveAreaTrigger (AuraEffect const *aurEff)
 
void RemoveAllAreaTriggers ()
 
void ModifyAuraState (AuraStateType flag, bool apply)
 
uint32 BuildAuraStateUpdateForTarget (Unit const *target) const
 
bool HasAuraState (AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
 
void UnsummonAllTotems ()
 
bool IsMagnet () const
 
UnitGetMeleeHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo=nullptr)
 
int32 SpellBaseDamageBonusDone (SpellSchoolMask schoolMask) const
 
uint32 SpellDamageBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1) const
 
float SpellDamagePctDone (Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype) const
 
uint32 SpellDamageBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype) const
 
int32 SpellBaseHealingBonusDone (SpellSchoolMask schoolMask) const
 
uint32 SpellHealingBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1) const
 
float SpellHealingPctDone (Unit *victim, SpellInfo const *spellProto) const
 
uint32 SpellHealingBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype) const
 
uint32 MeleeDamageBonusDone (Unit *pVictim, uint32 damage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
 
uint32 MeleeDamageBonusTaken (Unit *attacker, uint32 pdamage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
 
bool isSpellBlocked (Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=BASE_ATTACK)
 
bool isBlockCritical ()
 
float SpellCritChanceDone (Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
 
float SpellCritChanceTaken (Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
 
void ApplySpellImmune (uint32 spellId, uint32 op, uint32 type, bool apply)
 
uint32 GetSchoolImmunityMask () const
 
uint32 GetDamageImmunityMask () const
 
uint32 GetMechanicImmunityMask () const
 
bool IsImmunedToDamage (SpellSchoolMask meleeSchoolMask) const
 
bool IsImmunedToDamage (SpellInfo const *spellInfo) const
 
void UpdateSpeed (UnitMoveType mtype)
 
float GetSpeed (UnitMoveType mtype) const
 
float GetSpeedRate (UnitMoveType mtype) const
 
void SetSpeed (UnitMoveType mtype, float newValue)
 
void SetSpeedRate (UnitMoveType mtype, float rate)
 
void addFollower (FollowerReference *pRef)
 
void removeFollower (FollowerReference *)
 
MotionMasterGetMotionMaster ()
 
MotionMaster const * GetMotionMaster () const
 
bool IsStopped () const
 
void StopMoving ()
 
void PauseMovement (uint32 timer=0, uint8 slot=0, bool forced=true)
 
void ResumeMovement (uint32 timer=0, uint8 slot=0)
 
void AddUnitMovementFlag (uint32 f)
 
void RemoveUnitMovementFlag (uint32 f)
 
bool HasUnitMovementFlag (uint32 f) const
 
uint32 GetUnitMovementFlags () const
 
void SetUnitMovementFlags (uint32 f)
 
void AddExtraUnitMovementFlag (uint32 f)
 
void RemoveExtraUnitMovementFlag (uint32 f)
 
bool HasExtraUnitMovementFlag (uint32 f) const
 
uint32 GetExtraUnitMovementFlags () const
 
void SetExtraUnitMovementFlags (uint32 f)
 
bool IsSplineEnabled () const
 
void SetControlled (bool apply, UnitState state)
 
void ApplyControlStatesIfNeeded ()
 
uint32 GetComboPoints () const
 --------—Combo point system----------------— More...
 
void AddComboPoints (int8 count, Spell *spell=nullptr)
 
void GainSpellComboPoints (int8 count)
 
void ClearComboPoints ()
 
void SendPetActionFeedback (PetActionFeedback msg, uint32 spellId)
 -------—Pet responses methods--------------— More...
 
void SendPetTalk (uint32 pettalk)
 
void SendPetAIReaction (ObjectGuid guid)
 
void PropagateSpeedChange ()
 -------—End of Pet responses methods-------— More...
 
void ClearAllReactives ()
 
void StartReactiveTimer (ReactiveType reactive)
 
void UpdateReactives (uint32 p_time)
 
void UpdateAuraForGroup ()
 
bool CanProc () const
 
void SetCantProc (bool apply)
 
uint32 GetModelForForm (ShapeshiftForm form, uint32 spellId) const
 
bool CreateVehicleKit (uint32 id, uint32 creatureEntry, bool loading=false)
 
void RemoveVehicleKit (bool onRemoveFromWorld=false)
 
VehicleGetVehicleKit () const
 
VehicleGetVehicle () const
 
void SetVehicle (Vehicle *vehicle)
 
bool IsOnVehicle (Unit const *vehicle) const
 
UnitGetVehicleBase () const
 
CreatureGetVehicleCreatureBase () const
 
ObjectGuid GetTransGUID () const override
 
TransportBaseGetDirectTransport () const
 Returns the transport this unit is on directly (if on vehicle and transport, return vehicle) More...
 
void HandleSpellClick (Unit *clicker, int8 seatId=-1)
 
void EnterVehicle (Unit *base, int8 seatId=-1)
 
void ExitVehicle (Position const *exitPosition=nullptr)
 
void ChangeSeat (int8 seatId, bool next=true)
 
void _ExitVehicle (Position const *exitPosition=nullptr)
 
void _EnterVehicle (Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
 
bool isMoving () const
 
bool isTurning () const
 
bool IsFlying () const
 
bool IsFalling () const
 
float GetHoverOffset () const
 
void RewardRage (uint32 baseRage)
 
virtual float GetFollowAngle () const
 
void OutDebugInfo () const
 
virtual bool IsLoading () const
 
bool IsDuringRemoveFromWorld () const
 
PetToPet ()
 
Pet const * ToPet () const
 
TotemToTotem ()
 
Totem const * ToTotem () const
 
TempSummonToTempSummon ()
 
TempSummon const * ToTempSummon () const
 
ObjectGuid GetTarget () const
 
void SetInstantCast (bool set)
 
bool CanInstantCast () const
 
int32 GetHighestExclusiveSameEffectSpellGroupValue (AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
 
bool IsHighestExclusiveAura (Aura const *aura, bool removeOtherAuraApplications=false)
 
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)
 
virtual void Talk (uint32 textId, ChatMsg msgType, float textRange, WorldObject const *target)
 
virtual void Say (uint32 textId, WorldObject const *target=nullptr)
 
virtual void Yell (uint32 textId, WorldObject const *target=nullptr)
 
virtual void TextEmote (uint32 textId, WorldObject const *target=nullptr, bool isBossEmote=false)
 
virtual void Whisper (uint32 textId, Player *target, bool isBossWhisper=false)
 
float GetCollisionHeight () const override
 
uint32 GetVirtualItemId (uint32 slot) const
 
uint16 GetVirtualItemAppearanceMod (uint32 slot) const
 
void SetVirtualItem (uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
 
void BuildValuesUpdateWithFlag (ByteBuffer *data, UF::UpdateFieldFlag flags, Player const *target) const override
 
void BuildValuesUpdateForPlayerWithMask (UpdateData *data, UF::ObjectData::Mask const &requestedObjectMask, UF::UnitData::Mask const &requestedUnitMask, Player const *target) const
 
- Public Member Functions inherited from WorldObject
virtual ~WorldObject ()
 
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
 
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
 
bool IsInPhase (WorldObject const *obj) const
 
PhaseShiftGetPhaseShift ()
 
PhaseShift const & GetPhaseShift () const
 
PhaseShiftGetSuppressedPhaseShift ()
 
PhaseShift const & GetSuppressedPhaseShift () const
 
int32 GetDBPhase () const
 
void SetDBPhase (int32 p)
 
uint32 GetZoneId () const
 
uint32 GetAreaId () const
 
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
 
bool IsOutdoors () const
 
bool IsInWorldPvpZone () const
 
InstanceScriptGetInstanceScript () const
 
std::string const & GetName () const
 
void SetName (std::string newname)
 
std::string GetNameForLocaleIdx (LocaleConstant) const override
 
float GetDistance (WorldObject const *obj) const
 
float GetDistance (Position const &pos) const
 
float GetDistance (float x, float y, float z) const
 
float GetDistance2d (WorldObject const *obj) const
 
float GetDistance2d (float x, float y) const
 
float GetDistanceZ (WorldObject const *obj) const
 
bool IsSelfOrInSameMap (WorldObject const *obj) const
 
bool IsInMap (WorldObject const *obj) const
 
bool IsWithinDist3d (float x, float y, float z, float dist) const
 
bool IsWithinDist3d (Position const *pos, float dist) const
 
bool IsWithinDist2d (float x, float y, float dist) const
 
bool IsWithinDist2d (Position const *pos, float dist) const
 
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true) const
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
 
bool IsWithinLOS (float x, float y, float z, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
 
bool IsWithinLOSInMap (WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
 
Position GetHitSpherePointFor (Position const &dest) const
 
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z) const
 
bool GetDistanceOrder (WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
 
bool IsInRange (WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
 
bool IsInRange2d (float x, float y, float minRange, float maxRange) const
 
bool IsInRange3d (float x, float y, float z, float minRange, float maxRange) const
 
bool isInFront (WorldObject const *target, float arc=float(M_PI)) const
 
bool isInBack (WorldObject const *target, float arc=float(M_PI)) const
 
bool IsInBetween (Position const &pos1, Position const &pos2, float size=0) const
 
bool IsInBetween (WorldObject const *obj1, WorldObject const *obj2, float size=0) const
 
virtual void SendMessageToSet (WorldPacket const *data, bool self) const
 
virtual void SendMessageToSetInRange (WorldPacket const *data, float dist, bool self) const
 
virtual void SendMessageToSet (WorldPacket const *data, Player const *skipped_rcvr) const
 
void SendCombatLogMessage (WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
 
void PlayDistanceSound (uint32 soundId, Player *target=nullptr)
 
void PlayDirectSound (uint32 soundId, Player *target=nullptr, uint32 broadcastTextId=0)
 
void PlayDirectMusic (uint32 musicId, Player *target=nullptr)
 
void AddObjectToRemoveList ()
 
float GetGridActivationRange () const
 
float GetVisibilityRange () const
 
float GetSightRange (WorldObject const *target=nullptr) const
 
bool CanSeeOrDetect (WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
 
virtual void SetMap (Map *map)
 
virtual void ResetMap ()
 
MapGetMap () const
 
MapFindMap () const
 
void SetZoneScript ()
 
ZoneScriptGetZoneScript () const
 
ScenarioGetScenario () const
 
TempSummonSummonCreature (uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
 
TempSummonSummonCreature (uint32 entry, Position const &pos, TempSummonType despawnType, Milliseconds const &despawnTime, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
 
TempSummonSummonCreature (uint32 entry, float x, float y, float z, float o=0, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
 
GameObjectSummonGameObject (uint32 entry, Position const &pos, QuaternionData const &rot, uint32 respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
 
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, QuaternionData const &rot, uint32 respawnTime)
 
CreatureSummonTrigger (float x, float y, float z, float ang, uint32 dur, CreatureAI *(*GetAI)(Creature *)=nullptr)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon *> *list=nullptr)
 
CreatureFindNearestCreature (uint32 entry, float range, bool alive=true) const
 
GameObjectFindNearestGameObject (uint32 entry, float range) const
 
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
 
PlayerSelectNearestPlayer (float distance) const
 
ObjectGuid GetCharmerOrOwnerOrOwnGUID () const
 
UnitGetOwner () const
 
UnitGetCharmerOrOwner () const
 
UnitGetCharmerOrOwnerOrSelf () const
 
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
 
PlayerGetAffectingPlayer () const
 
PlayerGetSpellModOwner () const
 
int32 CalculateSpellDamage (Unit const *target, SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
 
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
float ApplyEffectModifiers (SpellInfo const *spellInfo, uint8 effIndex, float value) const
 
int32 CalcSpellDuration (SpellInfo const *spellInfo) const
 
int32 ModSpellDuration (SpellInfo const *spellInfo, WorldObject const *target, int32 duration, bool positive, uint32 effectMask) const
 
void ModSpellCastTime (SpellInfo const *spellInfo, int32 &castTime, Spell *spell=nullptr) const
 
void ModSpellDurationTime (SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
 
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellInfo const *spellInfo) const
 
SpellMissInfo SpellHitResult (Unit *victim, SpellInfo const *spellInfo, bool canReflect=false) const
 
void SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
 
FactionTemplateEntry const * GetFactionTemplateEntry () const
 
ReputationRank GetReactionTo (WorldObject const *target) const
 
bool IsHostileTo (WorldObject const *target) const
 
bool IsHostileToPlayers () const
 
bool IsFriendlyTo (WorldObject const *target) const
 
bool IsNeutralToAll () const
 
void CastSpell (SpellCastTargets const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
 
void CastSpell (WorldObject *target, uint32 spellId, CastSpellExtraArgs const &args={ })
 
void CastSpell (Position const &dest, uint32 spellId, CastSpellExtraArgs const &args={ })
 
bool IsValidAttackTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
 
bool IsValidAssistTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
 
UnitGetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
 
template<typename Container >
void GetGameObjectListWithEntryInGrid (Container &gameObjectContainer, uint32 entry, float maxSearchRange=250.0f) const
 
template<typename Container >
void GetCreatureListWithEntryInGrid (Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
 
template<typename Container >
void GetPlayerListInGrid (Container &playerContainer, float maxSearchRange) const
 
void DestroyForNearbyPlayers ()
 
virtual void UpdateObjectVisibilityOnCreate ()
 
void UpdatePositionData ()
 
void BuildUpdate (UpdateDataMapType &) override
 
void AddToObjectUpdate () override
 
void RemoveFromObjectUpdate () override
 
void AddToNotify (uint16 f)
 
bool isNeedNotify (uint16 f) const
 
uint16 GetNotifyFlags () const
 
void ResetAllNotifies ()
 
bool isActiveObject () const
 
void setActive (bool isActiveObject)
 
bool IsFarVisible () const
 
void SetFarVisible (bool on)
 
bool IsVisibilityOverridden () const
 
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
 
void SetWorldObject (bool apply)
 
bool IsPermanentWorldObject () const
 
bool IsWorldObject () const
 
TransportGetTransport () const
 
float GetTransOffsetX () const
 
float GetTransOffsetY () const
 
float GetTransOffsetZ () const
 
float GetTransOffsetO () const
 
Position const & GetTransOffset () 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
 
float GetFloorZ () const
 
float GetMapWaterOrGroundLevel (float x, float y, float z, float *ground=nullptr) const
 
float GetMapHeight (float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
 
bool IsPrivateObject () const
 
ObjectGuid GetPrivateObjectOwner () const
 
void SetPrivateObjectOwner (ObjectGuid const &owner)
 
bool CheckPrivateObjectOwnerVisibility (WorldObject const *seer) const
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
bool IsInWorld () const
 
ObjectGuid const & GetGUID () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
uint32 GetDynamicFlags () const
 
bool HasDynamicFlag (uint32 flag) const
 
void AddDynamicFlag (uint32 flag)
 
void RemoveDynamicFlag (uint32 flag)
 
void SetDynamicFlags (uint32 flag)
 
TypeID GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player const *target) const
 
void BuildValuesUpdateBlockForPlayerWithFlag (UpdateData *data, UF::UpdateFieldFlag flags, Player const *target) const
 
void BuildDestroyUpdateBlock (UpdateData *data) const
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
ByteBuffer PrepareValuesUpdateBuffer () const
 
void SetIsNewObject (bool enable)
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
 
bool IsPlayer () const
 
PlayerToPlayer ()
 
Player const * ToPlayer () const
 
bool IsCreature () const
 
CreatureToCreature ()
 
Creature const * ToCreature () const
 
bool IsUnit () const
 
UnitToUnit ()
 
Unit const * ToUnit () const
 
bool IsGameObject () const
 
GameObjectToGameObject ()
 
GameObject const * ToGameObject () const
 
bool IsCorpse () const
 
CorpseToCorpse ()
 
Corpse const * ToCorpse () const
 
bool IsDynObject () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
bool IsAreaTrigger () const
 
AreaTriggerToAreaTrigger ()
 
AreaTrigger const * ToAreaTrigger () const
 
bool IsConversation () const
 
ConversationToConversation ()
 
Conversation const * ToConversation () const
 
template<typename T >
void ForceUpdateFieldChange (UF::UpdateFieldSetter< T > const &)
 
- Public Member Functions inherited from WorldLocation
 WorldLocation (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
 WorldLocation (uint32 mapId, Position const &position)
 
void WorldRelocate (WorldLocation const &loc)
 
void WorldRelocate (WorldLocation const *loc)
 
void WorldRelocate (uint32 mapId, Position const &pos)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
WorldLocation GetWorldLocation () const
 
uint32 GetMapId () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
bool operator== (Position const &a) const
 
bool operator!= (Position const &a) const
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float orientation)
 
void Relocate (Position const &pos)
 
void Relocate (Position const *pos)
 
void RelocateOffset (Position const &offset)
 
void SetOrientation (float orientation)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
float GetOrientation () const
 
void GetPosition (float &x, float &y) const
 
void GetPosition (float &x, float &y, float &z) const
 
void GetPosition (float &x, float &y, float &z, float &o) const
 
Position GetPosition () const
 
Streamer< XY > PositionXYStream ()
 
ConstStreamer< XY > PositionXYStream () const
 
Streamer< XYZ > PositionXYZStream ()
 
ConstStreamer< XYZ > PositionXYZStream () const
 
Streamer< XYZO > PositionXYZOStream ()
 
ConstStreamer< XYZO > PositionXYZOStream () const
 
Streamer< PackedXYZ > PositionPackedXYZStream ()
 
ConstStreamer< PackedXYZ > PositionPackedXYZStream () const
 
bool IsPositionValid () const
 
float GetExactDist2dSq (const float x, const float y) const
 
float GetExactDist2d (const float x, const float y) const
 
float GetExactDist2dSq (Position const &pos) const
 
float GetExactDist2d (Position const &pos) 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
 
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 (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 IsInDist (Position const *pos, float dist) const
 
bool IsWithinBox (Position const &center, float xradius, float yradius, float zradius) const
 
bool IsWithinDoubleVerticalCylinder (Position const *center, float radius, float height) const
 
bool HasInArc (float arcangle, Position const *pos, float border=2.0f, Optional< float > orientation=Optional< float >()) const
 
bool HasInLine (Position const *pos, float objSize, float width, Optional< float > orientation=Optional< float >()) const
 
std::string ToString () const
 
- Public Member Functions inherited from GridObject< Creature >
virtual ~GridObject ()
 
bool IsInGrid () const
 
void AddToGrid (GridRefManager< Creature > &m)
 
void RemoveFromGrid ()
 

Static Public Member Functions

static CreatureCreateCreature (uint32 entry, Map *map, Position const &pos, uint32 vehId=0)
 
static CreatureCreateCreatureFromDB (ObjectGuid::LowType spawnId, Map *map, bool addToMap=true, bool allowDuplicate=false)
 
static float _GetDamageMod (int32 Rank)
 
- Static Public Member Functions inherited from Unit
static float CalculateAverageResistReduction (WorldObject const *caster, SpellSchoolMask schoolMask, Unit const *victim, SpellInfo const *spellInfo=nullptr)
 
static void DealDamageMods (Unit const *attacker, Unit const *victim, uint32 &damage, uint32 *absorb)
 
static uint32 DealDamage (Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
 
static void Kill (Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
 
static void DealHeal (HealInfo &healInfo)
 
static void ProcSkillsAndAuras (Unit *actor, Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
 
static void ApplyResilience (Unit const *victim, int32 *damage)
 
static uint32 SpellCriticalDamageBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
 
static uint32 SpellCriticalHealingBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
 
static bool IsDamageReducedByArmor (SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr, SpellEffectInfo const *spellEffectInfo=nullptr)
 
static uint32 CalcArmorReducedDamage (Unit const *attacker, Unit *victim, uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=MAX_ATTACK, uint8 attackerLevel=0)
 
static uint32 CalcSpellResistedDamage (Unit const *attacker, Unit *victim, uint32 damage, SpellSchoolMask schoolMask, SpellInfo const *spellInfo)
 
static void CalcAbsorbResist (DamageInfo &damageInfo)
 
static void CalcHealAbsorb (HealInfo &healInfo)
 
- Static Public Member Functions inherited from WorldObject
static bool InSamePhase (WorldObject const *a, WorldObject const *b)
 
static ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, WorldObject const *target)
 
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 

Public Attributes

Loot loot
 
uint32 m_spells [MAX_CREATURE_SPELLS]
 
uint32 m_groupLootTimer
 
ObjectGuid lootingGroupLowGUID
 
uint64 m_PlayerDamageReq
 
float m_SightDistance
 
float m_CombatDistance
 
bool m_isTempWorldObject
 
- Public Attributes inherited from Unit
uint32 m_extraAttacks
 
bool m_canDualWield
 
ControlList m_Controlled
 
Playerm_playerMovingMe
 
ObjectGuid m_SummonSlot [MAX_SUMMON_SLOT]
 
ObjectGuid m_ObjectSlot [MAX_GAMEOBJECT_SLOT]
 
float m_modMeleeHitChance
 
float m_modRangedHitChance
 
float m_modSpellHitChance
 
int32 m_baseSpellCritChance
 
uint32 m_baseAttackSpeed [MAX_ATTACK]
 
float m_modAttackSpeedPct [MAX_ATTACK]
 
uint32 m_attackTimer [MAX_ATTACK]
 
SpellImmuneContainer m_spellImmune [MAX_SPELL_IMMUNITY]
 
uint32 m_lastSanctuaryTime
 
bool IsAIEnabled
 
bool NeedChangeAI
 
ObjectGuid LastCharmerGUID
 
bool m_ControlledByPlayer
 
Movement::MoveSplinemovespline
 
UF::UpdateField< UF::UnitData, 0, TYPEID_UNITm_unitData
 
- Public Attributes inherited from WorldObject
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealth
 
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealthDetect
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibility
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibilityDetect
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibility
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibilityDetect
 
uint32 LastUsedScriptID
 
MovementInfo m_movementInfo
 
EventProcessor m_Events
 
- Public Attributes inherited from Object
UF::UpdateFieldHolder m_values
 
UF::UpdateField< UF::ObjectData, 0, TYPEID_OBJECTm_objectData
 
- Public Attributes inherited from WorldLocation
uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX
 
float m_positionY
 
float m_positionZ
 

Protected Member Functions

bool CreateFromProto (ObjectGuid::LowType guidlow, uint32 entry, CreatureData const *data=nullptr, uint32 vehId=0)
 
bool InitEntry (uint32 entry, CreatureData const *data=nullptr)
 
void RegenerateHealth ()
 
void Regenerate (Powers power)
 
bool IsInvisibleDueToDespawn () const override
 
bool CanAlwaysSee (WorldObject const *obj) const override
 
- Protected Member Functions inherited from Unit
 Unit (bool isWorldObject)
 
UF::UpdateFieldFlag GetUpdateFieldFlagsFor (Player const *target) const override
 
void BuildValuesCreate (ByteBuffer *data, Player const *target) const override
 
void BuildValuesUpdate (ByteBuffer *data, Player const *target) const override
 
void DestroyForPlayer (Player *target) const override
 
void ClearUpdateMask (bool remove) override
 
void _UpdateSpells (uint32 time)
 
void _DeleteRemovedAuras ()
 
void _UpdateAutoRepeatSpell ()
 
bool IsAlwaysVisibleFor (WorldObject const *seer) const override
 
bool IsAlwaysDetectableFor (WorldObject const *seer) const override
 
void DisableSpline ()
 
void ProcessPositionDataChanged (PositionFullTerrainStatus const &data) override
 
virtual void ProcessTerrainStatusUpdate (ZLiquidStatus status, Optional< LiquidData > const &liquidData)
 
virtual void SetInWater (bool inWater)
 
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 IsNeverVisibleFor (WorldObject const *) const
 
- Protected Member Functions inherited from Object
 Object ()
 
void _Create (ObjectGuid const &guid)
 
template<typename T >
void SetUpdateFieldValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
 
template<typename T >
void SetUpdateFieldFlagValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
 
template<typename T >
void RemoveUpdateFieldFlagValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
 
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result AddDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter)
 
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result InsertDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
 
template<typename T >
void RemoveDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
 
template<typename T >
void ClearDynamicUpdateFieldValues (UF::DynamicUpdateFieldSetter< T > setter)
 
template<typename T >
void RemoveOptionalUpdateFieldValue (UF::OptionalUpdateFieldSetter< T > setter)
 
template<typename T >
void SetUpdateFieldStatValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
 
template<typename T >
void ApplyModUpdateFieldValue (UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type mod, bool apply)
 
template<typename T >
void ApplyPercentModUpdateFieldValue (UF::UpdateFieldSetter< T > setter, float percent, bool apply)
 
template<typename Action >
void DoWithSuppressingObjectUpdates (Action &&action)
 
void BuildMovementUpdate (ByteBuffer *data, CreateObjectBits flags) const
 
void AddToObjectUpdateIfNeeded ()
 
- Protected Member Functions inherited from MapObject
 MapObject ()
 

Static Protected Member Functions

static float _GetHealthMod (int32 Rank)
 

Protected Attributes

VendorItemCounts m_vendorItemCounts
 
ObjectGuid m_lootRecipient
 
ObjectGuid m_lootRecipientGroup
 
time_t _pickpocketLootRestore
 Timers. More...
 
time_t m_corpseRemoveTime
 
time_t m_respawnTime
 
uint32 m_respawnDelay
 
uint32 m_corpseDelay
 
float m_respawnradius
 
uint32 m_boundaryCheckTime
 
uint32 m_combatPulseTime
 
uint32 m_combatPulseDelay
 
ReactStates m_reactState
 
MovementGeneratorType m_defaultMovementType
 
ObjectGuid::LowType m_spawnId
 For new or temporary creatures is 0 for saved it is lowguid. More...
 
uint8 m_equipmentId
 
int8 m_originalEquipmentId
 
bool m_AlreadyCallAssistance
 
bool m_AlreadySearchedAssistance
 
bool m_cannotReachTarget
 
uint32 m_cannotReachTimer
 
bool m_AI_locked
 
SpellSchoolMask m_meleeDamageSchoolMask
 
uint32 m_originalEntry
 
Position m_homePosition
 
Position m_transportHomePosition
 
bool DisableReputationGain
 
CreatureTemplate const * m_creatureInfo
 
CreatureData const * m_creatureData
 
uint16 m_LootMode
 
- Protected Attributes inherited from Unit
UnitAIi_AI
 
UnitAIi_disabledAI
 
bool m_AutoRepeatFirstCast
 
float m_createStats [MAX_STATS]
 
float m_floatStatPosBuff [MAX_STATS]
 
float m_floatStatNegBuff [MAX_STATS]
 
AttackerSet m_attackers
 
Unitm_attacking
 
DeathState m_deathState
 
int32 m_procDeep
 
DynObjectList m_dynObj
 
GameObjectList m_gameObj
 
AreaTriggerList m_areaTrigger
 
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
 
EnumFlag< SpellAuraInterruptFlagsm_interruptMask
 
EnumFlag< SpellAuraInterruptFlags2m_interruptMask2
 
float m_auraFlatModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_FLAT_END]
 
float m_auraPctModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_PCT_END]
 
float m_weaponDamage [MAX_ATTACK][2]
 
bool m_canModifyStats
 
VisibleAuraContainer m_visibleAuras
 
boost::container::flat_set< AuraApplication *, VisibleAuraSlotComparem_visibleAurasToUpdate
 
float m_speed_rate [MAX_MOVE_TYPE]
 
CharmInfom_charmInfo
 
SharedVisionList m_sharedVision
 
MotionMasteri_motionMaster
 
uint32 m_reactiveTimer [MAX_REACTIVE]
 
uint32 m_regenTimer
 
Vehiclem_vehicle
 
Vehiclem_vehicleKit
 
uint32 m_unitTypeMask
 
LiquidTypeEntry const * _lastLiquid
 
uint32 m_movementCounter
 Incrementing counter used in movement packets. More...
 
- Protected Attributes inherited from WorldObject
std::string m_name
 
bool m_isActive
 
bool m_isFarVisible
 
Optional< float > m_visibilityDistanceOverride
 
bool const m_isWorldObject
 
ZoneScriptm_zoneScript
 
Transportm_transport
 
uint32 m_zoneId
 
uint32 m_areaId
 
float m_staticFloorZ
 
bool m_outdoors
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
TypeID m_objectTypeId
 
CreateObjectBits m_updateFlag
 
bool m_objectUpdated
 

Private Member Functions

void ForcedDespawn (uint32 timeMSToDespawn=0, Seconds const &forceRespawnTimer=Seconds(0))
 
bool CheckNoGrayAggroConfig (uint32 playerLevel, uint32 creatureLevel) const
 

Private Attributes

uint32 _waypointPathId
 
std::pair< uint32, uint32_currentWaypointNodeInfo
 
CreatureGroupm_formation
 
bool m_triggerJustAppeared
 
bool m_respawnCompatibilityMode
 
Spell const * m_focusSpell
 
uint32 m_focusDelay
 
bool m_shouldReacquireTarget
 
ObjectGuid m_suppressedTarget
 
float m_suppressedOrientation
 
time_t _lastDamagedTime
 
CreatureTextRepeatGroup m_textRepeat
 
bool _regenerateHealth
 
bool _regenerateHealthLock
 

Additional Inherited Members

- Public Types inherited from Unit
typedef std::set< Unit * > AttackerSet
 
typedef std::set< Unit * > ControlList
 
typedef std::vector< Unit * > UnitVector
 
typedef std::multimap< uint32, Aura * > AuraMap
 
typedef std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
 
typedef std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
 
typedef std::multimap< uint32, AuraApplication * > AuraApplicationMap
 
typedef std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
 
typedef std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
 
typedef std::multimap< AuraStateType, AuraApplication * > AuraStateAurasMap
 
typedef std::pair< AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator > AuraStateAurasMapBounds
 
typedef std::list< AuraEffect * > AuraEffectList
 
typedef std::list< Aura * > AuraList
 
typedef std::list< AuraApplication * > AuraApplicationList
 
typedef std::array< DiminishingReturn, DIMINISHING_MAXDiminishing
 
typedef std::vector< std::pair< uint32, AuraApplication * > > AuraApplicationProcContainer
 
typedef std::set< AuraApplication *, VisibleAuraSlotCompareVisibleAuraContainer
 
- Protected Types inherited from Unit
typedef std::list< DynamicObject * > DynObjectList
 
typedef std::list< GameObject * > GameObjectList
 
typedef std::vector< AreaTrigger * > AreaTriggerList
 

Constructor & Destructor Documentation

◆ Creature()

Creature::Creature ( bool  isWorldObject = false)
explicit
308 {
310 
311  for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
312  m_spells[i] = 0;
313 
314  DisableReputationGain = false;
315 
316  m_SightDistance = sWorld->getFloatConfig(CONFIG_SIGHT_MONSTER);
317  m_CombatDistance = 0;//MELEE_RANGE;
318 
319  ResetLootMode(); // restore default loot mode
320  m_isTempWorldObject = false;
321 }
bool m_triggerJustAppeared
Definition: Creature.h:426
Position m_transportHomePosition
Definition: Creature.h:404
uint32 m_corpseDelay
Definition: Creature.h:380
CreatureTemplate const * m_creatureInfo
Definition: Creature.h:408
CreatureData const * m_creatureData
Definition: Creature.h:409
Position m_homePosition
Definition: Creature.h:403
float m_suppressedOrientation
Definition: Creature.h:434
uint32 m_boundaryCheckTime
Definition: Creature.h:382
bool m_isTempWorldObject
Definition: Creature.h:337
Definition: MotionMaster.h:53
time_t m_respawnTime
Definition: Creature.h:378
bool m_respawnCompatibilityMode
Definition: Creature.h:427
bool m_AlreadyCallAssistance
Definition: Creature.h:394
bool m_AlreadySearchedAssistance
Definition: Creature.h:395
uint32 m_cannotReachTimer
Definition: Creature.h:397
#define UI64LIT(N)
Definition: Define.h:140
uint32 m_spells[MAX_CREATURE_SPELLS]
Definition: Creature.h:226
Definition: World.h:203
MovementGeneratorType m_defaultMovementType
Definition: Creature.h:389
#define sWorld
Definition: World.h:925
std::pair< uint32, uint32 > _currentWaypointNodeInfo
Definition: Creature.h:422
Definition: UnitDefines.h:372
time_t _pickpocketLootRestore
Timers.
Definition: Creature.h:376
uint32 m_combatPulseDelay
Definition: Creature.h:384
ReactStates m_reactState
Definition: Creature.h:386
float m_respawnradius
Definition: Creature.h:381
const uint32 MAX_CREATURE_SPELLS
Definition: CreatureData.h:343
bool _regenerateHealth
Definition: Creature.h:440
CreatureGroup * m_formation
Definition: Creature.h:425
time_t m_corpseRemoveTime
Definition: Creature.h:377
time_t _lastDamagedTime
Definition: Creature.h:436
const uint32 CREATURE_REGEN_INTERVAL
Definition: CreatureData.h:336
MapObject()
Definition: MapObject.h:41
bool m_AI_locked
Definition: Creature.h:398
uint32 m_combatPulseTime
Definition: Creature.h:383
bool _regenerateHealthLock
Definition: Creature.h:441
uint32 m_originalEntry
Definition: Creature.h:401
uint64 m_PlayerDamageReq
Definition: Creature.h:324
uint8 m_equipmentId
Definition: Creature.h:391
bool DisableReputationGain
Definition: Creature.h:406
bool m_shouldReacquireTarget
Definition: Creature.h:432
SpellSchoolMask m_meleeDamageSchoolMask
Definition: Creature.h:400
void ResetLootMode()
Definition: Creature.h:224
uint32 m_focusDelay
Definition: Creature.h:431
uint32 _waypointPathId
Definition: Creature.h:421
uint32 m_respawnDelay
Definition: Creature.h:379
uint32 m_groupLootTimer
Definition: Creature.h:276
float m_SightDistance
Definition: Creature.h:335
uint8_t uint8
Definition: Define.h:154
ObjectGuid::LowType m_spawnId
For new or temporary creatures is 0 for saved it is lowguid.
Definition: Creature.h:390
bool m_cannotReachTarget
Definition: Creature.h:396
Spell const * m_focusSpell
Definition: Creature.h:430
float m_CombatDistance
Definition: Creature.h:335
Unit(bool isWorldObject)
Definition: Unit.cpp:296
int8 m_originalEquipmentId
Definition: Creature.h:392
uint32 m_regenTimer
Definition: Unit.h:1906
Definition: SharedDefines.h:306
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~Creature()

Creature::~Creature ( )
virtual
324 {
325  delete i_AI;
326  i_AI = nullptr;
327 
328  //if (m_uint32Values)
329  // TC_LOG_ERROR("entities.unit", "Deconstruct Creature Entry = %u", GetEntry());
330 }
UnitAI * i_AI
Definition: Unit.h:1844

Member Function Documentation

◆ _GetDamageMod()

float Creature::_GetDamageMod ( int32  Rank)
static
1654 {
1655  switch (Rank) // define rates for each elite rank
1656  {
1657  case CREATURE_ELITE_NORMAL:
1658  return sWorld->getRate(RATE_CREATURE_NORMAL_DAMAGE);
1659  case CREATURE_ELITE_ELITE:
1660  return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE);
1665  case CREATURE_ELITE_RARE:
1666  return sWorld->getRate(RATE_CREATURE_ELITE_RARE_DAMAGE);
1667  default:
1668  return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE);
1669  }
1670 }
Definition: World.h:479
#define sWorld
Definition: World.h:925
Definition: SharedDefines.h:4468
Definition: SharedDefines.h:4465
Definition: SharedDefines.h:4467
Definition: World.h:475
Definition: SharedDefines.h:4469
Definition: World.h:476
Definition: SharedDefines.h:4466
+ Here is the caller graph for this function:

◆ _GetHealthMod()

float Creature::_GetHealthMod ( int32  Rank)
staticprotected
1629 {
1630  switch (Rank) // define rates for each elite rank
1631  {
1632  case CREATURE_ELITE_NORMAL:
1633  return sWorld->getRate(RATE_CREATURE_NORMAL_HP);
1634  case CREATURE_ELITE_ELITE:
1635  return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP);
1637  return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_HP);
1639  return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_HP);
1640  case CREATURE_ELITE_RARE:
1641  return sWorld->getRate(RATE_CREATURE_ELITE_RARE_HP);
1642  default:
1643  return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP);
1644  }
1645 }
Definition: World.h:474
Definition: World.h:470
Definition: World.h:473
#define sWorld
Definition: World.h:925
Definition: World.h:471
Definition: SharedDefines.h:4468
Definition: SharedDefines.h:4465
Definition: SharedDefines.h:4467
Definition: World.h:472
Definition: SharedDefines.h:4469
Definition: SharedDefines.h:4466
+ Here is the caller graph for this function:

◆ _IsTargetAcceptable()

bool Creature::_IsTargetAcceptable ( Unit const *  target) const
2540 {
2541  ASSERT(target);
2542 
2543  // if the target cannot be attacked, the target is not acceptable
2544  if (IsFriendlyTo(target)
2545  || !target->isTargetableForAttack(false)
2546  || (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))))
2547  return false;
2548 
2549  if (target->HasUnitState(UNIT_STATE_DIED))
2550  {
2551  // guards can detect fake death
2552  if (IsGuard() && target->HasUnitFlag2(UNIT_FLAG2_FEIGN_DEATH))
2553  return true;
2554  else
2555  return false;
2556  }
2557 
2558  Unit const* targetVictim = target->getAttackerForHelper();
2559 
2560  // if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
2561  if (IsEngagedBy(target) || IsHostileTo(target))
2562  return true;
2563 
2564  // if the target's victim is friendly, and the target is neutral, the target is acceptable
2565  if (targetVictim && IsFriendlyTo(targetVictim))
2566  return true;
2567 
2568  // if the target's victim is not friendly, or the target is friendly, the target is not acceptable
2569  return false;
2570 }
Definition: Unit.h:236
bool IsEngagedBy(Unit const *who) const
Definition: Unit.h:1091
Vehicle * m_vehicle
Definition: Unit.h:1908
Definition: UnitDefines.h:157
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:48
bool IsFriendlyTo(WorldObject const *target) const
Definition: Object.cpp:2600
Unit * getAttackerForHelper() const
Definition: Unit.cpp:5377
bool IsOnVehicle(Unit const *vehicle) const
Definition: Unit.cpp:11171
bool IsGuard() const
Definition: Creature.h:98
#define ASSERT
Definition: Errors.h:57
bool IsHostileTo(WorldObject const *target) const
Definition: Object.cpp:2595
Definition: Unit.h:736
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddLootMode()

void Creature::AddLootMode ( uint16  lootMode)
inline
222 { m_LootMode |= lootMode; }
uint16 m_LootMode
Definition: Creature.h:411
+ Here is the caller graph for this function:

◆ AddToWorld()

void Creature::AddToWorld ( )
overridevirtual
  • Register the creature for guid lookup

Reimplemented from Object.

Reimplemented in Pet.

333 {
335  if (!IsInWorld())
336  {
337  if (GetZoneScript())
339 
341  if (m_spawnId)
342  GetMap()->GetCreatureBySpawnIdStore().insert(std::make_pair(m_spawnId, this));
343 
345  SearchFormation();
346  AIM_Initialize();
347  if (IsVehicle())
348  GetVehicleKit()->Install();
349  }
350 }
bool Insert(KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
Definition: TypeContainer.h:118
void Install()
Initializes power type for vehicle. Nothing more.
Definition: Vehicle.cpp:75
Vehicle * GetVehicleKit() const
Definition: Unit.h:1748
bool AIM_Initialize(CreatureAI *ai=nullptr)
Definition: Creature.cpp:1078
bool IsInWorld() const
Definition: Object.h:149
void AddToWorld() override
Definition: Unit.cpp:9073
Definition: Creature.h:61
Map * GetMap() const
Definition: Object.h:535
ObjectGuid const & GetGUID() const
Definition: Object.h:154
bool IsVehicle() const
Definition: Unit.h:841
MapStoredObjectTypesContainer & GetObjectsStore()
Definition: Map.h:457
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
Definition: Map.h:460
void SearchFormation()
Definition: Creature.cpp:383
ObjectGuid::LowType m_spawnId
For new or temporary creatures is 0 for saved it is lowguid.
Definition: Creature.h:390
ZoneScript * GetZoneScript() const
Definition: Object.h:540
virtual void OnCreatureCreate(Creature *)
Definition: ZoneScript.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AI()

CreatureAI* Creature::AI ( ) const
inline
156 { return reinterpret_cast<CreatureAI*>(i_AI); }
UnitAI * i_AI
Definition: Unit.h:1844
Definition: CreatureAI.h:49

◆ AI_InitializeAndEnable()

void Creature::AI_InitializeAndEnable ( )
1070 {
1071  IsAIEnabled = true;
1072  i_AI->InitializeAI();
1073  // Initialize vehicle
1074  if (GetVehicleKit())
1075  GetVehicleKit()->Reset();
1076 }
Vehicle * GetVehicleKit() const
Definition: Unit.h:1748
virtual void InitializeAI()
Definition: UnitAI.cpp:45
bool IsAIEnabled
Definition: Unit.h:1744
UnitAI * i_AI
Definition: Unit.h:1844
void Reset(bool evading=false)
Reapplies immunities and reinstalls accessories. Only has effect for creatures.
Definition: Vehicle.cpp:137
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AIM_Create()

bool Creature::AIM_Create ( CreatureAI ai = nullptr)
1053 {
1054  // make sure nothing can change the AI during AI update
1055  if (m_AI_locked)
1056  {
1057  TC_LOG_DEBUG("scripts", "AIM_Initialize: failed to init, locked.");
1058  return false;
1059  }
1060 
1061  AIM_Destroy();
1062 
1064 
1065  i_AI = ai ? ai : FactorySelector::SelectAI(this);
1066  return true;
1067 }
void Motion_Initialize()
Definition: Creature.cpp:1087
UnitAI * i_AI
Definition: Unit.h:1844
bool m_AI_locked
Definition: Creature.h:398
CreatureAI * SelectAI(Creature *creature)
Definition: CreatureAISelector.cpp:80
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:177
bool AIM_Destroy()
Definition: Creature.cpp:1034
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AIM_Destroy()

bool Creature::AIM_Destroy ( )
1035 {
1036  if (m_AI_locked)
1037  {
1038  TC_LOG_DEBUG("scripts", "AIM_Destroy: failed to destroy, locked.");
1039  return false;
1040  }
1041 
1043  "The disabled AI wasn't cleared!");
1044 
1045  delete i_AI;
1046  i_AI = nullptr;
1047 
1048  IsAIEnabled = false;
1049  return true;
1050 }
bool IsAIEnabled
Definition: Unit.h:1744
UnitAI * i_AI
Definition: Unit.h:1844
UnitAI * i_disabledAI
Definition: Unit.h:1844
bool m_AI_locked
Definition: Creature.h:398
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:177
#define ASSERT
Definition: Errors.h:57
+ Here is the caller graph for this function:

◆ AIM_Initialize()

bool Creature::AIM_Initialize ( CreatureAI ai = nullptr)
1079 {
1080  if (!AIM_Create(ai))
1081  return false;
1082 
1084  return true;
1085 }
bool AIM_Create(CreatureAI *ai=nullptr)
Definition: Creature.cpp:1052
void AI_InitializeAndEnable()
Definition: Creature.cpp:1069
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AllLootRemovedFromCorpse()

void Creature::AllLootRemovedFromCorpse ( )
2792 {
2793  if (loot.loot_type != LOOT_SKINNING && !IsPet() && GetCreatureTemplate()->SkinLootId && hasLootRecipient())
2796 
2797  time_t now = GameTime::GetGameTime();
2798  // Do not reset corpse remove time if corpse is already removed
2799  if (m_corpseRemoveTime <= now)
2800  return;
2801 
2802  float decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
2803 
2804  // corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
2805  if (loot.loot_type == LOOT_SKINNING)
2806  m_corpseRemoveTime = now;
2807  else
2808  m_corpseRemoveTime = now + uint32(m_corpseDelay * decayRate);
2809 
2811 }
uint32 m_corpseDelay
Definition: Creature.h:380
time_t m_respawnTime
Definition: Creature.h:378
Definition: World.h:495
Loot loot
Definition: Creature.h:206
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:187
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
#define sWorld
Definition: World.h:925
time_t m_corpseRemoveTime
Definition: Creature.h:377
time_t GetGameTime()
Definition: GameTime.cpp:39
bool IsPet() const
Definition: Unit.h:838
uint32_t uint32
Definition: Define.h:152
uint32 m_respawnDelay
Definition: Creature.h:379
LootType loot_type
Definition: Loot.h:218
Definition: Loot.h:97
bool hasLootRecipient() const
Definition: Creature.h:213
bool HaveLootFor(uint32 loot_id) const
Definition: LootMgr.h:81
void AddUnitFlag(UnitFlags flags)
Definition: Unit.h:926
Definition: UnitDefines.h:145
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AtEnterCombat()

void Creature::AtEnterCombat ( )
overridevirtual

Reimplemented from Unit.

3383 {
3385 
3387  Dismount();
3388 
3389  if (IsPet() || IsGuardian()) // update pets' speed for catchup OOC speed
3390  {
3394  }
3395 }
void Dismount()
Definition: Unit.cpp:7542
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:187
Definition: UnitDefines.h:109
Definition: UnitDefines.h:104
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
bool IsPet() const
Definition: Unit.h:838
Definition: UnitDefines.h:106
bool IsGuardian() const
Definition: Unit.h:837
virtual void AtEnterCombat()
Definition: Unit.cpp:8254
Definition: SharedDefines.h:4428
+ Here is the call graph for this function:

◆ AtExitCombat()

void Creature::AtExitCombat ( )
overridevirtual

Reimplemented from Unit.

3398 {
3400 
3403  SetDynamicFlags(GetCreatureTemplate()->dynamicflags);
3404 
3405  if (IsPet() || IsGuardian()) // update pets' speed for catchup OOC speed
3406  {
3410  }
3411 }
void SetDynamicFlags(uint32 flag)
Definition: Object.h:165
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:187
Definition: UnitDefines.h:109
Definition: Unit.h:250
void ClearUnitState(uint32 f)
Definition: Unit.h:831
Definition: UnitDefines.h:104
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
bool IsPet() const
Definition: Unit.h:838
Definition: UnitDefines.h:106
bool IsGuardian() const
Definition: Unit.h:837
bool HasDynamicFlag(uint32 flag) const
Definition: Object.h:162
Definition: SharedDefines.h:5516
virtual void AtExitCombat()
Definition: Unit.cpp:8274
+ Here is the call graph for this function:

◆ CalculateMinMaxDamage()

void Creature::CalculateMinMaxDamage ( WeaponAttackType  attType,
bool  normalized,
bool  addTotalPct,
float &  minDamage,
float &  maxDamage 
) const
overridevirtual

Implements Unit.

957 {
958  float variance = 1.0f;
959  UnitMods unitMod;
960  switch (attType)
961  {
962  case BASE_ATTACK:
963  default:
964  variance = GetCreatureTemplate()->BaseVariance;
965  unitMod = UNIT_MOD_DAMAGE_MAINHAND;
966  break;
967  case OFF_ATTACK:
968  variance = GetCreatureTemplate()->BaseVariance;
969  unitMod = UNIT_MOD_DAMAGE_OFFHAND;
970  break;
971  case RANGED_ATTACK:
972  variance = GetCreatureTemplate()->RangeVariance;
973  unitMod = UNIT_MOD_DAMAGE_RANGED;
974  break;
975  }
976 
977  if (attType == OFF_ATTACK && !haveOffhandWeapon())
978  {
979  minDamage = 0.0f;
980  maxDamage = 0.0f;
981  return;
982  }
983 
984  float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
985  float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
986 
987  if (!CanUseAttackType(attType)) // disarm case
988  {
989  weaponMinDamage = 0.0f;
990  weaponMaxDamage = 0.0f;
991  }
992 
993  float attackPower = GetTotalAttackPowerValue(attType, false);
994  float attackSpeedMulti = GetAPMultiplier(attType, normalized);
995  float baseValue = GetFlatModifierValue(unitMod, BASE_VALUE) + (attackPower / 3.5f) * variance;
996  float basePct = GetPctModifierValue(unitMod, BASE_PCT) * attackSpeedMulti;
997  float totalValue = GetFlatModifierValue(unitMod, TOTAL_VALUE);
998  float totalPct = addTotalPct ? GetPctModifierValue(unitMod, TOTAL_PCT) : 1.0f;
999  float dmgMultiplier = GetCreatureTemplate()->ModDamage; // = ModDamage * _GetDamageMod(rank);
1000 
1001  minDamage = ((weaponMinDamage + baseValue) * dmgMultiplier * basePct + totalValue) * totalPct;
1002  maxDamage = ((weaponMaxDamage + baseValue) * dmgMultiplier * basePct + totalValue) * totalPct;
1003 }
UnitMods
Definition: Unit.h:159
Definition: Unit.h:194
Definition: Unit.h:155
bool CanUseAttackType(uint8 attacktype) const
Definition: Unit.cpp:2354
Definition: Unit.h:142
float GetTotalAttackPowerValue(WeaponAttackType attType, bool includeWeapon=true) const
Definition: Unit.cpp:8827
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:187
Definition: Unit.h:196
float GetFlatModifierValue(UnitMods unitMod, UnitModifierFlatType modifierType) const
Definition: Unit.cpp:8582
Definition: Unit.h:195
Definition: Unit.h:149
float ModDamage
Definition: CreatureData.h:426
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const
Definition: Unit.cpp:8857
Definition: Unit.h:140
Definition: Unit.h:148
float RangeVariance
Definition: CreatureData.h:398
Definition: SharedDefines.h:6341
Definition: Unit.h:156
Definition: SharedDefines.h:6343
bool haveOffhandWeapon() const
Definition: Unit.cpp:478
float GetPctModifierValue(UnitMods unitMod, UnitModifierPctType modifierType) const
Definition: Unit.cpp:8593
float GetAPMultiplier(WeaponAttackType attType, bool normalized) const
Definition: Unit.cpp:10156
float BaseVariance
Definition: CreatureData.h:397
Definition: SharedDefines.h:6342
+ Here is the call graph for this function:

◆ CallAssistance()

void Creature::CallAssistance ( )
2446 {
2447  if (!m_AlreadyCallAssistance && GetVictim() && !IsPet() && !IsCharmed())
2448  {
2449  SetNoCallAssistance(true);
2450 
2451  float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
2452 
2453  if (radius > 0)
2454  {
2455  std::list<Creature*> assistList;
2456  Trinity::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
2458  Cell::VisitGridObjects(this, searcher, radius);
2459 
2460  if (!assistList.empty())
2461  {
2462  AssistDelayEvent* e = new AssistDelayEvent(EnsureVictim()->GetGUID(), *this);
2463  while (!assistList.empty())
2464  {
2465  // Pushing guids because in delay can happen some creature gets despawned => invalid pointer
2466  e->AddAssistant((*assistList.begin())->GetGUID());
2467  assistList.pop_front();
2468  }
2470  }
2471  }
2472  }
2473 }
Definition: GridNotifiers.h:1262
void SetNoCallAssistance(bool val)
Definition: Creature.h:241
bool IsCharmed() const
Definition: Unit.h:1265
bool m_AlreadyCallAssistance
Definition: Creature.h:394
Definition: Creature.h:444
void AddEvent(BasicEvent *event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.cpp:113
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:181
#define sWorld
Definition: World.h:925
Unit * EnsureVictim() const
Definition: Unit.h:815
ObjectGuid const & GetGUID() const
Definition: Object.h:154
Definition: GridNotifiers.h:544
bool IsPet() const
Definition: Unit.h:838
EventProcessor m_Events
Definition: Object.h:672
Unit * GetVictim() const
Definition: Unit.h:813
void AddAssistant(ObjectGuid guid)
Definition: Creature.h:450
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.h:82
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallForHelp()

void Creature::CallForHelp ( float  fRadius)
2476 {
2477  if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
2478  return;
2479 
2480  Trinity::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
2482  Cell::VisitGridObjects(this, worker, radius);
2483 }
bool IsCharmed() const
Definition: Unit.h:1265
Definition: GridNotifiers.h:560
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:181
Definition: GridNotifiers.h:1127
bool IsPet() const
Definition: Unit.h:838
Unit * GetVictim() const
Definition: Unit.h:813
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanAlwaysSee()

bool Creature::CanAlwaysSee ( WorldObject const *  obj) const
overrideprotectedvirtual

Reimplemented from WorldObject.

1977 {
1978  if (IsAIEnabled && AI()->CanSeeAlways(obj))
1979  return true;
1980 
1981  return false;
1982 }
bool IsAIEnabled
Definition: Unit.h:1744
CreatureAI * AI() const
Definition: Creature.h:156
+ Here is the call graph for this function:

◆ CanAssistTo()

bool Creature::CanAssistTo ( Unit const *  u,
Unit const *  enemy,
bool  checkfaction = true 
) const
2486 {
2487  // is it true?
2489  return false;
2490 
2491  // we don't need help from zombies :)
2492  if (!IsAlive())
2493  return false;
2494 
2495  // we cannot assist in evade mode
2496  if (IsInEvadeMode())
2497  return false;
2498 
2499  // or if enemy is in evade mode
2500  if (enemy->GetTypeId() == TYPEID_UNIT && enemy->ToCreature()->IsInEvadeMode())
2501  return false;
2502 
2503  // we don't need help from non-combatant ;)
2504  if (IsCivilian())
2505  return false;
2506 
2508  return false;
2509 
2510  // skip fighting creature
2511  if (IsEngaged())
2512  return false;
2513 
2514  // only free creature
2515  if (!GetCharmerOrOwnerGUID().IsEmpty())
2516  return false;
2517 
2518  // only from same creature faction
2519  if (checkfaction)
2520  {
2521  if (GetFaction() != u->GetFaction())
2522  return false;
2523  }
2524  else
2525  {
2526  if (!IsFriendlyTo(u))
2527  return false;
2528  }
2529 
2530  // skip non hostile to caster enemy creatures
2531  if (!IsHostileTo(enemy))
2532  return false;
2533 
2534  return true;
2535 }
bool IsCivilian() const
Definition: Creature.h:96
bool IsInEvadeMode() const
Definition: Creature.h:147
uint32 GetFaction() const override
Definition: Unit.h:947
Definition: UnitDefines.h:144
Definition: ObjectGuid.h:39
bool IsEngaged() const
Definition: Unit.h:1090
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:925
Definition: UnitDefines.h:372
Definition: UnitDefines.h:120
UnitFlags
Definition: UnitDefines.h:117
bool IsAlive() const
Definition: Unit.h:1217
bool IsImmuneToNPC() const
Definition: Unit.h:1104
bool HasReactState(ReactStates state) const
Definition: Creature.h:112
bool IsFriendlyTo(WorldObject const *target) const
Definition: Object.cpp:2600
bool IsEmpty() const
Definition: ObjectGuid.h:299
ObjectGuid GetCharmerOrOwnerGUID() const override
Definition: Unit.cpp:9739
bool IsHostileTo(WorldObject const *target) const
Definition: Object.cpp:2595
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanCreatureAttack()

bool Creature::CanCreatureAttack ( Unit const *  victim,
bool  force = true 
) const
2589 {
2590  if (!victim->IsInMap(this))
2591  return false;
2592 
2593  if (!IsValidAttackTarget(victim))
2594  return false;
2595 
2596  if (!victim->isInAccessiblePlaceFor(this))
2597  return false;
2598 
2599  if (IsAIEnabled && !AI()->CanAIAttack(victim))
2600  return false;
2601 
2602  // we cannot attack in evade mode
2603  if (IsInEvadeMode())
2604  return false;
2605 
2606  // or if enemy is in evade mode
2607  if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())
2608  return false;
2609 
2611  {
2612  if (GetMap()->IsDungeon())
2613  return true;
2614 
2615  // don't check distance to home position if recently damaged, this should include taunt auras
2617  return true;
2618  }
2619 
2620  // Map visibility range, but no more than 2*cell size
2621  float dist = std::min<float>(GetMap()->GetVisibilityRange(), SIZE_OF_GRID_CELL * 2);
2622 
2623  if (Unit* unit = GetCharmerOrOwner())
2624  return victim->IsWithinDist(unit, dist);
2625  else
2626  {
2627  // include sizes for huge npcs
2628  dist += GetCombatReach() + victim->GetCombatReach();
2629 
2630  // to prevent creatures in air ignore attacks because distance is already too high...
2631  if (GetMovementTemplate().IsFlightAllowed())
2632  return victim->IsInDist2d(&m_homePosition, dist);
2633  else
2634  return victim->IsInDist(&m_homePosition, dist);
2635  }
2636 }
time_t GetLastDamagedTime() const
Definition: Creature.h:350
float GetCombatReach() const override
Definition: Unit.h:791
#define SIZE_OF_GRID_CELL
Definition: GridDefines.h:47
float GetVisibilityRange() const
Definition: Map.h:279
bool IsInEvadeMode() const
Definition: Creature.h:147
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition: Object.cpp:2674
Position m_homePosition
Definition: Creature.h:403
bool isWorldBoss() const
Definition: Creature.cpp:2396
Definition: ObjectGuid.h:39
bool IsDungeon() const
Definition: Map.cpp:4240
virtual bool CanAIAttack(Unit const *) const
Definition: UnitAI.h:139
bool IsAIEnabled
Definition: Unit.h:1744
Map * GetMap() const
Definition: Object.h:535
CreatureAI * AI() const
Definition: Creature.h:156
time_t GetGameTime()
Definition: GameTime.cpp:39
Unit * GetCharmerOrOwner() const
Definition: Unit.cpp:5795
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
bool IsPlayer() const
Definition: ObjectGuid.h:306
Definition: SpellAuraDefines.h:99
ObjectGuid GetCharmerOrOwnerGUID() const override
Definition: Unit.cpp:9739
Definition: Unit.h:736
CreatureMovementData const & GetMovementTemplate() const
Definition: Creature.cpp:2783
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanFly()

bool Creature::CanFly ( ) const
inlineoverridevirtual

Implements Unit.

102 { return GetMovementTemplate().IsFlightAllowed(); }
bool IsFlightAllowed() const
Definition: CreatureData.h:330
CreatureMovementData const & GetMovementTemplate() const
Definition: Creature.cpp:2783
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanGeneratePickPocketLoot()

bool Creature::CanGeneratePickPocketLoot ( ) const
3343 {
3345 }
time_t _pickpocketLootRestore
Timers.
Definition: Creature.h:376
time_t GetGameTime()
Definition: GameTime.cpp:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanGiveExperience()

bool Creature::CanGiveExperience ( ) const
3375 {
3376  return !IsCritter()
3377  && !IsPet()
3378  && !IsTotem()
3380 }
bool IsTotem() const
Definition: Unit.h:840
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:187
uint32 flags_extra
Definition: CreatureData.h:436
bool IsPet() const
Definition: Unit.h:838
Definition: CreatureData.h:266
bool IsCritter() const
Definition: Unit.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanHover()

bool Creature::CanHover ( ) const
inline
103 { return GetMovementTem