AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Creature Class Reference

#include "Creature.h"

Inheritance diagram for Creature:
Unit GridObject< Creature > MovableMapObject WorldObject Object WorldLocation Position TempSummon Minion Guardian Puppet Totem Pet

Public Member Functions

 Creature (bool isWorldObject=false)
 
 ~Creature () override
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
float GetNativeObjectScale () const override
 
void SetObjectScale (float scale) override
 
void SetDisplayId (uint32 modelId) override
 
void DisappearAndDie ()
 
bool isVendorWithIconSpeak () const
 
bool Create (ObjectGuid::LowType guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData *data=nullptr)
 
bool LoadCreaturesAddon (bool reload=false)
 
void SelectLevel (bool changelevel=true)
 
void LoadEquipment (int8 id=1, bool force=false)
 
ObjectGuid::LowType GetSpawnId () const
 
void Update (uint32 time) override
 
void GetRespawnPosition (float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
 
void SetCorpseDelay (uint32 delay)
 
void SetCorpseRemoveTime (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
 This method check the current flag/status of a creature and its inhabit type.
 
bool CanEnterWater () const override
 
bool CanFly () const override
 
bool CanHover () const
 
bool IsRooted () const
 
MovementGeneratorType GetDefaultMovementType () const override
 -------—End of Pet responses methods-------—
 
void SetDefaultMovementType (MovementGeneratorType mgt)
 
void SetReactState (ReactStates st)
 
ReactStates GetReactState () const
 
bool HasReactState (ReactStates state) const
 
void InitializeReactState ()
 
bool isCanInteractWithBattleMaster (Player *player, bool msg) const
 
bool isCanTrainingAndResetTalentsOf (Player *player) const
 
bool IsValidTrainerForPlayer (Player *player, uint32 *npcFlags=nullptr) const
 
bool CanCreatureAttack (Unit const *victim, bool skipDistCheck=false) const
 
void LoadSpellTemplateImmunity ()
 
bool IsImmunedToSpell (SpellInfo const *spellInfo, Spell const *spell=nullptr) override
 
bool HasMechanicTemplateImmunity (uint32 mask) const
 
bool IsImmunedToSpellEffect (SpellInfo const *spellInfo, uint32 index) const override
 
bool isElite () const
 
bool isWorldBoss () const
 
bool IsDungeonBoss () const
 
bool IsImmuneToKnockback () const
 
bool IsAvoidingAOE () const
 
uint8 getLevelForTarget (WorldObject const *target) const override
 
bool IsInEvadeMode () const
 
bool IsEvadingAttacks () const
 
bool AIM_Initialize (CreatureAI *ai=nullptr)
 
void Motion_Initialize ()
 
CreatureAIAI () const
 
bool SetWalk (bool enable) override
 
bool SetDisableGravity (bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
 
bool SetSwim (bool enable) override
 
bool SetCanFly (bool enable, bool packetOnly=false) override
 
bool SetWaterWalking (bool enable, bool packetOnly=false) override
 
bool SetFeatherFall (bool enable, bool packetOnly=false) override
 
bool SetHover (bool enable, bool packetOnly=false, bool updateAnimationTier=true) override
 
bool HasSpellFocus (Spell const *focusSpell=nullptr) const
 
uint32 GetShieldBlockValue () const override
 
SpellSchoolMask GetMeleeDamageSchoolMask (WeaponAttackType=BASE_ATTACK, uint8=0) const override
 
void SetMeleeDamageSchool (SpellSchools school)
 
void _AddCreatureSpellCooldown (uint32 spell_id, uint16 categoryId, uint32 end_time)
 
void AddSpellCooldown (uint32 spell_id, uint32, uint32 end_time, bool needSendToClient=false, bool forceSendToSpectator=false) override
 
bool HasSpellCooldown (uint32 spell_id) const override
 
uint32 GetSpellCooldown (uint32 spell_id) const
 
void ProhibitSpellSchool (SpellSchoolMask idSchoolMask, uint32 unTimeMs) override
 
bool IsSpellProhibited (SpellSchoolMask idSchoolMask) const
 
void ClearProhibitedSpellTimers ()
 
bool HasSpell (uint32 spellID) const override
 
void UpdateMovementFlags ()
 
uint32 GetRandomId (uint32 id1, uint32 id2, uint32 id3)
 
bool UpdateEntry (uint32 entry, const CreatureData *data=nullptr, bool changelevel=true, bool updateAI=false)
 
bool UpdateEntry (uint32 entry, bool updateAI)
 
bool UpdateStats (Stats stat) override
 
bool UpdateAllStats () override
 
void UpdateResistances (uint32 school) override
 
void UpdateArmor () override
 
void UpdateMaxHealth () override
 
void UpdateMaxPower (Powers power) override
 
void UpdateAttackPowerAndDamage (bool ranged=false) override
 
void CalculateMinMaxDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage, uint8 damageIndex) override
 
void SetCanDualWield (bool value) override
 
int8 GetOriginalEquipmentId () const
 
uint8 GetCurrentEquipmentId ()
 
void SetCurrentEquipmentId (uint8 id)
 
float GetSpellDamageMod (int32 Rank)
 
VendorItemData const * GetVendorItems () const
 
uint32 GetVendorItemCurrentCount (VendorItem const *vItem)
 
uint32 UpdateVendorItemCurrentCount (VendorItem const *vItem, uint32 used_count)
 
TrainerSpellData const * GetTrainerSpells () const
 
CreatureTemplate const * GetCreatureTemplate () const
 
CreatureData const * GetCreatureData () const
 
void SetDetectionDistance (float dist)
 
CreatureAddon const * GetCreatureAddon () const
 
std::string const & GetAIName () const
 
std::string GetScriptName () const
 
uint32 GetScriptId () const
 
std::string const & GetNameForLocaleIdx (LocaleConstant locale_idx) const override
 
void setDeathState (DeathState s, bool despawn=false) override
 
bool LoadFromDB (ObjectGuid::LowType guid, Map *map, bool allowDuplicate=false)
 
bool LoadCreatureFromDB (ObjectGuid::LowType guid, Map *map, bool addToMap=true, bool gridLoad=false, bool allowDuplicate=false)
 
void SaveToDB ()
 
virtual void SaveToDB (uint32 mapid, uint8 spawnMask, uint32 phaseMask)
 
virtual void DeleteFromDB ()
 
ObjectGuid GetLootRecipientGUID () const
 
PlayerGetLootRecipient () const
 
ObjectGuid::LowType GetLootRecipientGroupGUID () const
 
GroupGetLootRecipientGroup () const
 
bool hasLootRecipient () const
 
bool isTappedBy (Player const *player) const
 
bool CanGeneratePickPocketLoot () const
 
void SetPickPocketLootTime ()
 
void ResetPickPocketLootTime ()
 
void SetLootRecipient (Unit *unit, bool withGroup=true)
 
void AllLootRemovedFromCorpse ()
 
uint16 GetLootMode () const
 
bool HasLootMode (uint16 lootMode) const
 
void SetLootMode (uint16 lootMode)
 
void AddLootMode (uint16 lootMode)
 
void RemoveLootMode (uint16 lootMode)
 
void ResetLootMode ()
 
SpellInfo const * reachWithSpellAttack (Unit *victim)
 
SpellInfo const * reachWithSpellCure (Unit *victim)
 
bool CanStartAttack (Unit const *u) const
 
float GetAggroRange (Unit const *target) const
 
float GetAttackDistance (Unit const *player) const
 
float GetDetectionRange () const
 
void SendAIReaction (AiReaction reactionType)
 
UnitSelectNearestTarget (float dist=0, bool playerOnly=false) const
 
UnitSelectNearestTargetInAttackDistance (float dist) const
 
void DoFleeToGetAssistance ()
 
void CallForHelp (float fRadius, Unit *target=nullptr)
 
void CallAssistance (Unit *target=nullptr)
 
void SetNoCallAssistance (bool val)
 
void SetNoSearchAssistance (bool val)
 
bool HasSearchedAssistance ()
 
bool CanAssistTo (Unit const *u, Unit const *enemy, bool checkfaction=true) const
 
bool _IsTargetAcceptable (Unit const *target) const
 
bool CanIgnoreFeignDeath () const
 
void UpdateMoveInLineOfSightState ()
 
bool IsMoveInLineOfSightDisabled ()
 
bool IsMoveInLineOfSightStrictlyDisabled ()
 
void RemoveCorpse (bool setSpawnTime=true, bool skipVisibility=false)
 
void DespawnOrUnsummon (Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
 
void DespawnOrUnsummon (uint32 msTimeToDespawn=0)
 
void DespawnOnEvade (Seconds respawnDelay=20s)
 
time_t const & GetRespawnTime () const
 
time_t GetRespawnTimeEx () const
 
void SetRespawnTime (uint32 respawn)
 
void Respawn (bool force=false)
 
void SaveRespawnTime () override
 
uint32 GetRespawnDelay () const
 
void SetRespawnDelay (uint32 delay)
 
uint32 GetCombatPulseDelay () const
 
void SetCombatPulseDelay (uint32 delay)
 
float GetWanderDistance () const
 
void SetWanderDistance (float dist)
 
void DoImmediateBoundaryCheck ()
 
void SendZoneUnderAttackMessage (Player *attacker)
 Send a message to LocalDefense channel for players opposition team in the zone.
 
void SetInCombatWithZone ()
 
bool hasQuest (uint32 quest_id) const override
 
bool hasInvolvedQuest (uint32 quest_id) const override
 
bool isRegeneratingHealth ()
 
void SetRegeneratingHealth (bool c)
 
void SetRegeneratingPower (bool c)
 
virtual uint8 GetPetAutoSpellSize () const
 
virtual uint32 GetPetAutoSpellOnPos (uint8 pos) const
 
void SetCannotReachTarget (ObjectGuid const &target=ObjectGuid::Empty)
 
bool CanNotReachTarget () const
 
bool IsNotReachableAndNeedRegen () const
 
void SetPosition (float x, float y, float z, float o)
 
void SetPosition (const Position &pos)
 
void SetHomePosition (float x, float y, float z, float o)
 
void SetHomePosition (const Position &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 (const Position &pos)
 
void GetTransportHomePosition (float &x, float &y, float &z, float &ori) const
 
Position const & GetTransportHomePosition () const
 
uint32 GetWaypointPath () const
 
void LoadPath (uint32 pathid)
 
uint32 GetCurrentWaypointID () const
 
void UpdateWaypointID (uint32 wpID)
 
void SearchFormation ()
 
CreatureGroup const * GetFormation () const
 
CreatureGroupGetFormation ()
 
void SetFormation (CreatureGroup *formation)
 
UnitSelectVictim ()
 
void SetDisableReputationGain (bool disable)
 
bool IsReputationGainDisabled () const
 
bool IsDamageEnoughForLootingAndReward () const
 
void LowerPlayerDamageReq (uint32 unDamage, bool damagedByPlayer=true)
 
void ResetPlayerDamageReq ()
 
uint32 GetPlayerDamageReq () const
 
uint32 GetOriginalEntry () const
 
void SetOriginalEntry (uint32 entry)
 
void SetTarget (ObjectGuid guid=ObjectGuid::Empty) override
 
void ClearTarget ()
 
void FocusTarget (Spell const *focusSpell, WorldObject const *target)
 
void ReleaseFocus (Spell const *focusSpell)
 
bool IsMovementPreventedByCasting () const override
 
time_t GetLastDamagedTime () const
 
std::shared_ptr< time_t > const & GetLastDamagedTimePtr () const
 
void SetLastDamagedTime (time_t val)
 
void SetLastDamagedTimePtr (std::shared_ptr< time_t > const &val)
 
bool IsFreeToMove ()
 
bool HasSwimmingFlagOutOfCombat () const
 
void RefreshSwimmingFlag (bool recheck=false)
 
void SetAssistanceTimer (uint32 value)
 
void ModifyThreatPercentTemp (Unit *victim, int32 percent, Milliseconds duration)
 
void ResumeChasingVictim ()
 Helper to resume chasing current victim.
 
bool CanCastSpell (uint32 spellID) const
 Returns true if the creature is able to cast the spell.
 
ObjectGuid GetSummonerGUID () const
 Helper to get the creature's summoner GUID, if it is a summon.
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Unit
 ~Unit () override
 
UnitAIGetAI ()
 
void SetAI (UnitAI *newAI)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void CleanupBeforeRemoveFromMap (bool finalCleanup)
 
void CleanupsBeforeDelete (bool finalCleanup=true) override
 
uint32 GetDynamicFlags () const override
 
void ReplaceAllDynamicFlags (uint32 flag) override
 
DiminishingLevels GetDiminishing (DiminishingGroup group)
 
void IncrDiminishing (DiminishingGroup group)
 
float ApplyDiminishingToDuration (DiminishingGroup group, int32 &duration, Unit *caster, DiminishingLevels Level, int32 limitduration)
 
void ApplyDiminishingAura (DiminishingGroup group, bool apply)
 
void ClearDiminishings ()
 
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
void Update (uint32 time) override
 
void setAttackTimer (WeaponAttackType type, int32 time)
 
void resetAttackTimer (WeaponAttackType type=BASE_ATTACK)
 
int32 getAttackTimer (WeaponAttackType type) const
 
bool isAttackReady (WeaponAttackType type=BASE_ATTACK) const
 
bool haveOffhandWeapon () const
 
bool CanDualWield () const
 
virtual void SetCanDualWield (bool value)
 
float GetCombatReach () const override
 
float GetMeleeReach () const
 
bool IsWithinRange (Unit const *obj, float dist) const
 
bool IsWithinCombatRange (Unit const *obj, float dist2compare) const
 
bool IsWithinMeleeRange (Unit const *obj, float dist=0.f) const
 
float GetMeleeRange (Unit const *target) const
 
virtual SpellSchoolMask GetMeleeDamageSchoolMask (WeaponAttackType attackType=BASE_ATTACK, uint8 damageIndex=0) const =0
 
bool GetRandomContactPoint (Unit const *target, float &x, float &y, float &z, bool force=false) const
 
void _addAttacker (Unit *pAttacker)
 
void _removeAttacker (Unit *pAttacker)
 
UnitgetAttackerForHelper () const
 
bool Attack (Unit *victim, bool meleeAttack)
 
void CastStop (uint32 except_spellid=0, bool withInstant=true)
 
bool AttackStop ()
 
void RemoveAllAttackers ()
 
AttackerSet const & getAttackers () const
 
bool GetMeleeAttackPoint (Unit *attacker, Position &pos)
 
bool isAttackingPlayer () const
 
UnitGetVictim () const
 
void CombatStop (bool includingCast=false)
 
void CombatStopWithPets (bool includingCast=false)
 
void StopAttackFaction (uint32 faction_id)
 
void StopAttackingInvalidTarget ()
 
UnitSelectNearbyTarget (Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
 
UnitSelectNearbyNoTotemTarget (Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
 
void SendMeleeAttackStop (Unit *victim=nullptr)
 
void SendMeleeAttackStart (Unit *victim, Player *sendTo=nullptr)
 
void AddUnitState (uint32 f)
 
bool HasUnitState (const uint32 f) const
 
void ClearUnitState (uint32 f)
 
uint32 GetUnitState () const
 
bool CanFreeMove () const
 
uint32 HasUnitTypeMask (uint32 mask) const
 
void AddUnitTypeMask (uint32 mask)
 
uint32 GetUnitTypeMask () const
 
bool IsSummon () const
 
bool IsGuardian () const
 
bool IsControllableGuardian () const
 
bool IsPet () const
 
bool IsHunterPet () const
 
bool IsTotem () const
 
bool IsVehicle () const
 
uint8 getLevel () const
 
uint8 GetLevel () const
 
uint8 getLevelForTarget (WorldObject const *) const override
 
void SetLevel (uint8 lvl, bool showLevelChange=true)
 
uint8 getRace (bool original=false) const
 
void setRace (uint8 race)
 
uint32 getRaceMask () const
 
uint8 getClass () const
 
uint32 getClassMask () const
 
uint8 getGender () const
 
DisplayRace GetDisplayRaceFromModelId (uint32 modelId) const
 
DisplayRace GetDisplayRace () const
 
float GetStat (Stats stat) const
 
void SetStat (Stats stat, int32 val)
 
uint32 GetArmor () const
 
void SetArmor (int32 val)
 
uint32 GetResistance (SpellSchools school) const
 
uint32 GetResistance (SpellSchoolMask mask) const
 
void SetResistance (SpellSchools school, int32 val)
 
uint32 GetHealth () const
 
uint32 GetMaxHealth () const
 
bool IsFullHealth () const
 
bool HealthBelowPct (int32 pct) const
 
bool HealthBelowPctDamaged (int32 pct, uint32 damage) const
 
bool HealthAbovePct (int32 pct) const
 
bool HealthAbovePctHealed (int32 pct, uint32 heal) const
 
float GetHealthPct () const
 
uint32 CountPctFromMaxHealth (int32 pct) const
 
uint32 CountPctFromCurHealth (int32 pct) const
 
float GetPowerPct (Powers power) const
 
void SetHealth (uint32 val)
 
void SetMaxHealth (uint32 val)
 
void SetFullHealth ()
 
int32 ModifyHealth (int32 val)
 
int32 GetHealthGain (int32 dVal)
 
Powers getPowerType () const
 
void setPowerType (Powers power)
 
uint32 GetPower (Powers power) const
 
uint32 GetMaxPower (Powers power) const
 
void SetPower (Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
 
void SetMaxPower (Powers power, uint32 val)
 
int32 ModifyPower (Powers power, int32 val, bool withPowerUpdate=true)
 
int32 ModifyPowerPct (Powers power, float pct, bool apply=true)
 
uint32 GetAttackTime (WeaponAttackType att) const
 
void SetAttackTime (WeaponAttackType att, uint32 val)
 
void ApplyAttackTimePercentMod (WeaponAttackType att, float val, bool apply)
 
void ApplyCastTimePercentMod (float val, bool apply)
 
UnitFlags GetUnitFlags () const
 
bool HasUnitFlag (UnitFlags flags) const
 
void SetUnitFlag (UnitFlags flags)
 
void RemoveUnitFlag (UnitFlags flags)
 
void ReplaceAllUnitFlags (UnitFlags flags)
 
UnitFlags2 GetUnitFlags2 () const
 
bool HasUnitFlag2 (UnitFlags2 flags) const
 
void SetUnitFlag2 (UnitFlags2 flags)
 
void RemoveUnitFlag2 (UnitFlags2 flags)
 
void ReplaceAllUnitFlags2 (UnitFlags2 flags)
 
SheathState GetSheath () const
 
virtual void SetSheath (SheathState sheathed)
 
uint32 GetFaction () const
 
void SetFaction (uint32 faction)
 
FactionTemplateEntry const * GetFactionTemplateEntry () const
 
ReputationRank GetReactionTo (Unit const *target, bool checkOriginalFaction=false) const
 
ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, Unit const *target) const
 
bool IsHostileTo (Unit const *unit) const
 
bool IsHostileToPlayers () const
 
bool IsFriendlyTo (Unit const *unit) const
 
bool IsNeutralToAll () const
 
bool IsInPartyWith (Unit const *unit) const
 
bool IsInRaidWith (Unit const *unit) const
 
void GetPartyMembers (std::list< Unit * > &units)
 
bool IsContestedGuard () const
 
bool IsInSanctuary () const
 
bool IsPvP () const
 
bool IsFFAPvP () const
 
void SetPvP (bool state)
 
uint32 GetCreatureType () const
 
uint32 GetCreatureTypeMask () const
 
uint8 getStandState () const
 
bool IsSitState () const
 
bool IsStandState () const
 
void SetStandState (uint8 state)
 
void SetStandFlags (uint8 flags)
 
void RemoveStandFlags (uint8 flags)
 
bool IsMounted () const
 
uint32 GetMountID () const
 
void Mount (uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
 
void Dismount ()
 
uint16 GetMaxSkillValueForLevel (Unit const *target=nullptr) const
 
void KillSelf (bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
 
void ProcDamageAndSpellFor (bool isVictim, Unit *target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const *procSpellInfo, uint32 damage, SpellInfo const *procAura=nullptr, int8 procAuraEffectIndex=-1, Spell const *procSpell=nullptr, DamageInfo *damageInfo=nullptr, HealInfo *healInfo=nullptr, uint32 procPhase=2)
 
void GetProcAurasTriggeredOnEvent (std::list< AuraApplication * > &aurasTriggeringProc, std::list< AuraApplication * > *procAuras, ProcEventInfo eventInfo)
 
void TriggerAurasProcOnEvent (CalcDamageInfo &damageInfo)
 
void TriggerAurasProcOnEvent (std::list< AuraApplication * > *myProcAuras, std::list< AuraApplication * > *targetProcAuras, Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
 
void TriggerAurasProcOnEvent (ProcEventInfo &eventInfo, std::list< AuraApplication * > &procAuras)
 
void HandleEmoteCommand (uint32 emoteId)
 
void AttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
 
void CalculateMeleeDamage (Unit *victim, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK, const bool sittingVictim=false)
 
void DealMeleeDamage (CalcDamageInfo *damageInfo, bool durabilityLoss)
 
void HandleProcExtraAttackFor (Unit *victim, uint32 count)
 
void SetLastExtraAttackSpell (uint32 spellId)
 
uint32 GetLastExtraAttackSpell () const
 
void AddExtraAttacks (uint32 count)
 
void SetLastDamagedTargetGuid (ObjectGuid const &guid)
 
ObjectGuid const & GetLastDamagedTargetGuid () const
 
void CalculateSpellDamageTaken (SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
 
void DealSpellDamage (SpellNonMeleeDamage *damageInfo, bool durabilityLoss, Spell const *spell=nullptr)
 
float GetMeleeCritChanceReduction () const
 
float GetRangedCritChanceReduction () const
 
float GetSpellCritChanceReduction () const
 
uint32 GetMeleeCritDamageReduction (uint32 damage) const
 
uint32 GetRangedCritDamageReduction (uint32 damage) const
 
uint32 GetSpellCritDamageReduction (uint32 damage) const
 
uint32 GetMeleeDamageReduction (uint32 damage) const
 
uint32 GetRangedDamageReduction (uint32 damage) const
 
uint32 GetSpellDamageReduction (uint32 damage) const
 
float MeleeSpellMissChance (Unit const *victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
 
SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellInfo const *spell)
 
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellInfo const *spell)
 
SpellMissInfo SpellHitResult (Unit *victim, SpellInfo const *spell, bool canReflect=false)
 
SpellMissInfo SpellHitResult (Unit *victim, Spell const *spell, bool canReflect=false)
 
float GetUnitDodgeChance () const
 
float GetUnitParryChance () const
 
float GetUnitBlockChance () const
 
float GetUnitMissChance (WeaponAttackType attType) const
 
float GetUnitCriticalChance (WeaponAttackType attackType, Unit const *victim) const
 
int32 GetMechanicResistChance (SpellInfo const *spell)
 
bool CanUseAttackType (uint8 attacktype) const
 
virtual uint32 GetShieldBlockValue () const =0
 
uint32 GetShieldBlockValue (uint32 soft_cap, uint32 hard_cap) const
 
uint32 GetUnitMeleeSkill (Unit const *target=nullptr) const
 
uint32 GetDefenseSkillValue (Unit const *target=nullptr) const
 
uint32 GetWeaponSkillValue (WeaponAttackType attType, Unit const *target=nullptr) const
 
float GetWeaponProcChance () const
 
float GetPPMProcChance (uint32 WeaponSpeed, float PPM, SpellInfo const *spellProto) const
 
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const *victim, WeaponAttackType attType) const
 
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const *victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const
 
NPCFlags GetNpcFlags () const
 
bool HasNpcFlag (NPCFlags flags) const
 
void SetNpcFlag (NPCFlags flags)
 
void RemoveNpcFlag (NPCFlags flags)
 
void ReplaceAllNpcFlags (NPCFlags 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
 
void SetImmuneToAll (bool apply, bool keepCombat=false)
 
bool IsImmuneToAll () const
 
void SetImmuneToPC (bool apply, bool keepCombat=false)
 
bool IsImmuneToPC () const
 
void SetImmuneToNPC (bool apply, bool keepCombat=false)
 
bool IsImmuneToNPC () const
 
bool IsEngaged () const
 
bool IsEngagedBy (Unit const *who) const
 
bool IsInCombat () const
 
bool IsInCombatWith (Unit const *who) const
 
bool IsPetInCombat () const
 
void CombatStart (Unit *target, bool initialAggro=true)
 
void CombatStartOnCast (Unit *target, bool initialAggro=true, uint32 duration=0)
 
void SetInCombatState (bool PvP, Unit *enemy=nullptr, uint32 duration=0)
 
void SetInCombatWith (Unit *enemy, uint32 duration=0)
 
void ClearInCombat ()
 
void ClearInPetCombat ()
 
uint32 GetCombatTimer () const
 
void SetCombatTimer (uint32 timer)
 
bool HasAuraTypeWithFamilyFlags (AuraType auraType, uint32 familyName, uint32 familyFlags) const
 
virtual bool HasSpell (uint32) const
 
bool HasBreakableByDamageAuraType (AuraType type, uint32 excludeAura=0) const
 
bool HasBreakableByDamageCrowdControlAura (Unit *excludeCasterChannel=nullptr) const
 
bool HasStealthAura () const
 
bool HasInvisibilityAura () const
 
bool isFeared () const
 
bool isInRoots () const
 
bool IsPolymorphed () const
 
bool isFrozen () const
 
bool isTargetableForAttack (bool checkFakeDeath=true, Unit const *byWho=nullptr) const
 
bool IsValidAttackTarget (Unit const *target, SpellInfo const *bySpell=nullptr) const
 
bool _IsValidAttackTarget (Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=nullptr) const
 
bool IsValidAssistTarget (Unit const *target) const
 
bool _IsValidAssistTarget (Unit const *target, SpellInfo const *bySpell) const
 
virtual bool IsInWater () const
 
virtual bool IsUnderWater () const
 
bool isInAccessiblePlaceFor (Creature const *c) const
 
void SendHealSpellLog (HealInfo const &healInfo, bool critical=false)
 
int32 HealBySpell (HealInfo &healInfo, bool critical=false)
 
void SendEnergizeSpellLog (Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
 
void EnergizeBySpell (Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
 
SpellCastResult CastSpell (SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastSpell (Unit *victim, uint32 spellId, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastSpell (Unit *victim, uint32 spellId, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastSpell (Unit *victim, SpellInfo const *spellInfo, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastSpell (Unit *victim, SpellInfo const *spellInfo, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastSpell (float x, float y, float z, uint32 spellId, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastSpell (GameObject *go, uint32 spellId, bool triggered, Item *castItem=nullptr, AuraEffect *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastCustomSpell (Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastCustomSpell (uint32 spellId, SpellValueMod mod, int32 value, Unit *victim, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastCustomSpell (uint32 spellId, SpellValueMod mod, int32 value, Unit *victim=nullptr, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
SpellCastResult CastCustomSpell (uint32 spellId, CustomSpellValues const &value, Unit *victim=nullptr, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
 
AuraAddAura (uint32 spellId, Unit *target)
 
AuraAddAura (SpellInfo const *spellInfo, uint8 effMask, Unit *target)
 
void SetAuraStack (uint32 spellId, Unit *target, uint32 stack)
 
void SendPlaySpellVisual (uint32 id)
 
void SendPlaySpellImpact (ObjectGuid guid, uint32 id)
 
void BuildCooldownPacket (WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown)
 
void BuildCooldownPacket (WorldPacket &data, uint8 flags, PacketCooldowns const &cooldowns)
 
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 *log)
 
void SendSpellNonMeleeReflectLog (SpellNonMeleeDamage *log, Unit *attacker)
 
void SendSpellNonMeleeDamageLog (Unit *target, SpellInfo const *spellInfo, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit=false, bool Split=false)
 
void SendPeriodicAuraLog (SpellPeriodicAuraLogInfo *pInfo)
 
void SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
 
void SendSpellDamageResist (Unit *target, uint32 spellId)
 
void SendSpellDamageImmune (Unit *target, uint32 spellId)
 
void NearTeleportTo (Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
 
void NearTeleportTo (float x, float y, float z, float orientation, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
 
void SendTameFailure (uint8 result)
 
void SendTeleportPacket (Position &pos)
 
virtual bool UpdatePosition (float x, float y, float z, float ang, bool teleport=false)
 
bool UpdatePosition (const Position &pos, bool teleport=false)
 
void UpdateOrientation (float orientation)
 Only server-side orientation update, does not broadcast to client.
 
void UpdateHeight (float newZ)
 Only server-side height update, does not broadcast to client.
 
void KnockbackFrom (float x, float y, float speedXY, float speedZ)
 
void JumpTo (float speedXY, float speedZ, bool forward=true)
 
void JumpTo (WorldObject *obj, float speedZ)
 
void SendMonsterMove (float NewPosX, float NewPosY, float NewPosZ, uint32 TransitTime, SplineFlags sf=SPLINEFLAG_WALK_MODE)
 
void MonsterMoveWithSpeed (float x, float y, float z, float speed)
 
void SendMovementFlagUpdate (bool self=false)
 
virtual bool SetWalk (bool enable)
 
virtual bool SetDisableGravity (bool disable, bool packetOnly=false, bool updateAnimationTier=true)
 
virtual bool SetSwim (bool enable)
 
virtual bool SetCanFly (bool enable, bool packetOnly=false)
 
virtual bool SetWaterWalking (bool enable, bool packetOnly=false)
 
virtual bool SetFeatherFall (bool enable, bool packetOnly=false)
 
virtual bool SetHover (bool enable, bool packetOnly=false, bool updateAnimationTier=true)
 
void SendMovementWaterWalking (Player *sendTo)
 
void SendMovementFeatherFall (Player *sendTo)
 
void SendMovementHover (Player *sendTo)
 
void SetInFront (WorldObject const *target)
 
void SetFacingTo (float ori)
 
void SetFacingToObject (WorldObject *object)
 
void SendChangeCurrentVictimOpcode (HostileReference *pHostileReference)
 
void SendClearThreatListOpcode ()
 
void SendRemoveFromThreatListOpcode (HostileReference *pHostileReference)
 
void SendThreatListUpdate ()
 
void SendClearTarget ()
 
void BuildHeartBeatMsg (WorldPacket *data) const
 
bool IsAlive () const
 
bool isDying () const
 
bool isDead () const
 
DeathState getDeathState ()
 
virtual void setDeathState (DeathState s, bool despawn=false)
 
ObjectGuid GetOwnerGUID () const
 
void SetOwnerGUID (ObjectGuid owner)
 
ObjectGuid GetCreatorGUID () const
 
void SetCreatorGUID (ObjectGuid creator)
 
ObjectGuid GetMinionGUID () const
 
void SetMinionGUID (ObjectGuid guid)
 
ObjectGuid GetCharmerGUID () const
 
void SetCharmerGUID (ObjectGuid owner)
 
ObjectGuid GetCharmGUID () const
 
void SetPetGUID (ObjectGuid guid)
 
ObjectGuid GetPetGUID () const
 
void SetCritterGUID (ObjectGuid guid)
 
ObjectGuid GetCritterGUID () const
 
bool IsControlledByPlayer () const
 
bool IsCreatedByPlayer () const
 
ObjectGuid GetCharmerOrOwnerGUID () const
 
ObjectGuid GetCharmerOrOwnerOrOwnGUID () const
 
bool IsCharmedOwnedByPlayerOrPlayer () const
 
PlayerGetSpellModOwner () const
 
UnitGetOwner () const
 
GuardianGetGuardianPet () const
 
MinionGetFirstMinion () const
 
UnitGetCharmer () const
 
UnitGetCharm () const
 
UnitGetCharmerOrOwner () const
 
UnitGetCharmerOrOwnerOrSelf () const
 
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
 
PlayerGetAffectingPlayer () const
 
void SetMinion (Minion *minion, bool apply)
 
void GetAllMinionsByEntry (std::list< Creature * > &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 onDeath=false)
 
bool IsCharmed () const
 
bool isPossessed () const
 
bool isPossessedByPlayer () const
 
bool isPossessing () const
 
bool isPossessing (Unit *u) const
 
CharmInfoGetCharmInfo ()
 
CharmInfoInitCharmInfo ()
 
void DeleteCharmInfo ()
 
void UpdateCharmAI ()
 
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 (SpellInfo const *newAura, uint8 effMask, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, bool periodicReset=false)
 
void _AddAura (UnitAura *aura, Unit *caster)
 
AuraApplication_CreateAuraApplication (Aura *aura, uint8 effMask)
 
void _ApplyAuraEffect (Aura *aura, uint8 effIndex)
 
void _ApplyAura (AuraApplication *aurApp, uint8 effMask)
 
void _UnapplyAura (AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
 
void _UnapplyAura (AuraApplication *aurApp, AuraRemoveMode removeMode)
 
void _RemoveNoStackAuraApplicationsDueToAura (Aura *aura)
 
void _RemoveNoStackAurasDueToAura (Aura *aura)
 
bool _IsNoStackAuraDueToAura (Aura *appliedAura, Aura *existingAura) const
 
void _RegisterAuraEffect (AuraEffect *aurEff, bool apply)
 
AuraMapGetOwnedAuras ()
 
AuraMap const & GetOwnedAuras () const
 
void RemoveOwnedAura (AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveOwnedAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 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, uint8 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, uint8 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 RemoveAurasDueToSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAuraFromStack (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAurasDueToSpellByDispel (uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit *dispeller, uint8 chargesRemoved=1)
 
void RemoveAurasDueToSpellBySteal (uint32 spellId, ObjectGuid casterGUID, Unit *stealer)
 
void RemoveAurasDueToItemSpell (uint32 spellId, ObjectGuid castItemGuid)
 
void RemoveAurasByType (AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
 
void RemoveNotOwnSingleTargetAuras ()
 
void RemoveAurasWithInterruptFlags (uint32 flag, uint32 except=0, bool isAutoshot=false)
 
void RemoveAurasWithAttribute (uint32 flags)
 
void RemoveAurasWithFamily (SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, 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 RemoveAllAurasOnDeath ()
 
void RemoveAllAurasRequiringDeadTarget ()
 
void RemoveAllAurasExceptType (AuraType type)
 
void RemoveEvadeAuras ()
 
void DelayOwnedAuras (uint32 spellId, ObjectGuid caster, int32 delaytime)
 
void _RemoveAllAuraStatMods ()
 
void _ApplyAllAuraStatMods ()
 
AuraEffectList const & GetAuraEffectsByType (AuraType type) const
 
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 name, uint32 iconId, uint8 effIndex) const
 
AuraEffectGetAuraEffect (AuraType type, SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID=ObjectGuid::Empty) const
 
AuraEffectGetAuraEffectDummy (uint32 spellid) const
 
AuraEffectGetDummyAuraEffect (SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
 
AuraApplicationGetAuraApplication (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
 
AuraGetAura (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
 
AuraApplicationGetAuraApplicationOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
 
AuraGetAuraOfRankedSpell (uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
 
void GetDispellableAuraList (Unit *caster, uint32 dispelMask, DispelChargesList &dispelList, SpellInfo const *dispelSpell)
 
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, uint8 reqEffMask=0) const
 
bool HasAuraType (AuraType auraType) const
 
bool HasAuraTypeWithCaster (AuraType auratype, ObjectGuid caster) const
 
bool HasAuraTypeWithMiscvalue (AuraType auratype, int32 miscvalue) const
 
bool HasAuraTypeWithAffectMask (AuraType auratype, SpellInfo const *affectedSpell) const
 
bool HasAuraTypeWithValue (AuraType auratype, int32 value) const
 
bool HasAuraTypeWithTriggerSpell (AuraType auratype, uint32 triggerSpell) const
 
bool HasNegativeAuraWithInterruptFlag (uint32 flag, ObjectGuid guid=ObjectGuid::Empty)
 
bool HasVisibleAuraType (AuraType auraType) const
 
bool HasNegativeAuraWithAttribute (uint32 flag, ObjectGuid guid=ObjectGuid::Empty)
 
bool HasAuraWithMechanic (uint32 mechanicMask) const
 
AuraEffectIsScriptOverriden (SpellInfo const *spell, int32 script) const
 
uint32 GetDiseasesByCaster (ObjectGuid casterGUID, uint8 mode=0)
 
uint32 GetDoTsByCaster (ObjectGuid casterGUID) const
 
int32 GetTotalAuraModifierAreaExclusive (AuraType auratype) const
 
int32 GetTotalAuraModifier (AuraType auratype) const
 
float GetTotalAuraMultiplier (AuraType auratype) const
 
int32 GetMaxPositiveAuraModifier (AuraType auratype)
 
int32 GetMaxNegativeAuraModifier (AuraType auratype) const
 
int32 GetTotalAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
float GetTotalAuraMultiplierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
int32 GetMaxPositiveAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask, const AuraEffect *except=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
 
float GetResistanceBuffMods (SpellSchools school, bool positive) const
 
void SetResistanceBuffMods (SpellSchools school, bool positive, float val)
 
void ApplyResistanceBuffModsMod (SpellSchools school, bool positive, float val, bool apply)
 
void ApplyResistanceBuffModsPercentMod (SpellSchools school, bool positive, float val, bool apply)
 
void InitStatBuffMods ()
 
void ApplyStatBuffMod (Stats stat, float val, bool apply)
 
void ApplyStatPercentBuffMod (Stats stat, float val, bool apply)
 
void SetCreateStat (Stats stat, float val)
 
void SetCreateHealth (uint32 val)
 
uint32 GetCreateHealth () const
 
void SetCreateMana (uint32 val)
 
uint32 GetCreateMana () const
 
uint32 GetCreatePowers (Powers power) const
 
float GetPosStat (Stats stat) const
 
float GetNegStat (Stats stat) const
 
float GetCreateStat (Stats stat) const
 
void SetCurrentCastedSpell (Spell *pSpell)
 
virtual void ProhibitSpellSchool (SpellSchoolMask, uint32)
 
void InterruptSpell (CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
 
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, bool bySelf=false)
 
SpellGetCurrentSpell (CurrentSpellTypes spellType) const
 
SpellGetCurrentSpell (uint32 spellType) const
 
SpellFindCurrentSpellBySpellId (uint32 spell_id) const
 
int32 GetCurrentSpellCastTime (uint32 spell_id) const
 
virtual bool IsMovementPreventedByCasting () const
 
ShapeshiftForm GetShapeshiftForm () const
 
void SetShapeshiftForm (ShapeshiftForm form)
 
bool IsInFeralForm () const
 
bool IsInDisallowedMountForm () const
 
bool HandleStatModifier (UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
 
void SetModifierValue (UnitMods unitMod, UnitModifierType modifierType, float value)
 
float GetModifierValue (UnitMods unitMod, UnitModifierType modifierType) const
 
float GetTotalStatValue (Stats stat, float additionalValue=0.0f) const
 
float GetTotalAuraModValue (UnitMods unitMod) const
 
SpellSchools GetSpellSchoolByAuraGroup (UnitMods unitMod) const
 
Stats GetStatByAuraGroup (UnitMods unitMod) const
 
Powers GetPowerTypeByAuraGroup (UnitMods unitMod) const
 
bool CanModifyStats () const
 
void SetCanModifyStats (bool modifyStats)
 
virtual bool UpdateStats (Stats stat)=0
 
virtual bool UpdateAllStats ()=0
 
virtual void UpdateResistances (uint32 school)=0
 
virtual void UpdateAllResistances ()
 
virtual void UpdateArmor ()=0
 
virtual void UpdateMaxHealth ()=0
 
virtual void UpdateMaxPower (Powers power)=0
 
virtual void UpdateAttackPowerAndDamage (bool ranged=false)=0
 
virtual void UpdateDamagePhysical (WeaponAttackType attType)
 
float GetTotalAttackPowerValue (WeaponAttackType attType, Unit *pVictim=nullptr) const
 
float GetWeaponDamageRange (WeaponAttackType attType, WeaponDamageRange type, uint8 damageIndex=0) const
 
void SetBaseWeaponDamage (WeaponAttackType attType, WeaponDamageRange damageRange, float value, uint8 damageIndex=0)
 
virtual void CalculateMinMaxDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage, uint8 damageIndex=0)=0
 
uint32 CalculateDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, uint8 itemDamagesMask=0)
 
float GetAPMultiplier (WeaponAttackType attType, bool normalized)
 
bool isInFrontInMap (Unit const *target, float distance, float arc=M_PI) const
 
bool isInBackInMap (Unit const *target, float distance, float arc=M_PI) const
 
bool IsVisible () const
 
void SetVisible (bool x)
 
void SetModelVisible (bool on)
 
uint32 GetPhaseByAuras () const
 
void SetPhaseMask (uint32 newPhaseMask, bool update) override
 
void UpdateObjectVisibility (bool forced=true, bool fromUpdate=false) override
 
bool CanHaveThreatList () const
 
void AddThreat (Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
 
float ApplyTotalThreatModifier (float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL)
 
void TauntApply (Unit *victim)
 
void TauntFadeOut (Unit *taunter)
 
ThreatMgrGetThreatMgr ()
 
ThreatMgr const & GetThreatMgr () const
 
void addHatedBy (HostileReference *pHostileReference)
 
void removeHatedBy (HostileReference *)
 
HostileRefMgrgetHostileRefMgr ()
 
VisibleAuraMap const * GetVisibleAuras ()
 
AuraApplicationGetVisibleAura (uint8 slot)
 
void SetVisibleAura (uint8 slot, AuraApplication *aur)
 
void RemoveVisibleAura (uint8 slot)
 
uint32 GetInterruptMask () const
 
void AddInterruptMask (uint32 mask)
 
void UpdateInterruptMask ()
 
virtual float GetNativeObjectScale () const
 
virtual void RecalculateObjectScale ()
 
uint32 GetDisplayId () const
 
virtual void SetDisplayId (uint32 modelId)
 
uint32 GetNativeDisplayId () const
 
void RestoreDisplayId ()
 
void SetNativeDisplayId (uint32 modelId)
 
void setTransForm (uint32 spellid)
 
uint32 getTransForm () const
 
void _RegisterDynObject (DynamicObject *dynObj)
 
void _UnregisterDynObject (DynamicObject *dynObj)
 
DynamicObjectGetDynObject (uint32 spellId)
 
bool RemoveDynObject (uint32 spellId)
 
void RemoveAllDynObjects ()
 
GameObjectGetGameObject (uint32 spellId) const
 
void AddGameObject (GameObject *gameObj)
 
void RemoveGameObject (GameObject *gameObj, bool del)
 
void RemoveGameObject (uint32 spellid, bool del)
 
void RemoveAllGameObjects ()
 
void ModifyAuraState (AuraStateType flag, bool apply)
 
uint32 BuildAuraStateUpdateForTarget (Unit *target) const
 
bool HasAuraState (AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
 
void UnsummonAllTotems (bool onDeath=false)
 
UnitGetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
 
UnitGetMeleeHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo=nullptr)
 
int32 SpellBaseDamageBonusDone (SpellSchoolMask schoolMask)
 
int32 SpellBaseDamageBonusTaken (SpellSchoolMask schoolMask, bool isDoT=false)
 
float SpellPctDamageModsDone (Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
 
uint32 SpellDamageBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
 
uint32 SpellDamageBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1)
 
int32 SpellBaseHealingBonusDone (SpellSchoolMask schoolMask)
 
int32 SpellBaseHealingBonusTaken (SpellSchoolMask schoolMask)
 
float SpellPctHealingModsDone (Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
 
uint32 SpellHealingBonusDone (Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
 
uint32 SpellHealingBonusTaken (Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1)
 
uint32 MeleeDamageBonusDone (Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
 
uint32 MeleeDamageBonusTaken (Unit *attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
 
bool isSpellBlocked (Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=BASE_ATTACK)
 
bool isBlockCritical ()
 
float SpellDoneCritChance (Unit const *, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType, bool skipEffectCheck) const
 
float SpellTakenCritChance (Unit const *caster, SpellInfo const *spellProto, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType, bool skipEffectCheck) const
 
void SetLastManaUse (uint32 spellCastTime)
 
bool IsUnderLastManaUseEffect () const
 
void SetContestedPvP (Player *attackedPlayer=nullptr, bool lookForNearContestedGuards=true)
 
uint32 GetCastingTimeForBonus (SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
 
float CalculateDefaultCoefficient (SpellInfo const *spellInfo, DamageEffectType damagetype) const
 
void CastDelayedSpellWithPeriodicAmount (Unit *caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex=0)
 
void ApplySpellImmune (uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
 
void ApplySpellDispelImmunity (SpellInfo const *spellProto, DispelType type, bool apply)
 
virtual bool IsImmunedToSpell (SpellInfo const *spellInfo, Spell const *spell=nullptr)
 
bool IsImmunedToDamage (SpellSchoolMask meleeSchoolMask) const
 
bool IsImmunedToDamage (SpellInfo const *spellInfo) const
 
bool IsImmunedToDamage (Spell const *spell) const
 
bool IsImmunedToSchool (SpellSchoolMask meleeSchoolMask) const
 
bool IsImmunedToSchool (SpellInfo const *spellInfo) const
 
bool IsImmunedToSchool (Spell const *spell) const
 
bool IsImmunedToDamageOrSchool (SpellSchoolMask meleeSchoolMask) const
 
bool IsImmunedToDamageOrSchool (SpellInfo const *spellInfo) const
 
virtual bool IsImmunedToSpellEffect (SpellInfo const *spellInfo, uint32 index) const
 
void UpdateSpeed (UnitMoveType mtype, bool forced)
 
float GetSpeed (UnitMoveType mtype) const
 
float GetSpeedRate (UnitMoveType mtype) const
 
void SetSpeed (UnitMoveType mtype, float rate, bool forced=false)
 
void SetSpeedRate (UnitMoveType mtype, float rate)
 
float ApplyEffectModifiers (SpellInfo const *spellProto, uint8 effect_index, float value) const
 
int32 CalculateSpellDamage (Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
 
int32 CalcSpellDuration (SpellInfo const *spellProto)
 
int32 ModSpellDuration (SpellInfo const *spellProto, Unit const *target, int32 duration, bool positive, uint32 effectMask)
 
void ModSpellCastTime (SpellInfo const *spellProto, int32 &castTime, Spell *spell=nullptr)
 
float CalculateLevelPenalty (SpellInfo const *spellProto) const
 
void addFollower (FollowerReference *pRef)
 
void removeFollower (FollowerReference *)
 
MotionMasterGetMotionMaster ()
 
const MotionMasterGetMotionMaster () const
 
virtual MovementGeneratorType GetDefaultMovementType () const
 -------—End of Pet responses methods-------—
 
bool IsStopped () const
 
void StopMoving ()
 
void StopMovingOnCurrentPos ()
 
virtual void PauseMovement (uint32 timer=0, uint8 slot=0)
 
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 (uint16 f)
 
void RemoveExtraUnitMovementFlag (uint16 f)
 
uint16 HasExtraUnitMovementFlag (uint16 f) const
 
uint16 GetExtraUnitMovementFlags () const
 
void SetExtraUnitMovementFlags (uint16 f)
 
void SetControlled (bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
 
void DisableRotate (bool apply)
 
void DisableSpline ()
 
uint8 GetComboPoints (Unit const *who=nullptr) const
 --------—Combo point system----------------—
 
uint8 GetComboPoints (ObjectGuid const &guid) const
 
UnitGetComboTarget () const
 
ObjectGuid const GetComboTargetGUID () const
 
void AddComboPoints (Unit *target, int8 count)
 
void AddComboPoints (int8 count)
 
void ClearComboPoints ()
 
void SendComboPoints ()
 
void AddComboPointHolder (Unit *unit)
 
void RemoveComboPointHolder (Unit *unit)
 
void ClearComboPointHolders ()
 
void SendPetActionFeedback (uint8 msg)
 -------—Pet responses methods--------------—
 
void SendPetTalk (uint32 pettalk)
 
void SendPetAIReaction (ObjectGuid guid)
 
void propagateSpeedChange ()
 -------—End of Pet responses methods-------—
 
void ClearAllReactives ()
 
void StartReactiveTimer (ReactiveType reactive)
 
void UpdateReactives (uint32 p_time)
 
void UpdateAuraForGroup (uint8 slot)
 
bool CanProc ()
 
void SetCantProc (bool apply)
 
void AddPetAura (PetAura const *petSpell)
 
void RemovePetAura (PetAura const *petSpell)
 
void CastPetAura (PetAura const *aura)
 
bool IsPetAura (Aura const *aura)
 
uint32 GetModelForForm (ShapeshiftForm form, uint32 spellId) const
 
uint32 GetModelForTotem (PlayerTotemType totemType)
 
void SetRedirectThreat (ObjectGuid guid, uint32 pct)
 
void ResetRedirectThreat ()
 
void ModifyRedirectThreat (int32 amount)
 
uint32 GetRedirectThreatPercent ()
 
UnitGetRedirectThreatTarget () const
 
bool CreateVehicleKit (uint32 id, uint32 creatureEntry)
 
void RemoveVehicleKit ()
 
VehicleGetVehicleKit () const
 
VehicleGetVehicle () const
 
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)
 
bool HandleSpellClick (Unit *clicker, int8 seatId=-1)
 
void EnterVehicle (Unit *base, int8 seatId=-1)
 
void EnterVehicleUnattackable (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)
 
void BuildMovementPacket (ByteBuffer *data) const
 
virtual bool CanSwim () const
 this method checks the current flag of a unit
 
bool IsLevitating () const
 
bool IsWalking () const
 
bool isMoving () const
 
bool isTurning () const
 
bool IsHovering () const
 
bool isSwimming () const
 
virtual bool CanFly () const =0
 
bool IsFlying () const
 
bool IsFalling () const
 
float GetHoverHeight () const
 
virtual bool CanEnterWater () const =0
 
void RewardRage (uint32 damage, uint32 weaponSpeedHitFactor, bool attacker)
 
virtual float GetFollowAngle () const
 
void OutDebugInfo () const
 
virtual bool isBeingLoaded () const
 
bool IsDuringRemoveFromWorld () const
 
PetToPet ()
 
TotemToTotem ()
 
TempSummonToTempSummon ()
 
const TempSummonToTempSummon () const
 
void AddPointedBy (SafeUnitPointer *sup)
 
void RemovePointedBy (SafeUnitPointer *sup)
 
void ExecuteDelayedUnitRelocationEvent ()
 
void ExecuteDelayedUnitAINotifyEvent ()
 
virtual bool HasSpellCooldown (uint32) const
 
virtual bool HasSpellItemCooldown (uint32, uint32) const
 
virtual void AddSpellCooldown (uint32, uint32, uint32, bool needSendToClient=false, bool forceSendToSpectator=false)
 
bool CanApplyResilience () const
 
void PetSpellFail (SpellInfo const *spellInfo, Unit *target, uint32 result)
 
int32 CalculateAOEDamageReduction (int32 damage, uint32 schoolMask, Unit *caster) const
 
ObjectGuid GetTarget () const
 
virtual void SetTarget (ObjectGuid=ObjectGuid::Empty)=0
 
void SetInstantCast (bool set)
 
bool CanInstantCast () const
 
virtual void Talk (std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
 
virtual void Say (std::string_view text, Language language, WorldObject const *target=nullptr)
 
virtual void Yell (std::string_view text, Language language, WorldObject const *target=nullptr)
 
virtual void TextEmote (std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
 
virtual void Whisper (std::string_view text, Language language, Player *target, bool isBossWhisper=false)
 
virtual void Talk (uint32 textId, ChatMsg msgType, float textRange, WorldObject const *target)
 
virtual void Say (uint32 textId, WorldObject const *target=nullptr)
 
virtual void Yell (uint32 textId, WorldObject const *target=nullptr)
 
virtual void TextEmote (uint32 textId, WorldObject const *target=nullptr, bool isBossEmote=false)
 
virtual void Whisper (uint32 textId, Player *target, bool isBossWhisper=false)
 
float GetCollisionHeight () const override
 Return collision height sent to client.
 
float GetCollisionWidth () const override
 this method gets the diameter of a Unit by DB if any value is defined, otherwise it gets the value by the DBC
 
float GetCollisionRadius () const override
 this method gets the radius of a Unit by DB if any value is defined, otherwise it gets the value by the DBC
 
void ProcessPositionDataChanged (PositionFullTerrainStatus const &data) override
 
virtual void ProcessTerrainStatusUpdate ()
 
bool CanRestoreMana (SpellInfo const *spellInfo) const
 
std::string GetDebugInfo () const override
 
uint32 GetOldFactionId () const
 
- Public Member Functions inherited from WorldObject
 ~WorldObject () override
 
virtual void Update (uint32)
 
void _Create (ObjectGuid::LowType guidlow, HighGuid guidhigh, uint32 phaseMask)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void GetNearPoint2D (WorldObject const *searcher, float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
 
void GetNearPoint2D (float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
 
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
 
void GetVoidClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0, float controlZ=0) const
 
bool GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float angle=0, WorldObject const *forWho=nullptr, bool force=false) 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 startX, float startY, float startZ, float destX, float destY)
 
Position GetFirstCollisionPosition (float destX, float destY, float destZ)
 
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 GetChargeContactPoint (WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
 
float GetObjectSize () const
 
virtual float GetCombatReach () const
 
void UpdateGroundPositionZ (float x, float y, float &z) const
 
void UpdateAllowedPositionZ (float x, float y, float &z, float *groundZ=nullptr) const
 
void GetRandomPoint (const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
 
Position GetRandomPoint (const Position &srcPos, float distance) const
 
uint32 GetInstanceId () const
 
virtual void SetPhaseMask (uint32 newPhaseMask, bool update)
 
uint32 GetPhaseMask () const
 
bool InSamePhase (WorldObject const *obj) const
 
bool InSamePhase (uint32 phasemask) const
 
uint32 GetZoneId () const
 
uint32 GetAreaId () const
 
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
 
bool IsOutdoors () const
 
LiquidData const & GetLiquidData () const
 
InstanceScriptGetInstanceScript () const
 
std::string const & GetName () const
 
void SetName (std::string const &newname)
 
virtual std::string const & GetNameForLocaleIdx (LocaleConstant) const
 
float GetDistance (WorldObject const *obj) const
 
float GetDistance (const Position &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 (const Position *pos, float dist) const
 
bool IsWithinDist2d (float x, float y, float dist) const
 
bool IsWithinDist2d (const Position *pos, float dist) const
 
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
 
bool IsWithinLOS (float x, float y, float z, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS) const
 
bool IsWithinLOSInMap (WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
Position GetHitSpherePointFor (Position const &dest, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) 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=M_PI) const
 
bool isInBack (WorldObject const *target, float arc=M_PI) const
 
bool IsInBetween (WorldObject const *obj1, WorldObject const *obj2, float size=0) const
 
virtual void CleanupsBeforeDelete (bool finalCleanup=true)
 
virtual void SendMessageToSet (WorldPacket const *data, bool self) const
 
virtual void SendMessageToSetInRange (WorldPacket const *data, float dist, bool, bool includeMargin=false, Player const *skipped_rcvr=nullptr) const
 
virtual void SendMessageToSet (WorldPacket const *data, Player const *skipped_rcvr) const
 
virtual uint8 getLevelForTarget (WorldObject const *) const
 
void PlayDistanceSound (uint32 sound_id, Player *target=nullptr)
 
void PlayDirectSound (uint32 sound_id, Player *target=nullptr)
 
void PlayDirectMusic (uint32 music_id, Player *target=nullptr)
 
void SendObjectDeSpawnAnim (ObjectGuid guid)
 
virtual void SaveRespawnTime ()
 
void AddObjectToRemoveList ()
 
float GetGridActivationRange () const
 
float GetVisibilityRange () const
 
virtual float GetSightRange (WorldObject const *target=nullptr) const
 
bool CanSeeOrDetect (WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
 
void SendPlayMusic (uint32 Music, bool OnlySelf)
 
virtual void SetMap (Map *map)
 
virtual void ResetMap ()
 
MapGetMap () const
 
MapFindMap () const
 
void SetZoneScript ()
 
void ClearZoneScript ()
 
ZoneScriptGetZoneScript () const
 
TempSummonSummonCreature (uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
 
TempSummonSummonCreature (uint32 id, float x, float y, float z, float ang=0, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false)
 
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
 
CreatureSummonTrigger (float x, float y, float z, float ang, uint32 dur, bool setLevel=false, 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, bool onlySpawned=false) const
 
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
 
PlayerSelectNearestPlayer (float distance=0) const
 
void GetGameObjectListWithEntryInGrid (std::list< GameObject * > &lList, uint32 uiEntry, float fMaxSearchRange) const
 
void GetCreatureListWithEntryInGrid (std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
 
void GetDeadCreatureListInGrid (std::list< Creature * > &lList, float maxSearchRange, bool alive=false) const
 
void DestroyForNearbyPlayers ()
 
virtual void UpdateObjectVisibility (bool forced=true, bool fromUpdate=false)
 
void BuildUpdate (UpdateDataMapType &data_map, UpdatePlayerSet &player_set) override
 
void GetCreaturesWithEntryInRange (std::list< Creature * > &creatureList, float radius, uint32 entry)
 
void SetPositionDataUpdate ()
 
void UpdatePositionData ()
 
void AddToObjectUpdate () override
 
void RemoveFromObjectUpdate () override
 
void AddToNotify (uint16 f)
 
void RemoveFromNotify (uint16 f)
 
bool isNeedNotify (uint16 f) const
 
uint16 GetNotifyFlags () const
 
bool NotifyExecuted (uint16 f) const
 
void SetNotified (uint16 f)
 
void ResetAllNotifies ()
 
bool isActiveObject () const
 
void setActive (bool isActiveObject)
 
bool IsFarVisible () const
 
bool IsVisibilityOverridden () const
 
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
 
void SetWorldObject (bool apply)
 
bool IsPermanentWorldObject () const
 
bool IsWorldObject () const
 
bool IsInWintergrasp () const
 
TransportGetTransport () const
 
float GetTransOffsetX () const
 
float GetTransOffsetY () const
 
float GetTransOffsetZ () const
 
float GetTransOffsetO () const
 
uint32 GetTransTime () const
 
int8 GetTransSeat () const
 
virtual ObjectGuid GetTransGUID () const
 
void SetTransport (Transport *t)
 
virtual float GetStationaryX () const
 
virtual float GetStationaryY () const
 
virtual float GetStationaryZ () const
 
virtual float GetStationaryO () 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
 
float GetFloorZ () const
 
float GetMinHeightInWater () const
 Get the minimum height of a object that should be in water to start floating/swim.
 
virtual float GetCollisionHeight () const
 
virtual float GetCollisionWidth () const
 
virtual float GetCollisionRadius () const
 
void AddAllowedLooter (ObjectGuid guid)
 
void ResetAllowedLooters ()
 
void SetAllowedLooters (GuidUnorderedSet const looters)
 
bool HasAllowedLooter (ObjectGuid guid) const
 
GuidUnorderedSet const & GetAllowedLooters () const
 
void RemoveAllowedLooter (ObjectGuid guid)
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
bool IsInWorld () const
 
virtual void AddToWorld ()
 
virtual void RemoveFromWorld ()
 
ObjectGuid GetGUID () const
 
PackedGuid const & GetPackGUID () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
virtual void SetObjectScale (float scale)
 
virtual uint32 GetDynamicFlags () const
 
bool HasDynamicFlag (uint32 flag) const
 
virtual void SetDynamicFlag (uint32 flag)
 
virtual void RemoveDynamicFlag (uint32 flag)
 
virtual void ReplaceAllDynamicFlags (uint32 flag)
 
TypeID GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
void BuildMovementUpdateBlock (UpdateData *data, uint32 flags=0) const
 
virtual void DestroyForPlayer (Player *target, bool onDeath=false) const
 
int32 GetInt32Value (uint16 index) const
 
uint32 GetUInt32Value (uint16 index) const
 
uint64 GetUInt64Value (uint16 index) const
 
float GetFloatValue (uint16 index) const
 
uint8 GetByteValue (uint16 index, uint8 offset) const
 
uint16 GetUInt16Value (uint16 index, uint8 offset) const
 
ObjectGuid GetGuidValue (uint16 index) const
 
void SetInt32Value (uint16 index, int32 value)
 
void SetUInt32Value (uint16 index, uint32 value)
 
void UpdateUInt32Value (uint16 index, uint32 value)
 
void SetUInt64Value (uint16 index, uint64 value)
 
void SetFloatValue (uint16 index, float value)
 
void SetByteValue (uint16 index, uint8 offset, uint8 value)
 
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
 
void SetInt16Value (uint16 index, uint8 offset, int16 value)
 
void SetGuidValue (uint16 index, ObjectGuid value)
 
void SetStatFloatValue (uint16 index, float value)
 
void SetStatInt32Value (uint16 index, int32 value)
 
bool AddGuidValue (uint16 index, ObjectGuid value)
 
bool RemoveGuidValue (uint16 index, ObjectGuid value)
 
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModUInt64Value (uint16 index, int32 val, bool apply)
 
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
 
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
 
void ApplyPercentModFloatValue (uint16 index, float val, bool apply)
 
void SetFlag (uint16 index, uint32 newFlag)
 
void RemoveFlag (uint16 index, uint32 oldFlag)
 
void ToggleFlag (uint16 index, uint32 flag)
 
bool HasFlag (uint16 index, uint32 flag) const
 
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
 
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
 
void SetFlag64 (uint16 index, uint64 newFlag)
 
void RemoveFlag64 (uint16 index, uint64 oldFlag)
 
void ToggleFlag64 (uint16 index, uint64 flag)
 
bool HasFlag64 (uint16 index, uint64 flag) const
 
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
 
void ClearUpdateMask (bool remove)
 
uint16 GetValuesCount () const
 
virtual bool hasQuest (uint32) const
 
virtual bool hasInvolvedQuest (uint32) const
 
virtual void BuildUpdate (UpdateDataMapType &, UpdatePlayerSet &)
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
 
void SetFieldNotifyFlag (uint16 flag)
 
void RemoveFieldNotifyFlag (uint16 flag)
 
void ForceValuesUpdateAtIndex (uint32)
 
bool IsPlayer () const
 
PlayerToPlayer ()
 
Player const * ToPlayer () const
 
CreatureToCreature ()
 
Creature const * ToCreature () const
 
UnitToUnit ()
 
Unit const * ToUnit () const
 
GameObjectToGameObject ()
 
GameObject const * ToGameObject () const
 
CorpseToCorpse ()
 
Corpse const * ToCorpse () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
virtual std::string GetDebugInfo () 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 (const WorldLocation &loc)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
void SetMapId (uint32 mapId)
 
uint32 GetMapId () const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z, float &o) const
 
void GetWorldLocation (WorldLocation *location) const
 
WorldLocation GetWorldLocation () const
 
std::string GetDebugInfo () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
 Position (Position const &loc)
 
 Position (Position &&)=default
 
Positionoperator= (const Position &)=default
 
Positionoperator= (Position &&)=default
 
bool operator== (Position const &a) const
 
bool operator!= (Position const &a)
 
 operator G3D::Vector3 () 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 (const Position &pos)
 
void Relocate (const Position *pos)
 
void RelocatePolarOffset (float angle, float dist, float z=0.0f)
 
void RelocateOffset (const Position &offset)
 
void SetOrientation (float orientation)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
float GetOrientation () const
 
void GetPosition (float &x, float &y) const
 
void GetPosition (float &x, float &y, float &z) const
 
void GetPosition (float &x, float &y, float &z, float &o) const
 
Position GetPosition () const
 
Position::PositionXYZStreamer PositionXYZStream ()
 
Position::PositionXYZOStreamer PositionXYZOStream ()
 
bool IsPositionValid () const
 
float GetExactDist2dSq (const float x, const float y) const
 
float GetExactDist2dSq (Position const &pos) const
 
float GetExactDist2dSq (Position const *pos) const
 
float GetExactDist2d (const float x, const float y) const
 
float GetExactDist2d (Position const &pos) const
 
float GetExactDist2d (Position const *pos) const
 
float GetExactDistSq (float x, float y, float z) const
 
float GetExactDistSq (Position const &pos) const
 
float GetExactDistSq (Position const *pos) const
 
float GetExactDist (float x, float y, float z) const
 
float GetExactDist (Position const &pos) const
 
float GetExactDist (Position const *pos) const
 
void GetPositionOffsetTo (const Position &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAngle (const Position *pos) const
 
float GetAngle (float x, float y) const
 
float GetAbsoluteAngle (float x, float y) const
 
float GetAbsoluteAngle (Position const &pos) const
 
float GetAbsoluteAngle (Position const *pos) const
 
float GetRelativeAngle (const Position *pos) const
 
float GetRelativeAngle (float x, float y) const
 
float ToAbsoluteAngle (float relAngle) const
 
void GetSinCos (float x, float y, float &vsin, float &vcos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (const Position *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (const Position *pos, float dist) const
 
bool IsWithinBox (const Position &center, float xradius, float yradius, float zradius) const
 
bool HasInArc (float arcangle, const Position *pos, float targetRadius=0.0f) const
 
bool HasInLine (Position const *pos, float width) const
 
std::string ToString () const
 
- Public Member Functions inherited from GridObject< Creature >
bool IsInGrid () const
 
void AddToGrid (GridRefMgr< Creature > &m)
 
void RemoveFromGrid ()
 

Static Public Member Functions

static float _GetDamageMod (int32 Rank)
 
- Static Public Member Functions inherited from Unit
static float GetEffectiveResistChance (Unit const *owner, SpellSchoolMask schoolMask, Unit const *victim)
 
static void DealDamageMods (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, bool allowGM=false, Spell const *spell=nullptr)
 
static void Kill (Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
 
static int32 DealHeal (Unit *healer, Unit *victim, uint32 addhealth)
 
static void ProcDamageAndSpell (Unit *actor, Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=BASE_ATTACK, SpellInfo const *procSpellInfo=nullptr, SpellInfo const *procAura=nullptr, int8 procAuraEffectIndex=-1, Spell const *procSpell=nullptr, DamageInfo *damageInfo=nullptr, HealInfo *healInfo=nullptr, uint32 procPhase=2)
 
static void ApplyResilience (Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
 
static uint32 SpellCriticalDamageBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
 
static uint32 SpellCriticalHealingBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
 
static bool IsDamageReducedByArmor (SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr, uint8 effIndex=MAX_SPELL_EFFECTS)
 
static uint32 CalcArmorReducedDamage (Unit const *attacker, Unit const *victim, const uint32 damage, SpellInfo const *spellInfo, uint8 attackerLevel=0, WeaponAttackType attackType=MAX_ATTACK)
 
static void CalcAbsorbResist (DamageInfo &dmgInfo, bool Splited=false)
 
static void CalcHealAbsorb (HealInfo &healInfo)
 
static void HandleSafeUnitPointersOnDelete (Unit *thisUnit)
 
- Static Public Member Functions inherited from Object
static ObjectGuid GetGUID (Object const *o)
 
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 

Public Attributes

struct {
   ::Spell const *   Spell = nullptr
 
   uint32   Delay = 0
 
   ObjectGuid   Target
 
   float   Orientation = 0.0f
 
_spellFocusInfo
 
Loot loot
 
uint32 m_spells [MAX_CREATURE_SPELLS]
 
CreatureSpellCooldowns m_CreatureSpellCooldowns
 
uint32 m_ProhibitSchoolTime [7]
 
uint32 m_groupLootTimer
 
uint32 lootingGroupLowGUID
 
float m_SightDistance
 
float m_CombatDistance
 
bool m_isTempWorldObject
 
uint32 m_moveCircleMovementTime = MOVE_CIRCLE_CHECK_INTERVAL
 
uint32 m_moveBackwardsMovementTime = MOVE_BACKWARDS_CHECK_INTERVAL
 
- Public Attributes inherited from Unit
uint32 m_extraAttacks
 
bool m_canDualWield
 
ControlSet m_Controlled
 
SafeUnitPointer m_movedByPlayer
 
ObjectGuid m_SummonSlot [MAX_SUMMON_SLOT]
 
ObjectGuid m_ObjectSlot [MAX_GAMEOBJECT_SLOT]
 
float m_modMeleeHitChance
 
float m_modRangedHitChance
 
float m_modSpellHitChance
 
int32 m_baseSpellCritChance
 
float m_threatModifier [MAX_SPELL_SCHOOL]
 
float m_modAttackSpeedPct [3]
 
EventProcessor m_Events
 
SpellImmuneList m_spellImmune [MAX_SPELL_IMMUNITY]
 
uint32 m_lastSanctuaryTime
 
PetAuraSet m_petAuras
 
bool IsAIEnabled
 
bool NeedChangeAI
 
bool m_ControlledByPlayer
 
bool m_CreatedByPlayer
 
std::set< SafeUnitPointer * > SafeUnitPointerSet
 
Position m_last_notify_position
 
uint32 m_last_notify_mstime
 
uint16 m_delayed_unit_relocation_timer
 
uint16 m_delayed_unit_ai_notify_timer
 
bool bRequestForcedVisibilityUpdate
 
Movement::MoveSplinemovespline
 
- 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
 
ElunaEventProcessor * elunaEvents
 
- Public Attributes inherited from Object
DataMap CustomData
 
- Public Attributes inherited from WorldLocation
uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX = 0
 
float m_positionY = 0
 
float m_positionZ = 0
 
float m_orientation = 0
 

Static Public Attributes

static constexpr uint32 MOVE_CIRCLE_CHECK_INTERVAL = 3000
 
static constexpr uint32 MOVE_BACKWARDS_CHECK_INTERVAL = 2000
 

Protected Member Functions

bool CreateFromProto (ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, const CreatureData *data=nullptr)
 
bool InitEntry (uint32 entry, const CreatureData *data=nullptr)
 
void RegenerateHealth ()
 
void Regenerate (Powers power)
 
bool IsInvisibleDueToDespawn () const override
 
bool CanAlwaysSee (WorldObject const *obj) const override
 
bool IsAlwaysDetectableFor (WorldObject const *seer) const override
 
- Protected Member Functions inherited from Unit
 Unit (bool isWorldObject)
 
void BuildValuesUpdate (uint8 updatetype, ByteBuffer *data, Player *target) const override
 
void _UpdateSpells (uint32 time)
 
void _DeleteRemovedAuras ()
 
void _UpdateAutoRepeatSpell ()
 
bool IsAlwaysVisibleFor (WorldObject const *seer) const override
 
bool IsAlwaysDetectableFor (WorldObject const *seer) const override
 
void SetFeared (bool apply, Unit *fearedBy=nullptr, bool isFear=false)
 
void SetConfused (bool apply)
 
void SetStunned (bool apply)
 
void SetRooted (bool apply, bool isStun=false)
 
- Protected Member Functions inherited from WorldObject
 WorldObject (bool isWorldObject)
 
virtual void ProcessPositionDataChanged (PositionFullTerrainStatus const &data)
 
void SetLocationMapId (uint32 _mapId)
 
void SetLocationInstanceId (uint32 _instanceId)
 
virtual bool IsNeverVisible () const
 
virtual bool IsAlwaysVisibleFor (WorldObject const *) const
 
virtual bool IsInvisibleDueToDespawn () const
 
virtual bool IsAlwaysDetectableFor (WorldObject const *) const
 
- Protected Member Functions inherited from Object
 Object ()
 
void _InitValues ()
 
void _Create (ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
 
std::string _ConcatFields (uint16 startIndex, uint16 size) const
 
bool _LoadIntoDataField (std::string const &data, uint32 startOffset, uint32 count)
 
uint32 GetUpdateFieldData (Player const *target, uint32 *&flags) const
 
void BuildMovementUpdate (ByteBuffer *data, uint16 flags) const
 
virtual void BuildValuesUpdate (uint8 updatetype, ByteBuffer *data, Player *target) const
 
virtual void AddToObjectUpdate ()=0
 
virtual void RemoveFromObjectUpdate ()=0
 
void AddToObjectUpdateIfNeeded ()
 
- Protected Member Functions inherited from MovableMapObject
 MovableMapObject ()=default
 

Static Protected Member Functions

static float _GetHealthMod (int32 Rank)
 

Protected Attributes

VendorItemCounts m_vendorItemCounts
 
ObjectGuid m_lootRecipient
 
ObjectGuid::LowType m_lootRecipientGroup
 
time_t m_corpseRemoveTime
 Timers.
 
time_t m_respawnTime
 
time_t m_respawnedTime
 
uint32 m_respawnDelay
 
uint32 m_corpseDelay
 
float m_wanderDistance
 
uint32 m_boundaryCheckTime
 
uint16 m_transportCheckTimer
 
uint32 lootPickPocketRestoreTime
 
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.
 
uint8 m_equipmentId
 
int8 m_originalEquipmentId
 
bool m_AlreadyCallAssistance
 
bool m_AlreadySearchedAssistance
 
bool m_regenHealth
 
bool m_regenPower
 
bool m_AI_locked
 
SpellSchoolMask m_meleeDamageSchoolMask
 
uint32 m_originalEntry
 
bool m_moveInLineOfSightDisabled
 
bool m_moveInLineOfSightStrictlyDisabled
 
Position m_homePosition
 
Position m_transportHomePosition
 
bool DisableReputationGain
 
CreatureTemplate const * m_creatureInfo
 
CreatureData const * m_creatureData
 
float m_detectionDistance
 
uint16 m_LootMode
 
- Protected Attributes inherited from Unit
UnitAIi_AI
 
UnitAIi_disabledAI
 
uint8 m_realRace
 
uint8 m_race
 
bool m_AutoRepeatFirstCast
 
int32 m_attackTimer [MAX_ATTACK]
 
float m_createStats [MAX_STATS]
 
AttackerSet m_attackers
 
Unitm_attacking
 
DeathState m_deathState
 
int32 m_procDeep
 
DynObjectList m_dynObj
 
GameObjectList m_gameObj
 
uint32 m_transform
 
Spellm_currentSpells [CURRENT_MAX_SPELL]
 
AuraMap m_ownedAuras
 
AuraApplicationMap m_appliedAuras
 
AuraList m_removedAuras
 
AuraMap::iterator m_auraUpdateIterator
 
uint32 m_removedAurasCount
 
AuraEffectList m_modAuras [TOTAL_AURAS]
 
AuraList m_scAuras
 
AuraApplicationList m_interruptableAuras
 
AuraStateAurasMap m_auraStateAuras
 
uint32 m_interruptMask
 
float m_auraModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_END]
 
float m_weaponDamage [MAX_ATTACK][MAX_WEAPON_DAMAGE_RANGE][MAX_ITEM_PROTO_DAMAGES]
 
bool m_canModifyStats
 
VisibleAuraMap m_visibleAuras
 
float m_speed_rate [MAX_MOVE_TYPE]
 
CharmInfom_charmInfo
 
SharedVisionList m_sharedVision
 
MotionMasteri_motionMaster
 
uint32 m_reactiveTimer [MAX_REACTIVE]
 
int32 m_regenTimer
 
ThreatMgr m_ThreatMgr
 
CharmThreatMap _charmThreatInfo
 
Vehiclem_vehicle
 
Vehiclem_vehicleKit
 
uint32 m_unitTypeMask
 
LiquidTypeEntry const * _lastLiquid
 
bool m_applyResilience
 
bool _instantCast
 
uint32 m_rootTimes
 
- Protected Attributes inherited from WorldObject
std::string m_name
 
bool m_isActive
 
bool m_isFarVisible
 
Optional< float > m_visibilityDistanceOverride
 
const bool m_isWorldObject
 
ZoneScriptm_zoneScript
 
uint32 _zoneId
 
uint32 _areaId
 
float _floorZ
 
bool _outdoors
 
LiquidData _liquidData
 
bool _updatePositionData
 
Transportm_transport
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
TypeID m_objectTypeId
 
uint16 m_updateFlag
 
union {
   int32 *   m_int32Values
 
   uint32 *   m_uint32Values
 
   float *   m_floatValues
 
}; 
 
UpdateMask _changesMask
 
uint16 m_valuesCount
 
uint16 _fieldNotifyFlags
 
bool m_objectUpdated
 

Private Member Functions

void ForcedDespawn (uint32 timeMSToDespawn=0, Seconds forcedRespawnTimer=0s)
 
bool CanPeriodicallyCallForAssistance () const
 

Private Attributes

uint32 m_waypointID
 
uint32 m_path_id
 
CreatureGroupm_formation
 
bool TriggerJustRespawned
 
std::shared_ptr< time_t > _lastDamagedTime
 
ObjectGuid m_cannotReachTarget
 
uint32 m_cannotReachTimer
 
Spell const * _focusSpell
 
bool _isMissingSwimmingFlagOutOfCombat
 

‍Locks the target during spell cast for proper facing


 
uint32 m_assistanceTimer
 
uint32 _playerDamageReq
 
bool _damagedByPlayer
 

Additional Inherited Members

- Public Types inherited from Unit
typedef std::unordered_set< Unit * > AttackerSet
 
typedef std::set< Unit * > ControlSet
 
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::list< DiminishingReturnDiminishing
 
typedef GuidUnorderedSet ComboPointHolderSet
 
typedef std::map< uint8, AuraApplication * > VisibleAuraMap
 
typedef std::set< PetAura const * > PetAuraSet
 
- Protected Types inherited from Unit
typedef std::list< DynamicObject * > DynObjectList
 
typedef GuidList GameObjectList
 
typedef std::map< ObjectGuid, float > CharmThreatMap
 

Detailed Description

Constructor & Destructor Documentation

◆ Creature()

Creature::Creature ( bool  isWorldObject = false)
explicit
224{
227
228 for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
229 m_spells[i] = 0;
230
231 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
233
235 DisableReputationGain = false;
236
238 m_CombatDistance = 0.0f;
239
240 ResetLootMode(); // restore default loot mode
241 TriggerJustRespawned = false;
242 m_isTempWorldObject = false;
243 _focusSpell = nullptr;
244
245 m_respawnedTime = time_t(0);
246}
std::uint8_t uint8
Definition: Define.h:110
#define CREATURE_REGEN_INTERVAL
Definition: CreatureData.h:35
@ UNIT_END
Definition: UpdateFields.h:175
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
static constexpr uint32 MAX_CREATURE_SPELLS
Definition: Unit.h:153
@ IDLE_MOTION_TYPE
Definition: MotionMaster.h:37
@ CONFIG_SIGHT_MONSTER
Definition: IWorld.h:194
@ SPELL_SCHOOL_NORMAL
Definition: SharedDefines.h:283
constexpr auto MAX_SPELL_SCHOOL
Definition: SharedDefines.h:292
@ SPELL_SCHOOL_MASK_NORMAL
Definition: SharedDefines.h:297
#define sWorld
Definition: World.h:447
bool m_regenPower
Definition: Creature.h:454
float m_wanderDistance
Definition: Creature.h:436
void ResetLootMode()
Definition: Creature.h:239
SpellSchoolMask m_meleeDamageSchoolMask
Definition: Creature.h:457
uint16 m_transportCheckTimer
Definition: Creature.h:438
bool m_AI_locked
Definition: Creature.h:455
uint32 m_assistanceTimer
Definition: Creature.h:500
int8 m_originalEquipmentId
Definition: Creature.h:449
ObjectGuid::LowType m_spawnId
For new or temporary creatures is 0 for saved it is lowguid.
Definition: Creature.h:447
Position m_transportHomePosition
Definition: Creature.h:464
ObjectGuid::LowType m_lootRecipientGroup
Definition: Creature.h:428
uint32 m_spells[MAX_CREATURE_SPELLS]
Definition: Creature.h:244
CreatureTemplate const * m_creatureInfo
Definition: Creature.h:468
bool _isMissingSwimmingFlagOutOfCombat
‍Locks the target during spell cast for proper facing
Definition: Creature.h:498
uint32 m_waypointID
Definition: Creature.h:484
MovementGeneratorType m_defaultMovementType
Definition: Creature.h:446
float m_detectionDistance
Definition: Creature.h:471
CreatureSpellCooldowns m_CreatureSpellCooldowns
Definition: Creature.h:245
float m_SightDistance
Definition: Creature.h:365
uint32 m_cannotReachTimer
Definition: Creature.h:494
uint32 m_respawnDelay
Definition: Creature.h:434
time_t m_corpseRemoveTime
Timers.
Definition: Creature.h:431
uint32 m_combatPulseDelay
Definition: Creature.h:441
time_t m_respawnTime
Definition: Creature.h:432
CreatureData const * m_creatureData
Definition: Creature.h:469
float m_CombatDistance
Definition: Creature.h:365
time_t m_respawnedTime
Definition: Creature.h:433
uint32 m_boundaryCheckTime
Definition: Creature.h:437
Position m_homePosition
Definition: Creature.h:463
bool TriggerJustRespawned
Definition: Creature.h:489
bool m_AlreadyCallAssistance
Definition: Creature.h:451
bool DisableReputationGain
Definition: Creature.h:466
CreatureGroup * m_formation
Definition: Creature.h:488
uint32 m_corpseDelay
Definition: Creature.h:435
uint8 m_equipmentId
Definition: Creature.h:448
bool m_AlreadySearchedAssistance
Definition: Creature.h:452
uint32 m_originalEntry
Definition: Creature.h:458
bool m_isTempWorldObject
Definition: Creature.h:367
ReactStates m_reactState
Definition: Creature.h:443
Spell const * _focusSpell
Definition: Creature.h:496
uint32 lootPickPocketRestoreTime
Definition: Creature.h:439
bool m_moveInLineOfSightStrictlyDisabled
Definition: Creature.h:461
uint32 lootingGroupLowGUID
Definition: Creature.h:302
bool m_regenHealth
Definition: Creature.h:453
uint32 _playerDamageReq
Definition: Creature.h:502
std::shared_ptr< time_t > _lastDamagedTime
Definition: Creature.h:491
bool _damagedByPlayer
Definition: Creature.h:503
uint32 m_path_id
Definition: Creature.h:485
bool m_moveInLineOfSightDisabled
Definition: Creature.h:460
uint32 m_groupLootTimer
Definition: Creature.h:301
uint32 m_combatPulseTime
Definition: Creature.h:440
uint32 m_ProhibitSchoolTime[7]
Definition: Creature.h:246
uint16 m_valuesCount
Definition: Object.h:242
MovableMapObject()=default
Definition: Unit.h:1302
int32 m_regenTimer
Definition: Unit.h:2542

References _focusSpell, CONFIG_SIGHT_MONSTER, CREATURE_REGEN_INTERVAL, DisableReputationGain, m_CombatDistance, m_CreatureSpellCooldowns, m_isTempWorldObject, m_ProhibitSchoolTime, Unit::m_regenTimer, m_respawnedTime, m_SightDistance, m_spells, Object::m_valuesCount, MAX_CREATURE_SPELLS, MAX_SPELL_SCHOOL, ResetLootMode(), SPELL_SCHOOL_NORMAL, sWorld, TriggerJustRespawned, and UNIT_END.

◆ ~Creature()

Creature::~Creature ( )
override
249{
250 m_vendorItemCounts.clear();
251
252 delete i_AI;
253 i_AI = nullptr;
254}
VendorItemCounts m_vendorItemCounts
Definition: Creature.h:423
UnitAI * i_AI
Definition: Unit.h:2485

References Unit::i_AI, and m_vendorItemCounts.

Member Function Documentation

◆ _AddCreatureSpellCooldown()

void Creature::_AddCreatureSpellCooldown ( uint32  spell_id,
uint16  categoryId,
uint32  end_time 
)
2774{
2775 CreatureSpellCooldown spellCooldown;
2776 spellCooldown.category = categoryId;
2777 spellCooldown.end = GameTime::GetGameTimeMS().count() + end_time;
2778 m_CreatureSpellCooldowns[spell_id] = std::move(spellCooldown);
2779}
Milliseconds GetGameTimeMS()
Definition: GameTime.cpp:43
Definition: CreatureData.h:529
uint16 category
Definition: CreatureData.h:533
uint32 end
Definition: CreatureData.h:534

References CreatureSpellCooldown::category, CreatureSpellCooldown::end, GameTime::GetGameTimeMS(), and m_CreatureSpellCooldowns.

Referenced by Pet::_LoadSpellCooldowns(), AddSpellCooldown(), TriggerBurningPitch(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::UpdateAI(), and npc_gunship_rocketeer::npc_gunship_rocketeerAI::UpdateAI().

◆ _GetDamageMod()

float Creature::_GetDamageMod ( int32  Rank)
static
1531{
1532 switch (Rank) // define rates for each elite rank
1533 {
1535 return sWorld->getRate(RATE_CREATURE_NORMAL_DAMAGE);
1543 return sWorld->getRate(RATE_CREATURE_ELITE_RARE_DAMAGE);
1544 default:
1546 }
1547}
@ RATE_CREATURE_NORMAL_DAMAGE
Definition: IWorld.h:486
@ RATE_CREATURE_ELITE_RARE_DAMAGE
Definition: IWorld.h:490
@ RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE
Definition: IWorld.h:489
@ RATE_CREATURE_ELITE_RAREELITE_DAMAGE
Definition: IWorld.h:488
@ RATE_CREATURE_ELITE_ELITE_DAMAGE
Definition: IWorld.h:487
@ CREATURE_ELITE_NORMAL
Definition: SharedDefines.h:2731
@ CREATURE_ELITE_WORLDBOSS
Definition: SharedDefines.h:2734
@ CREATURE_ELITE_RARE
Definition: SharedDefines.h:2735
@ CREATURE_ELITE_RAREELITE
Definition: SharedDefines.h:2733
@ CREATURE_ELITE_ELITE
Definition: SharedDefines.h:2732

References CREATURE_ELITE_ELITE, CREATURE_ELITE_NORMAL, CREATURE_ELITE_RARE, CREATURE_ELITE_RAREELITE, CREATURE_ELITE_WORLDBOSS, RATE_CREATURE_ELITE_ELITE_DAMAGE, RATE_CREATURE_ELITE_RARE_DAMAGE, RATE_CREATURE_ELITE_RAREELITE_DAMAGE, RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE, RATE_CREATURE_NORMAL_DAMAGE, and sWorld.

Referenced by ObjectMgr::CheckCreatureTemplate().

◆ _GetHealthMod()

float Creature::_GetHealthMod ( int32  Rank)
staticprotected
1512{
1513 switch (Rank) // define rates for each elite rank
1514 {
1516 return sWorld->getRate(RATE_CREATURE_NORMAL_HP);
1518 return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP);
1524 return sWorld->getRate(RATE_CREATURE_ELITE_RARE_HP);
1525 default:
1526 return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP);
1527 }
1528}
@ RATE_CREATURE_NORMAL_HP
Definition: IWorld.h:481
@ RATE_CREATURE_ELITE_WORLDBOSS_HP
Definition: IWorld.h:484
@ RATE_CREATURE_ELITE_ELITE_HP
Definition: IWorld.h:482
@ RATE_CREATURE_ELITE_RARE_HP
Definition: IWorld.h:485
@ RATE_CREATURE_ELITE_RAREELITE_HP
Definition: IWorld.h:483

References CREATURE_ELITE_ELITE, CREATURE_ELITE_NORMAL, CREATURE_ELITE_RARE, CREATURE_ELITE_RAREELITE, CREATURE_ELITE_WORLDBOSS, RATE_CREATURE_ELITE_ELITE_HP, RATE_CREATURE_ELITE_RARE_HP, RATE_CREATURE_ELITE_RAREELITE_HP, RATE_CREATURE_ELITE_WORLDBOSS_HP, RATE_CREATURE_NORMAL_HP, and sWorld.

Referenced by Guardian::InitStatsForLevel(), LoadCreatureFromDB(), and SelectLevel().

◆ _IsTargetAcceptable()

bool Creature::_IsTargetAcceptable ( Unit const *  target) const
2491{
2492 ASSERT(target);
2493
2494 // if the target cannot be attacked, the target is not acceptable
2495 if (IsFriendlyTo(target) || !target->isTargetableForAttack(false, this) || (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))))
2496 return false;
2497
2498 if (target->HasUnitState(UNIT_STATE_DIED))
2499 {
2500 // some creatures can detect fake death
2501 if (CanIgnoreFeignDeath() && target->HasUnitFlag2(UNIT_FLAG2_FEIGN_DEATH))
2502 return true;
2503 else
2504 return false;
2505 }
2506
2507 Unit const* targetVictim = target->getAttackerForHelper();
2508
2509 // if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
2510 if (IsEngagedBy(target) || IsHostileTo(target))
2511 return true;
2512
2513 // if the target's victim is friendly, and the target is neutral, the target is acceptable
2514 if (targetVictim && !IsNeutralToAll() && IsFriendlyTo(targetVictim))
2515 return true;
2516
2517 // if the target's victim is not friendly, or the target is friendly, the target is not acceptable
2518 return false;
2519}
#define ASSERT
Definition: Errors.h:68
@ UNIT_FLAG2_FEIGN_DEATH
Definition: Unit.h:488
@ UNIT_STATE_DIED
Definition: Unit.h:325
bool CanIgnoreFeignDeath() const
Definition: Creature.h:266
Vehicle * m_vehicle
Definition: Unit.h:2548
Unit * getAttackerForHelper() const
Definition: Unit.h:1378
bool IsNeutralToAll() const
Definition: Unit.cpp:10267
bool IsOnVehicle(Unit const *vehicle) const
Definition: Unit.h:2369
bool IsEngagedBy(Unit const *who) const
Definition: Unit.h:1700
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10249
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:10244
Unit * GetBase() const
May be called from scripts.
Definition: Vehicle.h:39

References ASSERT, CanIgnoreFeignDeath(), Unit::getAttackerForHelper(), Vehicle::GetBase(), Unit::HasUnitFlag2(), Unit::HasUnitState(), Unit::IsEngagedBy(), Unit::IsFriendlyTo(), Unit::IsHostileTo(), Unit::IsNeutralToAll(), Unit::IsOnVehicle(), Unit::isTargetableForAttack(), Unit::m_vehicle, UNIT_FLAG2_FEIGN_DEATH, and UNIT_STATE_DIED.

Referenced by CanStartAttack(), and CreatureAI::TriggerAlert().

◆ AddLootMode()

◆ AddSpellCooldown()

void Creature::AddSpellCooldown ( uint32  spell_id,
uint32  ,
uint32  end_time,
bool  needSendToClient = false,
bool  forceSendToSpectator = false 
)
overridevirtual

Reimplemented from Unit.

2782{
2783 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
2784 if (!spellInfo)
2785 return;
2786
2787 // used in proc system, otherwise normal creature cooldown
2788 if (end_time)
2789 {
2790 _AddCreatureSpellCooldown(spellInfo->Id, 0, end_time);
2791 return;
2792 }
2793
2794 uint32 spellcooldown = spellInfo->RecoveryTime;
2795 uint32 categoryId = spellInfo->GetCategory();
2796 uint32 categorycooldown = categoryId ? spellInfo->CategoryRecoveryTime : 0;
2797 if (Player* modOwner = GetSpellModOwner())
2798 {
2799 modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, spellcooldown);
2800 modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, categorycooldown);
2801 }
2802
2803 SpellCategoryStore::const_iterator i_scstore = sSpellsByCategoryStore.find(categoryId);
2804 if (categorycooldown && i_scstore != sSpellsByCategoryStore.end())
2805 {
2806 for (SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset)
2807 {
2808 _AddCreatureSpellCooldown(i_scset->second, categoryId, categorycooldown);
2809 }
2810 }
2811 else if (spellcooldown)
2812 {
2813 _AddCreatureSpellCooldown(spellInfo->Id, 0, spellcooldown);
2814 }
2815
2816 if (sSpellMgr->HasSpellCooldownOverride(spellInfo->Id))
2817 {
2818 if (IsCharmed() && GetCharmer()->IsPlayer())
2819 {
2820 WorldPacket data;
2821 BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spellInfo->Id, spellcooldown);
2823 }
2824 }
2825}
std::uint32_t uint32
Definition: Define.h:108
SpellCategoryStore sSpellsByCategoryStore
Definition: DBCStores.cpp:151
@ SPELL_COOLDOWN_FLAG_NONE
Definition: Unit.h:1242
@ SPELLMOD_COOLDOWN
Definition: SpellDefines.h:88
#define sSpellMgr
Definition: SpellMgr.h:825
void _AddCreatureSpellCooldown(uint32 spell_id, uint16 categoryId, uint32 end_time)
Definition: Creature.cpp:2773
bool IsPlayer() const
Definition: Object.h:194
Player * ToPlayer()
Definition: Object.h:195
Definition: Player.h:1056
void SendDirectMessage(WorldPacket const *data) const
Definition: Player.cpp:5607
bool IsCharmed() const
Definition: Unit.h:1885
Player * GetSpellModOwner() const
Definition: Unit.cpp:16845
Unit * GetCharmer() const
Definition: Unit.cpp:10607
void BuildCooldownPacket(WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown)
Definition: Unit.cpp:21266
Definition: WorldPacket.h:27
Definition: SpellInfo.h:314
uint32 GetCategory() const
Definition: SpellInfo.cpp:867
uint32 RecoveryTime
Definition: SpellInfo.h:346
uint32 Id
Definition: SpellInfo.h:318
uint32 CategoryRecoveryTime
Definition: SpellInfo.h:347

References _AddCreatureSpellCooldown(), Unit::BuildCooldownPacket(), SpellInfo::CategoryRecoveryTime, SpellInfo::GetCategory(), Unit::GetCharmer(), Unit::GetSpellModOwner(), SpellInfo::Id, Unit::IsCharmed(), Object::IsPlayer(), SpellInfo::RecoveryTime, Player::SendDirectMessage(), SPELL_COOLDOWN_FLAG_NONE, SPELLMOD_COOLDOWN, sSpellMgr, sSpellsByCategoryStore, and Object::ToPlayer().

Referenced by Aura::_ApplyForTarget(), Aura::_UnapplyForTarget(), WorldSession::HandlePetActionHelper(), boss_faction_championsAI::IsCCed(), Pet::Update(), and PetAI::UpdateAI().

◆ AddToWorld()

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

Reimplemented from Object.

Reimplemented in Pet.

257{
259 if (!IsInWorld())
260 {
261 // pussywizard: motion master needs to be initialized before OnCreatureCreate, which may set death state to JUST_DIED, to prevent crash
262 // it's also initialized in AIM_Initialize(), few lines below, but it's not a problem
264
266 if (m_spawnId)
267 {
268 GetMap()->GetCreatureBySpawnIdStore().insert(std::make_pair(m_spawnId, this));
269 }
271
273
275
276 if (IsVehicle())
277 {
279 }
280
281 if (GetZoneScript())
282 {
284 }
285
287
288 sScriptMgr->OnCreatureAddWorld(this);
289 }
290}
#define sScriptMgr
Definition: ScriptMgr.h:698
bool Insert(KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
Definition: TypeContainer.h:135
Definition: Creature.h:46
Loot loot
Definition: Creature.h:220
bool AIM_Initialize(CreatureAI *ai=nullptr)
Definition: Creature.cpp:1027
void Motion_Initialize()
Definition: Creature.cpp:1052
void SearchFormation()
Definition: Creature.cpp:326
bool IsInWorld() const
Definition: Object.h:101
ObjectGuid GetGUID() const
Definition: Object.h:107
Map * GetMap() const
Definition: Object.h:517
ZoneScript * GetZoneScript() const
Definition: Object.h:523
bool IsVehicle() const
Definition: Unit.h:1428
void AddToWorld() override
Definition: Unit.cpp:15674
Vehicle * GetVehicleKit() const
Definition: Unit.h:2367
void Install()
Definition: Vehicle.cpp:70
ObjectGuid sourceWorldObjectGUID
Definition: LootMgr.h:330
MapStoredObjectTypesContainer & GetObjectsStore()
Definition: Map.h:516
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
Definition: Map.h:519
virtual void OnCreatureCreate(Creature *)
Definition: ZoneScript.h:35

References Unit::AddToWorld(), AIM_Initialize(), Map::GetCreatureBySpawnIdStore(), Object::GetGUID(), WorldObject::GetMap(), Map::GetObjectsStore(), Unit::GetVehicleKit(), WorldObject::GetZoneScript(), TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Insert(), Vehicle::Install(), Object::IsInWorld(), Unit::IsVehicle(), loot, m_spawnId, Motion_Initialize(), ZoneScript::OnCreatureCreate(), SearchFormation(), Loot::sourceWorldObjectGUID, and sScriptMgr.

Referenced by AddObjectHelper().

◆ AI()

CreatureAI * Creature::AI ( ) const
inline
136{ return (CreatureAI*)i_AI; }
Definition: CreatureAI.h:71

References Unit::i_AI.

Referenced by Vehicle::AddPassenger(), Player::AddQuestAndCheckCompletion(), npc_mograine::npc_mograineAI::AshbringerEvent(), npc_anubisath_sentinel::aqsentinelAI::CallBuddiesToAttack(), boss_algalon_the_observer::boss_algalon_the_observerAI::CallConstellations(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::CallNextRajaxxLeader(), CanAlwaysSee(), CanCreatureAttack(), instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::CheckAchievementCriteriaMeet(), npc_still_at_it_trigger::npc_still_at_it_triggerAI::CheckAction(), spell_putricide_mutation_init::spell_putricide_mutation_init_SpellScript::CheckRequirementInternal(), spell_the_lich_king_ice_burst_target_search::spell_the_lich_king_ice_burst_target_search_SpellScript::CheckTargetCount(), npc_riggle_bassbait::npc_riggle_bassbaitAI::CheckTournamentState(), Unit::CombatStart(), CreatureUnitRelocationWorker(), Unit::DealDamage(), DespawnOnEvade(), hyjalAI::DeSpawnVeins(), instance_karazhan::instance_karazhan_InstanceMapScript::DoAction(), SummonList::DoAction(), boss_illidari_council::boss_illidari_councilAI::DoAction(), Spell::DoAllEffectOnTarget(), HomeMovementGenerator< Creature >::DoFinalize(), hyjalAI::DoOverrun(), instance_stratholme::instance_stratholme_InstanceMapScript::DoSpawnPlaguedCritters(), SummonList::DoZoneInCombat(), boss_zuljin::boss_zuljinAI::EnterPhase(), AssistDelayEvent::Execute(), RestoreAttack::Execute(), DelayedTalk::Execute(), UtherBatteredHiltEvent::Execute(), StartMovementEvent::Execute(), ValithriaDespawner::Execute(), CaptainSurviveTalk::Execute(), ChargeRifts::Execute(), spell_kiljaeden_sinister_reflection_clone::spell_kiljaeden_sinister_reflection_clone_SpellScript::FilterTargets(), spell_sapphiron_frost_explosion::spell_sapphiron_frost_explosion_SpellScript::FilterTargets(), RotateMovementGenerator::Finalize(), EffectMovementGenerator::Finalize(), npc_anubisath_sentinel::aqsentinelAI::GetOtherSentinels(), SmartScript::GetTargets(), go_ossirian_crystal::go_ossirian_crystalAI::GossipHello(), spell_herald_volzaj_insanity::HandleAfterCast(), spell_illidari_council_empyreal_balance::spell_illidari_council_empyreal_balance_SpellScript::HandleAfterCast(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), spell_item_lil_xt::HandleDummy(), spell_shadowblink::HandleDummy(), spell_halion_twilight_division::spell_halion_twilight_division_SpellScript::HandleDummy(), spell_q12096_q12092_dummy::spell_q12096_q12092_dummy_SpellScript::HandleDummy(), spell_q12096_q12092_bark::spell_q12096_q12092_bark_SpellScript::HandleDummy(), spell_q12589_shoot_rjr::spell_q12589_shoot_rjr_SpellScript::HandleDummy(), spell_algalon_trigger_3_adds::spell_algalon_trigger_3_adds_SpellScript::HandleDummyEffect(), spell_herald_volzaj_insanity::HandleDummyEffect(), spell_mc_play_dead::spell_mc_play_dead_AuraScript::HandleEffectRemove(), WorldSession::HandleGossipHelloOpcode(), WorldSession::HandleGossipSelectOptionOpcode(), npc_commandscript::HandleNpcSetDataCommand(), WorldSession::HandlePetActionHelper(), WorldSession::HandleQuestgiverChooseRewardOpcode(), WorldSession::HandleQuestgiverHelloOpcode(), spell_kiljaeden_darkness::spell_kiljaeden_darkness_AuraScript::HandleRemove(), spell_taldaram_summon_flame_ball::spell_taldaram_summon_flame_ball_SpellScript::HandleScript(), spell_putricide_unstable_experiment::spell_putricide_unstable_experiment_SpellScript::HandleScript(), spell_the_lich_king_vile_spirit_move_target_search::spell_the_lich_king_vile_spirit_move_target_search_SpellScript::HandleScript(), spell_ayamiss_swarmer_swarm::HandleScript(), spell_festergut_pungent_blight::spell_festergut_pungent_blight_SpellScript::HandleScript(), spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript::HandleScript(), spell_rotface_large_ooze_buff_combine::spell_rotface_large_ooze_buff_combine_SpellScript::HandleScript(), spell_q13011_bear_flank_master::HandleScript(), spell_volazj_whisper::HandleScriptEffect(), Unit::HandleSpellClick(), spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript::HandleSummon(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::InformCloud(), TempSummon::InitSummon(), IsAlwaysDetectableFor(), boss_hexlord_malacrass::boss_hex_lord_malacrassAI::JustEngagedWith(), npc_toc_warlock::npc_toc_warlockAI::JustSummoned(), npc_toc_hunter::npc_toc_hunterAI::JustSummoned(), npc_toc_boomkin::npc_toc_boomkinAI::JustSummoned(), boss_anubrekhan::boss_anubrekhanAI::JustSummoned(), boss_maexxna::boss_maexxnaAI::JustSummoned(), npc_frosthound::npc_frosthoundAI::JustSummoned(), npc_eris_hevenfire::npc_eris_hevenfireAI::JustSummoned(), npc_daphne_stilwell::npc_daphne_stilwellAI::JustSummoned(), npc_battle_at_valhalas::npc_battle_at_valhalasAI::JustSummoned(), boss_urom::boss_uromAI::JustSummoned(), npc_hor_lich_king::npc_hor_lich_kingAI::JustSummoned(), WorldBossAI::JustSummoned(), npc_grimstone::npc_grimstoneAI::JustSummoned(), boss_gyth::boss_gythAI::JustSummoned(), boss_rend_blackhand::boss_rend_blackhandAI::JustSummoned(), boss_curator::JustSummoned(), boss_attumen::JustSummoned(), boss_midnight::JustSummoned(), boss_nightbane::JustSummoned(), boss_sacrolash::boss_sacrolashAI::JustSummoned(), npc_demonic_vapor_trail::npc_demonic_vapor_trailAI::JustSummoned(), boss_muru::boss_muruAI::JustSummoned(), boss_halazzi::boss_halazziAI::JustSummoned(), boss_onyxia::JustSummoned(), boss_taldaram::JustSummoned(), boss_black_knight::boss_black_knightAI::JustSummoned(), boss_devourer_of_souls::boss_devourer_of_soulsAI::JustSummoned(), boss_drakkari_colossus::boss_drakkari_colossusAI::JustSummoned(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustSummoned(), boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::JustSummoned(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::JustSummoned(), npc_precious_icc::npc_precious_iccAI::JustSummoned(), npc_the_lich_king_controller::npc_the_lich_king_controllerAI::JustSummoned(), npc_gluttonous_abomination::npc_gluttonous_abominationAI::JustSummoned(), boss_gluth::boss_gluthAI::JustSummoned(), boss_gothik::boss_gothikAI::JustSummoned(), boss_volkhan::boss_volkhanAI::JustSummoned(), boss_nexusprince_shaffar::JustSummoned(), boss_grandmaster_vorpil::JustSummoned(), npc_akama_illidan::npc_akama_illidanAI::JustSummoned(), npc_creature_generator_akama::JustSummoned(), boss_the_black_stalker::JustSummoned(), boss_nethermancer_sepethrea::JustSummoned(), emerald_dragonAI::JustSummoned(), npc_nelson::npc_nelsonAI::JustSummoned(), boss_balinda::JustSummoned(), npc_koltira_deathweaver::npc_koltira_deathweaverAI::JustSummoned(), npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::JustSummoned(), npc_thrall_bfu::npc_thrall_bfuAI::JustSummoned(), npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::JustSummoned(), boss_archimonde::boss_archimondeAI::JustSummoned(), npc_muglash::npc_muglashAI::JustSummoned(), npc_kaya_flathoof::npc_kaya_flathoofAI::JustSummoned(), npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::JustSummoned(), npc_ame::npc_ameAI::JustSummoned(), npc_emily::npc_emilyAI::JustSummoned(), npc_deaths_door_fell_cannon_target_bunny::npc_deaths_door_fell_cannon_target_bunnyAI::JustSummoned(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::JustSummoned(), npc_maghar_captive::npc_maghar_captiveAI::JustSummoned(), npc_kurenai_captive::npc_kurenai_captiveAI::JustSummoned(), npc_bessy::npc_bessyAI::JustSummoned(), npc_buru_egg::JustSummoned(), Unit::Kill(), CreatureGroup::MemberEngagingTarget(), CreatureGroup::MemberEvaded(), npc_brew_bubble::MoveInLineOfSight(), npc_dkc1_gothik::npc_dkc1_gothikAI::MoveInLineOfSight(), npc_love_in_air_supply_sentry::MoveInLineOfSight(), npc_air_force_bots::npc_air_force_botsAI::MoveInLineOfSight(), WaypointMovementGenerator< Creature >::MovementInform(), npc_claw_tentacle::npc_claw_tentacle(), npc_eye_tentacle::npc_eye_tentacle(), npc_giant_claw_tentacle::npc_giant_claw_tentacle(), npc_giant_eye_tentacle::npc_giant_eye_tentacle(), spell_pilgrims_bounty_serve_generic::OnAuraRemove(), achievement_flu_shot_shortage::OnCheck(), achievement_smell_saronite::OnCheck(), achievement_shadowdodger::OnCheck(), achievement_cheese_the_freeze::OnCheck(), achievement_getting_cold_in_here::OnCheck(), achievement_i_could_say_that_this_cache_was_rare::OnCheck(), achievement_i_have_the_coolest_friends::OnCheck(), achievement_ignis_shattered::OnCheck(), achievement_mimiron_firefighter::OnCheck(), achievement_mimiron_set_up_us_the_bomb_11::OnCheck(), achievement_mimiron_set_up_us_the_bomb_12::OnCheck(), achievement_mimiron_set_up_us_the_bomb_13::OnCheck(), achievement_quick_shave::OnCheck(), instance_blackrock_spire::instance_blackrock_spireMapScript::OnCreatureCreate(), go_palehoof_sphere::OnGossipHello(), go_main_chambers_access_panel::OnGossipHello(), npc_pet_gen_argent_pony_bridle::OnGossipHello(), npc_death_knight_initiate::OnGossipHello(), npc_highlord_darion_mograine::OnGossipHello(), npc_jaina_proudmoore::OnGossipHello(), npc_thrall::OnGossipHello(), npc_tyrande_whisperwind::OnGossipHello(), npc_finklestein::OnGossipHello(), npc_captain_saeed::OnGossipHello(), npc_elder_clearwater::OnGossipHello(), npc_wormhole::OnGossipHello(), go_the_pearl_of_the_depths::OnGossipHello(), go_pressure_valve::OnGossipHello(), go_brazier::OnGossipHello(), go_finklestein_cauldron::OnGossipHello(), npc_pet_gen_argent_pony_bridle::OnGossipSelect(), boss_doomrel::OnGossipSelect(), boss_majordomo::OnGossipSelect(), npc_barnes::OnGossipSelect(), npc_death_knight_initiate::OnGossipSelect(), npc_highlord_darion_mograine::OnGossipSelect(), npc_varian_wrynn::OnGossipSelect(), npc_thrall_bfu::OnGossipSelect(), npc_jaina_proudmoore::OnGossipSelect(), npc_thrall::OnGossipSelect(), npc_arthas::OnGossipSelect(), npc_high_overlord_saurfang_icc::OnGossipSelect(), npc_muradin_bronzebeard_icc::OnGossipSelect(), brann_bronzebeard::OnGossipSelect(), npc_ulduar_keeper::OnGossipSelect(), npc_shandy_dalaran::OnGossipSelect(), npc_vekjik::OnGossipSelect(), npc_adventurous_dwarf::OnGossipSelect(), npc_fos_leader::OnGossipSelect(), npc_hor_leader::OnGossipSelect(), npc_ulduar_expedition_commander::OnGossipSelect(), npc_mcmanus::OnGossipSelect(), npc_finklestein::OnGossipSelect(), npc_captain_saeed::OnGossipSelect(), boss_azuregos::OnGossipSelect(), npc_thrall_old_hillsbrad::OnGossipSelect(), npc_hor_leader_second::OnGossipSelect(), npc_tirions_gambit_tirion::OnGossipSelect(), npc_artorius::OnGossipSelect(), npc_simone::OnGossipSelect(), npc_nelson::OnGossipSelect(), npc_franklin::OnGossipSelect(), instance_ulduar::instance_ulduar_InstanceMapScript::OnPlayerEnter(), npc_chicken_cluck::OnQuestAccept(), npc_kernobee::OnQuestAccept(), npc_koltira_deathweaver::OnQuestAccept(), pyrewood_ambush::OnQuestAccept(), npc_daphne_stilwell::OnQuestAccept(), npc_mikhail::OnQuestAccept(), npc_kerlonian::OnQuestAccept(), npc_prospector_remtravel::OnQuestAccept(), npc_tooga::OnQuestAccept(), npc_gilthares::OnQuestAccept(), npc_lakota_windsong::OnQuestAccept(), npc_paoka_swiftmountain::OnQuestAccept(), npc_ringo::OnQuestAccept(), npc_engineer_helice::OnQuestAccept(), npc_maghar_captive::OnQuestAccept(), npc_kurenai_captive::OnQuestAccept(), npc_maxx_a_million_escort::OnQuestAccept(), npc_eris_hevenfire::OnQuestAccept(), npc_deathstalker_erland::OnQuestAccept(), npc_calvin_montague::OnQuestAccept(), npc_cork_gizelton::OnQuestAccept(), npc_shenthul::OnQuestAccept(), npc_kaya_flathoof::OnQuestAccept(), npc_wizzlecrank_shredder::OnQuestAccept(), npc_ame::OnQuestAccept(), npc_ranshalla::OnQuestAccept(), npc_lurgglbr::OnQuestAccept(), npc_mootoo_the_younger::OnQuestAccept(), npc_bonker_togglevolt::OnQuestAccept(), npc_emily::OnQuestAccept(), npc_apothecary_hanes::OnQuestAccept(), npc_battle_at_valhalas::OnQuestAccept(), npc_finklestein::OnQuestAccept(), npc_bessy::OnQuestAccept(), npc_isla_starmane::OnQuestAccept(), npc_doctor::OnQuestAccept(), go_crystal_prison::OnQuestAccept(), go_crystalline_tear::OnQuestAccept(), npc_chicken_cluck::OnQuestComplete(), boss_apothecary_hummel::OnQuestReward(), npc_rocknot::OnQuestReward(), npc_thrall_warchief::OnQuestReward(), npc_lady_sylvanas_windrunner::OnQuestReward(), npc_tharnarian::OnQuestReward(), npc_elder_clearwater::OnQuestReward(), npc_riggle_bassbait::OnQuestReward(), at_blackrock_stadium::OnTrigger(), at_commander_dawnforge::OnTrigger(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), OrderWhelpTargetSelector::operator()(), FrostwingGauntletRespawner::operator()(), ValithriaDespawner::operator()(), Acore::CallOfHelpCreatureInRangeDo::operator()(), SplineHandler::operator()(), Unit::PetSpellFail(), spell_hodir_flash_freeze::spell_hodir_flash_freeze_AuraScript::PrepareAuraScript(), PretendToDie(), npc_jungle_punch_target::npc_jungle_punch_targetAI::proceedCwEvent(), SmartScript::ProcessAction(), instance_stratholme::instance_stratholme_InstanceMapScript::ProcessSlaughterEvent(), RemoveCorpse(), Vehicle::RemovePassenger(), boss_illidari_council::boss_illidari_councilAI::Reset(), Respawn(), Resurrect(), hyjalAI::Retreat(), boss_yoggsaron_lich_king::boss_yoggsaron_lich_kingAI::Say(), boss_yoggsaron_llane::boss_yoggsaron_llaneAI::Say(), boss_yoggsaron_neltharion::boss_yoggsaron_neltharionAI::Say(), boss_fathomguard_tidalvess::ScheduleRemoval(), spell_the_lich_king_valkyr_target_search::spell_the_lich_king_valkyr_target_search_SpellScript::SelectTarget(), SelectVictim(), instance_naxxramas::instance_naxxramas_InstanceMapScript::SetBossState(), Unit::SetCharmedBy(), SetInCombatWithZone(), boss_hexlord_malacrass::boss_hex_lord_malacrassAI::SpawnAdds(), npc_pilgrims_bounty_chair::SpellHitTarget(), npc_still_at_it_trigger::npc_still_at_it_triggerAI::Start(), spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::StartAttack(), WaypointMovementGenerator< Creature >::StartMove(), hyjalAI::SummonCreature(), brann_bronzebeard::brann_bronzebeardAI::SummonCreatures(), boss_zuramat::boss_zuramatAI::SummonedCreatureDespawn(), boss_sindragosa::boss_sindragosaAI::SummonedCreatureDespawn(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::SummonedCreatureDespawn(), boss_anubrekhan::boss_anubrekhanAI::SummonedCreatureDies(), npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave(), npc_artruis_the_hearthless::npc_artruis_the_hearthlessAI::SummonsAction(), npc_love_in_air_snivel_real::Talk(), Unit::TauntApply(), Unit::TauntFadeOut(), spell_igb_check_for_players::spell_igb_check_for_players_SpellScript::TriggerWipe(), Pet::Update(), instance_stratholme::instance_stratholme_InstanceMapScript::Update(), instance_naxxramas::instance_naxxramas_InstanceMapScript::Update(), Update(), npc_vaelastrasz_the_red::npc_vaelastrasz_the_redAI::UpdateAI(), pyrewood_ambush::pyrewood_ambushAI::UpdateAI(), boss_akilzon::boss_akilzonAI::UpdateAI(), npc_winterfin_playmate::UpdateAI(), npc_snowfall_glade_playmate::UpdateAI(), npc_the_biggest_tree::UpdateAI(), npc_high_oracle_soo_roo::UpdateAI(), npc_elder_kekek::UpdateAI(), npc_the_etymidian::UpdateAI(), npc_alexstraza_the_lifebinder::UpdateAI(), npc_frost_wyrm::npc_frost_wyrmAI::UpdateAI(), npc_gargoyle::npc_gargoyleAI::UpdateAI(), npc_twiggy_flathead::npc_twiggy_flatheadAI::UpdateAI(), boss_prince_valanar_icc::boss_prince_valanarAI::UpdateAI(), npc_freya_ward::npc_freya_wardAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::UpdateAI(), boss_razorscale::boss_razorscaleAI::UpdateAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::UpdateAI(), npc_still_at_it_trigger::npc_still_at_it_triggerAI::UpdateAI(), npc_commander_dawnforge::npc_commander_dawnforgeAI::UpdateAI(), npc_tooga::npc_toogaAI::UpdateFollowerAI(), npc_ringo::npc_ringoAI::UpdateFollowerAI(), InstanceScript::UpdateMinionState(), npc_ranger_lilatha::WaypointReached(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::WaypointReached(), npc_cork_gizelton::npc_cork_gizeltonAI::WaypointReached(), npc_ancestral_wolf::npc_ancestral_wolfAI::WaypointReached(), and npc_bessy::npc_bessyAI::WaypointReached().

◆ AIM_Initialize()

bool Creature::AIM_Initialize ( CreatureAI ai = nullptr)
1028{
1029 // make sure nothing can change the AI during AI update
1030 if (m_AI_locked)
1031 {
1032 LOG_DEBUG("scripts.ai", "AIM_Initialize: failed to init, locked.");
1033 return false;
1034 }
1035
1036 UnitAI* oldAI = i_AI;
1037
1038 // Xinef: called in add to world
1039 //Motion_Initialize();
1040
1041 i_AI = ai ? ai : FactorySelector::SelectAI(this);
1042 delete oldAI;
1043 IsAIEnabled = true;
1044 i_AI->InitializeAI();
1045
1046 // Xinef: Initialize vehicle if it is not summoned!
1047 if (GetVehicleKit() && m_spawnId)
1048 GetVehicleKit()->Reset();
1049 return true;
1050}
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:169
CreatureAI * SelectAI(Creature *creature)
Definition: CreatureAISelector.cpp:78
Definition: UnitAI.h:182
virtual void InitializeAI()
Definition: UnitAI.h:193
bool IsAIEnabled
Definition: Unit.h:2364
void Reset(bool evading=false)
Definition: Vehicle.cpp:118

References Unit::GetVehicleKit(), Unit::i_AI, UnitAI::InitializeAI(), Unit::IsAIEnabled, LOG_DEBUG, m_AI_locked, m_spawnId, Vehicle::Reset(), and FactorySelector::SelectAI().

Referenced by AddToWorld(), Pet::AddToWorld(), Respawn(), WorldObject::SummonTrigger(), and UpdateEntry().

◆ AllLootRemovedFromCorpse()

void Creature::AllLootRemovedFromCorpse ( )
2910{
2911 if (loot.loot_type != LOOT_SKINNING && !IsPet() && GetCreatureTemplate()->SkinLootId && hasLootRecipient())
2912 {
2914 {
2916 }
2917 }
2918
2919 time_t now = GameTime::GetGameTime().count();
2920 if (m_corpseRemoveTime <= now)
2921 {
2922 return;
2923 }
2924
2925 float decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
2926 uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
2927
2928 m_respawnTime -= diff;
2929
2930 // corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
2932 {
2934 }
2935 else
2936 {
2937 m_corpseRemoveTime -= diff;
2938 }
2939}
@ UNIT_FLAG_SKINNABLE
Definition: Unit.h:474
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
@ LOOT_SKINNING
Definition: LootMgr.h:86
@ RATE_CORPSE_DECAY_LOOTED
Definition: IWorld.h:508
Seconds GetGameTime()
Definition: GameTime.cpp:38
bool hasLootRecipient() const
Definition: Creature.h:225
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:199
bool IsPet() const
Definition: Unit.h:1425
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495
bool HaveLootFor(uint32 loot_id) const
Definition: LootMgr.h:224
LootType loot_type
Definition: LootMgr.h:326

References GetCreatureTemplate(), GameTime::GetGameTime(), hasLootRecipient(), LootStore::HaveLootFor(), Unit::IsPet(), loot, LOOT_SKINNING, Loot::loot_type, LootTemplates_Skinning, m_corpseRemoveTime, m_respawnTime, RATE_CORPSE_DECAY_LOOTED, Unit::SetUnitFlag(), sWorld, and UNIT_FLAG_SKINNABLE.

Referenced by WorldSession::DoLootRelease(), and Unit::Kill().

◆ CalculateMinMaxDamage()

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

Implements Unit.

1100{
1101 // creatures only have one damage
1102 if (damageIndex != 0)
1103 {
1104 minDamage = 0.f;
1105 maxDamage = 0.f;
1106 return;
1107 }
1108
1109 UnitMods unitMod;
1110 float variance = 1.0f;
1111 switch (attType)
1112 {
1113 case BASE_ATTACK:
1114 default:
1115 variance = GetCreatureTemplate()->BaseVariance;
1116 unitMod = UNIT_MOD_DAMAGE_MAINHAND;
1117 break;
1118 case OFF_ATTACK:
1119 variance = GetCreatureTemplate()->BaseVariance;
1120 unitMod = UNIT_MOD_DAMAGE_OFFHAND;
1121 break;
1122 case RANGED_ATTACK:
1123 variance = GetCreatureTemplate()->RangeVariance;
1124 unitMod = UNIT_MOD_DAMAGE_RANGED;
1125 break;
1126 }
1127
1128 if (attType == OFF_ATTACK && !haveOffhandWeapon())
1129 {
1130 minDamage = 0.0f;
1131 maxDamage = 0.0f;
1132 return;
1133 }
1134
1135 float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE);
1136 float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE);
1137
1138 if (!CanUseAttackType(attType)) // disarm case
1139 {
1140 weaponMinDamage = 0.0f;
1141 weaponMaxDamage = 0.0f;
1142 }
1143
1144 float attackPower = GetTotalAttackPowerValue(attType);
1145 float attackSpeedMulti = GetAPMultiplier(attType, normalized);
1146 float baseValue = GetModifierValue(unitMod, BASE_VALUE) + (attackPower / 14.0f) * variance;
1147 float basePct = GetModifierValue(unitMod, BASE_PCT) * attackSpeedMulti;
1148 float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
1149 float totalPct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
1150 float dmgMultiplier = GetCreatureTemplate()->DamageModifier; // = DamageModifier * _GetDamageMod(rank);
1151
1152 minDamage = ((weaponMinDamage + baseValue) * dmgMultiplier * basePct + totalValue) * totalPct;
1153 maxDamage = ((weaponMaxDamage + baseValue) * dmgMultiplier * basePct + totalValue) * totalPct;
1154
1155 // pussywizard: crashfix (casting negative to uint => min > max => assertion in urand)
1156 if (minDamage < 0.0f || minDamage > 1000000000.0f)
1157 minDamage = 0.0f;
1158 if (maxDamage < 0.0f || maxDamage > 1000000000.0f)
1159 maxDamage = 0.0f;
1160 if (minDamage > maxDamage)
1161 minDamage = maxDamage;
1162}
@ MINDAMAGE
Definition: Unit.h:254
@ MAXDAMAGE
Definition: Unit.h:255
UnitMods
Definition: Unit.h:261
@ UNIT_MOD_DAMAGE_OFFHAND
Definition: Unit.h:285
@ UNIT_MOD_DAMAGE_RANGED
Definition: Unit.h:286
@ UNIT_MOD_DAMAGE_MAINHAND
Definition: Unit.h:284
@ OFF_ATTACK
Definition: Unit.h:397
@ BASE_ATTACK
Definition: Unit.h:396
@ RANGED_ATTACK
Definition: Unit.h:398
@ BASE_VALUE
Definition: Unit.h:245
@ TOTAL_VALUE
Definition: Unit.h:247
@ TOTAL_PCT
Definition: Unit.h:248
@ BASE_PCT
Definition: Unit.h:246
float BaseVariance
Definition: CreatureData.h:204
float RangeVariance
Definition: CreatureData.h:205
float DamageModifier
Definition: CreatureData.h:201
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim=nullptr) const
Definition: Unit.cpp:15414
bool CanUseAttackType(uint8 attacktype) const
Definition: Unit.h:1621
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type, uint8 damageIndex=0) const
Definition: Unit.cpp:15438
bool haveOffhandWeapon() const
Definition: Unit.cpp:540
float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const
Definition: Unit.cpp:15274
float GetAPMultiplier(WeaponAttackType attType, bool normalized)
Definition: Unit.cpp:17483

References BASE_ATTACK, BASE_PCT, BASE_VALUE, CreatureTemplate::BaseVariance, Unit::CanUseAttackType(), CreatureTemplate::DamageModifier, Unit::GetAPMultiplier(), GetCreatureTemplate(), Unit::GetModifierValue(), Unit::GetTotalAttackPowerValue(), Unit::GetWeaponDamageRange(), Unit::haveOffhandWeapon(), MAXDAMAGE, MINDAMAGE, OFF_ATTACK, RANGED_ATTACK, CreatureTemplate::RangeVariance, TOTAL_PCT, TOTAL_VALUE, UNIT_MOD_DAMAGE_MAINHAND, UNIT_MOD_DAMAGE_OFFHAND, and UNIT_MOD_DAMAGE_RANGED.

◆ CallAssistance()

void Creature::CallAssistance ( Unit target = nullptr)
2367{
2368 if (!target)
2369 {
2370 target = GetVictim();
2371 }
2372
2373 if (!m_AlreadyCallAssistance && target && !IsPet() && !IsCharmed())
2374 {
2375 SetNoCallAssistance(true);
2376
2377 float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
2378
2379 if (radius > 0)
2380 {
2381 std::list<Creature*> assistList;
2382
2383 Acore::AnyAssistCreatureInRangeCheck u_check(this, target, radius);
2385 Cell::VisitGridObjects(this, searcher, radius);
2386
2387 if (!assistList.empty())
2388 {
2389 AssistDelayEvent* e = new AssistDelayEvent(target->GetGUID(), this);
2390 while (!assistList.empty())
2391 {
2392 // Pushing guids because in delay can happen some creature gets despawned => invalid pointer
2393 e->AddAssistant((*assistList.begin())->GetGUID());
2394 assistList.pop_front();
2395 }
2397 }
2398 }
2399 }
2400}
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY
Definition: IWorld.h:283
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS
Definition: IWorld.h:199
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:104
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:159
void SetNoCallAssistance(bool val)
Definition: Creature.h:261
Definition: Creature.h:507
void AddAssistant(ObjectGuid guid)
Definition: Creature.h:512
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
EventProcessor m_Events
Definition: Unit.h:2108
Unit * GetVictim() const
Definition: Unit.h:1398
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
Definition: GridNotifiers.h:470
Definition: GridNotifiers.h:1262

References AssistDelayEvent::AddAssistant(), EventProcessor::AddEvent(), EventProcessor::CalculateTime(), CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY, CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS, Object::GetGUID(), Unit::GetVictim(), Unit::IsCharmed(), Unit::IsPet(), m_AlreadyCallAssistance, Unit::m_Events, SetNoCallAssistance(), sWorld, and Cell::VisitGridObjects().

Referenced by Unit::Attack(), AssistanceMovementGenerator::Finalize(), and Update().

◆ CallForHelp()

void Creature::CallForHelp ( float  fRadius,
Unit target = nullptr 
)
2403{
2404 if (radius <= 0.0f || IsPet() || IsCharmed())
2405 {
2406 return;
2407 }
2408
2409 if (!target)
2410 {
2411 target = GetVictim();
2412 }
2413
2414 if (!target)
2415 {
2416 return;
2417 }
2418
2419 Acore::CallOfHelpCreatureInRangeDo u_do(this, target, radius);
2421 Cell::VisitGridObjects(this, worker, radius);
2422}
Definition: GridNotifiers.h:486
Definition: GridNotifiers.h:1143

References Unit::GetVictim(), Unit::IsCharmed(), Unit::IsPet(), and Cell::VisitGridObjects().

Referenced by boss_thorim_start_npcs::boss_thorim_start_npcsAI::DamageTaken(), boss_emperor_dagran_thaurissan::boss_draganthaurissanAI::JustEngagedWith(), boss_grand_champion::boss_grand_championAI::JustEngagedWith(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::JustEngagedWith(), npc_icc_nerubar_broodkeeper::npc_icc_nerubar_broodkeeperAI::JustEngagedWith(), boss_thorim_start_npcs::boss_thorim_start_npcsAI::JustEngagedWith(), boss_thorim_gauntlet_npcs::boss_thorim_gauntlet_npcsAI::JustEngagedWith(), boss_xt002::boss_xt002AI::JustEngagedWith(), boss_blackheart_the_inciter::JustEngagedWith(), boss_sartharion::boss_sartharionAI::JustEngagedWith(), boss_moroes::JustEngagedWith(), npc_sindragosa_trash::npc_sindragosa_trashAI::JustEngagedWith(), boss_anubrekhan::boss_anubrekhanAI::JustEngagedWith(), boss_faerlina::boss_faerlinaAI::JustEngagedWith(), boss_high_astromancer_solarian::JustEngagedWith(), boss_void_reaver::JustEngagedWith(), boss_gothik::boss_gothikAI::JustSummoned(), npc_sentinel_leader::UpdateAI(), and npc_cork_gizelton::npc_cork_gizeltonAI::WaypointReached().

◆ CanAlwaysSee()

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

Reimplemented from WorldObject.

1834{
1835 if (IsAIEnabled && AI()->CanSeeAlways(obj))
1836 return true;
1837
1838 return false;
1839}
CreatureAI * AI() const
Definition: Creature.h:136

References AI(), and Unit::IsAIEnabled.

◆ CanAssistTo()

bool Creature::CanAssistTo ( Unit const *  u,
Unit const *  enemy,
bool  checkfaction = true 
) const
Todo:
: Implement aggro range, detection range and assistance range templates
2425{
2426 // is it true?
2428 return false;
2429
2430 // we don't need help from zombies :)
2431 if (!IsAlive())
2432 return false;
2433
2434 // Xinef: we cannot assist in evade mode
2435 if (IsInEvadeMode())
2436 return false;
2437
2438 // pussywizard: or if enemy is in evade mode
2439 if (enemy && enemy->GetTypeId() == TYPEID_UNIT && enemy->ToCreature()->IsInEvadeMode())
2440 return false;
2441
2442 // we don't need help from non-combatant ;)
2443 if (IsCivilian())
2444 return false;
2445
2447 return false;
2448
2449 // skip fighting creature
2450 if (IsEngaged())
2451 return false;
2452
2453 // only free creature
2455 return false;
2456
2459 {
2460 return false;
2461 }
2462
2463 // only from same creature faction
2464 if (checkfaction)
2465 {
2466 if (GetFaction() != u->GetFaction())
2467 return false;
2468 }
2469 else
2470 {
2471 if (!IsFriendlyTo(u))
2472 return false;
2473 }
2474
2475 // skip non hostile to caster enemy creatures
2476 if (!IsHostileTo(enemy))
2477 return false;
2478
2479 // Check if can see the enemy
2480 if (!CanSeeOrDetect(enemy))
2481 {
2482 return false;
2483 }
2484
2485 return true;
2486}
@ CREATURE_FLAG_EXTRA_IGNORE_ALL_ASSISTANCE_CALLS
Definition: CreatureData.h:75
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
bool IsCivilian() const
Definition: Creature.h:76
bool HasReactState(ReactStates state) const
Definition: Creature.h:92
bool IsInEvadeMode() const
Definition: Creature.h:130
bool HasFlagsExtra(uint32 flag) const
Definition: CreatureData.h:272
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1726
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:1494
bool IsAlive() const
Definition: Unit.h:1822
uint32 GetFaction() const
Definition: Unit.h:1509
bool IsEngaged() const
Definition: Unit.h:1699
bool IsImmuneToNPC() const
Definition: Unit.h:1697
ObjectGuid GetCharmerOrOwnerGUID() const
Definition: Unit.h:1844

References WorldObject::CanSeeOrDetect(), CREATURE_FLAG_EXTRA_IGNORE_ALL_ASSISTANCE_CALLS, Unit::GetCharmerOrOwnerGUID(), Unit::GetFaction(), Object::GetTypeId(), CreatureTemplate::HasFlagsExtra(), HasReactState(), Unit::HasUnitFlag(), Unit::IsAlive(), IsCivilian(), Unit::IsEngaged(), Unit::IsFriendlyTo(), Unit::IsHostileTo(), Unit::IsImmuneToNPC(), IsInEvadeMode(), m_creatureInfo, REACT_AGGRESSIVE, Object::ToCreature(), TYPEID_UNIT, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.

Referenced by AssistDelayEvent::Execute(), Acore::CallOfHelpCreatureInRangeDo::operator()(), Acore::AnyAssistCreatureInRangeCheck::operator()(), and Acore::NearestAssistCreatureInCreatureRangeCheck::operator()().

◆ CanCastSpell()

bool Creature::CanCastSpell ( uint32  spellID) const

Returns true if the creature is able to cast the spell.

3729{
3730 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
3731 int32 currentPower = GetPower(getPowerType());
3732
3734 {
3735 return false;
3736 }
3737
3738 if (spellInfo && (currentPower < spellInfo->CalcPowerCost(this, spellInfo->GetSchoolMask())))
3739 {
3740 return false;
3741 }
3742
3743 return true;
3744}
std::int32_t int32
Definition: Define.h:104
@ UNIT_FIELD_FLAGS
Definition: UpdateFields.h:117
@ UNIT_FLAG_SILENCED
Definition: Unit.h:461
bool IsSpellProhibited(SpellSchoolMask idSchoolMask) const
Definition: Creature.cpp:2749
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:889
Powers getPowerType() const
Definition: Unit.h:1473
uint32 GetPower(Powers power) const
Definition: Unit.h:1475
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1974

References Unit::GetPower(), Unit::getPowerType(), SpellInfo::GetSchoolMask(), Object::HasFlag(), IsSpellProhibited(), sSpellMgr, UNIT_FIELD_FLAGS, and UNIT_FLAG_SILENCED.

◆ CanCreatureAttack()

bool Creature::CanCreatureAttack ( Unit const *  victim,
bool  skipDistCheck = false 
) const
2559{
2560 if (!victim->IsInMap(this))
2561 return false;
2562
2563 if (!IsValidAttackTarget(victim))
2564 return false;
2565
2566 if (!victim->isInAccessiblePlaceFor(this))
2567 return false;
2568
2569 if (IsAIEnabled && !AI()->CanAIAttack(victim))
2570 return false;
2571
2572 // pussywizard: we cannot attack in evade mode
2573 if (IsInEvadeMode())
2574 return false;
2575
2576 // pussywizard: or if enemy is in evade mode
2577 if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())
2578 return false;
2579
2580 // cannot attack if is during 5 second grace period, unless being attacked
2581 if (m_respawnedTime && (GameTime::GetGameTime().count() - m_respawnedTime) < 5 && victim->getAttackers().empty())
2582 {
2583 return false;
2584 }
2585
2586 // if victim is in FD and we can't see that
2587 if (victim->HasUnitFlag2(UNIT_FLAG2_FEIGN_DEATH) && !CanIgnoreFeignDeath())
2588 {
2589 return false;
2590 }
2591
2593 {
2594 if (GetMap()->IsDungeon())
2595 return true;
2596
2597 // pussywizard: don't check distance to home position if recently damaged (allow kiting away from spawnpoint!)
2598 // xinef: this should include taunt auras
2600 return true;
2601 }
2602
2603 if (skipDistCheck)
2604 return true;
2605
2606 // xinef: added size factor for huge npcs
2607 float dist = std::min<float>(GetMap()->GetVisibilityRange() + GetObjectSize() * 2, 150.0f);
2608
2609 if (Unit* unit = GetCharmerOrOwner())
2610 return victim->IsWithinDist(unit, dist);
2611 else
2612 {
2613 // to prevent creatures in air ignore attacks because distance is already too high...
2614 if (GetMovementTemplate().IsFlightAllowed())
2615 return victim->IsInDist2d(&m_homePosition, dist);
2616 else
2617 return victim->IsInDist(&m_homePosition, dist);
2618 }
2619}
@ SPELL_AURA_MOD_TAUNT
Definition: SpellAuraDefines.h:74
bool isWorldBoss() const
Definition: Creature.h:116
time_t GetLastDamagedTime() const
Definition: Creature.cpp:3587
CreatureMovementData const & GetMovementTemplate() const
Definition: Creature.cpp:2901
float GetVisibilityRange() const
Definition: Object.cpp:1645
float GetObjectSize() const
Definition: Object.cpp:2759
Unit * GetCharmerOrOwner() const
Definition: Unit.h:1861
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:5643
bool IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell=nullptr) const
Definition: Unit.cpp:13859

References AI(), CanIgnoreFeignDeath(), Unit::getAttackers(), Unit::GetCharmerOrOwner(), Unit::GetCharmerOrOwnerGUID(), GameTime::GetGameTime(), GetLastDamagedTime(), WorldObject::GetMap(), GetMovementTemplate(), WorldObject::GetObjectSize(), Object::GetTypeId(), WorldObject::GetVisibilityRange(), Unit::HasAuraType(), Unit::HasUnitFlag2(), Unit::IsAIEnabled, Unit::isInAccessiblePlaceFor(), Position::IsInDist(), Position::IsInDist2d(), IsInEvadeMode(), WorldObject::IsInMap(), Object::IsPlayer(), Unit::IsValidAttackTarget(), WorldObject::IsWithinDist(), isWorldBoss(), m_homePosition, m_respawnedTime, SPELL_AURA_MOD_TAUNT, Object::ToCreature(), TYPEID_UNIT, and UNIT_FLAG2_FEIGN_DEATH.

Referenced by PetAI::_needToStop(), boss_hadronox::boss_hadronoxAI::AnyPlayerValid(), CanStartAttack(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::JustSummoned(), PetAI::SelectNextTarget(), ThreatContainer::SelectNextVictim(), SelectVictim(), npc_pet_shaman_earth_elemental::UpdateAI(), and npc_pet_shaman_fire_elemental::UpdateAI().

◆ CanEnterWater()

bool Creature::CanEnterWater ( ) const
overridevirtual

Implements Unit.

3176{
3177 if (CanSwim())
3178 return true;
3179
3181}
bool CanSwim() const override
This method check the current flag/status of a creature and its inhabit type.
Definition: Creature.cpp:3164
bool IsSwimAllowed() const
Definition: CreatureData.h:141

References CanSwim(), GetMovementTemplate(), and CreatureMovementData::IsSwimAllowed().

Referenced by ConfusedMovementGenerator< T >::_InitSpecific(), RandomMovementGenerator< T >::_setRandomLocation(), Map::CanReachPositionAndGetValidCoords(), PathGenerator::CreateFilter(), Unit::isInAccessiblePlaceFor(), and RefreshSwimmingFlag().

◆ CanFly()

bool Creature::CanFly ( ) const
inlineoverridevirtual

◆ CanGeneratePickPocketLoot()

bool Creature::CanGeneratePickPocketLoot ( ) const

◆ CanHover()

bool Creature::CanHover ( ) const
inline
84{ return GetMovementTemplate().Ground == CreatureGroundMovementType::Hover || IsHovering(); }
CreatureGroundMovementType Ground
Definition: CreatureData.h:128
bool IsHovering() const
Definition: Unit.h:2396

References GetMovementTemplate(), CreatureMovementData::Ground, and Unit::IsHovering().

Referenced by LoadCreaturesAddon(), and UpdateMovementFlags().

◆ CanIgnoreFeignDeath()

bool Creature::CanIgnoreFeignDeath ( ) const
inline
266{ return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH) != 0; }
@ CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH
Definition: CreatureData.h:65

References CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH, and GetCreatureTemplate().

Referenced by _IsTargetAcceptable(), and CanCreatureAttack().

◆ CanNotReachTarget()

bool Creature::CanNotReachTarget ( ) const
3573{
3574 return m_cannotReachTarget;
3575}
ObjectGuid m_cannotReachTarget
Definition: Creature.h:493

References m_cannotReachTarget.

Referenced by IsEvadingAttacks(), IsNotReachableAndNeedRegen(), and Update().

◆ CanPeriodicallyCallForAssistance()

bool Creature::CanPeriodicallyCallForAssistance ( ) const
private
3619{
3620 if (!IsInCombat())
3621 return false;
3622
3624 return false;
3625
3626 if (!CanHaveThreatList())
3627 return false;
3628
3629 if (IsSummon() && GetMap()->Instanceable())
3630 return false;
3631
3632 return true;
3633}
@ UNIT_STATE_POSSESSED
Definition: Unit.h:341
bool CanHaveThreatList() const
Definition: Unit.cpp:14600
bool IsSummon() const
Definition: Unit.h:1422
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
bool IsInCombat() const
Definition: Unit.h:1702

References Unit::CanHaveThreatList(), WorldObject::GetMap(), Unit::HasUnitState(), Unit::IsInCombat(), Unit::IsSummon(), UNIT_STATE_DIED, and UNIT_STATE_POSSESSED.

Referenced by Update().

◆ CanStartAttack()

bool Creature::CanStartAttack ( Unit const *  u) const
1857{
1858 if (IsCivilian())
1859 return false;
1860
1861 // This set of checks is should be done only for creatures
1862 if ((IsImmuneToNPC() && who->GetTypeId() != TYPEID_PLAYER) || // flag is valid only for non player characters
1863 (IsImmuneToPC() && who->GetTypeId() == TYPEID_PLAYER)) // immune to PC and target is a player, return false
1864 {
1865 return false;
1866 }
1867
1868 if (Unit* owner = who->GetOwner())
1869 if (owner->GetTypeId() == TYPEID_PLAYER && IsImmuneToPC()) // immune to PC and target has player owner
1870 return false;
1871
1872 // Do not attack non-combat pets
1873 if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
1874 return false;
1875
1876 if (!CanFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) // too much Z difference, skip very costy vmap calculations here
1877 return false;
1878
1879 if (!_IsTargetAcceptable(who))
1880 return false;
1881
1882 // pussywizard: at this point we are either hostile to who or friendly to who->getAttackerForHelper()
1883 // pussywizard: if who is in combat and has an attacker, help him if the distance is right (help because who is hostile or help because attacker is friendly)
1884 bool assist = false;
1885 if (who->IsEngaged() && IsWithinDist(who, ATTACK_DISTANCE))
1886 if (Unit* victim = who->getAttackerForHelper())
1888 assist = true;
1889
1890 if (!assist)
1891 if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false)) // pussywizard: +m_combatDistance for turrets and similar
1892 return false;
1893
1894 if (!CanCreatureAttack(who))
1895 return false;
1896
1898 return false;
1899
1900 return IsWithinLOSInMap(who);
1901}
#define CREATURE_Z_ATTACK_RANGE
Definition: Creature.h:41
#define ATTACK_DISTANCE
Definition: ObjectDefines.h:25
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ UNIT_STATE_STUNNED
Definition: Unit.h:328
@ CREATURE_TYPE_NON_COMBAT_PET
Definition: SharedDefines.h:2639
bool _IsTargetAcceptable(Unit const *target) const
Definition: Creature.cpp:2490
bool CanFly() const override
Definition: Creature.h:83
bool CanCreatureAttack(Unit const *victim, bool skipDistCheck=false) const
Definition: Creature.cpp:2558
float GetAggroRange(Unit const *target) const
Definition: Creature.cpp:3295
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1316
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition: Object.cpp:1347
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321
float GetDistanceZ(WorldObject const *obj) const
Definition: Object.cpp:1198
Unit * GetOwner() const
Definition: Unit.cpp:10599
bool IsImmuneToPC() const
Definition: Unit.h:1695

References _IsTargetAcceptable(), ATTACK_DISTANCE, CanCreatureAttack(), CanFly(), CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS, CREATURE_TYPE_NON_COMBAT_PET, CREATURE_Z_ATTACK_RANGE, GetAggroRange(), Unit::getAttackerForHelper(), Unit::GetCreatureType(), WorldObject::GetDistanceZ(), Unit::GetOwner(), Object::GetTypeId(), Unit::HasUnitState(), IsCivilian(), Unit::IsEngaged(), Unit::IsImmuneToNPC(), Unit::IsImmuneToPC(), Unit::IsNeutralToAll(), WorldObject::IsWithinDist(), WorldObject::IsWithinDistInMap(), WorldObject::IsWithinLOSInMap(), m_CombatDistance, sWorld, TYPEID_PLAYER, TYPEID_UNIT, and UNIT_STATE_STUNNED.

Referenced by CreatureAI::MoveInLineOfSight(), FollowerAI::MoveInLineOfSight(), npc_escortAI::MoveInLineOfSight(), SmartAI::MoveInLineOfSight(), and Acore::NearestHostileUnitInAttackDistanceCheck::operator()().

◆ CanSwim()

bool Creature::CanSwim ( ) const
overridevirtual

This method check the current flag/status of a creature and its inhabit type.

Pets should swim by default to properly follow the player NOTE: You can set the UNIT_FLAG_CANNOT_SWIM temporary to deny a creature to swim

Reimplemented from Unit.

3165{
3166 if (Unit::CanSwim() || (!Unit::CanSwim() && !CanFly()))
3167 return true;
3168
3169 if (IsPet())
3170 return true;
3171
3172 return false;
3173}
virtual bool CanSwim() const
this method checks the current flag of a unit
Definition: Unit.cpp:20236

References CanFly(), Unit::CanSwim(), and Unit::IsPet().

Referenced by PathGenerator::BuildPolyPath(), CanEnterWater(), PathGenerator::IsSwimmableSegment(), WorldObject::UpdateAllowedPositionZ(), and UpdateMovementFlags().

◆ CanWalk()

◆ ClearProhibitedSpellTimers()

void Creature::ClearProhibitedSpellTimers ( )
2766{
2767 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
2768 {
2769 m_ProhibitSchoolTime[i] = 0;
2770 }
2771}

References m_ProhibitSchoolTime, MAX_SPELL_SCHOOL, and SPELL_SCHOOL_NORMAL.

◆ ClearTarget()

void Creature::ClearTarget ( )
inline
371{ SetTarget(); };
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition: Creature.cpp:3441

References SetTarget().

Referenced by boss_julianne::DamageTaken(), and boss_leotheras_the_blind::Reset().

◆ Create()

bool Creature::Create ( ObjectGuid::LowType  guidlow,
Map map,
uint32  phaseMask,
uint32  Entry,
uint32  vehId,
float  x,
float  y,
float  z,
float  ang,
const CreatureData data = nullptr 
)

Relocate before CreateFromProto, to initialize coords and allow returning correct zone id for selecting OutdoorPvP/Battlefield script

Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there

1068{
1069 ASSERT(map);
1070 SetMap(map);
1071 SetPhaseMask(phaseMask, false);
1072
1073 CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
1074 if (!cinfo)
1075 {
1076 LOG_ERROR("sql.sql", "Creature::Create(): creature template (guidlow: {}, entry: {}) does not exist.", guidlow, Entry);
1077 return false;
1078 }
1079
1082 Relocate(x, y, z, ang);
1083
1084 if (!IsPositionValid())
1085 {
1086 LOG_ERROR("entities.unit", "Creature::Create(): given coordinates for creature (guidlow {}, entry {}) are not valid (X: {}, Y: {}, Z: {}, O: {})", guidlow, Entry, x, y, z, ang);
1087 return false;
1088 }
1089
1090 // area/zone id is needed immediately for ZoneScript::GetCreatureEntry hook before it is known which creature template to load (no model/scale available yet)
1091 PositionFullTerrainStatus terrainData;
1093 ProcessPositionDataChanged(terrainData);
1094
1095 //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0;
1096 if (!CreateFromProto(guidlow, Entry, vehId, data))
1097 return false;
1098
1100
1101 switch (GetCreatureTemplate()->rank)
1102 {
1105 break;
1108 break;
1111 break;
1113 // Xinef: Reduce corpse delay for bossess outside of instance
1114 if (!GetInstanceId())
1115 m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_ELITE) * 2;
1116 else
1118 break;
1119 default:
1121 break;
1122 }
1123
1124 uint32 displayID = GetNativeDisplayId();
1125 if (sObjectMgr->GetCreatureModelRandomGender(&displayID) && !IsTotem()) // Cancel load if no model defined or if totem
1126 {
1127 SetDisplayId(displayID);
1128 SetNativeDisplayId(displayID);
1129 }
1130
1132
1135
1137
1139 {
1142 }
1143 else if (cinfo->type_flags & CREATURE_TYPE_FLAG_VISIBLE_TO_GHOSTS) // Xinef: Add ghost visibility for ghost units
1145
1146 if (Entry == VISUAL_WAYPOINT)
1147 SetVisible(false);
1148
1151
1152 return true;
1153}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
@ CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING
Definition: CreatureData.h:78
@ CREATURE_FLAG_EXTRA_GHOST_VISIBILITY
Definition: CreatureData.h:59
#define DEFAULT_COLLISION_HEIGHT
Definition: ObjectDefines.h:50
@ UNIT_STATE_IGNORE_PATHFINDING
Definition: Unit.h:352
#define sObjectMgr
Definition: ObjectMgr.h:1640
#define VISUAL_WAYPOINT
Definition: MotionMaster.h:32
@ CONFIG_CORPSE_DECAY_ELITE
Definition: IWorld.h:302
@ CONFIG_CORPSE_DECAY_NORMAL
Definition: IWorld.h:300
@ CONFIG_CORPSE_DECAY_WORLDBOSS
Definition: IWorld.h:304
@ CONFIG_CORPSE_DECAY_RARE
Definition: IWorld.h:301
@ CONFIG_CORPSE_DECAY_RAREELITE
Definition: IWorld.h:303
uint32 const Entry[3]
Definition: instance_blackwing_lair.cpp:72
@ SERVERSIDE_VISIBILITY_GHOST
Definition: SharedDefines.h:1274
@ GHOST_VISIBILITY_ALIVE
Definition: SharedDefines.h:1281
@ GHOST_VISIBILITY_GHOST
Definition: SharedDefines.h:1282
@ CREATURE_TYPE_FLAG_VISIBLE_TO_GHOSTS
Definition: SharedDefines.h:2696
bool LoadCreaturesAddon(bool reload=false)
Definition: Creature.cpp:2634
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:3422
bool CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, const CreatureData *data=nullptr)
Definition: Creature.cpp:1568
uint32 GetScriptId() const
Definition: Creature.cpp:2964
void UpdateMovementFlags()
Definition: Creature.cpp:3340
Definition: CreatureData.h:176
uint32 type_flags
Definition: CreatureData.h:216
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:360
uint32 GetPhaseMask() const
Definition: Object.h:434
uint32 LastUsedScriptID
Definition: Object.h:582
uint32 GetInstanceId() const
Definition: Object.h:431
virtual void SetMap(Map *map)
Definition: Object.cpp:2096
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition: Object.h:510
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:509
float m_positionZ
Definition: Position.h:58
float GetPositionZ() const
Definition: Position.h:119
bool IsPositionValid() const
Definition: Position.cpp:175
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void Relocate(float x, float y)
Definition: Position.h:73
void SetVisible(bool x)
Definition: Unit.cpp:14220
void AddUnitState(uint32 f)
Definition: Unit.h:1409
float GetHoverHeight() const
Definition: Unit.h:2401
uint32 GetNativeDisplayId() const
Definition: Unit.h:2184
void SetNativeDisplayId(uint32 modelId)
Definition: Unit.h:2186
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition: Unit.cpp:19313
void ProcessPositionDataChanged(PositionFullTerrainStatus const &data) override
Definition: Unit.cpp:4206
bool IsSpiritHealer() const
Definition: Unit.h:1674
bool IsTotem() const
Definition: Unit.h:1427
bool IsSpiritGuide() const
Definition: Unit.h:1675
Definition: Map.h:182
void GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, float z, float collisionHeight, PositionFullTerrainStatus &data, uint8 reqLiquidType=MAP_ALL_LIQUIDS)
Definition: Map.cpp:2290

References Unit::AddUnitState(), ASSERT, CONFIG_CORPSE_DECAY_ELITE, CONFIG_CORPSE_DECAY_NORMAL, CONFIG_CORPSE_DECAY_RARE, CONFIG_CORPSE_DECAY_RAREELITE, CONFIG_CORPSE_DECAY_WORLDBOSS, CreateFromProto(), CREATURE_ELITE_ELITE, CREATURE_ELITE_RARE, CREATURE_ELITE_RAREELITE, CREATURE_ELITE_WORLDBOSS, CREATURE_FLAG_EXTRA_GHOST_VISIBILITY, CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING, CREATURE_TYPE_FLAG_VISIBLE_TO_GHOSTS, DEFAULT_COLLISION_HEIGHT, Entry, GetCreatureTemplate(), Map::GetFullTerrainStatusForPosition(), Unit::GetHoverHeight(), WorldObject::GetInstanceId(), WorldObject::GetMap(), Unit::GetNativeDisplayId(), WorldObject::GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GetScriptId(), GHOST_VISIBILITY_ALIVE, GHOST_VISIBILITY_GHOST, Position::IsPositionValid(), Unit::IsSpiritGuide(), Unit::IsSpiritHealer(), Unit::IsTotem(), WorldObject::LastUsedScriptID, LoadCreaturesAddon(), LOG_ERROR, m_corpseDelay, Position::m_positionZ, WorldObject::m_serverSideVisibility, WorldObject::m_serverSideVisibilityDetect, Unit::ProcessPositionDataChanged(), Position::Relocate(), SERVERSIDE_VISIBILITY_GHOST, SetDisplayId(), WorldObject::SetMap(), Unit::SetNativeDisplayId(), Unit::SetPhaseMask(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::SetValue(), Unit::SetVisible(), sObjectMgr, sWorld, CreatureTemplate::type_flags, UNIT_STATE_IGNORE_PATHFINDING, UpdateMovementFlags(), and VISUAL_WAYPOINT.

Referenced by Battleground::AddCreature(), debug_commandscript::HandleDebugSpawnVehicleCommand(), npc_commandscript::HandleNpcAddCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), LoadCreatureFromDB(), Battlefield::SpawnCreature(), and Map::SummonCreature().

◆ CreateFromProto()

bool Creature::CreateFromProto ( ObjectGuid::LowType  guidlow,
uint32  Entry,
uint32  vehId,
const CreatureData data = nullptr 
)
protected
1569{
1570 SetZoneScript();
1571 if (GetZoneScript() && data)
1572 {
1573 uint32 FirstEntry = GetZoneScript()->GetCreatureEntry(guidlow, data);
1574 if (!FirstEntry)
1575 return false;
1576 }
1577
1578 CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
1579 if (!normalInfo)
1580 {
1581 LOG_ERROR("sql.sql", "Creature::CreateFromProto(): creature template (guidlow: {}, entry: {}) does not exist.", guidlow, Entry);
1582 return false;
1583 }
1584
1586
1587 Object::_Create(guidlow, Entry, (vehId || normalInfo->VehicleId) ? HighGuid::Vehicle : HighGuid::Unit);
1588
1589 // Xinef: select proper vehicle id
1590 if (!vehId)
1591 {
1592 CreatureTemplate const* cinfo = normalInfo;
1593 for (uint8 diff = uint8(GetMap()->GetSpawnMode()); diff > 0 && !IsPet();)
1594 {
1595 // we already have valid Map pointer for current creature!
1596 if (cinfo->DifficultyEntry[diff - 1])
1597 {
1598 cinfo = sObjectMgr->GetCreatureTemplate(normalInfo->DifficultyEntry[diff - 1]);
1599 if (cinfo && cinfo->VehicleId)
1600 break; // template found
1601
1602 // check and reported at startup, so just ignore (restore normalInfo)
1603 cinfo = normalInfo;
1604 }
1605
1606 // for instances heroic to normal, other cases attempt to retrieve previous difficulty
1607 if (diff >= RAID_DIFFICULTY_10MAN_HEROIC && GetMap()->IsRaid())
1608 diff -= 2; // to normal raid difficulty cases
1609 else
1610 --diff;
1611 }
1612
1613 if (cinfo->VehicleId)
1614 CreateVehicleKit(cinfo->VehicleId, (cinfo->VehicleId != normalInfo->VehicleId ? cinfo->Entry : normalInfo->Entry));
1615 }
1616 else
1617 CreateVehicleKit(vehId, Entry);
1618
1619 if (!UpdateEntry(Entry, data))
1620 return false;
1621
1622 return true;
1623}
@ RAID_DIFFICULTY_10MAN_HEROIC
Definition: DBCEnums.h:283
bool UpdateEntry(uint32 entry, const CreatureData *data=nullptr, bool changelevel=true, bool updateAI=false)
Definition: Creature.cpp:482
void SetOriginalEntry(uint32 entry)
Definition: Creature.h:361
uint32 Entry
Definition: CreatureData.h:177
uint32 VehicleId
Definition: CreatureData.h:223
uint32 DifficultyEntry[MAX_DIFFICULTY - 1]
Definition: CreatureData.h:178
void _Create(ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
Definition: Object.cpp:134
void SetZoneScript()
Definition: Object.cpp:2321
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Definition: Unit.cpp:18979
bool IsRaid() const
Definition: Map.h:450
virtual uint32 GetCreatureEntry(ObjectGuid::LowType, CreatureData const *data)
Definition: ZoneScript.h:32

References Object::_Create(), Unit::CreateVehicleKit(), CreatureTemplate::DifficultyEntry, CreatureTemplate::Entry, Entry, ZoneScript::GetCreatureEntry(), WorldObject::GetMap(), WorldObject::GetZoneScript(), Unit::IsPet(), Map::IsRaid(), LOG_ERROR, RAID_DIFFICULTY_10MAN_HEROIC, SetOriginalEntry(), WorldObject::SetZoneScript(), sObjectMgr, UpdateEntry(), and CreatureTemplate::VehicleId.

Referenced by Create().

◆ DeleteFromDB()

void Creature::DeleteFromDB ( )
virtual

Reimplemented in Pet.

1791{
1792 if (!m_spawnId)
1793 {
1794 LOG_ERROR("entities.unit", "Trying to delete not saved creature: {}", GetGUID().ToString());
1795 return;
1796 }
1797
1799 sObjectMgr->DeleteCreatureData(m_spawnId);
1800
1801 WorldDatabaseTransaction trans = WorldDatabase.BeginTransaction();
1802
1804 stmt->SetData(0, m_spawnId);
1805 trans->Append(stmt);
1806
1807 stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON);
1808 stmt->SetData(0, m_spawnId);
1809 trans->Append(stmt);
1810
1811 stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_CREATURE);
1812 stmt->SetData(0, m_spawnId);
1813 trans->Append(stmt);
1814
1815 stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_MODEL_EQUIP);
1816 stmt->SetData(0, m_spawnId);
1817 trans->Append(stmt);
1818
1819 WorldDatabase.CommitTransaction(trans);
1820}
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
SQLTransaction< WorldDatabaseConnection > WorldDatabaseTransaction
Definition: DatabaseEnvFwd.h:72
@ WORLD_DEL_GAME_EVENT_MODEL_EQUIP
Definition: WorldDatabase.h:94
@ WORLD_DEL_CREATURE_ADDON
Definition: WorldDatabase.h:73
@ WORLD_DEL_GAME_EVENT_CREATURE
Definition: WorldDatabase.h:93
@ WORLD_DEL_CREATURE
Definition: WorldDatabase.h:83
Definition: PreparedStatement.h:158
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:78
std::string ToString() const
Definition: Position.cpp:51
void RemoveCreatureRespawnTime(ObjectGuid::LowType dbGuid)
Definition: Map.cpp:3365

References Object::GetGUID(), WorldObject::GetMap(), LOG_ERROR, m_spawnId, Map::RemoveCreatureRespawnTime(), PreparedStatementBase::SetData(), sObjectMgr, Position::ToString(), WORLD_DEL_CREATURE, WORLD_DEL_CREATURE_ADDON, WORLD_DEL_GAME_EVENT_CREATURE, WORLD_DEL_GAME_EVENT_MODEL_EQUIP, and WorldDatabase.

Referenced by npc_commandscript::HandleNpcDeleteCommand().

◆ DespawnOnEvade()

void Creature::DespawnOnEvade ( Seconds  respawnDelay = 20s)
2126{
2128
2129 if (respawnDelay < 2s)
2130 {
2131 LOG_WARN("entities.unit", "DespawnOnEvade called with delay of {} seconds, defaulting to 2.", respawnDelay.count());
2132 respawnDelay = 2s;
2133 }
2134
2135 if (TempSummon* whoSummon = ToTempSummon())
2136 {
2137 LOG_WARN("entities.unit", "DespawnOnEvade called on a temporary summon.");
2138 whoSummon->UnSummon();
2139 return;
2140 }
2141
2142 DespawnOrUnsummon(Milliseconds(0), respawnDelay);
2143}
#define LOG_WARN(filterType__,...)
Definition: Log.h:161
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:27
virtual void SummonedCreatureDespawnAll()
Definition: CreatureAI.h:138
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117
Definition: TemporarySummon.h:40
TempSummon * ToTempSummon()
Definition: Unit.h:2414

References AI(), DespawnOrUnsummon(), LOG_WARN, CreatureAI::SummonedCreatureDespawnAll(), and Unit::ToTempSummon().

Referenced by boss_jeklik::EnterEvadeMode(), CreatureAI::EnterEvadeMode(), boss_midnight::EnterEvadeMode(), and boss_nightbane::MovementInform().

◆ DespawnOrUnsummon() [1/2]

void Creature::DespawnOrUnsummon ( Milliseconds  msTimeToDespawn,
Seconds  forcedRespawnTimer 
)
2118{
2119 if (TempSummon* summon = this->ToTempSummon())
2120 summon->UnSummon(msTimeToDespawn.count());
2121 else
2122 ForcedDespawn(msTimeToDespawn.count(), forcedRespawnTimer);
2123}
void ForcedDespawn(uint32 timeMSToDespawn=0, Seconds forcedRespawnTimer=0s)
Definition: Creature.cpp:2093

References ForcedDespawn(), and Unit::ToTempSummon().

Referenced by npc_mograine::npc_mograineAI::AshbringerEvent(), spell_the_lich_king_shadow_trap_periodic::spell_the_lich_king_shadow_trap_periodic_SpellScript::CheckTargetCount(), npc_simone::npc_simoneAI::CorpseRemoved(), Player::CreatePet(), boss_headless_horseman_head::DamageTaken(), npc_terenas_menethil::npc_terenas_menethilAI::DamageTaken(), npc_power_spark::npc_power_sparkAI::DamageTaken(), boss_freya::boss_freyaAI::DamageTaken(), boss_hodir::boss_hodirAI::DamageTaken(), npc_tiger_matriarch::npc_tiger_matriarchAI::DamageTaken(), MotionTransport::DelayedTeleportTransport(), SummonList::DespawnAll(), SummonList::DespawnEntry(), brann_bronzebeard::brann_bronzebeardAI::DespawnHeads(), DespawnOnEvade(), spell_rotface_unstable_ooze_explosion_suicide::spell_rotface_unstable_ooze_explosion_suicide_AuraScript::DespawnSelf(), Vehicle::Dismiss(), npc_icc_ice_sphere::npc_icc_ice_sphereAI::DoAction(), npc_ulduar_toasty_fire::npc_ulduar_toasty_fireAI::DoAction(), npc_ball_of_flame::npc_ball_of_flameAI::DoAction(), npc_saurfang_event::npc_saurfang_eventAI::DoAction(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::DoAction(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::DoAction(), npc_bone_spike::npc_bone_spikeAI::DoAction(), npc_strangulate_vehicle::npc_strangulate_vehicleAI::DoAction(), npc_terenas_menethil::npc_terenas_menethilAI::DoAction(), boss_algalon_the_observer::boss_algalon_the_observerAI::DoAction(), boss_infinite_corruptor::boss_infinite_corruptorAI::DoAction(), npc_twilight_summon::npc_twilight_summonAI::DoAction(), npc_snobold_vassal::npc_snobold_vassalAI::DoAction(), npc_living_mojo::npc_living_mojoAI::DoAction(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::DoAction(), npc_spark_of_ionar::npc_spark_of_ionarAI::DoAction(), npc_molten_golem::npc_molten_golemAI::DoAction(), npc_auriaya_feral_defender::npc_auriaya_feral_defenderAI::DoAction(), boss_thorim_sif::boss_thorim_sifAI::DoAction(), Spell::EffectScriptEffect(), Spell::EffectTameCreature(), boss_julianne::EnterEvadeMode(), boss_rend_blackhand::boss_rend_blackhandAI::EnterEvadeMode(), boss_attumen::EnterEvadeMode(), boss_entropius::boss_entropiusAI::EnterEvadeMode(), boss_black_knight::boss_black_knightAI::EnterEvadeMode(), npc_phantom_hallucination::npc_phantom_hallucinationAI::EnterEvadeMode(), boss_ahune::EnterEvadeMode(), boss_harbinger_skyriss::EnterEvadeMode(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::EnterEvadeMode(), npc_hallows_end_soh::EnterEvadeMode(), boss_ouro::EnterEvadeMode(), npc_dirt_mound::EnterEvadeMode(), npc_toc_pet_warlock::npc_toc_pet_warlockAI::EnterEvadeMode(), npc_toc_pet_hunter::npc_toc_pet_hunterAI::EnterEvadeMode(), npc_fel_infernal::npc_fel_infernalAI::EnterEvadeMode(), npc_mistress_of_pain::npc_mistress_of_painAI::EnterEvadeMode(), boss_nazan::EnterEvadeMode(), boss_vazruden::EnterEvadeMode(), ForcedDespawnDelayEvent::Execute(), VehicleDespawnEvent::Execute(), DelayedCastEvent::Execute(), EoEDrakeEnterVehicleEvent::Execute(), SuckBackEvent::Execute(), npc_hallows_end_soh::FinishEvent(), spell_gen_despawn_self::HandleDummy(), spell_item_lil_xt::HandleDummy(), spell_q12096_q12092_dummy::spell_q12096_q12092_dummy_SpellScript::HandleDummy(), spell_q12096_q12092_bark::spell_q12096_q12092_bark_SpellScript::HandleDummy(), spell_item_complete_raptor_capture::HandleDummy(), spell_item_rocket_chicken::HandleDummyTick(), spell_mc_play_dead::spell_mc_play_dead_AuraScript::HandleEffectRemove(), spell_dtk_raise_dead::spell_dtk_raise_dead_AuraScript::HandleEffectRemove(), spell_q11919_q11940_drake_hunt::spell_q11919_q11940_drake_hunt_AuraScript::HandleEffectRemove(), AuraEffect::HandlePeriodicTriggerSpellAuraTick(), spell_putricide_eat_ooze::spell_putricide_eat_ooze_SpellScript::HandleScript(), spell_rotface_little_ooze_combine::spell_rotface_little_ooze_combine_SpellScript::HandleScript(), spell_rotface_large_ooze_combine::spell_rotface_large_ooze_combine_SpellScript::HandleScript(), spell_rotface_large_ooze_buff_combine::spell_rotface_large_ooze_buff_combine_SpellScript::HandleScript(), spell_shredder_delivery::spell_shredder_delivery_SpellScript::HandleScript(), spell_q12690_burst_at_the_seams::HandleScript(), spell_illidan_cage_trap::spell_illidan_cage_trap_SpellScript::HandleScriptEffect(), spell_winter_veil_racer_slam_hit::HandleScriptEffect(), spell_q11065_wrangle_some_aether_rays_aura::if(), boss_twilight_corrupter::InitializeAI(), npc_preparations_for_war_vehicle::InitializeAI(), npc_underbog_mushroom::InitializeAI(), Guardian::InitStatsForLevel(), npc_taldaram_flamesphere::IsSummonedBy(), npc_putricide_oozeAI::IsSummonedBy(), npc_ranshalla::npc_ranshallaAI::JustDidDialogueStep(), boss_majordomo::boss_majordomoAI::JustDied(), npc_kilrek::JustDied(), boss_dorothee::JustDied(), boss_roar::JustDied(), boss_strawman::JustDied(), boss_tinhead::JustDied(), npc_zulian_prowler::npc_zulian_prowlerAI::JustDied(), npc_chained_spirit::JustDied(), npc_belnistrasz::npc_belnistraszAI::JustDied(), npc_living_inferno::npc_living_infernoAI::JustDied(), npc_memory::npc_memoryAI::JustDied(), npc_argent_soldier::npc_argent_soldierAI::JustDied(), npc_toc5_grand_champion_minion::npc_toc5_grand_champion_minionAI::JustDied(), npc_fel_infernal::npc_fel_infernalAI::JustDied(), npc_mistress_of_pain::npc_mistress_of_painAI::JustDied(), npc_dark_nucleus::npc_dark_nucleusAI::JustDied(), npc_gunship::npc_gunshipAI::JustDied(), npc_little_ooze::npc_little_oozeAI::JustDied(), npc_big_ooze::npc_big_oozeAI::JustDied(), npc_ice_tomb::npc_ice_tombAI::JustDied(), npc_eoe_wyrmrest_skytalon::npc_eoe_wyrmrest_skytalonAI::JustDied(), npc_ulduar_saronite_animus::npc_ulduar_saronite_animusAI::JustDied(), npc_ichor_globule::npc_ichor_globuleAI::JustDied(), npc_vh_void_sentry::npc_vh_void_sentryAI::JustDied(), npc_thassarian2::npc_thassarian2AI::JustDied(), npc_wintergarde_gryphon::JustDied(), npc_q24545_vegard::npc_q24545_vegardAI::JustDied(), npc_blessed_banner::npc_blessed_bannerAI::JustDied(), boss_fathomguard_sharkkis::JustDied(), boss_fathomguard_tidalvess::JustDied(), boss_fathomguard_caribdis::JustDied(), boss_ahune::JustDied(), boss_hydromancer_thespia::JustDied(), npc_buru_egg::JustDied(), boss_bug_trio::JustDied(), npc_frost_tomb::npc_frost_tombAI::JustDied(), npc_dirt_mound::JustEngagedWith(), boss_dorothee::JustReachedHome(), boss_roar::JustReachedHome(), boss_strawman::JustReachedHome(), boss_tinhead::JustReachedHome(), boss_crone::JustReachedHome(), boss_bigbadwolf::JustReachedHome(), boss_julianne::JustReachedHome(), boss_romulo::JustReachedHome(), boss_arlokk::boss_arlokkAI::JustReachedHome(), boss_headless_horseman::JustReachedHome(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::JustReachedHome(), npc_precious::npc_preciousAI::JustReachedHome(), npc_ouro_spawner::JustSummoned(), boss_rend_blackhand::boss_rend_blackhandAI::JustSummoned(), boss_kiljaeden::boss_kiljaedenAI::JustSummoned(), npc_medivh_bm::JustSummoned(), boss_gal_darah::boss_gal_darahAI::JustSummoned(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::JustSummoned(), boss_professor_putricide::boss_professor_putricideAI::JustSummoned(), boss_rotface::boss_rotfaceAI::JustSummoned(), boss_the_lich_king::boss_the_lich_kingAI::JustSummoned(), npc_risen_archmage::npc_risen_archmageAI::JustSummoned(), npc_gluttonous_abomination::npc_gluttonous_abominationAI::JustSummoned(), boss_malygos::boss_malygosAI::JustSummoned(), npc_tiger_matriarch::npc_tiger_matriarchAI::KilledUnit(), npc_brew_bubble::MoveInLineOfSight(), npc_khunok_the_behemoth::npc_khunok_the_behemothAI::MoveInLineOfSight(), npc_captured_beryl_sorcerer::npc_captured_beryl_sorcererAI::MoveInLineOfSight(), FollowerAI::MovementInform(), npc_brann_bronzebeard_algalon::npc_brann_bronzebeard_algalonAI::MovementInform(), npc_spirit_shade::npc_spirit_shadeAI::MovementInform(), npc_forest_frog::npc_forest_frogAI::MovementInform(), npc_enslaved_netherwing_drake::MovementInform(), npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI::MovementInform(), npc_troll_volunteer::npc_troll_volunteerAI::MovementInform(), boss_grand_champion::boss_grand_championAI::MovementInform(), npc_concentrated_ball::npc_concentrated_ballAI::MovementInform(), npc_darnavan::npc_darnavanAI::MovementInform(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::MovementInform(), npc_vehicle_d16_propelled_delivery::npc_vehicle_d16_propelled_deliveryAI::MovementInform(), npc_scarlet_ghoul::npc_scarlet_ghoulAI::MovementInform(), npc_injured_7th_legion_soldier::npc_injured_7th_legion_soldierAI::MovementInform(), npc_chained_spirit::MovementInform(), npc_balance_of_light_and_shadow::npc_balance_of_light_and_shadowAI::MovementInform(), npc_ball_of_flame::npc_ball_of_flameAI::MovementInform(), npc_assembly_lightning::npc_assembly_lightningAI::MovementInform(), npc_xt002_scrapbot::npc_xt002_scrapbotAI::MovementInform(), npc_released_offspring_harkoa::npc_released_offspring_harkoaAI::MovementInform(), npc_attracted_reef_bull::npc_attracted_reef_bullAI::MovementInform(), npc_image_of_medivh::npc_image_of_medivhAI::NextStep(), npc_lk_spirit_bomb::npc_lk_spirit_bombAI::npc_lk_spirit_bombAI(), npc_midsummer_ribbon_pole_target::npc_midsummer_ribbon_pole_target(), BattlefieldWG::OnCreatureCreate(), instance_gnomeregan::instance_gnomeregan_InstanceMapScript::OnCreatureCreate(), instance_dire_maul::instance_dire_maul_InstanceMapScript::OnCreatureCreate(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), instance_sethekk_halls::instance_sethekk_halls_InstanceMapScript::OnCreatureCreate(), go_scourge_enclosure::OnGossipHello(), go_jotunheim_cage::OnGossipHello(), npc_pet_gen_argent_pony_bridle::OnGossipSelect(), npc_grandmother::OnGossipSelect(), npc_ulduar_keeper::OnGossipSelect(), npc_adventurous_dwarf::OnGossipSelect(), spell_kaelthas_flame_strike::spell_kaelthas_flame_strike_AuraScript::OnRemove(), npc_valithria_portal::npc_valithria_portalAI::OnSpellClick(), boss_yoggsaron_descend_portal::boss_yoggsaron_descend_portalAI::OnSpellClick(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), FrostwingGauntletRespawner::operator()(), ValithriaDespawner::operator()(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::PassengerBoarded(), npc_ulduar_vx001::npc_ulduar_vx001AI::PassengerBoarded(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::PassengerBoarded(), npc_eoe_wyrmrest_skytalon::npc_eoe_wyrmrest_skytalonAI::PassengerBoarded(), npc_oculus_drake::npc_oculus_drakeAI::PassengerBoarded(), npc_ulduar_flames_initial::npc_ulduar_flames_initialAI::RemoveAll(), boss_gyth::boss_gythAI::Reset(), boss_nefarian::Reset(), npc_image_of_medivh::npc_image_of_medivhAI::Reset(), npc_singularity::npc_singularityAI::Reset(), boss_infinite_corruptor::boss_infinite_corruptorAI::Reset(), boss_mal_ganis::boss_mal_ganisAI::Reset(), npc_eye_tentacle::Reset(), npc_claw_tentacle::Reset(), npc_xerestrasza::npc_xerestraszaAI::Reset(), npc_raging_spirit::npc_raging_spiritAI::Reset(), npc_assembly_lightning::npc_assembly_lightningAI::Reset(), npc_xt002_pummeller::npc_xt002_pummellerAI::Reset(), npc_xt002_life_spark::npc_xt002_life_sparkAI::Reset(), npc_violet_hold_defense_system::Reset(), npc_target_trigger::Reset(), npc_oscillating_frequency_scanner_master_bunny::npc_oscillating_frequency_scanner_master_bunnyAI::Reset(), npc_simon_bunny::npc_simon_bunnyAI::ResetNode(), NPCStaveQuestAI::RevealForm(), spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::SelectTarget(), npc_frost_sphere::npc_frost_sphereAI::SpellHit(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::SpellHit(), npc_ulduar_flames_spread::npc_ulduar_flames_spreadAI::SpellHit(), npc_vics_flying_machine::npc_vics_flying_machineAI::SpellHit(), npc_captured_rageclaw::npc_captured_rageclawAI::SpellHit(), boss_headless_horseman_pumpkin::SpellHit(), npc_rabid_thistle_bear::npc_rabid_thistle_bearAI::SpellHit(), npc_aged_dying_ancient_kodo::npc_aged_dying_ancient_kodoAI::SpellHit(), npc_living_constellation::npc_living_constellationAI::SpellHit(), npc_drakuru_shackles::npc_drakuru_shacklesAI::SpellHit(), npc_midsummer_torch_target::SpellHit(), boss_magus_telestra::boss_magus_telestraAI::SpellHit(), npc_iron_watcher::npc_iron_watcherAI::SpellHit(), npc_vengeful_shade::npc_vengeful_shadeAI::SpellHitTarget(), boss_headless_horseman_head::SpellHitTarget(), npc_q24545_lich_king::npc_q24545_lich_kingAI::SpellHitTarget(), boss_ouro::Submerge(), npc_time_rift::SummonedCreatureDies(), boss_hazzarah::SummonedCreatureDies(), npc_artruis_the_hearthless::npc_artruis_the_hearthlessAI::SummonedCreatureDies(), npc_creature_generator_akama::SummonedCreatureDies(), boss_vexallus::SummonedCreatureDies(), boss_hydross_the_unstable::SummonMovementInform(), boss_razorgore::boss_razorgoreAI::SummonMovementInform(), npc_artruis_the_hearthless::npc_artruis_the_hearthlessAI::SummonsAction(), npc_drakuru_shackles::npc_drakuru_shacklesAI::UnlockRageclaw(), VehicleAI::UpdateAI(), npc_escortAI::UpdateAI(), npc_vaelastrasz_the_red::npc_vaelastrasz_the_redAI::UpdateAI(), boss_victor_nefarius::boss_victor_nefariusAI::UpdateAI(), npc_kernobee::npc_kernobeeAI::UpdateAI(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), npc_madrigosa::npc_madrigosaAI::UpdateAI(), boss_kalec::boss_kalecAI::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_dark_iron_attack_mole_machine::UpdateAI(), npc_brew_bubble::UpdateAI(), npc_love_in_air_snivel_real::UpdateAI(), npc_belnistrasz::npc_belnistraszAI::UpdateAI(), npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI::UpdateAI(), npc_depth_charge::npc_depth_chargeAI::UpdateAI(), npc_draenei_survivor::npc_draenei_survivorAI::UpdateAI(), npc_stillpine_capitive::npc_stillpine_capitiveAI::UpdateAI(), npc_rabid_thistle_bear::npc_rabid_thistle_bearAI::UpdateAI(), npc_giant_spotlight::npc_giant_spotlightAI::UpdateAI(), npc_sergeant_bly::npc_sergeant_blyAI::UpdateAI(), npc_weegli_blastfuse::npc_weegli_blastfuseAI::UpdateAI(), npc_fos_corrupted_soul_fragment::npc_fos_corrupted_soul_fragmentAI::UpdateAI(), boss_drakkari_elemental::boss_drakkari_elementalAI::UpdateAI(), npc_kinetic_bomb::npc_kinetic_bombAI::UpdateAI(), npc_vengeful_shade::npc_vengeful_shadeAI::UpdateAI(), npc_bone_spike::npc_bone_spikeAI::UpdateAI(), npc_ice_tomb::npc_ice_tombAI::UpdateAI(), npc_strangulate_vehicle::npc_strangulate_vehicleAI::UpdateAI(), npc_lk_spirit_bomb::npc_lk_spirit_bombAI::UpdateAI(), npc_valithria_cloud::npc_valithria_cloudAI::UpdateAI(), npc_blistering_zombie::npc_blistering_zombieAI::UpdateAI(), npc_impaling_spear::npc_impaling_spearAI::UpdateAI(), npc_vortex_ride::npc_vortex_rideAI::UpdateAI(), npc_power_spark::npc_power_sparkAI::UpdateAI(), npc_oculus_drake::npc_oculus_drakeAI::UpdateAI(), boss_algalon_the_observer::boss_algalon_the_observerAI::UpdateAI(), boss_freya_lifebinder::boss_freya_lifebinderAI::UpdateAI(), boss_freya_healthy_spore::boss_freya_healthy_sporeAI::UpdateAI(), boss_freya_summons::boss_freya_summonsAI::UpdateAI(), boss_freya_nature_bomb::boss_freya_nature_bombAI::UpdateAI(), npc_ulduar_flash_freeze::npc_ulduar_flash_freezeAI::UpdateAI(), boss_kologarn_eyebeam::boss_kologarn_eyebeamAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_ulduar_magnetic_core::npc_ulduar_magnetic_coreAI::UpdateAI(), npc_ulduar_bot_summon_trigger::npc_ulduar_bot_summon_triggerAI::UpdateAI(), npc_ulduar_flames_initial::npc_ulduar_flames_initialAI::UpdateAI(), boss_thorim::boss_thorimAI::UpdateAI(), boss_thorim_sif::boss_thorim_sifAI::UpdateAI(), boss_skadi_grauf::boss_skadi_graufAI::UpdateAI(), npc_vh_teleportation_portal::npc_vh_teleportation_portalAI::UpdateAI(), npc_azure_saboteur::npc_azure_saboteurAI::UpdateAI(), npc_lurgglbr::npc_lurgglbrAI::UpdateAI(), npc_thassarian2::npc_thassarian2AI::UpdateAI(), npc_preparations_for_war_vehicle::UpdateAI(), npc_minigob_manabonk::npc_minigob_manabonkAI::UpdateAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::UpdateAI(), npc_wintergarde_gryphon::UpdateAI(), npc_wounded_skirmisher::UpdateAI(), npc_lake_frog::npc_lake_frogAI::UpdateAI(), npc_lord_arete::npc_lord_areteAI::UpdateAI(), npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::UpdateAI(), npc_blessed_banner::npc_blessed_bannerAI::UpdateAI(), npc_feedin_da_goolz::npc_feedin_da_goolzAI::UpdateAI(), npc_crusade_recruit::npc_crusade_recruitAI::UpdateAI(), npc_fel_guard_hound::npc_fel_guard_houndAI::UpdateAI(), npc_enslaved_netherwing_drake::UpdateAI(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::UpdateAI(), npc_pet_gen_target_following_bomb::UpdateAI(), npc_pet_gen_imp_in_a_bottle::UpdateAI(), npc_pet_gen_fetch_ball::UpdateAI(), npc_artorius::npc_artoriusAI::UpdateAI(), npc_simone::npc_simoneAI::UpdateAI(), npc_nelson::npc_nelsonAI::UpdateAI(), npc_franklin::npc_franklinAI::UpdateAI(), npc_elder_clearwater::npc_elder_clearwaterAI::UpdateAI(), npc_koltira_deathweaver::npc_koltira_deathweaverAI::UpdateAI(), npc_ichor_globule::npc_ichor_globuleAI::UpdateAI(), FollowerAI::UpdateAI(), npc_brunnhildar_prisoner::npc_brunnhildar_prisonerAI::UpdateAI(), SmartAI::UpdateDespawn(), npc_rinji::npc_rinjiAI::UpdateEscortAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), SmartAI::UpdatePath(), npc_daphne_stilwell::npc_daphne_stilwellAI::WaypointReached(), npc_apothecary_hanes::npc_Apothecary_HanesAI::WaypointReached(), and npc_plaguehound_tracker::npc_plaguehound_trackerAI::WaypointReached().

◆ DespawnOrUnsummon() [2/2]

void Creature::DespawnOrUnsummon ( uint32  msTimeToDespawn = 0)
inline
276{ DespawnOrUnsummon(Milliseconds(msTimeToDespawn), 0s); };

References DespawnOrUnsummon().

Referenced by DespawnOrUnsummon().

◆ DisappearAndDie()

void Creature::DisappearAndDie ( )
317{
319 //SetVisibility(VISIBILITY_OFF);
320 //ObjectAccessor::UpdateObjectVisibility(this);
321 if (IsAlive())
322 setDeathState(DeathState::JustDied, true);
323 RemoveCorpse(false, true);
324}
void setDeathState(DeathState s, bool despawn=false) override
Definition: Creature.cpp:1903
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition: Creature.cpp:346
void DestroyForNearbyPlayers()
Definition: Object.cpp:2898

References WorldObject::DestroyForNearbyPlayers(), Unit::IsAlive(), RemoveCorpse(), and setDeathState().

Referenced by npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::EnterEvadeMode(), npc_marzon_silent_blade::npc_marzon_silent_bladeAI::EnterEvadeMode(), npc_dark_iron_guzzler::FindNextKeg(), Battlefield::HideNpc(), npc_taldaram_flamesphere::MovementInform(), instance_blackrock_spire::instance_blackrock_spireMapScript::OnCreatureCreate(), go_ulduar_tower::OnDestroyed(), go_dragonflayer_cage::OnGossipHello(), npc_valkyr_battle_maiden::npc_valkyr_battle_maidenAI::UpdateAI(), npc_janalai_hatcher::npc_janalai_hatcherAI::UpdateAI(), npc_janalai_hatchling::npc_janalai_hatchlingAI::UpdateAI(), npc_amanitar_mushrooms::UpdateAI(), npc_taldaram_flamesphere::UpdateAI(), npc_swarm_scarab::npc_swarm_scarabAI::UpdateAI(), npc_beryl_sorcerer::npc_beryl_sorcererAI::UpdateAI(), npc_venture_co_straggler::npc_venture_co_stragglerAI::UpdateAI(), npc_tyrion_spybot::npc_tyrion_spybotAI::UpdateAI(), and npc_emily::npc_emilyAI::WaypointReached().

◆ DoFleeToGetAssistance()

void Creature::DoFleeToGetAssistance ( )
998{
999 if (!GetVictim())
1000 return;
1001
1003 return;
1004
1005 float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
1006 if (radius > 0)
1007 {
1008 Creature* creature = nullptr;
1009
1012
1013 Cell::VisitGridObjects(this, searcher, radius);
1014
1016 UpdateSpeed(MOVE_RUN, false);
1017
1018 if (!creature)
1019 //SetFeared(true, GetVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
1020 //TODO: use 31365
1022 else
1023 GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ());
1024 }
1025}
@ UNIT_STATE_FLEEING
Definition: Unit.h:332
@ MOVE_RUN
Definition: Unit.h:379
@ SPELL_AURA_PREVENTS_FLEEING
Definition: SpellAuraDefines.h:155
@ CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS
Definition: IWorld.h:198
void SetNoSearchAssistance(bool val)
Definition: Creature.h:262
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18288
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition: Unit.cpp:14238
Definition: GridNotifiers.h:455
Definition: GridNotifiers.h:1293
void MoveSeekAssistance(float x, float y, float z)
Definition: MotionMaster.cpp:662

References CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetVictim(), Unit::HasAuraType(), MOVE_RUN, MotionMaster::MoveSeekAssistance(), Unit::SetControlled(), SetNoSearchAssistance(), SPELL_AURA_PREVENTS_FLEEING, sWorld, UNIT_STATE_FLEEING, Unit::UpdateSpeed(), and Cell::VisitGridObjects().

Referenced by npc_blackhand_incarcerator::npc_blackhand_incarceratorAI::DamageTaken(), SmartScript::ProcessAction(), and npc_sentinel_infiltrator::UpdateAI().

◆ DoImmediateBoundaryCheck()

void Creature::DoImmediateBoundaryCheck ( )
inline
299{ m_boundaryCheckTime = 0; }

References m_boundaryCheckTime.

Referenced by CreatureAI::SetBoundary().

◆ FocusTarget()

void Creature::FocusTarget ( Spell const *  focusSpell,
WorldObject const *  target 
)
3448{
3449 // already focused
3450 if (_focusSpell)
3451 return;
3452
3453 _focusSpell = focusSpell;
3454
3455 SetGuidValue(UNIT_FIELD_TARGET, this == target ? ObjectGuid::Empty : target->GetGUID());
3456 if (focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_AI_DOESNT_FACE_TARGET))
3458
3459 // Set serverside orientation if needed (needs to be after attribute check)
3460 if (this == target && (movespline->Finalized() || GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE))
3462 else
3463 SetInFront(target);
3464}
@ UNIT_FIELD_TARGET
Definition: UpdateFields.h:92
@ UNIT_STATE_ROTATING
Definition: Unit.h:345
@ CHASE_MOTION_TYPE
Definition: MotionMaster.h:43
@ SPELL_ATTR5_AI_DOESNT_FACE_TARGET
Definition: SharedDefines.h:586
void SetGuidValue(uint16 index, ObjectGuid value)
Definition: Object.cpp:723
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
float GetOrientation() const
Definition: Position.h:120
void SetFacingTo(float ori)
Definition: Unit.cpp:20884
Movement::MoveSpline * movespline
Definition: Unit.h:2454
void SetInFront(WorldObject const *target)
Definition: Unit.cpp:20878
bool Finalized() const
Definition: MoveSpline.h:116

References _focusSpell, Unit::AddUnitState(), CHASE_MOTION_TYPE, ObjectGuid::Empty, Movement::MoveSpline::Finalized(), Object::GetGUID(), Unit::GetMotionMaster(), Position::GetOrientation(), Spell::GetSpellInfo(), SpellInfo::HasAttribute(), Unit::movespline, Unit::SetFacingTo(), Object::SetGuidValue(), Unit::SetInFront(), SPELL_ATTR5_AI_DOESNT_FACE_TARGET, UNIT_FIELD_TARGET, and UNIT_STATE_ROTATING.

Referenced by Spell::prepare().

◆ ForcedDespawn()

void Creature::ForcedDespawn ( uint32  timeMSToDespawn = 0,
Seconds  forcedRespawnTimer = 0s 
)
private
2094{
2095 if (timeMSToDespawn)
2096 {
2097 ForcedDespawnDelayEvent* pEvent = new ForcedDespawnDelayEvent(*this, forceRespawnTimer);
2098 m_Events.AddEvent(pEvent, m_Events.CalculateTime(timeMSToDespawn));
2099 return;
2100 }
2101
2102 if (IsAlive())
2103 setDeathState(DeathState::JustDied, true);
2104
2105 // Xinef: set new respawn time, ignore corpse decay time...
2106 RemoveCorpse(true);
2107
2108 if (forceRespawnTimer > Seconds::zero())
2109 {
2110 if (GetMap())
2111 {
2112 GetMap()->ScheduleCreatureRespawn(GetGUID(), forceRespawnTimer);
2113 }
2114 }
2115}
Definition: Creature.h:523
void ScheduleCreatureRespawn(ObjectGuid, Milliseconds)
Definition: Map.cpp:3700

References EventProcessor::AddEvent(), EventProcessor::CalculateTime(), Object::GetGUID(), WorldObject::GetMap(), Unit::IsAlive(), Unit::m_Events, RemoveCorpse(), Map::ScheduleCreatureRespawn(), and setDeathState().

Referenced by DespawnOrUnsummon().

◆ GetAggroRange()

float Creature::GetAggroRange ( Unit const *  target) const
3296{
3297 // Determines the aggro range for creatures
3298 // Based on data from wowwiki due to lack of 3.3.5a data
3299
3300 float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO);
3301 if (aggroRate == 0)
3302 return 0.0f;
3303
3304 auto creatureLevel = target->getLevelForTarget(this);
3305 auto playerLevel = getLevelForTarget(target);
3306 int32 levelDiff = int32(creatureLevel) - int32(playerLevel);
3307
3308 // The maximum Aggro Radius is capped at 45 yards (25 level difference)
3309 if (levelDiff < -25)
3310 levelDiff = -25;
3311
3312 // The base aggro radius for mob of same level
3313 auto aggroRadius = GetDetectionRange();
3314 if (aggroRadius < 1)
3315 {
3316 return 0.0f;
3317 }
3318 // Aggro Radius varies with level difference at a rate of roughly 1 yard/level
3319 aggroRadius -= (float)levelDiff;
3320
3321 // detect range auras
3323
3324 // detected range auras
3325 aggroRadius += target->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE);
3326
3327 // Just in case, we don't want pets running all over the map
3328 if (aggroRadius > MAX_AGGRO_RADIUS)
3329 aggroRadius = MAX_AGGRO_RADIUS;
3330
3331 // Minimum Aggro Radius for a mob seems to be combat range (5 yards)
3332 // hunter pets seem to ignore minimum aggro radius so we'll default it a little higher
3333 float minRange = IsPet() ? 10.0f : 5.0f;
3334 if (aggroRadius < minRange)
3335 aggroRadius = minRange;
3336
3337 return (aggroRadius * aggroRate);
3338}
#define MAX_AGGRO_RADIUS
Definition: Unit.h:162
@ SPELL_AURA_MOD_DETECTED_RANGE
Definition: SpellAuraDefines.h:215
@ SPELL_AURA_MOD_DETECT_RANGE
Definition: SpellAuraDefines.h:154
@ RATE_CREATURE_AGGRO
Definition: IWorld.h:496
float GetDetectionRange() const
Definition: Creature.h:251
uint8 getLevelForTarget(WorldObject const *target) const override
Definition: Creature.cpp:2941
int32 GetTotalAuraModifier(AuraType auratype) const
Definition: Unit.cpp:5848

References GetDetectionRange(), Unit::getLevelForTarget(), getLevelForTarget(), Unit::GetTotalAuraModifier(), Unit::IsPet(), MAX_AGGRO_RADIUS, RATE_CREATURE_AGGRO, SPELL_AURA_MOD_DETECT_RANGE, SPELL_AURA_MOD_DETECTED_RANGE, and sWorld.

Referenced by CanStartAttack().

◆ GetAIName()

std::string const & Creature::GetAIName ( ) const
2955{
2956 return sObjectMgr->GetCreatureTemplate(GetEntry())->AIName;
2957}
uint32 GetEntry() const
Definition: Object.h:109

References Object::GetEntry(), and sObjectMgr.

Referenced by GetDebugInfo(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcSetDataCommand(), InitializeReactState(), SmartScript::IsSmart(), and UpdateMoveInLineOfSightState().

◆ GetAttackDistance()

float Creature::GetAttackDistance ( Unit const *  player) const
3493{
3494 float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO);
3495
3496 if (aggroRate == 0)
3497 return 0.0f;
3498
3499 if (!player)
3500 return 0.0f;
3501
3502 uint32 playerLevel = player->getLevelForTarget(this);
3503 uint32 creatureLevel = getLevelForTarget(player);
3504
3505 int32 levelDiff = static_cast<int32>(playerLevel) - static_cast<int32>(creatureLevel);
3506
3507 // "The maximum Aggro Radius has a cap of 25 levels under. Example: A level 30 char has the same Aggro Radius of a level 5 char on a level 60 mob."
3508 if (levelDiff < -25)
3509 levelDiff = -25;
3510
3511 // "The aggro radius of a mob having the same level as the player is roughly 20 yards"
3512 float retDistance = 20.0f;
3513
3514 // "Aggro Radius varies with level difference at a rate of roughly 1 yard/level"
3515 // radius grow if playlevel < creaturelevel
3516 retDistance -= static_cast<float>(levelDiff);
3517
3518 if (creatureLevel + 5 <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
3519 {
3520 // detect range auras
3521 retDistance += static_cast<float>( GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE) );
3522
3523 // detected range auras
3524 retDistance += static_cast<float>( player->GetTotalAuraModifier(SPELL_AURA_MOD_DETECTED_RANGE) );
3525 }
3526
3527 // "Minimum Aggro Radius for a mob seems to be combat range (5 yards)"
3528 if (retDistance < 5.0f)
3529 retDistance = 5.0f;
3530
3531 return (retDistance * aggroRate);
3532}
@ CONFIG_MAX_PLAYER_LEVEL
Definition: IWorld.h:236

References CONFIG_MAX_PLAYER_LEVEL, Unit::getLevelForTarget(), getLevelForTarget(), Unit::GetTotalAuraModifier(), RATE_CREATURE_AGGRO, SPELL_AURA_MOD_DETECT_RANGE, SPELL_AURA_MOD_DETECTED_RANGE, and sWorld.

Referenced by WorldObject::CanDetectStealthOf().

◆ GetCombatPulseDelay()

uint32 Creature::GetCombatPulseDelay ( ) const
inline
288{ return m_combatPulseDelay; }

References m_combatPulseDelay.

◆ GetCorpseDelay()

uint32 Creature::GetCorpseDelay ( ) const
inline

◆ GetCreatureAddon()

CreatureAddon const * Creature::GetCreatureAddon ( ) const
2622{
2623 if (m_spawnId)
2624 {
2625 if (CreatureAddon const* addon = sObjectMgr->GetCreatureAddon(m_spawnId))
2626 return addon;
2627 }
2628
2629 // dependent from difficulty mode entry
2630 return sObjectMgr->GetCreatureTemplateAddon(GetCreatureTemplate()->Entry);
2631}
Definition: CreatureData.h:429

References Entry, GetCreatureTemplate(), m_spawnId, and sObjectMgr.

Referenced by boss_grand_champion::boss_grand_championAI::AddCreatureAddonAuras(), wp_commandscript::HandleWpUnLoadCommand(), LoadCreaturesAddon(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::OnCreatureCreate(), and UpdateEntry().

◆ GetCreatureData()

◆ GetCreatureTemplate()

CreatureTemplate const * Creature::GetCreatureTemplate ( ) const
inline
199{ return m_creatureInfo; }

References m_creatureInfo.

Referenced by KillRewarder::_InitXP(), Unit::_IsValidAttackTarget(), AllLootRemovedFromCorpse(), Vehicle::ApplyAllImmunities(), Unit::ApplyDiminishingToDuration(), npc_escortAI::AssistPlayerInCombatAgainst(), FollowerAI::AssistPlayerInCombatAgainst(), SmartAI::AssistPlayerInCombatAgainst(), Unit::Attack(), Player::BuildPetTalentsInfoData(), Unit::BuildValuesUpdate(), CalculateMinMaxDamage(), SpellEffectInfo::CalcValue(), CanIgnoreFeignDeath(), Spell::CheckCast(), SpellInfo::CheckTarget(), Create(), Pet::CreateBaseAtCreature(), boss_high_king_maulgar::DoAction(), Spell::DoSpellHitOnUnit(), Spell::EffectForceDeselect(), Spell::EffectSanctuary(), Spell::EffectSkinning(), Spell::EffectSummonType(), Acore::XP::Gain(), GetCreatureAddon(), Unit::GetCreatureType(), Player::GetDefaultGossipMenuForSource(), GetMovementTemplate(), GetNativeObjectScale(), Pet::GetNativeObjectScale(), Player::GetNPCIfCanInteractWith(), SmartScript::GetScript(), AuraEffect::HandleFeignDeath(), WorldSession::HandleGossipHelloOpcode(), learn_commandscript::HandleLearnAllMyPetTalentsCommand(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcSetFactionIdCommand(), npc_commandscript::HandleNpcTameCommand(), AuraEffect::HandlePeriodicTriggerSpellAuraTick(), WorldSession::HandleQuestgiverHelloOpcode(), ArenaSpectator::HandleResetCommand(), WorldSession::HandleSellItemOpcode(), HasMechanicTemplateImmunity(), Pet::HaveInDiet(), InitEntry(), Pet::InitLevelupSpellsForLevel(), Guardian::InitStatsForLevel(), IsAvoidingAOE(), isCanTrainingAndResetTalentsOf(), IsCivilian(), isElite(), IsGuard(), Player::isHonorOrXPTarget(), IsImmunedToSpellEffect(), Unit::IsInPartyWith(), Unit::IsInRaidWith(), Pet::IsPermanentPetFor(), IsRacialLeader(), Unit::isSpellBlocked(), IsTrigger(), isWorldBoss(), npc_escortAI::JustRespawned(), FollowerAI::JustRespawned(), SmartAI::JustRespawned(), Unit::Kill(), Pet::LearnPetPassives(), Player::LearnPetTalent(), LoadCreatureFromDB(), Pet::LoadPetFromDB(), LoadSpellTemplateImmunity(), Unit::MeleeSpellHitResult(), boss_onyxia::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), npc_hor_leader_second::npc_hor_leader_secondAI::MoveToNextStopPoint(), npc_eye_of_acherus::npc_eye_of_acherus(), npc_scarlet_miner_cart::npc_scarlet_miner_cartAI::npc_scarlet_miner_cartAI(), npc_thrall_old_hillsbrad::OnGossipHello(), npc_artorius::OnGossipHello(), npc_simone::OnGossipHello(), npc_nelson::OnGossipHello(), npc_franklin::OnGossipHello(), npc_taxi::OnGossipHello(), Player::PetSpellInitialize(), Unit::RemoveCharmedBy(), Player::RemovePet(), boss_onyxia::Reset(), boss_sindragosa::boss_sindragosaAI::Reset(), Pet::resetTalents(), Player::RewardReputation(), Unit::RollMeleeOutcomeAgainst(), SaveToDB(), SelectLevel(), Player::SendLoot(), WorldSession::SendPetNameQuery(), WorldSession::SendTrainerList(), Unit::SetCharmedBy(), setDeathState(), npc_tirion_fordring_tft::npc_tirion_fordringAI::sGossipSelect(), npc_harrison_jones::npc_harrison_jonesAI::sGossipSelect(), npc_captured_rageclaw::npc_captured_rageclawAI::SpellHit(), boss_priestess_delrissa::SummonedCreatureDies(), Player::SummonPet(), npc_hor_lich_king::npc_hor_lich_kingAI::UpdateAI(), npc_hor_leader_second::npc_hor_leader_secondAI::UpdateAI(), npc_sinkhole_kill_credit::npc_sinkhole_kill_creditAI::UpdateAI(), npc_pet_gen_valkyr_guardian::UpdateAI(), generic_creature::generic_creatureAI::UpdateAI(), UpdateEntry(), UpdateMovementFlags(), Unit::UpdateSpeed(), and Player::UpdateWeaponSkill().

◆ GetCurrentEquipmentId()

◆ GetCurrentWaypointID()

uint32 Creature::GetCurrentWaypointID ( ) const
inline
343{ return m_waypointID; }

References m_waypointID.

◆ GetDebugInfo()

std::string Creature::GetDebugInfo ( ) const
overridevirtual

Reimplemented from Object.

Reimplemented in TempSummon, Minion, Guardian, and Pet.

3756{
3757 std::stringstream sstr;
3758 sstr << Unit::GetDebugInfo() << "\n"
3759 << "AIName: " << GetAIName() << " ScriptName: " << GetScriptName()
3760 << " WaypointPath: " << GetWaypointPath() << " SpawnId: " << GetSpawnId();
3761 return sstr.str();
3762}
uint32 GetWaypointPath() const
Definition: Creature.h:340
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:67
std::string GetScriptName() const
Definition: Creature.cpp:2959
std::string const & GetAIName() const
Definition: Creature.cpp:2954
std::string GetDebugInfo() const override
Definition: Unit.cpp:21581

References GetAIName(), Unit::GetDebugInfo(), GetScriptName(), GetSpawnId(), and GetWaypointPath().

Referenced by TempSummon::GetDebugInfo(), SetCannotReachTarget(), and Update().

◆ GetDefaultMovementType()

MovementGeneratorType Creature::GetDefaultMovementType ( ) const
inlineoverridevirtual

-------—End of Pet responses methods-------—

Reimplemented from Unit.

87{ return m_defaultMovementType; }

References m_defaultMovementType.

Referenced by LoadHelper(), and SaveToDB().

◆ GetDetectionRange()

float Creature::GetDetectionRange ( ) const
inline
251{ return m_detectionDistance; }

References m_detectionDistance.

Referenced by GetAggroRange().

◆ GetFormation() [1/2]

CreatureGroup * Creature::GetFormation ( )
inline
348{ return m_formation; }

References m_formation.

◆ GetFormation() [2/2]

◆ GetHomePosition() [1/2]

Position const & Creature::GetHomePosition ( ) const
inline
333{ return m_homePosition; }

References m_homePosition.

Referenced by GetRespawnPosition().

◆ GetHomePosition() [2/2]

void Creature::GetHomePosition ( float &  x,
float &  y,
float &  z,
float &  ori 
) const
inline
332{ m_homePosition.GetPosition(x, y, z, ori); }
void GetPosition(float &x, float &y) const
Definition: Position.h:122

References Position::GetPosition(), and m_homePosition.

Referenced by HomeMovementGenerator< Creature >::_setTargetLocation(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::AttackStart(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::AttackStart(), boss_ayamiss::boss_ayamiss(), npc_icc_spire_frostwyrm::CanAIAttack(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::CanAIAttack(), boss_halion::boss_halionAI::CanAIAttack(), boss_attumen::CanMeleeHit(), boss_midnight::CanMeleeHit(), boss_trollgore::boss_trollgoreAI::CheckEvadeIfOutOfCombatArea(), boss_anomalus::boss_anomalusAI::CheckEvadeIfOutOfCombatArea(), boss_gurtogg_bloodboil::boss_gurtogg_bloodboilAI::CheckEvadeIfOutOfCombatArea(), boss_illidan_stormrage::boss_illidan_stormrageAI::CheckEvadeIfOutOfCombatArea(), boss_lady_vashj::CheckEvadeIfOutOfCombatArea(), boss_kaelthas::boss_kaelthasAI::CheckEvadeIfOutOfCombatArea(), boss_onyxia::CheckInRoom(), boss_isle_of_conquest::boss_isle_of_conquestAI::CheckRageBuff(), boss_essence_of_suffering::boss_essence_of_sufferingAI::DamageTaken(), boss_essence_of_desire::boss_essence_of_desireAI::DamageTaken(), boss_taldaram::DoAction(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::DoAction(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::DoAction(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::DoAction(), npc_hor_spiritual_reflection::npc_hor_spiritual_reflectionAI::EnterEvadeMode(), boss_professor_putricide::boss_professor_putricideAI::EnterEvadeMode(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::EnterEvadeMode(), UtherBatteredHiltEvent::Execute(), DistractMovementGenerator::Finalize(), npc_arthas_teleport_visual::GetAI(), boss_prince_keleseth_icc::boss_prince_kelesethAI::InitializeAI(), boss_prince_taldaram_icc::boss_prince_taldaramAI::InitializeAI(), boss_prince_valanar_icc::boss_prince_valanarAI::InitializeAI(), npc_sindragosa_trash::npc_sindragosa_trashAI::InitializeAI(), boss_halion::boss_halionAI::IsAnyPlayerValid(), boss_loatheb::boss_loathebAI::IsInRoom(), boss_algalon_the_observer::boss_algalon_the_observerAI::IsInRoom(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustDied(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustDied(), boss_prince_valanar_icc::boss_prince_valanarAI::JustDied(), boss_balinda::JustEngagedWith(), boss_the_black_stalker::JustEngagedWith(), boss_professor_putricide::boss_professor_putricideAI::JustEngagedWith(), boss_rotface::boss_rotfaceAI::JustEngagedWith(), npc_daphne_stilwell::npc_daphne_stilwellAI::JustSummoned(), npc_mageguard_dalaran::npc_mageguard_dalaranAI::MoveInLineOfSight(), boss_lady_vashj::MovementInform(), npc_dragonflayer_forge_master::npc_dragonflayer_forge_masterAI::npc_dragonflayer_forge_masterAI(), npc_icc_vengeful_fleshreaper::npc_icc_vengeful_fleshreaperAI::npc_icc_vengeful_fleshreaperAI(), instance_ulduar::instance_ulduar_InstanceMapScript::OnCreatureCreate(), instance_the_black_morass::instance_the_black_morass_InstanceMapScript::OnCreatureRemove(), spell_halion_twilight_phasing::spell_halion_twilight_phasing_SpellScript::Phase(), SmartScript::ProcessAction(), boss_four_horsemen::boss_four_horsemenAI::Reset(), boss_thaddius::boss_thaddiusAI::Reset(), npc_q24545_lich_king::npc_q24545_lich_kingAI::Reset(), boss_nexusprince_shaffar::Reset(), boss_lady_vashj::Reset(), SmartAI::ReturnToLastOOCPos(), npc_escortAI::ReturnToLastPoint(), instance_naxxramas::instance_naxxramas_InstanceMapScript::SetBossState(), Player::SetClientControl(), npc_alexstraza_the_lifebinder::SetData(), npc_pet_gen_fetch_ball::SpellHitTarget(), npc_av_marshal_or_warmaster::npc_av_marshal_or_warmasterAI::UpdateAI(), boss_drekthar::boss_drektharAI::UpdateAI(), boss_galvangar::boss_galvangarAI::UpdateAI(), boss_vanndar::boss_vanndarAI::UpdateAI(), npc_blackhand_incarcerator::npc_blackhand_incarceratorAI::UpdateAI(), boss_broodlord::boss_broodlordAI::UpdateAI(), boss_priestess_delrissa::UpdateAI(), npc_scarlet_cannon::npc_scarlet_cannonAI::UpdateAI(), boss_kalecgos::boss_kalecgosAI::UpdateAI(), npc_alexstraza_the_lifebinder::UpdateAI(), boss_elder_nadox::UpdateAI(), boss_frostsworn_general::boss_frostsworn_generalAI::UpdateAI(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::UpdateAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_thaddius_summon::boss_thaddius_summonAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_bloodmage_laurith::npc_bloodmage_laurithAI::UpdateAI(), and boss_kaelthas::boss_kaelthasAI::UpdateAI().

◆ GetLastDamagedTime()

time_t Creature::GetLastDamagedTime ( ) const
3588{
3589 if (!_lastDamagedTime)
3590 return time_t(0);
3591
3592 return *_lastDamagedTime;
3593}

References _lastDamagedTime.

Referenced by CanCreatureAttack().

◆ GetLastDamagedTimePtr()

std::shared_ptr< time_t > const & Creature::GetLastDamagedTimePtr ( ) const
3596{
3597 return _lastDamagedTime;
3598}

References _lastDamagedTime.

Referenced by AssistDelayEvent::Execute().

◆ getLevelForTarget()

uint8 Creature::getLevelForTarget ( WorldObject const *  target) const
overridevirtual

Reimplemented from WorldObject.

2942{
2943 if (!isWorldBoss() || !target->ToUnit())
2944 return Unit::getLevelForTarget(target);
2945
2946 uint16 level = target->ToUnit()->GetLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
2947 if (level < 1)
2948 return 1;
2949 if (level > 255)
2950 return 255;
2951 return uint8(level);
2952}
std::uint16_t uint16
Definition: Define.h:109
@ CONFIG_WORLD_BOSS_LEVEL_DIFF
Definition: IWorld.h:286
uint8 getLevelForTarget(WorldObject const *) const override
Definition: Unit.h:1433

References CONFIG_WORLD_BOSS_LEVEL_DIFF, Unit::GetLevel(), Unit::getLevelForTarget(), isWorldBoss(), sWorld, and Object::ToUnit().

Referenced by GetAggroRange(), and GetAttackDistance().

◆ GetLootMode()

uint16 Creature::GetLootMode ( ) const
inline

◆ GetLootRecipient()

◆ GetLootRecipientGroup()

Group * Creature::GetLootRecipientGroup ( ) const
1252{
1254 return nullptr;
1255 return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
1256}
#define sGroupMgr
Definition: GroupMgr.h:51

References m_lootRecipientGroup, and sGroupMgr.

Referenced by SmartScript::GetTargets(), Player::isAllowedToLoot(), isTappedBy(), Unit::Kill(), and Player::SendLoot().

◆ GetLootRecipientGroupGUID()

ObjectGuid::LowType Creature::GetLootRecipientGroupGUID ( ) const
inline

◆ GetLootRecipientGUID()

ObjectGuid Creature::GetLootRecipientGUID ( ) const
inline

◆ GetMeleeDamageSchoolMask()

SpellSchoolMask Creature::GetMeleeDamageSchoolMask ( WeaponAttackType  = BASE_ATTACK,
uint8  = 0 
) const
inlineoverridevirtual

Implements Unit.

160{ return m_meleeDamageSchoolMask; }

References m_meleeDamageSchoolMask.

Referenced by ThreatContainer::SelectNextVictim().

◆ GetMovementTemplate()

◆ GetNameForLocaleIdx()

std::string const & Creature::GetNameForLocaleIdx ( LocaleConstant  locale_idx) const
overridevirtual

Reimplemented from WorldObject.

3057{
3058 if (loc_idx != DEFAULT_LOCALE)
3059 {
3060 uint8 uloc_idx = uint8(loc_idx);
3061 CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(GetEntry());
3062 if (cl)
3063 {
3064 if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
3065 return cl->Name[uloc_idx];
3066 }
3067 }
3068
3069 return GetName();
3070}
#define DEFAULT_LOCALE
Definition: Common.h:81
Definition: CreatureData.h:332
std::vector< std::string > Name
Definition: CreatureData.h:333
std::string const & GetName() const
Definition: Object.h:446

References DEFAULT_LOCALE, Object::GetEntry(), WorldObject::GetName(), CreatureLocale::Name, and sObjectMgr.

Referenced by Pet::CreateBaseAtCreature(), and WorldSession::SendPetNameQuery().

◆ GetNativeObjectScale()

float Creature::GetNativeObjectScale ( ) const
overridevirtual

Reimplemented from Unit.

Reimplemented in Pet.

3399{
3400 return GetCreatureTemplate()->scale;
3401}
float scale
Definition: CreatureData.h:198

References GetCreatureTemplate(), and CreatureTemplate::scale.

Referenced by Pet::GetNativeObjectScale(), InitEntry(), and Guardian::InitStatsForLevel().

◆ GetOriginalEntry()

uint32 Creature::GetOriginalEntry ( ) const
inline

◆ GetOriginalEquipmentId()

◆ GetPetAutoSpellOnPos()

virtual uint32 Creature::GetPetAutoSpellOnPos ( uint8  pos) const
inlinevirtual

Reimplemented in Pet.

316 {
318 return 0;
319 else
320 return m_charmInfo->GetCharmSpell(pos)->GetAction();
321 }
#define MAX_SPELL_CHARM
Definition: Unit.h:157
@ ACT_ENABLED
Definition: Unit.h:1027
ActiveStates GetType() const
Definition: Unit.h:1059
uint32 GetAction() const
Definition: Unit.h:1060
CharmSpellInfo * GetCharmSpell(uint8 index)
Definition: Unit.h:1137
CharmInfo * m_charmInfo
Definition: Unit.h:2536

References ACT_ENABLED, UnitActionBarEntry::GetAction(), CharmInfo::GetCharmSpell(), UnitActionBarEntry::GetType(), Unit::m_charmInfo, and MAX_SPELL_CHARM.

Referenced by PetAI::_canMeleeAttack(), and PetAI::UpdateAI().

◆ GetPetAutoSpellSize()

virtual uint8 Creature::GetPetAutoSpellSize ( ) const
inlinevirtual

Reimplemented in Pet.

314{ return MAX_SPELL_CHARM; }

References MAX_SPELL_CHARM.

Referenced by PetAI::_canMeleeAttack(), and PetAI::UpdateAI().

◆ GetPlayerDamageReq()

uint32 Creature::GetPlayerDamageReq ( ) const
3724{
3725 return _playerDamageReq;
3726}

References _playerDamageReq.

Referenced by Acore::XP::Gain().

◆ GetRandomId()

uint32 Creature::GetRandomId ( uint32  id1,
uint32  id2,
uint32  id3 
)
3636{
3637 uint32 id = id1;
3638 uint8 ids = 0;
3639
3640 if (id2)
3641 {
3642 ++ids;
3643 if (id3) ++ids;
3644 }
3645
3646 if (ids)
3647 {
3648 uint8 idNumber = urand(0, ids);
3649 switch (idNumber)
3650 {
3651 case 0:
3652 id = id1;
3653 break;
3654 case 1:
3655 id = id2;
3656 break;
3657 case 2:
3658 id = id3;
3659 break;
3660 }
3661 }
3662 return id;
3663}
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44

References urand().

Referenced by LoadCreatureFromDB(), and Respawn().

◆ GetReactState()

ReactStates Creature::GetReactState ( ) const
inline
91{ return m_reactState; }

References m_reactState.

Referenced by boss_shade_of_aran::AttackStart(), boss_kiljaeden::boss_kiljaedenAI::AttackStart(), boss_icehowl::boss_icehowlAI::AttackStart(), boss_the_lurker_below::AttackStart(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::CanAIAttack(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::CanAIAttack(), npc_lk_wicked_spirit::npc_lk_wicked_spiritAI::CanAIAttack(), SmartAI::CanAIAttack(), boss_renataki::boss_renatakiAI::CanAlwaysBeDetectable(), boss_renataki::boss_renatakiAI::CanBeSeen(), boss_renataki::boss_renatakiAI::CanSeeAlways(), CharmInfo::CharmInfo(), Player::CharmSpellInitialize(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::DamageTaken(), npc_ulduar_vx001::npc_ulduar_vx001AI::DamageTaken(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::DamageTaken(), boss_shade_of_aran::DamageTaken(), boss_brutallus::boss_brutallusAI::DamageTaken(), boss_kiljaeden::boss_kiljaedenAI::EnterEvadeMode(), Pet::FillPetInfo(), boss_ick::boss_ickAI::KilledUnit(), npc_chesspiece::OnCharmed(), npc_scarlet_ghoul::npc_scarlet_ghoulAI::OwnerAttackedBy(), Player::PetSpellInitialize(), npc_imprisoned_beryl_sorcerer::npc_imprisoned_beryl_sorcererAI::Reset(), Pet::SavePetToDB(), boss_kiljaeden::boss_kiljaedenAI::UpdateAI(), boss_renataki::boss_renatakiAI::UpdateAI(), boss_viscidus::UpdateAI(), boss_icehowl::boss_icehowlAI::UpdateAI(), npc_gunship_boarding_leader::npc_gunship_boarding_leaderAI::UpdateAI(), npc_gunship_boarding_add::npc_gunship_boarding_add_realAI::UpdateAI(), npc_gunship_mage::npc_gunship_mageAI::UpdateAI(), npc_gunship_gunner::npc_gunship_gunnerAI::UpdateAI(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI(), boss_lady_vashj::UpdateAI(), boss_leotheras_the_blind::UpdateAI(), boss_the_lurker_below::UpdateAI(), npc_gunship_rocketeer::npc_gunship_rocketeerAI::UpdateAI(), InstanceScript::UpdateMinionState(), and Player::VehicleSpellInitialize().

◆ GetRespawnDelay()

◆ GetRespawnPosition()

void Creature::GetRespawnPosition ( float &  x,
float &  y,
float &  z,
float *  ori = nullptr,
float *  dist = nullptr 
) const
2862{
2863 if (m_spawnId)
2864 {
2865 if (CreatureData const* data = sObjectMgr->GetCreatureData(m_spawnId))
2866 {
2867 x = data->posX;
2868 y = data->posY;
2869 z = data->posZ;
2870 if (ori)
2871 *ori = data->orientation;
2872 if (dist)
2873 *dist = data->wander_distance;
2874
2875 return;
2876 }
2877 }
2878
2879 // xinef: changed this from current position to home position, fixes world summons with infinite duration
2880 if (GetTransport())
2881 {
2882 x = GetPositionX();
2883 y = GetPositionY();
2884 z = GetPositionZ();
2885 if (ori)
2886 *ori = GetOrientation();
2887 }
2888 else
2889 {
2891 x = homePos.GetPositionX();
2892 y = homePos.GetPositionY();
2893 z = homePos.GetPositionZ();
2894 if (ori)
2895 *ori = homePos.GetOrientation();
2896 }
2897 if (dist)
2898 *dist = 0;
2899}
Position const homePos
Definition: boss_chromaggus.cpp:72
Position const & GetHomePosition() const
Definition: Creature.h:333
Definition: CreatureData.h:359
Transport * GetTransport() const
Definition: Object.h:585
Definition: Position.h:28

References GetHomePosition(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), WorldObject::GetTransport(), homePos, m_spawnId, and sObjectMgr.

Referenced by RemoveCorpse(), and npc_escortAI::UpdateAI().

◆ GetRespawnTime()

time_t const & Creature::GetRespawnTime ( ) const
inline

◆ GetRespawnTimeEx()

time_t Creature::GetRespawnTimeEx ( ) const
2852{
2853 time_t now = GameTime::GetGameTime().count();
2854
2855 if (m_respawnTime > now)
2856 return m_respawnTime;
2857 else
2858 return now;
2859}

References GameTime::GetGameTime(), and m_respawnTime.

Referenced by npc_commandscript::HandleNpcInfoCommand().

◆ GetScriptId()

◆ GetScriptName()

std::string Creature::GetScriptName ( ) const

◆ GetShieldBlockValue()

uint32 Creature::GetShieldBlockValue ( ) const
inlineoverridevirtual

Implements Unit.

156 {
157 return (GetLevel() / 2 + uint32(GetStat(STAT_STRENGTH) / 20));
158 }
@ STAT_STRENGTH
Definition: SharedDefines.h:258
float GetStat(Stats stat) const
Definition: Unit.h:1444
uint8 GetLevel() const
Definition: Unit.h:1432

References Unit::GetLevel(), Unit::GetStat(), and STAT_STRENGTH.

◆ GetSpawnId()

ObjectGuid::LowType Creature::GetSpawnId ( ) const
inline
67{ return m_spawnId; }

References m_spawnId.

Referenced by BattlegroundAV::AddAVCreature(), CreatureGroup::AddMember(), Vehicle::ApplyAllImmunities(), boss_ghazan::DoAction(), RandomMovementGenerator< T >::DoInitialize(), GetDebugInfo(), CreatureGroup::GetNewTargetForMember(), GameEventMgr::GetNPCFlag(), SmartScript::GetScript(), WorldSession::HandleAuctionSellItem(), debug_commandscript::HandleDebugGetLootRecipientCommand(), OPvPCapturePointZM_GraveYard::HandleGossipOption(), npc_commandscript::HandleNpcAddCommand(), npc_commandscript::HandleNpcAddFormationCommand(), npc_commandscript::HandleNpcGuidCommand(), npc_commandscript::HandleNpcInfoCommand(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcSetLinkCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetSpawnTimeCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), wp_commandscript::HandleWpLoadCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), wp_commandscript::HandleWpUnLoadCommand(), npc_eastvale_peasent::Initialize(), npc_spinestalker::npc_spinestalkerAI::InitializeAI(), npc_rimefang::npc_rimefangAI::InitializeAI(), npc_sindragosa_trash::npc_sindragosa_trashAI::InitializeAI(), npc_risen_archmage::npc_risen_archmageAI::JustEngagedWith(), npc_spinestalker::npc_spinestalkerAI::JustRespawned(), npc_rimefang::npc_rimefangAI::JustRespawned(), npc_sindragosa_trash::npc_sindragosa_trashAI::JustRespawned(), CreatureGroup::MemberEngagingTarget(), CreatureGroup::MemberEvaded(), instance_sunken_temple::instance_sunken_temple_InstanceMapScript::OnCreatureCreate(), instance_sunwell_plateau::instance_sunwell_plateau_InstanceMapScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), RisenArchmageCheck::operator()(), ValithriaDespawner::operator()(), DoorsGuidCheck::operator()(), FormationMgr::RemoveCreatureFromGroup(), npc_ahnqiraji_critter::Reset(), Respawn(), SearchFormation(), boss_kaelthas::boss_kaelthasAI::SummonedCreatureDies(), and npc_risen_archmage::npc_risen_archmageAI::UpdateAI().

◆ GetSpellCooldown()

uint32 Creature::GetSpellCooldown ( uint32  spell_id) const
2828{
2829 CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spell_id);
2830 if (itr == m_CreatureSpellCooldowns.end())
2831 return 0;
2832
2833 return itr->second.end > GameTime::GetGameTimeMS().count() ? itr->second.end - GameTime::GetGameTimeMS().count() : 0;
2834}

References GameTime::GetGameTimeMS(), and m_CreatureSpellCooldowns.

◆ GetSpellDamageMod()

float Creature::GetSpellDamageMod ( int32  Rank)
1550{
1551 switch (Rank) // define rates for each elite rank
1552 {
1563 default:
1565 }
1566}
@ RATE_CREATURE_NORMAL_SPELLDAMAGE
Definition: IWorld.h:491
@ RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE
Definition: IWorld.h:492
@ RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE
Definition: IWorld.h:493
@ RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE
Definition: IWorld.h:494
@ RATE_CREATURE_ELITE_RARE_SPELLDAMAGE
Definition: IWorld.h:495

References CREATURE_ELITE_ELITE, CREATURE_ELITE_NORMAL, CREATURE_ELITE_RARE, CREATURE_ELITE_RAREELITE, CREATURE_ELITE_WORLDBOSS, RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE, RATE_CREATURE_ELITE_RARE_SPELLDAMAGE, RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE, RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE, RATE_CREATURE_NORMAL_SPELLDAMAGE, and sWorld.

Referenced by Unit::SpellDamageBonusDone().

◆ GetSummonerGUID()

ObjectGuid Creature::GetSummonerGUID ( ) const

Helper to get the creature's summoner GUID, if it is a summon.

3747{
3748 if (TempSummon const* temp = ToTempSummon())
3749 return temp->GetSummonerGUID();
3750
3751 LOG_DEBUG("entities.unit", "Creature::GetSummonerGUID() called by creature that is not a summon. Creature: {} ({})", GetEntry(), GetName());
3752 return ObjectGuid::Empty;
3753}

References ObjectGuid::Empty, Object::GetEntry(), WorldObject::GetName(), LOG_DEBUG, and Unit::ToTempSummon().

Referenced by npc_inner_demon::CanAIAttack(), npc_inner_demon::CanReceiveDamage(), npc_inner_demon::JustDied(), npc_collapsing_star::npc_collapsing_starAI::JustSummoned(), and npc_algalon_worm_hole::npc_algalon_worm_holeAI::JustSummoned().

◆ GetTrainerSpells()

TrainerSpellData const * Creature::GetTrainerSpells ( ) const
3051{
3052 return sObjectMgr->GetNpcTrainerSpells(GetEntry());
3053}

References Object::GetEntry(), and sObjectMgr.

Referenced by WorldSession::HandleTrainerBuySpellOpcode(), and WorldSession::SendTrainerList().

◆ GetTransportHomePosition() [1/2]

Position const & Creature::GetTransportHomePosition ( ) const
inline

◆ GetTransportHomePosition() [2/2]

void Creature::GetTransportHomePosition ( float &  x,
float &  y,
float &  z,
float &  ori 
) const
inline

◆ GetVendorItemCurrentCount()

uint32 Creature::GetVendorItemCurrentCount ( VendorItem const *  vItem)
2979{
2980 if (!vItem->maxcount)
2981 return vItem->maxcount;
2982
2983 VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
2984 for (; itr != m_vendorItemCounts.end(); ++itr)
2985 if (itr->itemId == vItem->item)
2986 break;
2987
2988 if (itr == m_vendorItemCounts.end())
2989 return vItem->maxcount;
2990
2991 VendorItemCount* vCount = &*itr;
2992
2993 time_t ptime = GameTime::GetGameTime().count();
2994
2995 if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime)
2996 {
2997 ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(vItem->item);
2998
2999 uint32 diff = uint32((ptime - vCount->lastIncrementTime) / vItem->incrtime);
3000 if ((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount)
3001 {
3002 m_vendorItemCounts.erase(itr);
3003 return vItem->maxcount;
3004 }
3005
3006 vCount->count += diff * pProto->BuyCount;
3007 vCount->lastIncrementTime = ptime;
3008 }
3009
3010 return vCount->count;
3011}
Definition: CreatureData.h:485
time_t lastIncrementTime
Definition: CreatureData.h:490
uint32 count
Definition: CreatureData.h:489
Definition: ItemTemplate.h:628
uint32 BuyCount
Definition: ItemTemplate.h:638

References ItemTemplate::BuyCount, VendorItemCount::count, GameTime::GetGameTime(), VendorItem::incrtime, VendorItem::item, VendorItemCount::lastIncrementTime, m_vendorItemCounts, VendorItem::maxcount, and sObjectMgr.

Referenced by Player::BuyItemFromVendorSlot(), and WorldSession::SendListInventory().

◆ GetVendorItems()

VendorItemData const * Creature::GetVendorItems ( ) const
2974{
2975 return sObjectMgr->GetNpcVendorItemList(GetEntry());
2976}

References Object::GetEntry(), and sObjectMgr.

Referenced by Player::BuyItemFromVendorSlot(), and WorldSession::SendListInventory().

◆ GetWanderDistance()

float Creature::GetWanderDistance ( ) const
inline

◆ GetWaypointPath()

◆ hasInvolvedQuest()

bool Creature::hasInvolvedQuest ( uint32  quest_id) const
overridevirtual

Reimplemented from Object.

1780{
1781 QuestRelationBounds qir = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(GetEntry());
1782 for (QuestRelations::const_iterator itr = qir.first; itr != qir.second; ++itr)
1783 {
1784 if (itr->second == quest_id)
1785 return true;
1786 }
1787 return false;
1788}
std::pair< QuestRelations::const_iterator, QuestRelations::const_iterator > QuestRelationBounds
Definition: ObjectMgr.h:519

References Object::GetEntry(), and sObjectMgr.

◆ HasLootMode()

bool Creature::HasLootMode ( uint16  lootMode) const
inline
235{ return m_LootMode & lootMode; }

References m_LootMode.

◆ hasLootRecipient()

◆ HasMechanicTemplateImmunity()

bool Creature::HasMechanicTemplateImmunity ( uint32  mask) const
2156{
2158}
uint32 MechanicImmuneMask
Definition: CreatureData.h:237
bool IsPlayer() const
Definition: ObjectGuid.h:170
ObjectGuid GetOwnerGUID() const
Definition: Unit.h:1828

References GetCreatureTemplate(), Unit::GetOwnerGUID(), ObjectGuid::IsPlayer(), and CreatureTemplate::MechanicImmuneMask.

Referenced by Unit::HandleProcTriggerSpell(), IsImmunedToSpell(), IsImmunedToSpellEffect(), and Unit::UpdateSpeed().

◆ hasQuest()

bool Creature::hasQuest ( uint32  quest_id) const
overridevirtual

Reimplemented from Object.

1769{
1770 QuestRelationBounds qr = sObjectMgr->GetCreatureQuestRelationBounds(GetEntry());
1771 for (QuestRelations::const_iterator itr = qr.first; itr != qr.second; ++itr)
1772 {
1773 if (itr->second == quest_id)
1774 return true;
1775 }
1776 return false;
1777}

References Object::GetEntry(), and sObjectMgr.

◆ HasReactState()

◆ HasSearchedAssistance()

bool Creature::HasSearchedAssistance ( )
inline

References m_AlreadySearchedAssistance.

Referenced by setDeathState().

◆ HasSpell()

bool Creature::HasSpell ( uint32  spellID) const
overridevirtual

Reimplemented from Unit.

Reimplemented in Pet.

2843{
2844 uint8 i;
2845 for (i = 0; i < MAX_CREATURE_SPELLS; ++i)
2846 if (spellID == m_spells[i])
2847 break;
2848 return i < MAX_CREATURE_SPELLS; //broke before end of iteration of known spells
2849}

References m_spells, and MAX_CREATURE_SPELLS.

Referenced by WorldSession::HandleCastSpellOpcode().

◆ HasSpellCooldown()

bool Creature::HasSpellCooldown ( uint32  spell_id) const
overridevirtual

◆ HasSpellFocus()

bool Creature::HasSpellFocus ( Spell const *  focusSpell = nullptr) const
3467{
3468 if (isDead()) // dead creatures cannot focus
3469 {
3470 return false;
3471 }
3472
3473 return focusSpell ? (focusSpell == _spellFocusInfo.Spell) : (_spellFocusInfo.Spell || _spellFocusInfo.Delay);
3474}
struct Creature::@218 _spellFocusInfo
bool isDead() const
Definition: Unit.h:1824

References _spellFocusInfo, and Unit::isDead().

Referenced by IsMovementPreventedByCasting().

◆ HasSwimmingFlagOutOfCombat()

bool Creature::HasSwimmingFlagOutOfCombat ( ) const
inline

◆ InitEntry()

bool Creature::InitEntry ( uint32  Entry,
const CreatureData data = nullptr 
)
protected

change the entry of creature until respawn

385{
386 CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
387 if (!normalInfo)
388 {
389 LOG_ERROR("sql.sql", "Creature::InitEntry creature entry {} does not exist.", Entry);
390 return false;
391 }
392
393 // get difficulty 1 mode entry
394 // Xinef: Skip for pets!
395 CreatureTemplate const* cinfo = normalInfo;
396 for (uint8 diff = uint8(GetMap()->GetSpawnMode()); diff > 0 && !IsPet();)
397 {
398 // we already have valid Map pointer for current creature!
399 if (normalInfo->DifficultyEntry[diff - 1])
400 {
401 cinfo = sObjectMgr->GetCreatureTemplate(normalInfo->DifficultyEntry[diff - 1]);
402 if (cinfo)
403 break; // template found
404
405 // check and reported at startup, so just ignore (restore normalInfo)
406 cinfo = normalInfo;
407 }
408
409 // for instances heroic to normal, other cases attempt to retrieve previous difficulty
410 if (diff >= RAID_DIFFICULTY_10MAN_HEROIC && GetMap()->IsRaid())
411 diff -= 2; // to normal raid difficulty cases
412 else
413 --diff;
414 }
415
416 SetEntry(Entry); // normal entry always
417 m_creatureInfo = cinfo; // map mode related always
418
419 // equal to player Race field, but creature does not have race
421
422 // known valid are: CLASS_WARRIOR, CLASS_PALADIN, CLASS_ROGUE, CLASS_MAGE
424
425 // Cancel load if no model defined
426 if (!(cinfo->GetFirstValidModelId()))
427 {
428 LOG_ERROR("sql.sql", "Creature (Entry: {}) has no model defined in table `creature_template`, can't load. ", Entry);
429 return false;
430 }
431
433 if (!sObjectMgr->GetCreatureModelRandomGender(&displayID)) // Cancel load if no model defined
434 {
435 LOG_ERROR("sql.sql", "Creature (Entry: {}) has no model defined in table `creature_template`, can't load. ", Entry);
436 return false;
437 }
438
439 SetDisplayId(displayID);
440 SetNativeDisplayId(displayID);
441
442 // Load creature equipment
443 if (!data)
444 {
445 LoadEquipment(); // use default from the template
446 }
447 else if (data->equipmentId == 0)
448 {
449 LoadEquipment(0); // 0 means no equipment for creature table
450 }
451 else
452 {
455 }
456
457 SetName(normalInfo->Name); // at normal entry always
458
460
462 SetSpeed(MOVE_RUN, cinfo->speed_run);
465
466 // Will set UNIT_FIELD_BOUNDINGRADIUS and UNIT_FIELD_COMBATREACH
468
470
471 // checked at loading
475
476 for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
478
479 return true;
480}
@ UNIT_FIELD_BYTES_0
Definition: UpdateFields.h:95
@ UNIT_MOD_CAST_SPEED
Definition: UpdateFields.h:137
@ UNIT_FIELD_HOVERHEIGHT
Definition: UpdateFields.h:173
@ MOVE_FLIGHT
Definition: Unit.h:384
@ MOVE_SWIM
Definition: Unit.h:381
@ MOVE_WALK
Definition: Unit.h:378
MovementGeneratorType
Definition: MotionMaster.h:36
@ RANDOM_MOTION_TYPE
Definition: MotionMaster.h:38
void SetObjectScale(float scale) override
Definition: Creature.cpp:3403
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1746
float GetNativeObjectScale() const override
Definition: Creature.cpp:3398
uint32 GetFirstValidModelId() const
Definition: Creature.cpp:132
float speed_run
Definition: CreatureData.h:194
std::string Name
Definition: CreatureData.h:184
uint32 spells[MAX_CREATURE_SPELLS]
Definition: CreatureData.h:221
float speed_swim
Definition: CreatureData.h:195
uint32 MovementType
Definition: CreatureData.h:227
uint32 unit_class
Definition: CreatureData.h:206
float speed_walk
Definition: CreatureData.h:193
float HoverHeight
Definition: CreatureData.h:229
float speed_flight
Definition: CreatureData.h:196
int8 equipmentId
Definition: CreatureData.h:367
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition: Object.cpp:750
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:737
void SetEntry(uint32 entry)
Definition: Object.h:110
void SetName(std::string const &newname)
Definition: Object.h:447
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14414
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition: ObjectMgr.cpp:1726

References ObjectMgr::ChooseDisplayId(), CreatureTemplate::DifficultyEntry, Entry, CreatureData::equipmentId, GetCreatureTemplate(), CreatureTemplate::GetFirstValidModelId(), WorldObject::GetMap(), GetNativeObjectScale(), CreatureTemplate::HoverHeight, IDLE_MOTION_TYPE, Unit::IsPet(), Map::IsRaid(), LoadEquipment(), LOG_ERROR, m_creatureInfo, m_defaultMovementType, m_originalEquipmentId, m_spells, m_wanderDistance, MAX_CREATURE_SPELLS, MOVE_FLIGHT, MOVE_RUN, MOVE_SWIM, MOVE_WALK, CreatureTemplate::MovementType, CreatureTemplate::Name, RAID_DIFFICULTY_10MAN_HEROIC, RANDOM_MOTION_TYPE, Object::SetByteValue(), SetDisplayId(), Object::SetEntry(), Object::SetFloatValue(), WorldObject::SetName(), Unit::SetNativeDisplayId(), SetObjectScale(), Unit::SetSpeed(), sObjectMgr, CreatureTemplate::speed_flight, CreatureTemplate::speed_run, CreatureTemplate::speed_swim, CreatureTemplate::speed_walk, CreatureTemplate::spells, CreatureTemplate::unit_class, UNIT_FIELD_BYTES_0, UNIT_FIELD_HOVERHEIGHT, and UNIT_MOD_CAST_SPEED.

Referenced by Pet::Create(), and UpdateEntry().

◆ InitializeReactState()

void Creature::InitializeReactState ( )
2146{
2147 if ((IsTotem() || IsTrigger() || IsCritter() || IsSpiritService()) && GetAIName() != "SmartAI" && !GetScriptId())
2149 else
2151 /*else if (IsCivilian())
2152 SetReactState(REACT_DEFENSIVE);*/
2153}
@ REACT_PASSIVE
Definition: Unit.h:1035
bool IsTrigger() const
Definition: Creature.h:77
void SetReactState(ReactStates st)
Definition: Creature.h:90
bool IsCritter() const
Definition: Unit.h:1688
bool IsSpiritService() const
Definition: Unit.h:1687

References GetAIName(), GetScriptId(), Unit::IsCritter(), Unit::IsSpiritService(), Unit::IsTotem(), IsTrigger(), REACT_AGGRESSIVE, REACT_PASSIVE, and SetReactState().

Referenced by spell_gen_feign_death_all_flags::HandleEffectRemove(), spell_gen_feign_death_no_dyn_flag::HandleEffectRemove(), spell_gen_feign_death_no_prevent_emotes::HandleEffectRemove(), Respawn(), and UpdateEntry().

◆ IsAlwaysDetectableFor()

bool Creature::IsAlwaysDetectableFor ( WorldObject const *  seer) const
overrideprotectedvirtual

Reimplemented from WorldObject.

1842{
1844 {
1845 return true;
1846 }
1847
1848 if (IsAIEnabled && AI()->CanAlwaysBeDetectable(seer))
1849 {
1850 return true;
1851 }
1852
1853 return false;
1854}
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
Definition: Unit.cpp:14202

References AI(), Unit::IsAIEnabled, and Unit::IsAlwaysDetectableFor().

◆ IsAvoidingAOE()

◆ isCanInteractWithBattleMaster()

bool Creature::isCanInteractWithBattleMaster ( Player player,
bool  msg 
) const
1156{
1157 if (!IsBattleMaster())
1158 return false;
1159
1160 BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(GetEntry());
1161 if (!msg)
1162 return player->GetBGAccessByLevel(bgTypeId);
1163
1164 if (!player->GetBGAccessByLevel(bgTypeId))
1165 {
1166 ClearGossipMenuFor(player);
1167 switch (bgTypeId)
1168 {
1169 case BATTLEGROUND_AV:
1170 SendGossipMenuFor(player, 7616, this);
1171 break;
1172 case BATTLEGROUND_WS:
1173 SendGossipMenuFor(player, 7599, this);
1174 break;
1175 case BATTLEGROUND_AB:
1176 SendGossipMenuFor(player, 7642, this);
1177 break;
1178 case BATTLEGROUND_EY:
1179 case BATTLEGROUND_NA:
1180 case BATTLEGROUND_BE:
1181 case BATTLEGROUND_AA:
1182 case BATTLEGROUND_RL:
1183 case BATTLEGROUND_SA:
1184 case BATTLEGROUND_DS:
1185 case BATTLEGROUND_RV:
1186 SendGossipMenuFor(player, 10024, this);
1187 break;
1188 default:
1189 break;
1190 }
1191 return false;
1192 }
1193 return true;
1194}
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:188
BattlegroundTypeId
Definition: SharedDefines.h:3479
@ BATTLEGROUND_AA
Definition: SharedDefines.h:3486
@ BATTLEGROUND_WS
Definition: SharedDefines.h:3482
@ BATTLEGROUND_EY
Definition: SharedDefines.h:3487
@ BATTLEGROUND_AV
Definition: SharedDefines.h:3481
@ BATTLEGROUND_BE
Definition: SharedDefines.h:3485
@ BATTLEGROUND_RV
Definition: SharedDefines.h:3491
@ BATTLEGROUND_NA
Definition: SharedDefines.h:3484
@ BATTLEGROUND_DS
Definition: SharedDefines.h:3490
@ BATTLEGROUND_SA
Definition: SharedDefines.h:3489
@ BATTLEGROUND_AB
Definition: SharedDefines.h:3483
@ BATTLEGROUND_RL
Definition: SharedDefines.h:3488
bool GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
Definition: Player.cpp:12239
bool IsBattleMaster() const
Definition: Unit.h:1671

References BATTLEGROUND_AA, BATTLEGROUND_AB, BATTLEGROUND_AV, BATTLEGROUND_BE, BATTLEGROUND_DS, BATTLEGROUND_EY, BATTLEGROUND_NA, BATTLEGROUND_RL, BATTLEGROUND_RV, BATTLEGROUND_SA, BATTLEGROUND_WS, ClearGossipMenuFor(), Player::GetBGAccessByLevel(), Object::GetEntry(), Unit::IsBattleMaster(), sBattlegroundMgr, and SendGossipMenuFor().

◆ isCanTrainingAndResetTalentsOf()

bool Creature::isCanTrainingAndResetTalentsOf ( Player player) const
1197{
1198 return player->GetLevel() >= 10
1200 && player->getClass() == GetCreatureTemplate()->trainer_class;
1201}
@ TRAINER_TYPE_CLASS
Definition: SharedDefines.h:2617
uint32 trainer_class
Definition: CreatureData.h:213
uint32 trainer_type
Definition: CreatureData.h:211
uint8 getClass() const
Definition: Unit.h:1438

References Unit::getClass(), GetCreatureTemplate(), Unit::GetLevel(), CreatureTemplate::trainer_class, CreatureTemplate::trainer_type, and TRAINER_TYPE_CLASS.

Referenced by WorldSession::HandleTalentWipeConfirmOpcode().

◆ IsCivilian()

◆ IsDamageEnoughForLootingAndReward()

◆ IsDungeonBoss()

◆ isElite()

bool Creature::isElite ( ) const
inline
108 {
109 if (IsPet())
110 return false;
111
113 return rank != CREATURE_ELITE_NORMAL && rank != CREATURE_ELITE_RARE;
114 }
uint32 rank
Definition: CreatureData.h:199

References CREATURE_ELITE_NORMAL, CREATURE_ELITE_RARE, GetCreatureTemplate(), Unit::IsPet(), and CreatureTemplate::rank.

Referenced by Spell::EffectSkinning(), and Acore::XP::Gain().

◆ IsEvadingAttacks()

bool Creature::IsEvadingAttacks ( ) const
inline

◆ IsFreeToMove()

bool Creature::IsFreeToMove ( )
877{
879 // Do not reposition ourself when we are not allowed to move
881 (GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE ||
882 moveFlags & MOVEMENTFLAG_SPLINE_ENABLED))
883 {
884 return false;
885 }
886
887 return true;
888}
@ MOVEMENTFLAG_SPLINE_ENABLED
Definition: Unit.h:579
bool IsMovementPreventedByCasting() const override
Definition: Creature.cpp:3534
uint32 GetMovementFlags() const
Definition: Object.h:318
MovementInfo m_movementInfo
Definition: Object.h:595
bool CanFreeMove() const
Definition: Unit.h:1413
bool isMoving() const
Definition: Unit.h:2394

References Unit::CanFreeMove(), CHASE_MOTION_TYPE, Unit::GetMotionMaster(), MovementInfo::GetMovementFlags(), IsMovementPreventedByCasting(), Unit::isMoving(), WorldObject::m_movementInfo, and MOVEMENTFLAG_SPLINE_ENABLED.

Referenced by CreatureAI::MoveBackwardsChecks(), and CreatureAI::MoveCircleChecks().

◆ IsGuard()

bool Creature::IsGuard ( ) const
inline

◆ IsImmunedToSpell()

bool Creature::IsImmunedToSpell ( SpellInfo const *  spellInfo,
Spell const *  spell = nullptr 
)
overridevirtual

Reimplemented from Unit.

2191{
2192 if (!spellInfo)
2193 return false;
2194
2195 // Xinef: this should exclude self casts...
2196 // Spells that don't have effectMechanics.
2197 if (spellInfo->Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(1 << (spellInfo->Mechanic - 1)))
2198 return true;
2199
2200 // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break
2201 // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
2202 bool immunedToAllEffects = true;
2203 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2204 if (spellInfo->Effects[i].IsEffect() && !IsImmunedToSpellEffect(spellInfo, i))
2205 {
2206 immunedToAllEffects = false;
2207 break;
2208 }
2209 if (immunedToAllEffects)
2210 return true;
2211
2212 return Unit::IsImmunedToSpell(spellInfo, spell);
2213}
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1635
@ MECHANIC_NONE
Definition: SharedDefines.h:1325
bool HasMechanicTemplateImmunity(uint32 mask) const
Definition: Creature.cpp:2155
bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const override
Definition: Creature.cpp:2215
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo, Spell const *spell=nullptr)
Definition: Unit.cpp:12910

References SpellInfo::Effects, HasMechanicTemplateImmunity(), Unit::IsImmunedToSpell(), IsImmunedToSpellEffect(), MAX_SPELL_EFFECTS, SpellInfo::Mechanic, and MECHANIC_NONE.

◆ IsImmunedToSpellEffect()

bool Creature::IsImmunedToSpellEffect ( SpellInfo const *  spellInfo,
uint32  index 
) const
overridevirtual

Reimplemented from Unit.

Reimplemented in Totem.

2216{
2217 // Xinef: this should exclude self casts...
2218 if (spellInfo->Effects[index].Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(1 << (spellInfo->Effects[index].Mechanic - 1)))
2219 return true;
2220
2221 if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL)
2222 return true;
2223
2224 return Unit::IsImmunedToSpellEffect(spellInfo, index);
2225}
@ SPELL_EFFECT_HEAL
Definition: SharedDefines.h:788
@ CREATURE_TYPE_MECHANICAL
Definition: SharedDefines.h:2636
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const
Definition: Unit.cpp:13000

References CREATURE_TYPE_MECHANICAL, SpellInfo::Effects, GetCreatureTemplate(), HasMechanicTemplateImmunity(), Unit::IsImmunedToSpellEffect(), MECHANIC_NONE, and SPELL_EFFECT_HEAL.

Referenced by IsImmunedToSpell(), and Totem::IsImmunedToSpellEffect().

◆ IsImmuneToKnockback()

bool Creature::IsImmuneToKnockback ( ) const
3090{
3091 if (GetOwnerGUID().IsPlayer())
3092 return false;
3093
3094 CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
3095 return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK);
3096}
@ CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK
Definition: CreatureData.h:79

References CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK, CreatureTemplate::flags_extra, Object::GetEntry(), Unit::GetOwnerGUID(), Object::IsPlayer(), and sObjectMgr.

◆ IsInEvadeMode()

◆ IsInvisibleDueToDespawn()

bool Creature::IsInvisibleDueToDespawn ( ) const
overrideprotectedvirtual

Reimplemented from WorldObject.

1823{
1825 return true;
1826
1828 return false;
1829
1830 return true;
1831}
virtual bool IsInvisibleDueToDespawn() const
Definition: Object.h:650

References GameTime::GetGameTime(), Unit::IsAlive(), WorldObject::IsInvisibleDueToDespawn(), and m_corpseRemoveTime.

◆ IsMoveInLineOfSightDisabled()

bool Creature::IsMoveInLineOfSightDisabled ( )
inline

◆ IsMoveInLineOfSightStrictlyDisabled()

bool Creature::IsMoveInLineOfSightStrictlyDisabled ( )
inline

◆ IsMovementPreventedByCasting()

bool Creature::IsMovementPreventedByCasting ( ) const
overridevirtual

Reimplemented from Unit.

3535{
3537 // first check if currently a movement allowed channel is active and we're not casting
3538 if (spell && spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive() && spell->GetSpellInfo()->IsActionAllowedChannel())
3539 {
3540 return false;
3541 }
3542
3543 if (HasSpellFocus())
3544 {
3545 return true;
3546 }
3547
3549 {
3550 return true;
3551 }
3552
3553 return false;
3554}
@ CURRENT_CHANNELED_SPELL
Definition: Unit.h:992
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SPELL_STATE_FINISHED
Definition: Spell.h:226
bool HasSpellFocus(Spell const *focusSpell=nullptr) const
Definition: Creature.cpp:3466
Spell * m_currentSpells[CURRENT_MAX_SPELL]
Definition: Unit.h:2515
Definition: Spell.h:284
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:574
uint32 getState() const
Definition: Spell.h:482
bool IsChannelActive() const
Definition: Spell.h:553
bool IsActionAllowedChannel() const
Definition: SpellInfo.cpp:1248

References CURRENT_CHANNELED_SPELL, Spell::GetSpellInfo(), Spell::getState(), HasSpellFocus(), Unit::HasUnitState(), SpellInfo::IsActionAllowedChannel(), Spell::IsChannelActive(), Unit::m_currentSpells, SPELL_STATE_FINISHED, and UNIT_STATE_CASTING.

Referenced by WaypointMovementGenerator< Creature >::DoUpdate(), RandomMovementGenerator< T >::DoUpdate(), ChaseMovementGenerator< T >::DoUpdate(), FollowMovementGenerator< T >::DoUpdate(), IsFreeToMove(), and WaypointMovementGenerator< Creature >::StartMove().

◆ IsNotReachableAndNeedRegen()

bool Creature::IsNotReachableAndNeedRegen ( ) const
3578{
3579 if (CanNotReachTarget())
3580 {
3582 }
3583
3584 return false;
3585}
constexpr auto IN_MILLISECONDS
Definition: Common.h:55
@ CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID
Definition: IWorld.h:412

References CanNotReachTarget(), CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID, IN_MILLISECONDS, m_cannotReachTimer, and sWorld.

Referenced by Update().

◆ IsRacialLeader()

bool Creature::IsRacialLeader ( ) const
inline
bool RacialLeader
Definition: CreatureData.h:234

References GetCreatureTemplate(), and CreatureTemplate::RacialLeader.

Referenced by Player::RewardHonor().

◆ isRegeneratingHealth()

bool Creature::isRegeneratingHealth ( )
inline

◆ IsReputationGainDisabled()

bool Creature::IsReputationGainDisabled ( ) const
inline
354{ return DisableReputationGain; }

References DisableReputationGain.

Referenced by Player::RewardReputation().

◆ IsRooted()

bool Creature::IsRooted ( ) const
inline
85{ return GetMovementTemplate().IsRooted(); }
bool IsRooted() const
Definition: CreatureData.h:151

References GetMovementTemplate(), and CreatureMovementData::IsRooted().

Referenced by SetDisableGravity(), SetHover(), and UpdateEntry().

◆ IsSpellProhibited()

bool Creature::IsSpellProhibited ( SpellSchoolMask  idSchoolMask) const
2750{
2751 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
2752 {
2753 if (idSchoolMask & (1 << i))
2754 {
2756 {
2757 return true;
2758 }
2759 }
2760 }
2761
2762 return false;
2763}

References GameTime::GetGameTimeMS(), m_ProhibitSchoolTime, MAX_SPELL_SCHOOL, and SPELL_SCHOOL_NORMAL.

Referenced by CanCastSpell(), Spell::CheckCast(), and SmartScript::ProcessAction().

◆ isTappedBy()

bool Creature::isTappedBy ( Player const *  player) const
1320{
1321 if (player->GetGUID() == m_lootRecipient)
1322 return true;
1323
1324 Group const* playerGroup = player->GetGroup();
1325 if (!playerGroup || playerGroup != GetLootRecipientGroup()) // if we dont have a group we arent the recipient
1326 return false; // if creature doesnt have group bound it means it was solo killed by someone else
1327
1328 return true;
1329}
Group * GetLootRecipientGroup() const
Definition: Creature.cpp:1251
Definition: Group.h:169

References Player::GetGroup(), Object::GetGUID(), GetLootRecipientGroup(), and m_lootRecipient.

Referenced by Unit::BuildValuesUpdate().

◆ IsTrigger()

◆ IsValidTrainerForPlayer()

bool Creature::IsValidTrainerForPlayer ( Player player,
uint32 npcFlags = nullptr 
) const
1204{
1205 if (!IsTrainer())
1206 {
1207 return false;
1208 }
1209
1211 {
1212 case TRAINER_TYPE_CLASS:
1213 case TRAINER_TYPE_PETS:
1215 {
1216 if (npcFlags)
1217 *npcFlags &= ~UNIT_NPC_FLAG_TRAINER_CLASS;
1218
1219 return false;
1220 }
1221 break;
1224 {
1225 return false;
1226 }
1227 break;
1230 {
1231 if (npcFlags)
1232 *npcFlags &= ~UNIT_NPC_FLAG_TRAINER_PROFESSION;
1233
1234 return false;
1235 }
1236 break;
1237 default:
1238 break;
1239 }
1240
1241 return true;
1242}
@ TRAINER_TYPE_TRADESKILLS
Definition: SharedDefines.h:2619
@ TRAINER_TYPE_PETS
Definition: SharedDefines.h:2620
@ TRAINER_TYPE_MOUNTS
Definition: SharedDefines.h:2618
uint32 trainer_spell
Definition: CreatureData.h:212
uint32 trainer_race
Definition: CreatureData.h:214
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3831
bool IsTrainer() const
Definition: Unit.h:1666
uint8 getRace(bool original=false) const
Definition: Unit.cpp:21287

References Unit::getClass(), Unit::getRace(), Player::HasSpell(), Unit::IsTrainer(), m_creatureInfo, CreatureTemplate::trainer_class, CreatureTemplate::trainer_race, CreatureTemplate::trainer_spell, CreatureTemplate::trainer_type, TRAINER_TYPE_CLASS, TRAINER_TYPE_MOUNTS, TRAINER_TYPE_PETS, and TRAINER_TYPE_TRADESKILLS.

Referenced by Unit::BuildValuesUpdate().

◆ isVendorWithIconSpeak()

bool Creature::isVendorWithIconSpeak ( ) const
1626{
1628}
@ UNIT_NPC_FLAG_VENDOR
Definition: Unit.h:523
std::string IconName
Definition: CreatureData.h:186
uint32 npcflag
Definition: CreatureData.h:379

References CreatureTemplate::IconName, m_creatureData, m_creatureInfo, CreatureData::npcflag, and UNIT_NPC_FLAG_VENDOR.

◆ isWorldBoss()

◆ LoadCreatureFromDB()

bool Creature::LoadCreatureFromDB ( ObjectGuid::LowType  guid,
Map map,
bool  addToMap = true,
bool  gridLoad = false,
bool  allowDuplicate = false 
)
1631{
1632 if (!allowDuplicate)
1633 {
1634 // If an alive instance of this spawnId is already found, skip creation
1635 // If only dead instance(s) exist, despawn them and spawn a new (maybe also dead) version
1636 const auto creatureBounds = map->GetCreatureBySpawnIdStore().equal_range(spawnId);
1637 std::vector <Creature*> despawnList;
1638
1639 if (creatureBounds.first != creatureBounds.second)
1640 {
1641 for (auto itr = creatureBounds.first; itr != creatureBounds.second; ++itr)
1642 {
1643 if (itr->second->IsAlive())
1644 {
1645 LOG_DEBUG("maps", "Would have spawned {} but {} already exists", spawnId, creatureBounds.first->second->GetGUID().ToString());
1646 return false;
1647 }
1648 else
1649 {
1650 despawnList.push_back(itr->second);
1651 LOG_DEBUG("maps", "Despawned dead instance of spawn {} ({})", spawnId, itr->second->GetGUID().ToString());
1652 }
1653 }
1654
1655 for (Creature* despawnCreature : despawnList)
1656 {
1657 despawnCreature->AddObjectToRemoveList();
1658 }
1659 }
1660 }
1661
1662 CreatureData const* data = sObjectMgr->GetCreatureData(spawnId);
1663 if (!data)
1664 {
1665 LOG_ERROR("sql.sql", "Creature (SpawnId: {}) not found in table `creature`, can't load. ", spawnId);
1666 return false;
1667 }
1668
1669 // xinef: fix from db
1670 if ((addToMap || gridLoad) && !data->overwrittenZ)
1671 {
1672 float tz = map->GetHeight(data->posX, data->posY, data->posZ + 1.0f, true);
1673 if (tz >= data->posZ && tz - data->posZ <= 1.0f)
1674 const_cast<CreatureData*>(data)->posZ = tz + 0.1f;
1675
1676 const_cast<CreatureData*>(data)->overwrittenZ = true;
1677 }
1678
1679 // xinef: this has to be assigned before Create function, properly loads equipment id from DB
1680 m_creatureData = data;
1681 m_spawnId = spawnId;
1682
1683 // Add to world
1684 uint32 entry = GetRandomId(data->id1, data->id2, data->id3);
1685
1686 if (!Create(map->GenerateLowGuid<HighGuid::Unit>(), map, data->phaseMask, entry, 0, data->posX, data->posY, data->posZ, data->orientation, data))
1687 return false;
1688
1689 //We should set first home position, because then AI calls home movement
1690 SetHomePosition(data->posX, data->posY, data->posZ, data->orientation);
1691
1693
1695 m_deathState = DeathState::Alive;
1696
1698 if (m_respawnTime) // respawn on Update
1699 {
1700 m_deathState = DeathState::Dead;
1701 if (CanFly())
1702 {
1703 float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
1704 if (data->posZ - tz > 0.1f && Acore::IsValidMapCoord(tz))
1705 {
1706 Relocate(data->posX, data->posY, tz);
1707 }
1708 }
1709 }
1710
1711 uint32 curhealth;
1712
1713 if (!m_regenHealth)
1714 {
1715 curhealth = data->curhealth;
1716 if (curhealth)
1717 {
1718 curhealth = uint32(curhealth * _GetHealthMod(GetCreatureTemplate()->rank));
1719 if (curhealth < 1)
1720 curhealth = 1;
1721 }
1722 SetPower(POWER_MANA, data->curmana);
1723 }
1724 else
1725 {
1726 curhealth = GetMaxHealth();
1728 }
1729
1730 SetHealth(m_deathState == DeathState::Alive ? curhealth : 0);
1731
1732 // checked at creature_template loading
1734
1735 if (addToMap && !GetMap()->AddToMap(this))
1736 return false;
1737 return true;
1738}
#define MAX_FALL_DISTANCE
Definition: Map.h:166
@ POWER_MANA
Definition: SharedDefines.h:269
bool IsValidMapCoord(float c)
Definition: GridDefines.h:216
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:330
static float _GetHealthMod(int32 Rank)
Definition: Creature.cpp:1511
bool Create(ObjectGuid::LowType guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData *data=nullptr)
Definition: Creature.cpp:1067
uint32 GetRandomId(uint32 id1, uint32 id2, uint32 id3)
Definition: Creature.cpp:3635
float wander_distance
Definition: CreatureData.h:373
uint32 phaseMask
Definition: CreatureData.h:365
uint32 spawntimesecs
Definition: CreatureData.h:372
uint8 movementType
Definition: CreatureData.h:377
uint32 id2
Definition: CreatureData.h:362
uint32 curhealth
Definition: CreatureData.h:375
float orientation
Definition: CreatureData.h:371
uint32 curmana
Definition: CreatureData.h:376
uint32 id3
Definition: CreatureData.h:363
float posY
Definition: CreatureData.h:369
float posX
Definition: CreatureData.h:368
bool overwrittenZ
Definition: CreatureData.h:384
float posZ
Definition: CreatureData.h:370
uint32 id1
Definition: CreatureData.h:361
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15552
uint32 GetMaxHealth() const
Definition: Unit.h:1455
DeathState m_deathState
Definition: Unit.h:2504
void SetHealth(uint32 val)
Definition: Unit.cpp:15464
uint32 GetMaxPower(Powers power) const
Definition: Unit.h:1476
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition: Map.cpp:2043
time_t GetCreatureRespawnTime(ObjectGuid::LowType dbGuid) const
Definition: Map.h:572
ObjectGuid::LowType GenerateLowGuid()
Definition: Map.h:637

References _GetHealthMod(), CanFly(), Create(), CreatureData::curhealth, CreatureData::curmana, Map::GenerateLowGuid(), Map::GetCreatureBySpawnIdStore(), Map::GetCreatureRespawnTime(), GetCreatureTemplate(), Map::GetHeight(), WorldObject::GetMap(), Unit::GetMaxHealth(), Unit::GetMaxPower(), WorldObject::GetPhaseMask(), GetRandomId(), CreatureData::id1, CreatureData::id2, CreatureData::id3, Acore::IsValidMapCoord(), LOG_DEBUG, LOG_ERROR, m_creatureData, Unit::m_deathState, m_defaultMovementType, m_regenHealth, m_respawnDelay, m_respawnTime, m_spawnId, m_wanderDistance, MAX_FALL_DISTANCE, CreatureData::movementType, CreatureData::orientation, CreatureData::overwrittenZ, CreatureData::phaseMask, CreatureData::posX, CreatureData::posY, CreatureData::posZ, POWER_MANA, Position::Relocate(), Unit::SetHealth(), SetHomePosition(), Unit::SetPower(), sObjectMgr, CreatureData::spawntimesecs, and CreatureData::wander_distance.

Referenced by ObjectMgr::AddCreData(), MotionTransport::CreateNPCPassenger(), GameEventMgr::GameEventSpawn(), npc_commandscript::HandleNpcAddCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), LoadFromDB(), and PoolGroup< T >::Spawn1Object().

◆ LoadCreaturesAddon()

bool Creature::LoadCreaturesAddon ( bool  reload = false)

Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2: If no inhabittype_fly (if no MovementFlag_DisableGravity or MovementFlag_CanFly flag found in sniffs) Check using InhabitType as movement flags are assigned dynamically basing on whether the creature is in air or not Set MovementFlag_Hover. Otherwise do nothing.

2635{
2636 CreatureAddon const* cainfo = GetCreatureAddon();
2637 if (!cainfo)
2638 return false;
2639
2640 if (cainfo->mount != 0)
2641 Mount(cainfo->mount);
2642
2643 if (cainfo->bytes1 != 0)
2644 {
2645 // 0 StandState
2646 // 1 FreeTalentPoints Pet only, so always 0 for default creature
2647 // 2 StandFlags
2648 // 3 StandMiscFlags
2649
2651 //SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_PET_TALENTS, uint8((cainfo->bytes1 >> 8) & 0xFF));
2655
2661 if (CanHover())
2663 }
2664
2665 if (cainfo->bytes2 != 0)
2666 {
2667 // 0 SheathState
2668 // 1 Bytes2Flags
2669 // 2 UnitRename Pet only, so always 0 for default creature
2670 // 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
2671
2672 SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
2673 //SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
2674 //SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
2676 //SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));
2678 }
2679
2681
2682 // Check if visibility distance different
2683 if (cainfo->visibilityDistanceType != VisibilityDistanceType::Normal)
2684 {
2686 }
2687
2688 //Load Path
2689 if (cainfo->path_id != 0)
2690 {
2692 setActive(true);
2693 m_path_id = cainfo->path_id;
2694 }
2695
2696 if (!cainfo->auras.empty())
2697 {
2698 for (std::vector<uint32>::const_iterator itr = cainfo->auras.begin(); itr != cainfo->auras.end(); ++itr)
2699 {
2700 SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
2701 if (!AdditionalSpellInfo)
2702 {
2703 LOG_ERROR("sql.sql", "Creature ({}) has wrong spell {} defined in `auras` field.", GetGUID().ToString(), *itr);
2704 continue;
2705 }
2706
2707 // skip already applied aura
2708 if (HasAura(*itr))
2709 {
2710 if (!reload)
2711 LOG_ERROR("sql.sql", "Creature ({}) has duplicate aura (spell {}) in `auras` field.", GetGUID().ToString(), *itr);
2712
2713 continue;
2714 }
2715
2716 AddAura(*itr, this);
2717 LOG_DEBUG("entities.unit", "Spell: {} added to creature ({})", *itr, GetGUID().ToString());
2718 }
2719 }
2720
2721 return true;
2722}
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ UNIT_FIELD_BYTES_1
Definition: UpdateFields.h:131
@ UNIT_FIELD_BYTES_2
Definition: UpdateFields.h:161
@ MOVEMENTFLAG_HOVER
Definition: Unit.h:582
@ UNIT_BYTES_1_OFFSET_ANIM_TIER
Definition: Unit.h:47
@ UNIT_BYTES_1_OFFSET_PET_TALENTS
Definition: Unit.h:45
@ UNIT_BYTES_1_OFFSET_STAND_STATE
Definition: Unit.h:44
@ UNIT_BYTES_1_OFFSET_VIS_FLAG
Definition: Unit.h:46
@ CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE
Definition: IWorld.h:166
bool CanHover() const
Definition: Creature.h:84
CreatureAddon const * GetCreatureAddon() const
Definition: Creature.cpp:2621
std::vector< uint32 > auras
Definition: CreatureData.h:435
uint32 mount
Definition: CreatureData.h:431
uint32 emote
Definition: CreatureData.h:434
uint32 path_id
Definition: CreatureData.h:430
VisibilityDistanceType visibilityDistanceType
Definition: CreatureData.h:436
uint32 bytes1
Definition: CreatureData.h:432
uint32 bytes2
Definition: CreatureData.h:433
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void SetVisibilityDistanceOverride(VisibilityDistanceType type)
Definition: Object.cpp:1122
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:19127
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:13459
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:2286

References Unit::AddAura(), Unit::AddUnitMovementFlag(), CreatureAddon::auras, CreatureAddon::bytes1, CreatureAddon::bytes2, CanHover(), CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE, CreatureAddon::emote, GetCreatureAddon(), Object::GetGUID(), Unit::HasAura(), LOG_DEBUG, LOG_ERROR, m_path_id, CreatureAddon::mount, Unit::Mount(), MOVEMENTFLAG_HOVER, CreatureAddon::path_id, WorldObject::setActive(), Object::SetByteValue(), Object::SetUInt32Value(), WorldObject::SetVisibilityDistanceOverride(), sSpellMgr, sWorld, Position::ToString(), UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTES_1_OFFSET_PET_TALENTS, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_BYTES_1_OFFSET_VIS_FLAG, UNIT_FIELD_BYTES_1, UNIT_FIELD_BYTES_2, UNIT_NPC_EMOTESTATE, and CreatureAddon::visibilityDistanceType.

Referenced by CreatureAI::_EnterEvadeMode(), Create(), HomeMovementGenerator< Creature >::DoFinalize(), boss_doomrel::boss_doomrelAI::EnterEvadeMode(), npc_pos_freed_slave::npc_pos_freed_slaveAI::EnterEvadeMode(), npc_pet_hunter_snake_trap::EnterEvadeMode(), hyjalAI::EnterEvadeMode(), boss_urom::boss_uromAI::LeaveCombat(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::Reset(), npc_valithria_cloud::npc_valithria_cloudAI::Reset(), and setDeathState().

◆ LoadEquipment()

void Creature::LoadEquipment ( int8  id = 1,
bool  force = false 
)
1747{
1748 if (id == 0)
1749 {
1750 if (force)
1751 {
1752 for (uint8 i = 0; i < MAX_EQUIPMENT_ITEMS; ++i)
1754 m_equipmentId = 0;
1755 }
1756 return;
1757 }
1758
1759 EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(GetEntry(), id);
1760 if (!einfo)
1761 return;
1762
1763 m_equipmentId = id;
1764 for (uint8 i = 0; i < 3; ++i)
1766}
#define MAX_EQUIPMENT_ITEMS
Definition: CreatureData.h:39
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
Definition: CreatureData.h:349
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
Definition: CreatureData.h:350

References Object::GetEntry(), EquipmentInfo::ItemEntry, m_equipmentId, MAX_EQUIPMENT_ITEMS, Object::SetUInt32Value(), sObjectMgr, and UNIT_VIRTUAL_ITEM_SLOT_ID.

Referenced by boss_thekal::CheckPhaseTransition(), boss_leotheras_the_blind::DemonTime(), boss_twinemperorsAI::DoAction(), boss_leotheras_the_blind::DoAction(), spell_marli_transform::HandleApply(), spell_boss_magus_telestra_summon_telestra_clones::spell_boss_magus_telestra_summon_telestra_clones_AuraScript::HandleApply(), spell_marli_transform::HandleRemove(), spell_boss_magus_telestra_summon_telestra_clones::spell_boss_magus_telestra_summon_telestra_clones_AuraScript::HandleRemove(), spell_death_knight_initiate_visual::HandleScriptEffect(), InitEntry(), boss_swamplord_muselek::JustEngagedWith(), boss_pathaleon_the_calculator::JustEngagedWith(), npc_unworthy_initiate::npc_unworthy_initiateAI::MovementInform(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), spell_illidan_demon_transform1::spell_illidan_demon_transform1_AuraScript::OnPeriodic(), spell_illidan_demon_transform2::spell_illidan_demon_transform2_AuraScript::OnPeriodic(), boss_mr_smite::boss_mr_smiteAI::Reset(), npc_unworthy_initiate::npc_unworthy_initiateAI::Reset(), npc_koltira_deathweaver::npc_koltira_deathweaverAI::Reset(), boss_thekal::Reset(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::Reset(), boss_illidan_stormrage::boss_illidan_stormrageAI::Reset(), boss_pathaleon_the_calculator::Reset(), Respawn(), ScriptedAI::SetEquipmentSlots(), boss_mr_smite::boss_mr_smiteAI::UpdateAI(), npc_partygoer_pather::UpdateAI(), npc_partygoer::UpdateAI(), npc_forest_frog::npc_forest_frogAI::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), boss_illidan_stormrage::boss_illidan_stormrageAI::UpdateAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), and npc_koltira_deathweaver::npc_koltira_deathweaverAI::WaypointReached().

◆ LoadFromDB()

bool Creature::LoadFromDB ( ObjectGuid::LowType  guid,
Map map,
bool  allowDuplicate = false 
)
inline
213{ return LoadCreatureFromDB(guid, map, false, true, allowDuplicate); }
bool LoadCreatureFromDB(ObjectGuid::LowType guid, Map *map, bool addToMap=true, bool gridLoad=false, bool allowDuplicate=false)
Definition: Creature.cpp:1630

References LoadCreatureFromDB().

Referenced by LoadHelper().

◆ LoadPath()

◆ LoadSpellTemplateImmunity()

void Creature::LoadSpellTemplateImmunity ( )
2161{
2162 // uint32 max used for "spell id", the immunity system will not perform SpellInfo checks against invalid spells
2163 // used so we know which immunities were loaded from template
2164 static uint32 const placeholderSpellId = std::numeric_limits<uint32>::max();
2165
2166 // unapply template immunities (in case we're updating entry)
2167 for (uint8 i = SPELL_SCHOOL_NORMAL; i <= SPELL_SCHOOL_ARCANE; ++i)
2168 {
2169 ApplySpellImmune(placeholderSpellId, IMMUNITY_SCHOOL, i, false);
2170 }
2171
2172 // don't inherit immunities for hunter pets
2173 if (GetOwnerGUID().IsPlayer() && IsHunterPet())
2174 {
2175 return;
2176 }
2177
2178 if (uint8 mask = GetCreatureTemplate()->SpellSchoolImmuneMask)
2179 {
2180 for (uint8 i = SPELL_SCHOOL_NORMAL; i <= SPELL_SCHOOL_ARCANE; ++i)
2181 {
2182 if (mask & (1 << i))
2183 {
2184 ApplySpellImmune(placeholderSpellId, IMMUNITY_SCHOOL, 1 << i, true);
2185 }
2186 }
2187 }
2188}
@ SPELL_SCHOOL_ARCANE
Definition: SharedDefines.h:289
@ IMMUNITY_SCHOOL
Definition: SharedDefines.h:1396
bool IsHunterPet() const
Definition: Unit.h:1426
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13383

References Unit::ApplySpellImmune(), GetCreatureTemplate(), Unit::GetOwnerGUID(), IMMUNITY_SCHOOL, Unit::IsHunterPet(), Object::IsPlayer(), SPELL_SCHOOL_ARCANE, and SPELL_SCHOOL_NORMAL.

Referenced by UpdateEntry().

◆ LowerPlayerDamageReq()

void Creature::LowerPlayerDamageReq ( uint32  unDamage,
bool  damagedByPlayer = true 
)
3707{
3708 if (_playerDamageReq)
3709 _playerDamageReq > unDamage ? _playerDamageReq -= unDamage : _playerDamageReq = 0;
3710
3711 if (!_damagedByPlayer)
3712 {
3713 _damagedByPlayer = damagedByPlayer;
3714 }
3715}

References _damagedByPlayer, and _playerDamageReq.

Referenced by boss_viscidus::boss_viscidus(), boss_viscidus::DamageTaken(), boss_buru::DamageTaken(), boss_twinemperorsAI::DamageTaken(), npc_artorius::npc_artoriusAI::DamageTaken(), npc_franklin::npc_franklinAI::DamageTaken(), npc_heated_battle::npc_heated_battleAI::DamageTaken(), boss_razuvious::boss_razuviousAI::DamageTaken(), boss_kologarn::boss_kologarnAI::DamageTaken(), Unit::DealDamage(), boss_xt002::boss_xt002AI::DoAction(), boss_yoggsaron::boss_yoggsaronAI::DoAction(), boss_ichoron::boss_ichoronAI::DoAction(), Spell::DoAllEffectOnTarget(), misc_commandscript::HandleDamageCommand(), misc_commandscript::HandleDieCommand(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::HealReceived(), boss_twin_valkyrAI::JustEngagedWith(), boss_sister_svalna::boss_sister_svalnaAI::JustEngagedWith(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustEngagedWith(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustEngagedWith(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustEngagedWith(), boss_prince_valanar_icc::boss_prince_valanarAI::JustEngagedWith(), npc_dirt_mound::JustSummoned(), boss_drakkari_colossus::boss_drakkari_colossusAI::JustSummoned(), boss_viscidus::SummonedCreatureDies(), npc_boneguard_footman::npc_boneguard_footmanAI::UpdateAI(), npc_phase_hunter::npc_phase_hunterAI::UpdateAI(), and npc_target_dummy::npc_target_dummyAI::UpdateAI().

◆ ModifyThreatPercentTemp()

void Creature::ModifyThreatPercentTemp ( Unit victim,
int32  percent,
Milliseconds  duration 
)
3686{
3687 if (victim)
3688 {
3689 float currentThreat = GetThreatMgr().GetThreat(victim);
3690
3691 if (percent != 0.0f)
3692 {
3693 GetThreatMgr().ModifyThreatByPercent(victim, percent);
3694 }
3695
3696 TemporaryThreatModifierEvent* pEvent = new TemporaryThreatModifierEvent(*this, victim->GetGUID(), currentThreat);
3697 m_Events.AddEvent(pEvent, m_Events.CalculateTime(duration.count()));
3698 }
3699}
float GetThreat(Unit *victim, bool alsoSearchOfflineList=false)
Definition: ThreatMgr.cpp:525
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition: ThreatMgr.cpp:508
Definition: Creature.h:534
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2159

References EventProcessor::AddEvent(), EventProcessor::CalculateTime(), Object::GetGUID(), ThreatMgr::GetThreat(), Unit::GetThreatMgr(), Unit::m_Events, and ThreatMgr::ModifyThreatByPercent().

◆ Motion_Initialize()

void Creature::Motion_Initialize ( )
1053{
1054 if (!m_formation)
1056 else if (m_formation->GetLeader() == this)
1057 {
1058 m_formation->FormationReset(false, true);
1060 }
1061 else if (m_formation->IsFormed())
1062 GetMotionMaster()->MoveIdle(); //wait the order of leader
1063 else
1065}
Creature * GetLeader() const
Definition: CreatureGroups.h:98
void FormationReset(bool dismiss, bool initMotionMaster)
Definition: CreatureGroups.cpp:334
bool IsFormed() const
Definition: CreatureGroups.h:102
void Initialize()
Definition: MotionMaster.cpp:73
void MoveIdle()
Definition: MotionMaster.cpp:232

References CreatureGroup::FormationReset(), CreatureGroup::GetLeader(), Unit::GetMotionMaster(), MotionMaster::Initialize(), CreatureGroup::IsFormed(), m_formation, and MotionMaster::MoveIdle().

Referenced by AddToWorld(), Pet::AddToWorld(), and setDeathState().

◆ ProhibitSpellSchool()

void Creature::ProhibitSpellSchool ( SpellSchoolMask  idSchoolMask,
uint32  unTimeMs 
)
overridevirtual

Reimplemented from Unit.

2739{
2740 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
2741 {
2742 if (idSchoolMask & (1 << i))
2743 {
2744 m_ProhibitSchoolTime[i] = GameTime::GetGameTimeMS().count() + unTimeMs;
2745 }
2746 }
2747}

References GameTime::GetGameTimeMS(), m_ProhibitSchoolTime, MAX_SPELL_SCHOOL, and SPELL_SCHOOL_NORMAL.

◆ reachWithSpellAttack()

SpellInfo const * Creature::reachWithSpellAttack ( Unit victim)
2228{
2229 if (!victim)
2230 return nullptr;
2231
2232 for (uint32 i = 0; i < MAX_CREATURE_SPELLS; ++i)
2233 {
2234 if (!m_spells[i])
2235 continue;
2236 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
2237 if (!spellInfo)
2238 {
2239 LOG_ERROR("entities.unit", "WORLD: unknown spell id {}", m_spells[i]);
2240 continue;
2241 }
2242
2243 bool bcontinue = true;
2244 for (uint32 j = 0; j < MAX_SPELL_EFFECTS; j++)
2245 {
2246 if ((spellInfo->Effects[j].Effect == SPELL_EFFECT_SCHOOL_DAMAGE) ||
2247 (spellInfo->Effects[j].Effect == SPELL_EFFECT_INSTAKILL) ||
2248 (spellInfo->Effects[j].Effect == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE) ||
2249 (spellInfo->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH)
2250 )
2251 {
2252 bcontinue = false;
2253 break;
2254 }
2255 }
2256 if (bcontinue)
2257 continue;
2258
2259 if (spellInfo->ManaCost > GetPower(POWER_MANA))
2260 continue;
2261 float range = spellInfo->GetMaxRange(false);
2262 float minrange = spellInfo->GetMinRange(false);
2263 float dist = GetDistance(victim);
2264 if (dist > range || dist < minrange)
2265 continue;
2267 continue;
2269 continue;
2270 return spellInfo;
2271 }
2272 return nullptr;
2273}
@ UNIT_FLAG_PACIFIED
Definition: Unit.h:465
@ SPELL_EFFECT_HEALTH_LEECH
Definition: SharedDefines.h:787
@ SPELL_EFFECT_ENVIRONMENTAL_DAMAGE
Definition: SharedDefines.h:785
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition: SharedDefines.h:780
@ SPELL_EFFECT_INSTAKILL
Definition: SharedDefines.h:779
@ SPELL_PREVENTION_TYPE_SILENCE
Definition: SharedDefines.h:1554
@ SPELL_PREVENTION_TYPE_PACIFY
Definition: SharedDefines.h:1555
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
uint32 PreventionType
Definition: SpellInfo.h:388
float GetMinRange(bool positive=false) const
Definition: SpellInfo.cpp:2300
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition: SpellInfo.h:391
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:2309
uint32 ManaCost
Definition: SpellInfo.h:361

References SpellInfo::Effects, WorldObject::GetDistance(), SpellInfo::GetMaxRange(), SpellInfo::GetMinRange(), Unit::GetPower(), Unit::HasUnitFlag(), LOG_ERROR, m_spells, SpellInfo::ManaCost, MAX_CREATURE_SPELLS, MAX_SPELL_EFFECTS, POWER_MANA, SpellInfo::PreventionType, SPELL_EFFECT_ENVIRONMENTAL_DAMAGE, SPELL_EFFECT_HEALTH_LEECH, SPELL_EFFECT_INSTAKILL, SPELL_EFFECT_SCHOOL_DAMAGE, SPELL_PREVENTION_TYPE_PACIFY, SPELL_PREVENTION_TYPE_SILENCE, sSpellMgr, UNIT_FLAG_PACIFIED, and UNIT_FLAG_SILENCED.

◆ reachWithSpellCure()

SpellInfo const * Creature::reachWithSpellCure ( Unit victim)
2276{
2277 if (!victim)
2278 return nullptr;
2279
2280 for (uint32 i = 0; i < MAX_CREATURE_SPELLS; ++i)
2281 {
2282 if (!m_spells[i])
2283 continue;
2284 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
2285 if (!spellInfo)
2286 {
2287 LOG_ERROR("entities.unit", "WORLD: unknown spell id {}", m_spells[i]);
2288 continue;
2289 }
2290
2291 bool bcontinue = true;
2292 for (uint32 j = 0; j < MAX_SPELL_EFFECTS; j++)
2293 {
2294 if ((spellInfo->Effects[j].Effect == SPELL_EFFECT_HEAL))
2295 {
2296 bcontinue = false;
2297 break;
2298 }
2299 }
2300 if (bcontinue)
2301 continue;
2302
2303 if (spellInfo->ManaCost > GetPower(POWER_MANA))
2304 continue;
2305
2306 float range = spellInfo->GetMaxRange(true);
2307 float minrange = spellInfo->GetMinRange(true);
2308 float dist = GetDistance(victim);
2309 //if (!isInFront(victim, range) && spellInfo->AttributesEx)
2310 // continue;
2311 if (dist > range || dist < minrange)
2312 continue;
2314 continue;
2316 continue;
2317 return spellInfo;
2318 }
2319 return nullptr;
2320}

References SpellInfo::Effects, WorldObject::GetDistance(), SpellInfo::GetMaxRange(), SpellInfo::GetMinRange(), Unit::GetPower(), Unit::HasUnitFlag(), LOG_ERROR, m_spells, SpellInfo::ManaCost, MAX_CREATURE_SPELLS, MAX_SPELL_EFFECTS, POWER_MANA, SpellInfo::PreventionType, SPELL_EFFECT_HEAL, SPELL_PREVENTION_TYPE_PACIFY, SPELL_PREVENTION_TYPE_SILENCE, sSpellMgr, UNIT_FLAG_PACIFIED, and UNIT_FLAG_SILENCED.

◆ RefreshSwimmingFlag()

void Creature::RefreshSwimmingFlag ( bool  recheck = false)
3184{
3185 if (!_isMissingSwimmingFlagOutOfCombat || recheck)
3187
3188 // Check if the creature has UNIT_FLAG_SWIMMING and add it if it's missing
3189 // Creatures must be able to chase a target in water if they can enter water
3192}
@ UNIT_FLAG_SWIMMING
Definition: Unit.h:463
bool CanEnterWater() const override
Definition: Creature.cpp:3175

References _isMissingSwimmingFlagOutOfCombat, CanEnterWater(), Unit::HasUnitFlag(), Unit::SetUnitFlag(), and UNIT_FLAG_SWIMMING.

◆ Regenerate()

void Creature::Regenerate ( Powers  power)
protected
891{
892 uint32 curValue = GetPower(power);
893 uint32 maxValue = GetMaxPower(power);
894
895 // Xinef: implement power regeneration flag
897 return;
898
899 if (!m_regenPower)
900 {
901 return;
902 }
903
904 if (curValue >= maxValue)
905 return;
906
907 float addvalue = 0.0f;
908
909 switch (power)
910 {
911 case POWER_FOCUS:
912 {
913 // For hunter pets.
914 addvalue = 24 * sWorld->getRate(RATE_POWER_FOCUS);
915 break;
916 }
917 case POWER_ENERGY:
918 {
919 // For deathknight's ghoul.
920 addvalue = 20;
921 break;
922 }
923 case POWER_MANA:
924 {
925 // Combat and any controlled creature
927 {
929 {
930 addvalue = uint32((GetStat(STAT_SPIRIT) / (IsUnderLastManaUseEffect() ? 8.0f : 5.0f) + 17.0f));
931 }
932 else if (!IsUnderLastManaUseEffect())
933 {
934 float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA);
935 float Spirit = GetStat(STAT_SPIRIT);
936
937 addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate);
938 }
939 }
940 else
941 addvalue = maxValue / 3;
942 break;
943 }
944 default:
945 return;
946 }
947
948 // Apply modifiers (if any).
950 for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
951 if (Powers((*i)->GetMiscValue()) == power)
952 AddPct(addvalue, (*i)->GetAmount());
953
955
956 ModifyPower(power, int32(addvalue));
957}
T AddPct(T &base, U pct)
Definition: Util.h:67
constexpr Milliseconds PET_FOCUS_REGEN_INTERVAL
Definition: CreatureData.h:41
@ NPC_WATER_ELEMENTAL_TEMP
Definition: PetDefines.h:104
@ NPC_IMP
Definition: PetDefines.h:95
@ NPC_WATER_ELEMENTAL_PERM
Definition: PetDefines.h:106
@ UNIT_FLAG2_REGENERATE_POWER
Definition: Unit.h:498
@ SPELL_AURA_MOD_POWER_REGEN
Definition: SpellAuraDefines.h:148
@ SPELL_AURA_MOD_POWER_REGEN_PERCENT
Definition: SpellAuraDefines.h:173
@ RATE_POWER_MANA
Definition: IWorld.h:428
@ RATE_POWER_FOCUS
Definition: IWorld.h:433
Powers
Definition: SharedDefines.h:268
@ POWER_ENERGY
Definition: SharedDefines.h:272
@ POWER_FOCUS
Definition: SharedDefines.h:271
@ STAT_SPIRIT
Definition: SharedDefines.h:262
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:14137
bool IsUnderLastManaUseEffect() const
Definition: Unit.cpp:17508
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1981
bool HasUnitFlag2(UnitFlags2 flags) const
Definition: Unit.h:1500
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
Definition: Unit.cpp:5952
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1318

References AddPct(), CREATURE_REGEN_INTERVAL, Unit::GetAuraEffectsByType(), Unit::GetCharmerOrOwnerGUID(), Object::GetEntry(), Unit::GetMaxPower(), Unit::GetOwnerGUID(), Unit::GetPower(), Unit::GetStat(), Unit::GetTotalAuraModifierByMiscValue(), Unit::HasUnitFlag2(), IN_MILLISECONDS, Unit::IsInCombat(), Object::IsPlayer(), Unit::IsUnderLastManaUseEffect(), m_regenPower, Unit::ModifyPower(), NPC_IMP, NPC_WATER_ELEMENTAL_PERM, NPC_WATER_ELEMENTAL_TEMP, PET_FOCUS_REGEN_INTERVAL, POWER_ENERGY, POWER_FOCUS, POWER_MANA, RATE_POWER_FOCUS, RATE_POWER_MANA, SPELL_AURA_MOD_POWER_REGEN, SPELL_AURA_MOD_POWER_REGEN_PERCENT, STAT_SPIRIT, sWorld, and UNIT_FLAG2_REGENERATE_POWER.

Referenced by Pet::Update(), and Update().

◆ RegenerateHealth()

void Creature::RegenerateHealth ( )
protected
960{
962 return;
963
964 uint32 curValue = GetHealth();
965 uint32 maxValue = GetMaxHealth();
966
967 if (curValue >= maxValue)
968 return;
969
970 uint32 addvalue = 0;
971
972 // Not only pet, but any controlled creature
973 // Xinef: fix polymorph rapid regen
975 addvalue = maxValue / 3;
976 else //if (GetCharmerOrOwnerGUID())
977 {
978 float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH);
979 float Spirit = GetStat(STAT_SPIRIT);
980
981 if (GetPower(POWER_MANA) > 0)
982 addvalue = uint32(Spirit * 0.25 * HealthIncreaseRate);
983 else
984 addvalue = uint32(Spirit * 0.80 * HealthIncreaseRate);
985 }
986
987 // Apply modifiers (if any).
989 for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
990 AddPct(addvalue, (*i)->GetAmount());
991
993
994 ModifyHealth(addvalue);
995}
@ SPELL_AURA_MOD_HEALTH_REGEN_PERCENT
Definition: SpellAuraDefines.h:151
@ SPELL_AURA_MOD_REGEN
Definition: SpellAuraDefines.h:147
@ RATE_HEALTH
Definition: IWorld.h:427
bool isRegeneratingHealth()
Definition: Creature.h:311
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:14079
bool IsPolymorphed() const
Definition: Unit.cpp:17009
uint32 GetHealth() const
Definition: Unit.h:1454

References AddPct(), CREATURE_REGEN_INTERVAL, Unit::GetAuraEffectsByType(), Unit::GetCharmerOrOwnerGUID(), Unit::GetHealth(), Unit::GetMaxHealth(), Unit::GetPower(), Unit::GetStat(), Unit::GetTotalAuraModifier(), IN_MILLISECONDS, Unit::IsPolymorphed(), isRegeneratingHealth(), Unit::ModifyHealth(), POWER_MANA, RATE_HEALTH, SPELL_AURA_MOD_HEALTH_REGEN_PERCENT, SPELL_AURA_MOD_REGEN, STAT_SPIRIT, and sWorld.

Referenced by Update().

◆ ReleaseFocus()

void Creature::ReleaseFocus ( Spell const *  focusSpell)
3477{
3478 // focused to something else
3479 if (focusSpell != _focusSpell)
3480 return;
3481
3482 _focusSpell = nullptr;
3483 if (Unit* victim = GetVictim())
3484 SetGuidValue(UNIT_FIELD_TARGET, victim->GetGUID());
3485 else
3487
3488 if (focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_AI_DOESNT_FACE_TARGET))
3490}
void ClearUnitState(uint32 f)
Definition: Unit.h:1411

References _focusSpell, Unit::ClearUnitState(), ObjectGuid::Empty, Spell::GetSpellInfo(), Unit::GetVictim(), SpellInfo::HasAttribute(), Object::SetGuidValue(), SPELL_ATTR5_AI_DOESNT_FACE_TARGET, UNIT_FIELD_TARGET, and UNIT_STATE_ROTATING.

◆ RemoveCorpse()

void Creature::RemoveCorpse ( bool  setSpawnTime = true,
bool  skipVisibility = false 
)
347{
348 if (getDeathState() != DeathState::Corpse)
349 return;
350
352 setDeathState(DeathState::Dead);
354 if (!skipVisibility) // pussywizard
355 DestroyForNearbyPlayers(); // pussywizard: previous UpdateObjectVisibility()
356 loot.clear();
357 uint32 respawnDelay = m_respawnDelay;
358 if (IsAIEnabled)
359 AI()->CorpseRemoved(respawnDelay);
360
361 // Should get removed later, just keep "compatibility" with scripts
362 if (setSpawnTime)
363 {
364 m_respawnTime = GameTime::GetGameTime().count() + respawnDelay;
365 //SaveRespawnTime();
366 }
367
368 float x, y, z, o;
369 GetRespawnPosition(x, y, z, &o);
370 SetHomePosition(x, y, z, o);
371 SetPosition(x, y, z, o);
372
373 // xinef: relocate notifier
374 m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f, 0.0f);
375
376 // pussywizard: if corpse was removed during falling then the falling will continue after respawn, so stop falling is such case
377 if (IsFalling())
378 StopMoving();
379}
virtual void CorpseRemoved(uint32 &)
== Triggered Actions Requested ==================
Definition: CreatureAI.h:190
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition: Creature.cpp:2861
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3072
DeathState getDeathState()
Definition: Unit.h:1825
void StopMoving()
Definition: Unit.cpp:16918
Position m_last_notify_position
Definition: Unit.h:2423
void RemoveAllAuras()
Definition: Unit.cpp:5259
bool IsFalling() const
Definition: Unit.cpp:20223
void clear()
Definition: LootMgr.h:343

References AI(), Loot::clear(), CreatureAI::CorpseRemoved(), WorldObject::DestroyForNearbyPlayers(), Unit::getDeathState(), GameTime::GetGameTime(), GetRespawnPosition(), Unit::IsAIEnabled, Unit::IsFalling(), loot, m_corpseRemoveTime, Unit::m_last_notify_position, m_respawnDelay, m_respawnTime, Position::Relocate(), Unit::RemoveAllAuras(), setDeathState(), SetHomePosition(), SetPosition(), and Unit::StopMoving().

Referenced by OPvPCapturePoint::DelCreature(), DisappearAndDie(), RespawnEvent::Execute(), ForcedDespawn(), AuraEffect::HandleAuraControlVehicle(), boss_skeram::JustDied(), npc_qiraj_war_spawn::npc_qiraj_war_spawnAI::JustDied(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustDied(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustDied(), boss_prince_valanar_icc::boss_prince_valanarAI::JustDied(), npc_illidari_spawn::npc_illidari_spawnAI::JustDied(), npc_nether_drake::npc_nether_drakeAI::MovementInform(), ValithriaDespawner::operator()(), Respawn(), npc_simone::npc_simoneAI::RespawnPet(), Update(), npc_towering_infernal::npc_towering_infernalAI::UpdateAI(), npc_lesser_doomguard::npc_lesser_doomguardAI::UpdateAI(), npc_abomination::npc_abominationAI::WaypointReached(), and npc_ghoul::npc_ghoulAI::WaypointReached().

◆ RemoveFromWorld()

void Creature::RemoveFromWorld ( )
overridevirtual

Reimplemented from Object.

Reimplemented in TempSummon, Minion, Puppet, and Pet.

293{
294 if (IsInWorld())
295 {
296 sScriptMgr->OnCreatureRemoveWorld(this);
297
298 if (GetZoneScript())
300
301 if (m_formation)
302 sFormationMgr->RemoveCreatureFromGroup(m_formation, this);
303
304 if (Transport* transport = GetTransport())
305 transport->RemovePassenger(this, true);
306
308
309 if (m_spawnId)
310 Acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
311
313 }
314}
#define sFormationMgr
Definition: CreatureGroups.h:126
void MultimapErasePair(M< K, V, Rest... > &multimap, K const &key, V const &value)
Definition: Containers.h:228
bool Remove(KEY_TYPE const &handle)
Definition: TypeContainer.h:141
Definition: Transport.h:29
void RemoveFromWorld() override
Definition: Unit.cpp:15682
virtual void OnCreatureRemove(Creature *)
Definition: ZoneScript.h:36

References Object::GetGUID(), WorldObject::GetMap(), Map::GetObjectsStore(), WorldObject::GetTransport(), WorldObject::GetZoneScript(), Object::IsInWorld(), m_formation, m_spawnId, Acore::Containers::MultimapErasePair(), ZoneScript::OnCreatureRemove(), TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Remove(), Unit::RemoveFromWorld(), sFormationMgr, and sScriptMgr.

Referenced by TempSummon::RemoveFromWorld().

◆ RemoveLootMode()

void Creature::RemoveLootMode ( uint16  lootMode)
inline
238{ m_LootMode &= ~lootMode; }

References m_LootMode.

Referenced by boss_yoggsaron::boss_yoggsaronAI::boss_yoggsaronAI().

◆ ResetLootMode()

◆ ResetPickPocketLootTime()

void Creature::ResetPickPocketLootTime ( )
inline

References lootPickPocketRestoreTime.

Referenced by Respawn().

◆ ResetPlayerDamageReq()

◆ Respawn()

void Creature::Respawn ( bool  force = false)
1975{
1976 if (force)
1977 {
1978 if (IsAlive())
1979 {
1980 setDeathState(DeathState::JustDied);
1981 }
1982 else if (getDeathState() != DeathState::Corpse)
1983 {
1984 setDeathState(DeathState::Corpse);
1985 }
1986 }
1987
1988 ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_RESPAWN, GetEntry());
1989
1990 if (!sConditionMgr->IsObjectMeetToConditions(this, conditions) && !force)
1991 {
1992 // Creature should not respawn, reset respawn timer. Conditions will be checked again the next time it tries to respawn.
1994 return;
1995 }
1996
1997 bool allowed = !IsAIEnabled || AI()->CanRespawn(); // First check if there are any scripts that prevent us respawning
1998 if (!allowed && !force) // Will be rechecked on next Update call
1999 return;
2000
2001 ObjectGuid dbtableHighGuid = ObjectGuid::Create<HighGuid::Unit>(m_creatureData ? m_creatureData->id1 : GetEntry(), m_spawnId);
2002 time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid);
2003
2004 CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(GetEntry());
2005
2006 if (!linkedRespawntime || (cInfo && cInfo->HasFlagsExtra(CREATURE_FLAG_EXTRA_HARD_RESET)) || force) // Should respawn
2007 {
2008 RemoveCorpse(false, false);
2009
2010 if (getDeathState() == DeathState::Dead)
2011 {
2012 if (m_spawnId)
2013 {
2015 CreatureData const* data = sObjectMgr->GetCreatureData(m_spawnId);
2016 // Respawn check if spawn has 2 entries
2017 if (data->id2)
2018 {
2019 uint32 entry = GetRandomId(data->id1, data->id2, data->id3);
2020 UpdateEntry(entry, data, true); // Select Random Entry
2021 m_defaultMovementType = MovementGeneratorType(data->movementType); // Reload Movement Type
2022 LoadEquipment(data->equipmentId); // Reload Equipment
2023 AIM_Initialize(); // Reload AI
2024 }
2025 else
2026 {
2027 if (m_originalEntry != GetEntry())
2029 }
2030 }
2031
2032 LOG_DEBUG("entities.unit", "Respawning creature {} (SpawnId: {}, {})", GetName(), GetSpawnId(), GetGUID().ToString());
2033 m_respawnTime = 0;
2035 loot.clear();
2036 SelectLevel();
2037
2038 setDeathState(DeathState::JustRespawned);
2039
2040 // MDic - Acidmanifesto
2041 // Do not override transform auras
2043 {
2044 uint32 displayID = GetNativeDisplayId();
2045 if (sObjectMgr->GetCreatureModelRandomGender(&displayID)) // Cancel load if no model defined
2046 {
2047 SetDisplayId(displayID);
2048 SetNativeDisplayId(displayID);
2049 }
2050 }
2051
2053
2054 //Call AI respawn virtual function
2055 if (IsAIEnabled)
2056 {
2057 //reset the AI to be sure no dirty or uninitialized values will be used till next tick
2058 AI()->Reset();
2059 TriggerJustRespawned = true;//delay event to next tick so all creatures are created on the map before processing
2060 }
2061
2062 uint32 poolid = m_spawnId ? sPoolMgr->IsPartOfAPool<Creature>(m_spawnId) : 0;
2063 if (poolid)
2064 sPoolMgr->UpdatePool<Creature>(poolid, m_spawnId);
2065
2066 //Re-initialize reactstate that could be altered by movementgenerators
2068
2070 }
2072 // xinef: relocate notifier, fixes npc appearing in corpse position after forced respawn (instead of spawn)
2073 m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f, 0.0f);
2075
2076 }
2077 else // the master is dead
2078 {
2079 ObjectGuid targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
2080 if (targetGuid == dbtableHighGuid) // if linking self, never respawn (check delayed to next day)
2081 {
2083 }
2084 else
2085 {
2086 time_t now = GameTime::GetGameTime().count();
2087 m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime) + urand(5, MINUTE); // else copy time from master and add a little
2088 }
2089 SaveRespawnTime(); // also save to DB immediately
2090 }
2091}
constexpr auto DAY
Definition: Common.h:51
constexpr auto MINUTE
Definition: Common.h:49
#define sConditionMgr
Definition: ConditionMgr.h:289
@ CONDITION_SOURCE_TYPE_CREATURE_RESPAWN
Definition: ConditionMgr.h:151
std::list< Condition * > ConditionList
Definition: ConditionMgr.h:236
@ CREATURE_FLAG_EXTRA_HARD_RESET
Definition: CreatureData.h:80
#define sPoolMgr
Definition: PoolMgr.h:163
@ SPELL_AURA_TRANSFORM
Definition: SpellAuraDefines.h:119
virtual void Reset()
Definition: UnitAI.h:195
virtual bool CanRespawn()
Definition: CreatureAI.h:116
void SaveRespawnTime() override
Definition: Creature.cpp:2550
void SetRespawnTime(uint32 respawn)
Definition: Creature.cpp:3675
void SelectLevel(bool changelevel=true)
Definition: Creature.cpp:1448
void InitializeReactState()
Definition: Creature.cpp:2145
void ResetPickPocketLootTime()
Definition: Creature.h:229
Definition: ObjectGuid.h:120
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition: Unit.cpp:19394
time_t GetLinkedRespawnTime(ObjectGuid guid) const
Definition: Map.cpp:3574
void InitDefault()
Definition: MotionMaster.cpp:87

References AI(), AIM_Initialize(), CreatureAI::CanRespawn(), Loot::clear(), CONDITION_SOURCE_TYPE_CREATURE_RESPAWN, CREATURE_FLAG_EXTRA_HARD_RESET, DAY, CreatureData::equipmentId, Unit::GetAuraEffectsByType(), Unit::getDeathState(), Object::GetEntry(), GameTime::GetGameTime(), Object::GetGUID(), Map::GetLinkedRespawnTime(), WorldObject::GetMap(), Unit::GetMotionMaster(), WorldObject::GetName(), Unit::GetNativeDisplayId(), GetRandomId(), GetSpawnId(), CreatureTemplate::HasFlagsExtra(), CreatureData::id1, CreatureData::id2, CreatureData::id3, MotionMaster::InitDefault(), InitializeReactState(), Unit::IsAIEnabled, Unit::IsAlive(), LoadEquipment(), LOG_DEBUG, loot, m_creatureData, m_defaultMovementType, Unit::m_last_notify_position, m_originalEntry, m_respawnDelay, m_respawnedTime, m_respawnTime, m_spawnId, MINUTE, CreatureData::movementType, Position::Relocate(), RemoveCorpse(), Map::RemoveCreatureRespawnTime(), UnitAI::Reset(), ResetPickPocketLootTime(), SaveRespawnTime(), sConditionMgr, SelectLevel(), setDeathState(), SetDisplayId(), Unit::SetNativeDisplayId(), SetRespawnTime(), sObjectMgr, SPELL_AURA_TRANSFORM, sPoolMgr, Position::ToString(), TriggerJustRespawned, UpdateEntry(), Unit::UpdateObjectVisibility(), and urand().

Referenced by BattlegroundAV::AddAVCreature(), boss_thaddius_summon::boss_thaddius_summonAI::DoAction(), RespawnEvent::Execute(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), misc_commandscript::HandleRespawnCommand(), hyjalAI::JustDied(), npc_isle_of_conquest_turret::npc_isle_of_conquest_turretAI::JustDied(), npc_simone::npc_simoneAI::JustRespawned(), CreatureGroup::MemberEvaded(), instance_karazhan::instance_karazhan_InstanceMapScript::OnCreatureCreate(), instance_uldaman::instance_uldaman_InstanceMapScript::OnCreatureCreate(), instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::OnCreatureCreate(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), at_blackrock_stadium::OnTrigger(), Acore::RespawnDo::operator()(), instance_blood_furnace::instance_blood_furnace_InstanceMapScript::ResetPrisoner(), instance_molten_core::instance_molten_core_InstanceMapScript::SetBossState(), instance_naxxramas::instance_naxxramas_InstanceMapScript::SetBossState(), Battlefield::ShowNpc(), boss_warchief_kargath_bladefist::SummonedCreatureDies(), Update(), npc_escortAI::UpdateAI(), and InstanceScript::UpdateMinionState().

◆ ResumeChasingVictim()

void Creature::ResumeChasingVictim ( )
inline

Helper to resume chasing current victim.

void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:300

References Unit::GetMotionMaster(), Unit::GetVictim(), and MotionMaster::MoveChase().

Referenced by boss_julianne::DoAction(), boss_shade_of_aran::JustEngagedWith(), boss_grandmaster_vorpil::JustEngagedWith(), boss_leotheras_the_blind::Reset(), and boss_laj::ScheduleTasks().

◆ SaveRespawnTime()

◆ SaveToDB() [1/2]

void Creature::SaveToDB ( )
1332{
1333 // this should only be used when the creature has already been loaded
1334 // preferably after adding to map, because mapid may not be valid otherwise
1335 CreatureData const* data = sObjectMgr->GetCreatureData(m_spawnId);
1336 if (!data)
1337 {
1338 LOG_ERROR("entities.unit", "Creature::SaveToDB failed, cannot get creature data!");
1339 return;
1340 }
1341
1343 SaveToDB(mapId, data->spawnMask, GetPhaseMask());
1344}
void SaveToDB()
Definition: Creature.cpp:1331
uint8 spawnMask
Definition: CreatureData.h:378
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:138
MotionTransport * ToMotionTransport()
Definition: GameObject.h:331
uint32 mapID
Definition: GameObjectData.h:223
struct GameObjectTemplate::@223::@238 moTransport
uint32 GetMapId() const
Definition: Position.h:276

References GameObject::GetGOInfo(), WorldLocation::GetMapId(), WorldObject::GetPhaseMask(), WorldObject::GetTransport(), LOG_ERROR, m_spawnId, GameObjectTemplate::mapID, GameObjectTemplate::moTransport, SaveToDB(), sObjectMgr, CreatureData::spawnMask, and GameObject::ToMotionTransport().

Referenced by npc_commandscript::HandleNpcAddCommand(), npc_commandscript::HandleNpcSetLevelCommand(), npc_commandscript::HandleNpcSetModelCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetPhaseCommand(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), and SaveToDB().

◆ SaveToDB() [2/2]

void Creature::SaveToDB ( uint32  mapid,
uint8  spawnMask,
uint32  phaseMask 
)
virtual

Reimplemented in TempSummon, and Pet.

1347{
1348 // update in loaded data
1349 if (!m_spawnId)
1350 m_spawnId = sObjectMgr->GenerateCreatureSpawnId();
1351
1352 CreatureData& data = sObjectMgr->NewOrExistCreatureData(m_spawnId);
1353
1354 uint32 displayId = GetNativeDisplayId();
1355 uint32 npcflag = GetNpcFlags();
1356 uint32 unit_flags = GetUnitFlags();
1357 uint32 dynamicflags = GetDynamicFlags();
1358
1359 // check if it's a custom model and if not, use 0 for displayId
1360 CreatureTemplate const* cinfo = GetCreatureTemplate();
1361 if (cinfo)
1362 {
1363 if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
1364 displayId == cinfo->Modelid3 || displayId == cinfo->Modelid4)
1365 displayId = 0;
1366
1367 if (npcflag == cinfo->npcflag)
1368 npcflag = 0;
1369
1370 if (unit_flags == cinfo->unit_flags)
1371 unit_flags = 0;
1372
1373 if (dynamicflags == cinfo->dynamicflags)
1374 dynamicflags = 0;
1375 }
1376
1377 data.id1 = GetEntry();
1378 data.mapid = mapid;
1379 data.phaseMask = phaseMask;
1380 data.displayid = displayId;
1382 if (!GetTransport())
1383 {
1384 data.posX = GetPositionX();
1385 data.posY = GetPositionY();
1386 data.posZ = GetPositionZ();
1387 data.orientation = GetOrientation();
1388 }
1389 else
1390 {
1391 data.posX = GetTransOffsetX();
1392 data.posY = GetTransOffsetY();
1393 data.posZ = GetTransOffsetZ();
1395 }
1396
1398 // prevent add data integrity problems
1400 data.currentwaypoint = 0;
1401 data.curhealth = GetHealth();
1402 data.curmana = GetPower(POWER_MANA);
1403 // prevent add data integrity problems
1406 data.spawnMask = spawnMask;
1407 data.npcflag = npcflag;
1408 data.unit_flags = unit_flags;
1409 data.dynamicflags = dynamicflags;
1410
1411 // update in DB
1412 WorldDatabaseTransaction trans = WorldDatabase.BeginTransaction();
1413
1415 stmt->SetData(0, m_spawnId);
1416 trans->Append(stmt);
1417
1418 uint8 index = 0;
1419
1420 stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE);
1421 stmt->SetData(index++, m_spawnId);
1422 stmt->SetData(index++, GetEntry());
1423 stmt->SetData(index++, 0);
1424 stmt->SetData(index++, 0);
1425 stmt->SetData(index++, uint16(mapid));
1426 stmt->SetData(index++, spawnMask);
1427 stmt->SetData(index++, GetPhaseMask());
1428 stmt->SetData(index++, int32(GetCurrentEquipmentId()));
1429 stmt->SetData(index++, GetPositionX());
1430 stmt->SetData(index++, GetPositionY());
1431 stmt->SetData(index++, GetPositionZ());
1432 stmt->SetData(index++, GetOrientation());
1433 stmt->SetData(index++, m_respawnDelay);
1434 stmt->SetData(index++, m_wanderDistance);
1435 stmt->SetData(index++, 0);
1436 stmt->SetData(index++, GetHealth());
1437 stmt->SetData(index++, GetPower(POWER_MANA));
1438 stmt->SetData(index++, uint8(GetDefaultMovementType()));
1439 stmt->SetData(index++, npcflag);
1440 stmt->SetData(index++, unit_flags);
1441 stmt->SetData(index++, dynamicflags);
1442 trans->Append(stmt);
1443
1444 WorldDatabase.CommitTransaction(trans);
1445 sScriptMgr->OnCreatureSaveToDB(this);
1446}
@ WORLD_INS_CREATURE
Definition: WorldDatabase.h:92
uint8 GetCurrentEquipmentId()
Definition: Creature.h:188
MovementGeneratorType GetDefaultMovementType() const override
-------—End of Pet responses methods-------—
Definition: Creature.h:87
uint32 unit_flags
Definition: CreatureData.h:207
uint32 Modelid4
Definition: CreatureData.h:183
uint32 Modelid1
Definition: CreatureData.h:180
uint32 Modelid2
Definition: CreatureData.h:181
uint32 npcflag
Definition: CreatureData.h:192
uint32 Modelid3
Definition: CreatureData.h:182
uint32 dynamicflags
Definition: CreatureData.h:209
uint32 dynamicflags
Definition: CreatureData.h:381
uint32 displayid
Definition: CreatureData.h:366
uint32 unit_flags
Definition: CreatureData.h:380
uint32 currentwaypoint
Definition: CreatureData.h:374
uint16 mapid
Definition: CreatureData.h:364
float GetTransOffsetX() const
Definition: Object.h:586
float GetTransOffsetY() const
Definition: Object.h:587
float GetTransOffsetZ() const
Definition: Object.h:588
float GetTransOffsetO() const
Definition: Object.h:589
NPCFlags GetNpcFlags() const
Definition: Unit.h:1659
UnitFlags GetUnitFlags() const
Definition: Unit.h:1493
uint32 GetDynamicFlags() const override
Definition: Unit.h:1337

References CreatureData::curhealth, CreatureData::curmana, CreatureData::currentwaypoint, CreatureData::displayid, CreatureTemplate::dynamicflags, CreatureData::dynamicflags, CreatureData::equipmentId, GetCreatureTemplate(), GetCurrentEquipmentId(), GetDefaultMovementType(), Unit::GetDynamicFlags(), Object::GetEntry(), Unit::GetHealth(), Unit::GetNativeDisplayId(), Unit::GetNpcFlags(), Position::GetOrientation(), WorldObject::GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetPower(), WorldObject::GetTransOffsetO(), WorldObject::GetTransOffsetX(), WorldObject::GetTransOffsetY(), WorldObject::GetTransOffsetZ(), WorldObject::GetTransport(), Unit::GetUnitFlags(), CreatureData::id1, IDLE_MOTION_TYPE, m_respawnDelay, m_spawnId, m_wanderDistance, CreatureData::mapid, CreatureTemplate::Modelid1, CreatureTemplate::Modelid2, CreatureTemplate::Modelid3, CreatureTemplate::Modelid4, CreatureData::movementType, CreatureTemplate::npcflag, CreatureData::npcflag, CreatureData::orientation, CreatureData::phaseMask, CreatureData::posX, CreatureData::posY, CreatureData::posZ, POWER_MANA, RANDOM_MOTION_TYPE, PreparedStatementBase::SetData(), sObjectMgr, CreatureData::spawnMask, CreatureData::spawntimesecs, sScriptMgr, CreatureTemplate::unit_flags, CreatureData::unit_flags, CreatureData::wander_distance, WORLD_DEL_CREATURE, WORLD_INS_CREATURE, and WorldDatabase.

◆ SearchFormation()

void Creature::SearchFormation ( )
327{
328 if (IsSummon())
329 {
330 return;
331 }
332
334 if (!spawnId)
335 {
336 return;
337 }
338
339 CreatureGroupInfoType::const_iterator frmdata = sFormationMgr->CreatureGroupMap.find(spawnId);
340 if (frmdata != sFormationMgr->CreatureGroupMap.end())
341 {
342 sFormationMgr->AddCreatureToGroup(frmdata->second.leaderGUID, this);
343 }
344}
uint32 LowType
Definition: ObjectGuid.h:124

References GetSpawnId(), Unit::IsSummon(), and sFormationMgr.

Referenced by AddToWorld(), and npc_commandscript::HandleNpcAddFormationCommand().

◆ SelectLevel()

void Creature::SelectLevel ( bool  changelevel = true)
Todo:
: set UNIT_FIELD_POWER*, for some creature class case (energy, etc)
1449{
1450 CreatureTemplate const* cInfo = GetCreatureTemplate();
1451
1452 uint32 rank = IsPet() ? 0 : cInfo->rank;
1453
1454 // level
1455 uint8 minlevel = std::min(cInfo->maxlevel, cInfo->minlevel);
1456 uint8 maxlevel = std::max(cInfo->maxlevel, cInfo->minlevel);
1457 uint8 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel);
1458
1459 sScriptMgr->OnBeforeCreatureSelectLevel(cInfo, this, level);
1460
1461 if (changelevel)
1462 SetLevel(level);
1463
1464 CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cInfo->unit_class);
1465
1466 // health
1467 float healthmod = _GetHealthMod(rank);
1468
1469 uint32 basehp = std::max<uint32>(1, stats->GenerateHealth(cInfo));
1470 uint32 health = uint32(basehp * healthmod);
1471
1472 SetCreateHealth(health);
1473 SetMaxHealth(health);
1474 SetHealth(health);
1476
1477 // mana
1478 uint32 mana = stats->GenerateMana(cInfo);
1479
1480 SetCreateMana(mana);
1481 SetMaxPower(POWER_MANA, mana); //MAX Mana
1482 SetPower(POWER_MANA, mana);
1483
1485
1488
1489 // damage
1490
1491 float basedamage = stats->GenerateBaseDamage(cInfo);
1492
1493 float weaponBaseMinDamage = basedamage;
1494 float weaponBaseMaxDamage = basedamage * 1.5;
1495
1496 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, weaponBaseMinDamage);
1497 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
1498
1499 SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, weaponBaseMinDamage);
1500 SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
1501
1502 SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, weaponBaseMinDamage);
1503 SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
1504
1507
1508 sScriptMgr->Creature_SelectLevel(cInfo, this);
1509}
@ UNIT_MOD_ATTACK_POWER
Definition: Unit.h:282
@ UNIT_MOD_HEALTH
Definition: Unit.h:267
@ UNIT_MOD_MANA
Definition: Unit.h:268
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition: Unit.h:283
void ResetPlayerDamageReq()
Definition: Creature.cpp:3717
uint8 minlevel
Definition: CreatureData.h:188
uint8 maxlevel
Definition: CreatureData.h:189
Definition: CreatureData.h:292
uint32 RangedAttackPower
Definition: CreatureData.h:297
uint32 AttackPower
Definition: CreatureData.h:296
float GenerateBaseDamage(CreatureTemplate const *info) const
Definition: CreatureData.h:321
uint32 GenerateMana(CreatureTemplate const *info) const
Definition: CreatureData.h:307
uint32 GenerateHealth(CreatureTemplate const *info) const
Definition: CreatureData.h:302
void SetCreateHealth(uint32 val)
Definition: Unit.h:2052
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value, uint8 damageIndex=0)
Definition: Unit.h:2132
void SetMaxPower(Powers power, uint32 val)
Definition: Unit.cpp:15617
void SetCreateMana(uint32 val)
Definition: Unit.h:2054
void SetLevel(uint8 lvl, bool showLevelChange=true)
Definition: Unit.cpp:15446
void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value)
Definition: Unit.h:2112
void SetMaxHealth(uint32 val)
Definition: Unit.cpp:15514

References _GetHealthMod(), CreatureBaseStats::AttackPower, BASE_ATTACK, BASE_VALUE, CreatureBaseStats::GenerateBaseDamage(), CreatureBaseStats::GenerateHealth(), CreatureBaseStats::GenerateMana(), GetCreatureTemplate(), Unit::IsPet(), MAXDAMAGE, CreatureTemplate::maxlevel, MINDAMAGE, CreatureTemplate::minlevel, OFF_ATTACK, POWER_MANA, RANGED_ATTACK, CreatureBaseStats::RangedAttackPower, CreatureTemplate::rank, ResetPlayerDamageReq(), Unit::SetBaseWeaponDamage(), Unit::SetCreateHealth(), Unit::SetCreateMana(), Unit::SetHealth(), Unit::SetLevel(), Unit::SetMaxHealth(), Unit::SetMaxPower(), Unit::SetModifierValue(), Unit::SetPower(), sObjectMgr, sScriptMgr, CreatureTemplate::unit_class, UNIT_MOD_ATTACK_POWER, UNIT_MOD_ATTACK_POWER_RANGED, UNIT_MOD_HEALTH, UNIT_MOD_MANA, and urand().

Referenced by Spell::EffectSummonType(), npc_target_dummy::npc_target_dummyAI::Reset(), Respawn(), and UpdateEntry().

◆ SelectNearestTarget()

Unit * Creature::SelectNearestTarget ( float  dist = 0,
bool  playerOnly = false 
) const
2324{
2325 if (dist == 0.0f)
2326 {
2328 }
2329
2330 Unit* target = nullptr;
2331
2332 Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
2333 Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck> searcher(this, target, u_check);
2334 Cell::VisitAllObjects(this, searcher, dist);
2335 return target;
2336}
#define MAX_VISIBILITY_DISTANCE
Definition: ObjectDefines.h:31
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:207
Definition: GridNotifiers.h:403
Definition: GridNotifiers.h:1188

References MAX_VISIBILITY_DISTANCE, and Cell::VisitAllObjects().

Referenced by boss_twinemperorsAI::DoAction(), SmartScript::GetTargets(), npc_toc_warlock::npc_toc_warlockAI::JustSummoned(), npc_toc_hunter::npc_toc_hunterAI::JustSummoned(), npc_toc_boomkin::npc_toc_boomkinAI::JustSummoned(), boss_onyxia::JustSummoned(), boss_black_knight::boss_black_knightAI::JustSummoned(), boss_grand_champion::boss_grand_championAI::MovementInform(), npc_swarm_scarab::npc_swarm_scarabAI::Reset(), npc_nerubian_burrower::npc_nerubian_burrowerAI::Reset(), npc_fel_infernal::npc_fel_infernalAI::Reset(), npc_mistress_of_pain::npc_mistress_of_painAI::Reset(), boss_skarvald_the_constructor::boss_skarvald_the_constructorAI::Reset(), boss_dalronn_the_controller::boss_dalronn_the_controllerAI::Reset(), npc_heated_battle::npc_heated_battleAI::Reset(), npc_pet_hunter_snake_trap::Reset(), npc_pet_pri_shadowfiend::Reset(), npc_memory::npc_memoryAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), npc_freya_ward::npc_freya_wardAI::UpdateAI(), npc_q24545_vegard::npc_q24545_vegardAI::UpdateAI(), and npc_pet_gen_target_following_bomb::UpdateAI().

◆ SelectNearestTargetInAttackDistance()

Unit * Creature::SelectNearestTargetInAttackDistance ( float  dist) const
2340{
2341 if (dist < ATTACK_DISTANCE)
2342 dist = ATTACK_DISTANCE;
2343 if (dist > MAX_SEARCHER_DISTANCE)
2344 dist = MAX_SEARCHER_DISTANCE;
2345
2346 Unit* target = nullptr;
2349 Cell::VisitAllObjects(this, searcher, std::max(dist, ATTACK_DISTANCE));
2350
2351 return target;
2352}
#define MAX_SEARCHER_DISTANCE
Definition: ObjectDefines.h:33
Definition: GridNotifiers.h:1217

References ATTACK_DISTANCE, MAX_SEARCHER_DISTANCE, and Cell::VisitAllObjects().

Referenced by PetAI::SelectNextTarget(), and SimpleCharmedAI::UpdateAI().

◆ SelectVictim()

Unit * Creature::SelectVictim ( )
14720{
14721 // function provides main threat functionality
14722 // next-victim-selection algorithm and evade mode are called
14723 // threat list sorting etc.
14724
14725 Unit* target = nullptr;
14726
14727 // First checking if we have some taunt on us
14729 if (!tauntAuras.empty())
14730 for (Unit::AuraEffectList::const_reverse_iterator itr = tauntAuras.rbegin(); itr != tauntAuras.rend(); ++itr)
14731 if (Unit* caster = (*itr)->GetCaster())
14732 if (CanCreatureAttack(caster) && !caster->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, GetGUID()))
14733 {
14734 target = caster;
14735 break;
14736 }
14737
14738 if (CanHaveThreatList())
14739 {
14740 if (!target && !m_ThreatMgr.isThreatListEmpty())
14741 target = m_ThreatMgr.getHostileTarget();
14742 }
14743 else if (!HasReactState(REACT_PASSIVE))
14744 {
14745 // we have player pet probably
14746 target = getAttackerForHelper();
14747 if (!target && IsSummon())
14748 if (Unit* owner = ToTempSummon()->GetOwner())
14749 {
14750 if (owner->IsInCombat())
14751 target = owner->getAttackerForHelper();
14752 if (!target)
14753 for (ControlSet::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr)
14754 if ((*itr)->IsInCombat())
14755 {
14756 target = (*itr)->getAttackerForHelper();
14757 if (target)
14758 break;
14759 }
14760 }
14761 }
14762 else
14763 return nullptr;
14764
14765 if (target && CanCreatureAttack(target))
14766 {
14767 SetInFront(target);
14768 return target;
14769 }
14770
14771 // last case when creature must not go to evade mode:
14772 // it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list
14773 // Note: creature does not have targeted movement generator but has attacker in this case
14774 for (AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
14775 if ((*itr) && CanCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER && !(*itr)->ToCreature()->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
14776 return nullptr;
14777
14778 if (GetVehicle())
14779 return nullptr;
14780
14781 // pussywizard: not sure why it's here
14782 // pussywizard: can't evade when having invisibility aura with duration? o_O
14784 if (!iAuras.empty())
14785 {
14786 for (Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
14787 if ((*itr)->GetBase()->IsPermanent())
14788 {
14790 break;
14791 }
14792 return nullptr;
14793 }
14794
14795 // Last chance: creature group
14796 if (CreatureGroup* group = GetFormation())
14797 {
14798 if (Unit* groupTarget = group->GetNewTargetForMember(this))
14799 {
14800 SetInFront(groupTarget);
14801 return groupTarget;
14802 }
14803 }
14804
14805 // enter in evade mode in other case
14806 AI()->EnterEvadeMode();
14807
14808 return nullptr;
14809}
@ UNIT_MASK_CONTROLABLE_GUARDIAN
Definition: Unit.h:683
@ SPELL_AURA_MOD_INVISIBILITY
Definition: SpellAuraDefines.h:81
@ SPELL_AURA_IGNORED
Definition: SpellAuraDefines.h:284
@ EVADE_REASON_NO_HOSTILES
Definition: CreatureAI.h:90
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:196
Unit * getHostileTarget()
Definition: ThreatMgr.cpp:515
bool isThreatListEmpty() const
Definition: ThreatMgr.h:225
CreatureGroup const * GetFormation() const
Definition: Creature.h:347
Definition: CreatureGroups.h:89
Vehicle * GetVehicle() const
Definition: Unit.h:2368
ThreatMgr m_ThreatMgr
Definition: Unit.h:2544
AttackerSet m_attackers
Definition: Unit.h:2501

References AI(), CanCreatureAttack(), Unit::CanHaveThreatList(), CreatureAI::EnterEvadeMode(), CreatureAI::EVADE_REASON_NO_HOSTILES, Unit::getAttackerForHelper(), Unit::GetAuraEffectsByType(), GetFormation(), Object::GetGUID(), ThreatMgr::getHostileTarget(), Unit::GetOwner(), Unit::GetVehicle(), HasReactState(), Unit::IsSummon(), ThreatMgr::isThreatListEmpty(), Unit::m_attackers, Unit::m_ThreatMgr, REACT_PASSIVE, Unit::SetInFront(), SPELL_AURA_IGNORED, SPELL_AURA_MOD_INVISIBILITY, SPELL_AURA_MOD_TAUNT, Unit::ToTempSummon(), TYPEID_PLAYER, and UNIT_MASK_CONTROLABLE_GUARDIAN.

Referenced by StartMovementEvent::Execute(), boss_urom::boss_uromAI::JustSummoned(), boss_gyth::boss_gythAI::JustSummoned(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), npc_rimefang::npc_rimefangAI::MovementInform(), Unit::TauntFadeOut(), Update(), npc_raging_spirit::npc_raging_spiritAI::UpdateAI(), npc_pet_gen_gnomish_flame_turret::UpdateAI(), CreatureAI::UpdateVictim(), and CreatureAI::UpdateVictimWithGaze().

◆ SendAIReaction()

void Creature::SendAIReaction ( AiReaction  reactionType)
2355{
2356 WorldPacket data(SMSG_AI_REACTION, 12);
2357
2358 data << GetGUID();
2359 data << uint32(reactionType);
2360
2361 ((WorldObject*)this)->SendMessageToSet(&data, true);
2362
2363 LOG_DEBUG("network", "WORLD: Sent SMSG_AI_REACTION, type {}.", reactionType);
2364}
@ SMSG_AI_REACTION
Definition: Opcodes.h:346
Definition: Object.h:393

References Object::GetGUID(), LOG_DEBUG, and SMSG_AI_REACTION.

Referenced by Unit::Attack(), and CreatureAI::TriggerAlert().

◆ SendZoneUnderAttackMessage()

void Creature::SendZoneUnderAttackMessage ( Player attacker)

Send a message to LocalDefense channel for players opposition team in the zone.

2726{
2728 data << (uint32)GetAreaId();
2729 sWorld->SendGlobalMessage(&data, nullptr, (attacker->GetTeamId() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE));
2730}
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ SMSG_ZONE_UNDER_ATTACK
Definition: Opcodes.h:626
uint32 GetAreaId() const
Definition: Object.cpp:3108
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2072

References WorldObject::GetAreaId(), Player::GetTeamId(), SMSG_ZONE_UNDER_ATTACK, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.

Referenced by GuardAI::JustDied().

◆ SetAssistanceTimer()

void Creature::SetAssistanceTimer ( uint32  value)
inline
394{ m_assistanceTimer = value; }

References m_assistanceTimer.

Referenced by Unit::Attack().

◆ SetCanDualWield()

void Creature::SetCanDualWield ( bool  value)
overridevirtual

◆ SetCanFly()

bool Creature::SetCanFly ( bool  enable,
bool  packetOnly = false 
)
overridevirtual

movement counter

Reimplemented from Unit.

3195{
3196 if (!Unit::SetCanFly(enable))
3197 return false;
3198
3199 if (m_movedByPlayer)
3200 {
3201 sScriptMgr->AnticheatSetCanFlybyServer(m_movedByPlayer->ToPlayer(), enable);
3202
3203 if (!enable)
3205
3207 data << GetPackGUID();
3208 data << uint32(0);
3210
3211 data.Initialize(MSG_MOVE_UPDATE_CAN_FLY, 64);
3212 data << GetPackGUID();
3213 BuildMovementPacket(&data);
3214 m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
3215 return true;
3216 }
3217
3219 data << GetPackGUID();
3220 SendMessageToSet(&data, false);
3221 return true;
3222}
@ MSG_MOVE_UPDATE_CAN_FLY
Definition: Opcodes.h:971
@ SMSG_SPLINE_MOVE_SET_FLYING
Definition: Opcodes.h:1088
@ SMSG_MOVE_SET_CAN_FLY
Definition: Opcodes.h:865
@ SMSG_SPLINE_MOVE_UNSET_FLYING
Definition: Opcodes.h:1089
@ SMSG_MOVE_UNSET_CAN_FLY
Definition: Opcodes.h:866
PackedGuid const & GetPackGUID() const
Definition: Object.h:108
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition: Object.h:482
void SetFallInformation(uint32 time, float z)
Definition: Player.h:2298
void SendMessageToSet(WorldPacket const *data, bool self) const override
Definition: Player.h:1989
virtual bool SetCanFly(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20958
SafeUnitPointer m_movedByPlayer
Definition: Unit.h:1902
void BuildMovementPacket(ByteBuffer *data) const
Definition: Unit.cpp:20171

References Unit::BuildMovementPacket(), GameTime::GetGameTime(), Object::GetPackGUID(), Position::GetPositionZ(), WorldPacket::Initialize(), Unit::m_movedByPlayer, MSG_MOVE_UPDATE_CAN_FLY, Player::SendDirectMessage(), WorldObject::SendMessageToSet(), Player::SendMessageToSet(), Unit::SetCanFly(), Player::SetFallInformation(), SMSG_MOVE_SET_CAN_FLY, SMSG_MOVE_UNSET_CAN_FLY, SMSG_SPLINE_MOVE_SET_FLYING, SMSG_SPLINE_MOVE_UNSET_FLYING, sScriptMgr, and Object::ToPlayer().

Referenced by boss_twin_valkyrAI::boss_twin_valkyrAI(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::DoAction(), npc_ball_of_flame::npc_ball_of_flameAI::DoAction(), npc_kalecgos_kj::npc_kalecgos_kjAI::DoAction(), boss_urom::boss_uromAI::EnterEvadeMode(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::FlyAway(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::GoToMinchar(), boss_sartharion_tenebron::boss_sartharion_tenebronAI::HandleExtraEvent(), boss_sartharion_shadron::boss_sartharion_shadronAI::HandleExtraEvent(), boss_sartharion_vesperon::boss_sartharion_vesperonAI::HandleExtraEvent(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::InitializeAI(), npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::IsSummonedBy(), boss_urom::boss_uromAI::JustDied(), boss_sartharion_dragonAI::JustEngagedWith(), boss_ayamiss::JustEngagedWith(), npc_icc_spire_frostwyrm::JustReachedHome(), brann_bronzebeard::brann_bronzebeardAI::JustSummoned(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustSummoned(), boss_kiljaeden::boss_kiljaedenAI::JustSummoned(), boss_onyxia::MovementInform(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::MovementInform(), boss_sister_svalna::boss_sister_svalnaAI::MovementInform(), npc_icc_spire_frostwyrm::MovementInform(), npc_enslaved_proto_drake::npc_enslaved_proto_drakeAI::MovementInform(), boss_nazan::MovementInform(), npc_hallows_end_soh::MovementInform(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::MovementInform(), npc_alexstrasza::npc_alexstraszaAI::npc_alexstraszaAI(), npc_batrider::npc_batrider(), npc_concentrated_ball::npc_concentrated_ballAI::npc_concentrated_ballAI(), npc_pet_gen_moth::npc_pet_gen_moth(), npc_vehicle_d16_propelled_delivery::npc_vehicle_d16_propelled_deliveryAI::PassengerBoarded(), npc_hover_disk::npc_hover_diskAI::PassengerBoarded(), boss_nefarian::PathEndReached(), boss_nefarian::Reset(), npc_image_of_medivh::npc_image_of_medivhAI::Reset(), npc_valkyr_battle_maiden::npc_valkyr_battle_maidenAI::Reset(), npc_hallows_end_soh::Reset(), boss_onyxia::Reset(), boss_ayamiss::Reset(), boss_sartharion_dragonAI::Reset(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::Reset(), boss_sister_svalna::boss_sister_svalnaAI::Reset(), npc_icc_spire_frostwyrm::Reset(), npc_ulduar_mimiron_rocket::npc_ulduar_mimiron_rocketAI::Reset(), boss_nazan::Reset(), npc_enslaved_proto_drake::npc_enslaved_proto_drakeAI::SetData(), SmartAI::SetFly(), npc_simon_bunny::npc_simon_bunnyAI::SetGUID(), boss_urom::boss_uromAI::SpellHit(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::UpdateAI(), boss_onyxia::UpdateAI(), npc_frost_sphere::npc_frost_sphereAI::UpdateAI(), boss_krick::boss_krickAI::UpdateAI(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::UpdateAI(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::UpdateAI(), boss_urom::boss_uromAI::UpdateAI(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI(), npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI::UpdateAI(), npc_pet_gen_wind_rider_cub::UpdateAI(), npc_batrider::UpdateAI(), and UpdateMovementFlags().

◆ SetCannotReachTarget()

void Creature::SetCannotReachTarget ( ObjectGuid const &  target = ObjectGuid::Empty)
3557{
3558 if (cannotReach == m_cannotReachTarget)
3559 {
3560 return;
3561 }
3562
3563 m_cannotReachTarget = cannotReach;
3565
3566 if (cannotReach)
3567 {
3568 LOG_DEBUG("entities.unit", "Creature::SetCannotReachTarget() called with true. Details: {}", GetDebugInfo());
3569 }
3570}
std::string GetDebugInfo() const override
Definition: Creature.cpp:3755

References GetDebugInfo(), LOG_DEBUG, m_cannotReachTarget, and m_cannotReachTimer.

Referenced by CreatureAI::_EnterEvadeMode(), ChaseMovementGenerator< T >::DoUpdate(), setDeathState(), and Update().

◆ SetCombatPulseDelay()

void Creature::SetCombatPulseDelay ( uint32  delay)
inline
290 {
291 m_combatPulseDelay = delay;
292 if (m_combatPulseTime == 0 || m_combatPulseTime > delay)
293 m_combatPulseTime = delay;
294 }

References m_combatPulseDelay, and m_combatPulseTime.

Referenced by BossAI::_JustEngagedWith(), and BossAI::_Reset().

◆ SetCorpseDelay()

void Creature::SetCorpseDelay ( uint32  delay)
inline
72{ m_corpseDelay = delay; }

References m_corpseDelay.

Referenced by npc_raging_flames::InitializeAI(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::JustDied(), npc_hor_raging_ghoul::npc_hor_raging_ghoulAI::JustDied(), npc_hor_risen_witch_doctor::npc_hor_risen_witch_doctorAI::JustDied(), npc_hor_lumbering_abomination::npc_hor_lumbering_abominationAI::JustDied(), npc_mindless_ghoul::npc_mindless_ghoulAI::JustDied(), boss_hazzarah::JustSummoned(), npc_anubarak_spike::npc_anubarak_spikeAI::npc_anubarak_spikeAI(), npc_frost_sphere::npc_frost_sphereAI::npc_frost_sphereAI(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::npc_highlord_darion_mograineAI(), npc_mindless_ghoul::npc_mindless_ghoulAI::npc_mindless_ghoulAI(), instance_black_temple::instance_black_temple_InstanceMapScript::OnCreatureCreate(), ValithriaDespawner::operator()(), npc_varian_wrynn::npc_varian_wrynnAI::Reset(), npc_jaina_proudmoore_bfu::npc_jaina_proudmoore_bfuAI::Reset(), npc_thrall_bfu::npc_thrall_bfuAI::Reset(), npc_lady_sylvanas_windrunner_bfu::npc_lady_sylvanas_windrunner_bfuAI::Reset(), npc_swarm_scarab::npc_swarm_scarabAI::Reset(), npc_nerubian_burrower::npc_nerubian_burrowerAI::Reset(), npc_lk_wicked_spirit::npc_lk_wicked_spiritAI::Reset(), npc_valithria_cloud::npc_valithria_cloudAI::Reset(), npc_argent_captainAI::Reset(), npc_heated_battle::npc_heated_battleAI::Reset(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::Reset(), and boss_svala::boss_svalaAI::UpdateAI().

◆ SetCorpseRemoveTime()

void Creature::SetCorpseRemoveTime ( uint32  delay)

◆ SetCurrentEquipmentId()

void Creature::SetCurrentEquipmentId ( uint8  id)
inline

◆ setDeathState()

void Creature::setDeathState ( DeathState  s,
bool  despawn = false 
)
overridevirtual

Reimplemented from Unit.

Reimplemented in Minion, and Pet.

1904{
1905 Unit::setDeathState(s, despawn);
1906
1907 if (s == DeathState::JustDied)
1908 {
1909 _lastDamagedTime.reset();
1910
1913
1914 // always save boss respawn time at death to prevent crash cheating
1915 if (GetMap()->IsDungeon() || isWorldBoss() || GetCreatureTemplate()->rank >= CREATURE_ELITE_ELITE)
1917
1918 SetTarget(); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
1920
1921 Dismount(); // if creature is mounted on a virtual mount, remove it at death
1922
1923 setActive(false);
1924
1926 {
1927 SetNoSearchAssistance(false);
1928 }
1929
1930 //Dismiss group if is leader
1931 if (m_formation && m_formation->GetLeader() == this)
1932 m_formation->FormationReset(true, false);
1933
1934 bool needsFalling = !despawn && (IsFlying() || IsHovering()) && !IsUnderWater();
1935 SetHover(false, false, false);
1936 SetDisableGravity(false, false, false);
1937
1938 if (needsFalling)
1939 GetMotionMaster()->MoveFall(0, true);
1940
1941 Unit::setDeathState(DeathState::Corpse, despawn);
1942 }
1943 else if (s == DeathState::JustRespawned)
1944 {
1945 //if (IsPet())
1946 // setActive(true);
1947 SetFullHealth();
1948 SetLootRecipient(nullptr);
1951 CreatureTemplate const* cinfo = GetCreatureTemplate();
1952 // Xinef: npc run by default
1953 //SetWalk(true);
1954
1955 // pussywizard:
1958
1960
1964
1965 Unit::setDeathState(DeathState::Alive, despawn);
1966
1968 LoadCreaturesAddon(true);
1969 if (GetCreatureData() && GetPhaseMask() != GetCreatureData()->phaseMask)
1970 SetPhaseMask(GetCreatureData()->phaseMask, false);
1971 }
1972}
@ MOVEMENTFLAG_FALLING
Definition: Unit.h:564
NPCFlags
Non Player Character flags.
Definition: Unit.h:514
@ UNIT_NPC_FLAG_NONE
Definition: Unit.h:515
@ UNIT_STATE_ALL_STATE
Definition: Unit.h:373
@ UNIT_STATE_NO_ENVIRONMENT_UPD
Definition: Unit.h:353
SpellSchools
Definition: SharedDefines.h:282
bool HasSearchedAssistance()
Definition: Creature.h:263
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1258
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
void SetCannotReachTarget(ObjectGuid const &target=ObjectGuid::Empty)
Definition: Creature.cpp:3556
bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3274
void SetMeleeDamageSchool(SpellSchools school)
Definition: Creature.h:161
uint32 dmgschool
Definition: CreatureData.h:200
virtual void setDeathState(DeathState s, bool despawn=false)
Definition: Unit.cpp:14538
void SetFullHealth()
Definition: Unit.h:1469
void Dismount()
Definition: Unit.cpp:13518
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:2288
virtual bool IsUnderWater() const
Definition: Unit.cpp:4296
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:2287
void ReplaceAllNpcFlags(NPCFlags flags)
Definition: Unit.h:1663
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
Definition: MotionMaster.cpp:587

References _lastDamagedTime, Unit::ClearUnitState(), CREATURE_ELITE_ELITE, Unit::Dismount(), CreatureTemplate::dmgschool, CreatureGroup::FormationReset(), GetCreatureData(), GetCreatureTemplate(), GameTime::GetGameTime(), CreatureGroup::GetLeader(), WorldObject::GetMap(), Unit::GetMotionMaster(), WorldObject::GetPhaseMask(), HasSearchedAssistance(), Unit::HasUnitMovementFlag(), Unit::IsFlying(), Unit::IsHovering(), Unit::IsUnderWater(), isWorldBoss(), LoadCreaturesAddon(), m_corpseDelay, m_corpseRemoveTime, m_formation, m_respawnDelay, m_respawnTime, Motion_Initialize(), MotionMaster::MoveFall(), MOVEMENTFLAG_FALLING, CreatureTemplate::npcflag, Unit::RemoveUnitMovementFlag(), Unit::ReplaceAllNpcFlags(), ResetPlayerDamageReq(), SaveRespawnTime(), WorldObject::setActive(), SetCannotReachTarget(), Unit::setDeathState(), SetDisableGravity(), Unit::SetFullHealth(), SetHover(), SetLootRecipient(), SetMeleeDamageSchool(), SetNoSearchAssistance(), Unit::SetPhaseMask(), SetTarget(), UNIT_NPC_FLAG_NONE, UNIT_STATE_ALL_STATE, UNIT_STATE_IGNORE_PATHFINDING, UNIT_STATE_NO_ENVIRONMENT_UPD, and UpdateMovementFlags().

Referenced by BattlegroundAV::AddAVCreature(), DisappearAndDie(), npc_auriaya_feral_defender::npc_auriaya_feral_defenderAI::DoAction(), boss_freya_summons::boss_freya_summonsAI::DoAction(), ForcedDespawn(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcSetMoveTypeCommand(), npc_commandscript::HandleNpcSetWanderDistanceCommand(), npc_echo_of_medivh::HandlePieceJustDied(), npc_nether_drake::npc_nether_drakeAI::MovementInform(), instance_ulduar::instance_ulduar_InstanceMapScript::OnCreatureCreate(), RemoveCorpse(), Respawn(), npc_simone::npc_simoneAI::RespawnPet(), Minion::setDeathState(), Pet::setDeathState(), boss_hexlord_malacrass::boss_hex_lord_malacrassAI::SpawnAdds(), npc_argent_captainAI::SpellHit(), npc_drakuru_shackles::npc_drakuru_shacklesAI::SpellHit(), npc_escortAI::UpdateAI(), npc_a_special_surprise::npc_a_special_surpriseAI::UpdateAI(), npc_towering_infernal::npc_towering_infernalAI::UpdateAI(), npc_lesser_doomguard::npc_lesser_doomguardAI::UpdateAI(), npc_clintar_spirit::npc_clintar_spiritAI::UpdateAI(), npc_injured_patient::npc_injured_patientAI::UpdateAI(), npc_abomination::npc_abominationAI::WaypointReached(), and npc_ghoul::npc_ghoulAI::WaypointReached().

◆ SetDefaultMovementType()

◆ SetDetectionDistance()

void Creature::SetDetectionDistance ( float  dist)
inline
201{ m_detectionDistance = dist; }

References m_detectionDistance.

Referenced by UpdateEntry().

◆ SetDisableGravity()

bool Creature::SetDisableGravity ( bool  disable,
bool  packetOnly = false,
bool  updateAnimationTier = true 
)
overridevirtual

It's possible only a packet is sent but moveflags are not updated Need more research on this

movement counter

Reimplemented from Unit.

3110{
3113 if (!packetOnly && !Unit::SetDisableGravity(disable))
3114 return false;
3115
3116 if (m_movedByPlayer)
3117 {
3119 data << GetPackGUID();
3120 data << uint32(0);
3122
3123 data.Initialize(MSG_MOVE_GRAVITY_CHNG, 64);
3124 data << GetPackGUID();
3125 BuildMovementPacket(&data);
3126 m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
3127 return true;
3128 }
3129
3130 if (updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT) && !IsRooted())
3131 {
3132 if (IsLevitating())
3134 else if (IsHovering())
3136 else
3138 }
3139
3141 data << GetPackGUID();
3142 SendMessageToSet(&data, false);
3143 return true;
3144}
@ UNIT_BYTE1_FLAG_FLY
Definition: Unit.h:82
@ UNIT_BYTE1_FLAG_GROUND
Definition: Unit.h:79
@ UNIT_BYTE1_FLAG_HOVER
Definition: Unit.h:81
@ UNIT_STATE_ROOT
Definition: Unit.h:335
@ SMSG_SPLINE_MOVE_GRAVITY_DISABLE
Definition: Opcodes.h:1265
@ SMSG_MOVE_GRAVITY_DISABLE
Definition: Opcodes.h:1260
@ SMSG_MOVE_GRAVITY_ENABLE
Definition: Opcodes.h:1262
@ SMSG_SPLINE_MOVE_GRAVITY_ENABLE
Definition: Opcodes.h:1266
@ MSG_MOVE_GRAVITY_CHNG
Definition: Opcodes.h:1264
bool IsRooted() const
Definition: Creature.h:85
bool IsLevitating() const
Definition: Unit.h:2392
virtual bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:20921

References Unit::BuildMovementPacket(), Object::GetPackGUID(), Unit::HasUnitState(), WorldPacket::Initialize(), Unit::IsAlive(), Unit::IsHovering(), Unit::IsLevitating(), IsRooted(), Unit::m_movedByPlayer, MSG_MOVE_GRAVITY_CHNG, Player::SendDirectMessage(), WorldObject::SendMessageToSet(), Player::SendMessageToSet(), Object::SetByteValue(), Unit::SetDisableGravity(), SMSG_MOVE_GRAVITY_DISABLE, SMSG_MOVE_GRAVITY_ENABLE, SMSG_SPLINE_MOVE_GRAVITY_DISABLE, SMSG_SPLINE_MOVE_GRAVITY_ENABLE, Object::ToPlayer(), UNIT_BYTE1_FLAG_FLY, UNIT_BYTE1_FLAG_GROUND, UNIT_BYTE1_FLAG_HOVER, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_FIELD_BYTES_1, and UNIT_STATE_ROOT.

Referenced by boss_twin_valkyrAI::boss_twin_valkyrAI(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::boss_yoggsaron_brainAI(), boss_the_lich_king::boss_the_lich_kingAI::DamageTaken(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::DoAction(), boss_taldaram::DoAction(), npc_ball_of_flame::npc_ball_of_flameAI::DoAction(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::DoAction(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::DoAction(), boss_sindragosa::boss_sindragosaAI::DoAction(), boss_algalon_the_observer::boss_algalon_the_observerAI::DoAction(), npc_madrigosa::npc_madrigosaAI::DoAction(), npc_kalecgos_kj::npc_kalecgos_kjAI::DoAction(), boss_nightbane::EnterEvadeMode(), boss_malygos::boss_malygosAI::EnterEvadeMode(), boss_urom::boss_uromAI::EnterEvadeMode(), boss_razorscale::boss_razorscaleAI::EnterEvadeMode(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::FlyAway(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::GoToMinchar(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), boss_taldaram::InitializeAI(), npc_icc_nerubar_broodkeeper::npc_icc_nerubar_broodkeeperAI::InitializeAI(), boss_malygos::boss_malygosAI::InitializeAI(), boss_razorscale::boss_razorscaleAI::InitializeAI(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::InitializeAI(), boss_urom::boss_uromAI::JustDied(), boss_ayamiss::JustEngagedWith(), boss_jeklik::JustEngagedWith(), boss_saviana_ragefire::boss_saviana_ragefireAI::JustReachedHome(), npc_spinestalker::npc_spinestalkerAI::JustReachedHome(), npc_rimefang::npc_rimefangAI::JustReachedHome(), npc_icc_spire_frostwyrm::JustReachedHome(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustSummoned(), boss_kiljaeden::boss_kiljaedenAI::JustSummoned(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::JustSummoned(), npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI::JustSummoned(), boss_algalon_the_observer::boss_algalon_the_observerAI::MovementInform(), npc_enslaved_netherwing_drake::MovementInform(), boss_onyxia::MovementInform(), boss_ayamiss::MovementInform(), boss_taldaram::MovementInform(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::MovementInform(), boss_sister_svalna::boss_sister_svalnaAI::MovementInform(), npc_icc_spire_frostwyrm::MovementInform(), npc_icc_nerubar_broodkeeper::npc_icc_nerubar_broodkeeperAI::MovementInform(), boss_malygos::boss_malygosAI::MovementInform(), npc_oculus_drake::npc_oculus_drakeAI::MovementInform(), boss_razorscale::boss_razorscaleAI::MovementInform(), npc_enslaved_proto_drake::npc_enslaved_proto_drakeAI::MovementInform(), boss_nazan::MovementInform(), boss_felmyst::boss_felmystAI::MovementInform(), npc_hallows_end_soh::MovementInform(), boss_saviana_ragefire::boss_saviana_ragefireAI::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), npc_spinestalker::npc_spinestalkerAI::MovementInform(), npc_rimefang::npc_rimefangAI::MovementInform(), boss_kaelthas::boss_kaelthasAI::MovementInform(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::MovementInform(), npc_kalecgos::MovementInform(), boss_jedoga_shadowseeker::MovementInform(), npc_alexstrasza::npc_alexstraszaAI::npc_alexstraszaAI(), npc_attracted_reef_bull::npc_attracted_reef_bullAI::npc_attracted_reef_bullAI(), npc_concentrated_ball::npc_concentrated_ballAI::npc_concentrated_ballAI(), npc_icc_nerubar_broodkeeper::npc_icc_nerubar_broodkeeperAI::npc_icc_nerubar_broodkeeperAI(), npc_korkron_or_wildhammer::npc_korkron_or_wildhammer(), npc_pet_gen_moth::npc_pet_gen_moth(), npc_pet_gen_valkyr_guardian::npc_pet_gen_valkyr_guardian(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::npc_ulduar_aerial_command_unitAI(), instance_ulduar::instance_ulduar_InstanceMapScript::OnCreatureCreate(), npc_vehicle_d16_propelled_delivery::npc_vehicle_d16_propelled_deliveryAI::PassengerBoarded(), npc_eoe_wyrmrest_skytalon::npc_eoe_wyrmrest_skytalonAI::PassengerBoarded(), npc_oculus_drake::npc_oculus_drakeAI::PassengerBoarded(), boss_jeklik::PathEndReached(), boss_nefarian::PathEndReached(), SmartScript::ProcessAction(), boss_nefarian::Reset(), boss_nightbane::Reset(), boss_felmyst::boss_felmystAI::Reset(), boss_kalecgos::boss_kalecgosAI::Reset(), boss_kalec::boss_kalecAI::Reset(), npc_akilzon_eagle::npc_akilzon_eagleAI::Reset(), npc_janalai_hatchling::npc_janalai_hatchlingAI::Reset(), boss_jeklik::Reset(), npc_soh_fire_trigger::Reset(), npc_hallows_end_soh::Reset(), boss_headless_horseman::Reset(), npc_frost_wyrm::npc_frost_wyrmAI::Reset(), npc_gargoyle::npc_gargoyleAI::Reset(), boss_onyxia::Reset(), boss_ayamiss::Reset(), boss_jedoga_shadowseeker::Reset(), npc_blood_queen_lana_thel::npc_blood_queen_lana_thelAI::Reset(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::Reset(), npc_spinestalker::npc_spinestalkerAI::Reset(), npc_rimefang::npc_rimefangAI::Reset(), boss_sister_svalna::boss_sister_svalnaAI::Reset(), npc_icc_spire_frostwyrm::Reset(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::Reset(), boss_kologarn::boss_kologarnAI::Reset(), boss_thorim_pillar::boss_thorim_pillarAI::Reset(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::Reset(), boss_illidan_stormrage::boss_illidan_stormrageAI::Reset(), boss_nazan::Reset(), boss_kaelthas::boss_kaelthasAI::Reset(), npc_enslaved_netherwing_drake::Reset(), npc_dancing_flames::npc_dancing_flamesAI::Reset(), npc_enslaved_proto_drake::npc_enslaved_proto_drakeAI::SetData(), setDeathState(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::SpellHit(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::SpellHit(), npc_saurfang_event::npc_saurfang_eventAI::SpellHit(), boss_urom::boss_uromAI::SpellHit(), boss_nightbane::TakeOff(), boss_nightbane::UpdateAI(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::UpdateAI(), npc_madrigosa::npc_madrigosaAI::UpdateAI(), boss_felmyst::boss_felmystAI::UpdateAI(), boss_kalecgos::boss_kalecgosAI::UpdateAI(), npc_highborne_lamenter::npc_highborne_lamenterAI::UpdateAI(), npc_giant_infernal::npc_giant_infernalAI::UpdateAI(), boss_onyxia::UpdateAI(), boss_jedoga_shadowseeker::UpdateAI(), boss_saviana_ragefire::boss_saviana_ragefireAI::UpdateAI(), boss_krick::boss_krickAI::UpdateAI(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::UpdateAI(), boss_sindragosa::boss_sindragosaAI::UpdateAI(), npc_rimefang::npc_rimefangAI::UpdateAI(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), boss_urom::boss_uromAI::UpdateAI(), npc_oculus_drake::npc_oculus_drakeAI::UpdateAI(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), boss_razorscale::boss_razorscaleAI::UpdateAI(), npc_wintergarde_gryphon::UpdateAI(), boss_illidan_stormrage::boss_illidan_stormrageAI::UpdateAI(), boss_kaelthas::boss_kaelthasAI::UpdateAI(), npc_enslaved_netherwing_drake::UpdateAI(), npc_pet_gen_wind_rider_cub::UpdateAI(), and UpdateMovementFlags().

◆ SetDisableReputationGain()

void Creature::SetDisableReputationGain ( bool  disable)
inline
353{ DisableReputationGain = disable; }

References DisableReputationGain.

Referenced by hyjalAI::SummonCreature().

◆ SetDisplayId()

void Creature::SetDisplayId ( uint32  modelId)
overridevirtual

Reimplemented from Unit.

Reimplemented in Pet.

3423{
3424 Unit::SetDisplayId(modelId);
3425
3426 float combatReach = DEFAULT_WORLD_OBJECT_SIZE;
3427
3428 if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
3429 {
3430 SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (IsPet() ? 1.0f : minfo->bounding_radius) * GetObjectScale());
3431 if (minfo->combat_reach > 0)
3432 combatReach = minfo->combat_reach;
3433 }
3434
3435 if (IsPet())
3436 combatReach = DEFAULT_COMBAT_REACH;
3437
3439}
#define DEFAULT_WORLD_OBJECT_SIZE
Definition: ObjectDefines.h:45
#define DEFAULT_COMBAT_REACH
Definition: ObjectDefines.h:46
@ UNIT_FIELD_COMBATREACH
Definition: UpdateFields.h:123
@ UNIT_FIELD_BOUNDINGRADIUS
Definition: UpdateFields.h:122
Definition: CreatureData.h:388
float GetObjectScale() const
Definition: Object.h:112
virtual void SetDisplayId(uint32 modelId)
Definition: Unit.cpp:17030

References DEFAULT_COMBAT_REACH, DEFAULT_WORLD_OBJECT_SIZE, Object::GetObjectScale(), Unit::IsPet(), Unit::SetDisplayId(), Object::SetFloatValue(), sObjectMgr, UNIT_FIELD_BOUNDINGRADIUS, and UNIT_FIELD_COMBATREACH.

Referenced by npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::Activate(), Create(), npc_terenas_menethil::npc_terenas_menethilAI::DamageTaken(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::Deactivate(), npc_icc_severed_essence::npc_icc_severed_essenceAI::DoAction(), boss_ichoron::boss_ichoronAI::DoExplodeCompleted(), SACDeactivateEvent::Execute(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), npc_commandscript::HandleNpcSetModelCommand(), wp_commandscript::HandleWpShowCommand(), InitEntry(), npc_troll_volunteer::npc_troll_volunteerAI::InitializeAI(), Totem::InitStats(), Guardian::InitStatsForLevel(), npc_eoe_wyrmrest_skytalon::npc_eoe_wyrmrest_skytalonAI::JustDied(), boss_ichoron::boss_ichoronAI::JustDied(), boss_tharon_ja::boss_tharon_jaAI::JustDied(), npc_scholomance_occultist::npc_scholomance_occultistAI::JustReachedHome(), npc_fairbanks::npc_fairbanksAI::MoveInLineOfSight(), npc_cw_area_trigger::npc_cw_area_triggerAI::npc_cw_area_triggerAI(), npc_eye_of_acherus::npc_eye_of_acherus(), npc_giant_infernal::npc_giant_infernalAI::npc_giant_infernalAI(), npc_grizzlemaw_cw_trigger::npc_grizzlemaw_cw_triggerAI::npc_grizzlemaw_cw_triggerAI(), npc_scarlet_miner_cart::npc_scarlet_miner_cartAI::npc_scarlet_miner_cartAI(), npc_the_biggest_tree::npc_the_biggest_tree(), npc_eoe_wyrmrest_skytalon::npc_eoe_wyrmrest_skytalonAI::PassengerBoarded(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::ReorderInstance(), boss_kalec::boss_kalecAI::Reset(), boss_black_knight::boss_black_knightAI::Reset(), boss_tharon_ja::boss_tharon_jaAI::Reset(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::Reset(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::Reset(), boss_ichoron::boss_ichoronAI::Reset(), boss_laj::Reset(), npc_infernal_attacker::npc_infernal_attackerAI::Reset(), Respawn(), boss_laj::ScheduleTasks(), Pet::SetDisplayId(), npc_netherspite_infernal::SpellHit(), npc_harrison_jones::npc_harrison_jonesAI::SpellHit(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::SpellHit(), npc_infernal_attacker::npc_infernal_attackerAI::SpellHit(), boss_black_knight::boss_black_knightAI::SpellHitTarget(), npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave(), npc_vaelastrasz_the_red::npc_vaelastrasz_the_redAI::UpdateAI(), npc_harrison_jones::npc_harrison_jonesAI::UpdateAI(), npc_giant_infernal::npc_giant_infernalAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_frost_sphere::npc_frost_sphereAI::UpdateAI(), boss_tharon_ja::boss_tharon_jaAI::UpdateAI(), npc_pos_collapsing_icicle::npc_pos_collapsing_icicleAI::UpdateAI(), npc_terenas_menethil::npc_terenas_menethilAI::UpdateAI(), npc_blistering_zombie::npc_blistering_zombieAI::UpdateAI(), npc_ulduar_icicle::npc_ulduar_icicleAI::UpdateAI(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::UpdateAI(), npc_azure_saboteur::npc_azure_saboteurAI::UpdateAI(), and boss_ichoron::boss_ichoronAI::UpdateAI().

◆ SetFeatherFall()

bool Creature::SetFeatherFall ( bool  enable,
bool  packetOnly = false 
)
overridevirtual

movement counter

Reimplemented from Unit.

3250{
3251 if (!packetOnly && !Unit::SetFeatherFall(enable))
3252 return false;
3253
3254 if (m_movedByPlayer)
3255 {
3257 data << GetPackGUID();
3258 data << uint32(0);
3260
3261 data.Initialize(MSG_MOVE_FEATHER_FALL, 64);
3262 data << GetPackGUID();
3263 BuildMovementPacket(&data);
3264 m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
3265 return true;
3266 }
3267
3269 data << GetPackGUID();
3270 SendMessageToSet(&data, true);
3271 return true;
3272}
@ SMSG_MOVE_FEATHER_FALL
Definition: Opcodes.h:272
@ SMSG_MOVE_NORMAL_FALL
Definition: Opcodes.h:273
@ MSG_MOVE_FEATHER_FALL
Definition: Opcodes.h:718
@ SMSG_SPLINE_MOVE_NORMAL_FALL
Definition: Opcodes.h:804
@ SMSG_SPLINE_MOVE_FEATHER_FALL
Definition: Opcodes.h:803
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20998

References Unit::BuildMovementPacket(), Object::GetPackGUID(), WorldPacket::Initialize(), Unit::m_movedByPlayer, MSG_MOVE_FEATHER_FALL, Player::SendDirectMessage(), WorldObject::SendMessageToSet(), Player::SendMessageToSet(), Unit::SetFeatherFall(), SMSG_MOVE_FEATHER_FALL, SMSG_MOVE_NORMAL_FALL, SMSG_SPLINE_MOVE_FEATHER_FALL, SMSG_SPLINE_MOVE_NORMAL_FALL, and Object::ToPlayer().

◆ SetFormation()

void Creature::SetFormation ( CreatureGroup formation)
inline
349{ m_formation = formation; }

References m_formation.

Referenced by CreatureGroup::AddMember(), and CreatureGroup::RemoveMember().

◆ SetHomePosition() [1/2]

void Creature::SetHomePosition ( const Position pos)
inline

◆ SetHomePosition() [2/2]

void Creature::SetHomePosition ( float  x,
float  y,
float  z,
float  o 
)
inline
330{ m_homePosition.Relocate(x, y, z, o); }

References m_homePosition, and Position::Relocate().

Referenced by Battleground::AddCreature(), boss_loatheb::boss_loathebAI::boss_loathebAI(), MotionTransport::CreateNPCPassenger(), npc_weegli_blastfuse::npc_weegli_blastfuseAI::DestroyDoor(), boss_taldaram::DoAction(), npc_icc_spire_frostwyrm::DoAction(), brann_bronzebeard::brann_bronzebeardAI::DoAction(), boss_algalon_the_observer::boss_algalon_the_observerAI::DoAction(), boss_tyrannus::boss_tyrannusAI::DoAction(), hyjalAI::DoOverrun(), boss_ayamiss::EnterEvadeMode(), violet_hold_trashAI::EnterEvadeMode(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::GoSiphon(), WorldSession::HandleBattlemasterHelloOpcode(), WorldSession::HandleGossipHelloOpcode(), spell_item_toxic_wasteling::HandleJump(), WorldSession::HandleQuestgiverHelloOpcode(), boss_eck::boss_eckAI::InitializeAI(), boss_flame_leviathan::boss_flame_leviathanAI::InitializeAI(), boss_aeonus::IsSummonedBy(), npc_simone::npc_simoneAI::JustDied(), boss_mandokir::boss_mandokirAI::JustEngagedWith(), boss_urom::boss_uromAI::JustEngagedWith(), boss_flame_leviathan::boss_flame_leviathanAI::JustEngagedWith(), boss_kelthuzad::boss_kelthuzadAI::JustSummoned(), npc_daphne_stilwell::npc_daphne_stilwellAI::JustSummoned(), npc_hor_lich_king::npc_hor_lich_kingAI::JustSummoned(), boss_the_lich_king::boss_the_lich_kingAI::JustSummoned(), boss_algalon_the_observer::boss_algalon_the_observerAI::JustSummoned(), CreatureGroup::LeaderMoveTo(), LoadCreatureFromDB(), npc_aged_dying_ancient_kodo::npc_aged_dying_ancient_kodoAI::MoveInLineOfSight(), npc_icc_nerubar_broodkeeper::npc_icc_nerubar_broodkeeperAI::MoveInLineOfSight(), boss_mandokir::boss_mandokirAI::MovementInform(), npc_enslaved_proto_drake::npc_enslaved_proto_drakeAI::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), npc_spinestalker::npc_spinestalkerAI::MovementInform(), npc_rimefang::npc_rimefangAI::MovementInform(), npc_omen::npc_omenAI::MovementInform(), npc_gunship_boarding_addAI::MovementInform(), boss_ghazan::MovementInform(), npc_escortAI::MovementInform(), SmartAI::MovepointReached(), npc_akama_illidan::npc_akama_illidanAI::npc_akama_illidanAI(), RemoveCorpse(), instance_culling_of_stratholme::instance_culling_of_stratholme_InstanceMapScript::Reposition(), instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Reposition(), boss_arlokk::boss_arlokkAI::Reset(), boss_jeklik::Reset(), npc_simone::npc_simoneAI::RespawnPet(), WorldSession::SendListInventory(), gunship_npc_AI::SetData(), NPCStaveQuestAI::SetHomePosition(), Battlefield::SpawnCreature(), boss_urom::boss_uromAI::SpellHit(), boss_majordomo::boss_majordomoAI::SpellHit(), boss_ionar::boss_ionarAI::Split(), WaypointMovementGenerator< Creature >::StartMove(), Map::SummonCreature(), npc_drakonid_spawner::SummonedCreatureDies(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), hyjal_trashAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_twilight_volunteer::UpdateAI(), npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::UpdateAI(), npc_icc_vengeful_fleshreaper::npc_icc_vengeful_fleshreaperAI::UpdateAI(), violet_hold_trashAI::UpdateAI(), npc_azure_saboteur::npc_azure_saboteurAI::UpdateAI(), npc_thassarian2::npc_thassarian2AI::UpdateAI(), npc_millhouse_manastorm::npc_millhouse_manastormAI::UpdateAI(), and MotionTransport::UpdatePassengerPositions().

◆ SetHover()

bool Creature::SetHover ( bool  enable,
bool  packetOnly = false,
bool  updateAnimationTier = true 
)
overridevirtual

Reimplemented from Unit.

3275{
3276 if (!packetOnly && !Unit::SetHover(enable))
3277 return false;
3278
3279 if (updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT) && !IsRooted())
3280 {
3281 if (IsLevitating())
3283 else if (IsHovering())
3285 else
3287 }
3288
3290 data << GetPackGUID();
3291 SendMessageToSet(&data, false);
3292 return true;
3293}
@ SMSG_SPLINE_MOVE_SET_HOVER
Definition: Opcodes.h:805
@ SMSG_SPLINE_MOVE_UNSET_HOVER
Definition: Opcodes.h:806
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:21020

References Object::GetPackGUID(), Unit::HasUnitState(), Unit::IsAlive(), Unit::IsHovering(), Unit::IsLevitating(), IsRooted(), WorldObject::SendMessageToSet(), Object::SetByteValue(), Unit::SetHover(), SMSG_SPLINE_MOVE_SET_HOVER, SMSG_SPLINE_MOVE_UNSET_HOVER, UNIT_BYTE1_FLAG_FLY, UNIT_BYTE1_FLAG_GROUND, UNIT_BYTE1_FLAG_HOVER, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_FIELD_BYTES_1, and UNIT_STATE_ROOT.

Referenced by boss_taldaram::DoAction(), npc_ball_of_flame::npc_ball_of_flameAI::DoAction(), boss_taldaram::InitializeAI(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::JustEngagedWith(), boss_saviana_ragefire::boss_saviana_ragefireAI::JustReachedHome(), boss_taldaram::MovementInform(), npc_kalecgos::MovementInform(), boss_jedoga_shadowseeker::MovementInform(), npc_korkron_or_wildhammer::npc_korkron_or_wildhammer(), npc_depth_charge::npc_depth_chargeAI::Reset(), boss_jedoga_shadowseeker::Reset(), npc_dark_nucleus::npc_dark_nucleusAI::Reset(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::Reset(), boss_svala::boss_svalaAI::Reset(), setDeathState(), npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI::UpdateAI(), boss_jedoga_shadowseeker::UpdateAI(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), npc_wintergarde_gryphon::UpdateAI(), and UpdateMovementFlags().

◆ SetInCombatWithZone()

void Creature::SetInCombatWithZone ( )
2733{
2734 if (IsAIEnabled)
2735 AI()->DoZoneInCombat();
2736}
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:94

References AI(), CreatureAI::DoZoneInCombat(), and Unit::IsAIEnabled.

Referenced by npc_mograine::npc_mograineAI::DamageTaken(), npc_ghostly_priest::npc_ghostly_priestAI::DoAction(), npc_phantom_mage::npc_phantom_mageAI::DoAction(), npc_shadowy_mercenary::npc_shadowy_mercenaryAI::DoAction(), npc_spectral_footman::npc_spectral_footmanAI::DoAction(), npc_tortured_rifleman::npc_tortured_riflemanAI::DoAction(), boss_dorothee::DoAction(), boss_roar::DoAction(), boss_strawman::DoAction(), boss_tinhead::DoAction(), npc_ball_of_flame::npc_ball_of_flameAI::DoAction(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::DoAction(), npc_risen_archmage::npc_risen_archmageAI::DoAction(), npc_living_constellation::npc_living_constellationAI::DoAction(), boss_the_lurker_below::DoAction(), boss_broggok::DoAction(), boss_grand_warlock_nethekurse::DoAction(), boss_drakkari_colossus::boss_drakkari_colossusAI::DoAction(), boss_thaddius_summon::boss_thaddius_summonAI::DoAction(), boss_yoggsaron::boss_yoggsaronAI::DoAction(), boss_palehoof::boss_palehoofAI::DoAction(), npc_massive_jormungar::npc_massive_jormungarAI::DoAction(), npc_ferocious_rhino::npc_ferocious_rhinoAI::DoAction(), npc_ravenous_furbolg::npc_ravenous_furbolgAI::DoAction(), npc_frenzied_worgen::npc_frenzied_worgenAI::DoAction(), boss_skadi::boss_skadiAI::DoAction(), boss_essence_of_suffering::boss_essence_of_sufferingAI::DoAction(), boss_essence_of_desire::boss_essence_of_desireAI::DoAction(), boss_essence_of_anger::boss_essence_of_angerAI::DoAction(), boss_kelidan_the_breaker::DoAction(), boss_algalon_the_observer::boss_algalon_the_observerAI::EnterEvadeMode(), npc_little_ooze::npc_little_oozeAI::EnterEvadeMode(), npc_big_ooze::npc_big_oozeAI::EnterEvadeMode(), RestoreFight::Execute(), spell_teron_gorefiend_shadowy_construct::HandleEffectApply(), spell_mutate_explode_bug::HandleOnHit(), spell_the_lich_king_vile_spirit_move_target_search::spell_the_lich_king_vile_spirit_move_target_search_SpellScript::HandleScript(), spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript::HandleSummon(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::InitFight(), boss_glob_of_viscidus::InitializeAI(), brann_bronzebeard::brann_bronzebeardAI::InitializeEvent(), npc_corrupted_totem::IsSummonedBy(), npc_living_inferno::npc_living_infernoAI::IsSummonedBy(), boss_felblood_kaelthas::JustEngagedWith(), boss_headless_horseman::JustEngagedWith(), boss_volazj::JustEngagedWith(), boss_twilight_halion::boss_twilight_halionAI::JustEngagedWith(), boss_faction_championsAI::JustEngagedWith(), npc_risen_archmage::npc_risen_archmageAI::JustEngagedWith(), npc_icc_valkyr_herald::npc_icc_valkyr_heraldAI::JustEngagedWith(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::JustEngagedWith(), boss_drakos::boss_drakosAI::JustEngagedWith(), boss_eregos::boss_eregosAI::JustEngagedWith(), boss_urom::boss_uromAI::JustEngagedWith(), boss_varos::boss_varosAI::JustEngagedWith(), boss_bjarngrim::boss_bjarngrimAI::JustEngagedWith(), boss_ionar::boss_ionarAI::JustEngagedWith(), boss_loken::boss_lokenAI::JustEngagedWith(), boss_volkhan::boss_volkhanAI::JustEngagedWith(), boss_algalon_the_observer::boss_algalon_the_observerAI::JustEngagedWith(), boss_flame_leviathan::boss_flame_leviathanAI::JustEngagedWith(), boss_freya::boss_freyaAI::JustEngagedWith(), boss_vezax::boss_vezaxAI::JustEngagedWith(), boss_razorscale::boss_razorscaleAI::JustEngagedWith(), boss_xt002::boss_xt002AI::JustEngagedWith(), boss_skadi::boss_skadiAI::JustEngagedWith(), boss_skadi_grauf::boss_skadi_graufAI::JustEngagedWith(), boss_svala::boss_svalaAI::JustEngagedWith(), npc_frozen_orb::npc_frozen_orbAI::JustEngagedWith(), boss_olm_the_summoner::JustEngagedWith(), boss_kiggler_the_crazed::JustEngagedWith(), boss_blindeye_the_seer::JustEngagedWith(), boss_krosh_firehand::JustEngagedWith(), boss_harbinger_skyriss::JustEngagedWith(), boss_thaddius_summon::boss_thaddius_summonAI::JustEngagedWith(), boss_the_lich_king::boss_the_lich_kingAI::JustEngagedWith(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::JustEngagedWith(), boss_trollgore::boss_trollgoreAI::JustEngagedWith(), boss_sindragosa::boss_sindragosaAI::JustEngagedWith(), boss_gluth::boss_gluthAI::JustEngagedWith(), boss_gothik::boss_gothikAI::JustEngagedWith(), boss_grobbulus::boss_grobbulusAI::JustEngagedWith(), boss_heigan::boss_heiganAI::JustEngagedWith(), boss_loatheb::boss_loathebAI::JustEngagedWith(), boss_maexxna::boss_maexxnaAI::JustEngagedWith(), boss_patchwerk::boss_patchwerkAI::JustEngagedWith(), boss_thaddius::boss_thaddiusAI::JustEngagedWith(), boss_steelbreaker::boss_steelbreakerAI::JustEngagedWith(), boss_runemaster_molgeim::boss_runemaster_molgeimAI::JustEngagedWith(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::JustEngagedWith(), boss_fathomlord_karathress::JustEngagedWith(), boss_magtheridon::JustEngagedWith(), boss_anubrekhan::boss_anubrekhanAI::JustSummoned(), boss_grobbulus::boss_grobbulusAI::JustSummoned(), boss_loatheb::boss_loathebAI::JustSummoned(), boss_maexxna::boss_maexxnaAI::JustSummoned(), boss_auriaya::boss_auriayaAI::JustSummoned(), npc_ouro_spawner::JustSummoned(), npc_dirt_mound::JustSummoned(), boss_dalronn_the_controller::boss_dalronn_the_controllerAI::JustSummoned(), boss_urom::boss_uromAI::JustSummoned(), npc_hor_lich_king::npc_hor_lich_kingAI::JustSummoned(), boss_curator::JustSummoned(), npc_demonic_vapor_trail::npc_demonic_vapor_trailAI::JustSummoned(), npc_kiljaeden_controller::npc_kiljaeden_controllerAI::JustSummoned(), boss_muru::boss_muruAI::JustSummoned(), boss_hazzarah::JustSummoned(), npc_hive_zara_larva::JustSummoned(), boss_anub_arak::boss_anub_arakAI::JustSummoned(), boss_novos::boss_novosAI::JustSummoned(), boss_slad_ran::boss_slad_ranAI::JustSummoned(), boss_professor_putricide::boss_professor_putricideAI::JustSummoned(), boss_noth::boss_nothAI::JustSummoned(), boss_magus_telestra::boss_magus_telestraAI::JustSummoned(), npc_creature_generator_akama::JustSummoned(), boss_fathomlord_karathress::JustSummoned(), boss_fathomguard_sharkkis::JustSummoned(), boss_fathomguard_tidalvess::JustSummoned(), boss_morogrim_tidewalker::JustSummoned(), boss_ahune::JustSummoned(), boss_omor_the_unscarred::JustSummoned(), boss_vazruden_the_herald::JustSummoned(), boss_high_astromancer_solarian::JustSummoned(), boss_nethermancer_sepethrea::JustSummoned(), boss_reliquary_of_souls::boss_reliquary_of_soulsAI::MoveInLineOfSight(), boss_kaelthas::boss_kaelthasAI::MoveInLineOfSight(), boss_nightbane::MovementInform(), boss_captain_skarloc::MovementInform(), boss_four_horsemen::boss_four_horsemenAI::MovementInform(), boss_headless_horseman::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), boss_sartharion_dragonAI::MovementInform(), boss_jedoga_shadowseeker::MovementInform(), npc_gunship_mage::npc_gunship_mageAI::MovementInform(), npc_ulduar_saronite_animus::npc_ulduar_saronite_animusAI::npc_ulduar_saronite_animusAI(), instance_karazhan::instance_karazhan_InstanceMapScript::OnCreatureCreate(), boss_julianne::Reset(), boss_headless_horseman_head::Reset(), npc_twilight_summon::npc_twilight_summonAI::Reset(), boss_twilight_halion::boss_twilight_halionAI::Reset(), boss_yoggsaron_guardian_of_ys::boss_yoggsaron_guardian_of_ysAI::Reset(), boss_yoggsaron_crusher_tentacle::boss_yoggsaron_crusher_tentacleAI::Reset(), boss_yoggsaron_immortal_guardian::boss_yoggsaron_immortal_guardianAI::Reset(), instance_naxxramas::instance_naxxramas_InstanceMapScript::SetBossState(), boss_darkmaster_gandling::boss_darkmaster_gandlingAI::SetData(), npc_argent_captainAI::SpellHit(), spell_putricide_ooze_channel::spell_putricide_ooze_channel_SpellScript::StartAttack(), brann_bronzebeard::brann_bronzebeardAI::SummonCreatures(), Update(), boss_felmyst::boss_felmystAI::UpdateAI(), boss_kiljaeden::boss_kiljaedenAI::UpdateAI(), boss_entropius::boss_entropiusAI::UpdateAI(), boss_mandokir::boss_mandokirAI::UpdateAI(), boss_krik_thir::boss_krik_thirAI::UpdateAI(), boss_falric::boss_falricAI::UpdateAI(), boss_marwyn::boss_marwynAI::UpdateAI(), npc_phantom_hallucination::npc_phantom_hallucinationAI::UpdateAI(), npc_hor_lich_king::npc_hor_lich_kingAI::UpdateAI(), npc_vengeful_shade::npc_vengeful_shadeAI::UpdateAI(), npc_little_ooze::npc_little_oozeAI::UpdateAI(), npc_big_ooze::npc_big_oozeAI::UpdateAI(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_algalon_the_observer::boss_algalon_the_observerAI::UpdateAI(), boss_flame_leviathan::boss_flame_leviathanAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), boss_razorscale::boss_razorscaleAI::UpdateAI(), boss_anzu::UpdateAI(), boss_ahune::UpdateAI(), and npc_onyx_flamecaller::npc_onyx_flamecallerAI::WaypointReached().

◆ SetLastDamagedTime()

void Creature::SetLastDamagedTime ( time_t  val)
3601{
3602 if (val > 0)
3603 {
3604 if (_lastDamagedTime)
3605 *_lastDamagedTime = val;
3606 else
3607 _lastDamagedTime = std::make_shared<time_t>(val);
3608 }
3609 else
3610 _lastDamagedTime.reset();
3611}

References _lastDamagedTime.

Referenced by CreatureAI::_EnterEvadeMode(), Unit::DealDamage(), npc_pos_freed_slave::npc_pos_freed_slaveAI::EnterEvadeMode(), npc_pet_hunter_snake_trap::EnterEvadeMode(), and AssistDelayEvent::Execute().

◆ SetLastDamagedTimePtr()

void Creature::SetLastDamagedTimePtr ( std::shared_ptr< time_t > const &  val)
3614{
3615 _lastDamagedTime = val;
3616}

References _lastDamagedTime.

Referenced by AssistDelayEvent::Execute().

◆ SetLootMode()

◆ SetLootRecipient()

void Creature::SetLootRecipient ( Unit unit,
bool  withGroup = true 
)
1259{
1260 // set the player whose group should receive the right
1261 // to loot the creature after it dies
1262 // should be set to nullptr after the loot disappears
1263
1264 if (!unit)
1265 {
1270 return;
1271 }
1272
1274 if (!player) // normal creature, no player involved
1275 return;
1276
1277 m_lootRecipient = player->GetGUID();
1278
1279 Map* map = GetMap();
1280 if (map && map->IsDungeon() && (isWorldBoss() || IsDungeonBoss()))
1281 {
1283 }
1284
1285 if (withGroup)
1286 {
1287 if (Group* group = player->GetGroup())
1288 {
1289 m_lootRecipientGroup = group->GetGUID().GetCounter();
1290
1291 if (map && map->IsDungeon() && (isWorldBoss() || IsDungeonBoss()))
1292 {
1293 Map::PlayerList const& PlayerList = map->GetPlayers();
1294 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
1295 {
1296 if (Player* groupMember = i->GetSource())
1297 {
1298 if (groupMember->IsGameMaster() || groupMember->IsSpectator())
1299 {
1300 continue;
1301 }
1302
1303 if (groupMember->GetGroup() == group)
1304 {
1305 AddAllowedLooter(groupMember->GetGUID());
1306 }
1307 }
1308 }
1309 }
1310 }
1311 }
1312 else
1314
1316}
@ UNIT_DYNFLAG_TAPPED
Definition: SharedDefines.h:3123
@ UNIT_DYNFLAG_LOOTABLE
Definition: SharedDefines.h:3121
Definition: LinkedList.h:139
bool IsDungeonBoss() const
Definition: Creature.cpp:3080
virtual void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:118
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:117
void ResetAllowedLooters()
Definition: Object.cpp:3151
void AddAllowedLooter(ObjectGuid guid)
Definition: Object.cpp:3141
void Clear()
Definition: ObjectGuid.h:140
Group * GetGroup()
Definition: Player.h:2431
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10615
Definition: Map.h:313
bool IsDungeon() const
Definition: Map.h:448
PlayerList const & GetPlayers() const
Definition: Map.h:485
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References WorldObject::AddAllowedLooter(), MapRefMgr::begin(), ObjectGuid::Clear(), MapRefMgr::end(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), Player::GetGroup(), Object::GetGUID(), WorldObject::GetMap(), Map::GetPlayers(), Map::IsDungeon(), IsDungeonBoss(), isWorldBoss(), m_lootRecipient, m_lootRecipientGroup, Object::RemoveDynamicFlag(), WorldObject::ResetAllowedLooters(), Object::SetDynamicFlag(), UNIT_DYNFLAG_LOOTABLE, and UNIT_DYNFLAG_TAPPED.

Referenced by CreatureAI::_EnterEvadeMode(), npc_heated_battle::npc_heated_battleAI::DamageTaken(), Unit::DealDamage(), boss_doomrel::boss_doomrelAI::EnterEvadeMode(), npc_koltira_deathweaver::npc_koltira_deathweaverAI::EnterEvadeMode(), npc_varian_wrynn::npc_varian_wrynnAI::EnterEvadeMode(), npc_thrall_bfu::npc_thrall_bfuAI::EnterEvadeMode(), npc_pos_freed_slave::npc_pos_freed_slaveAI::EnterEvadeMode(), npc_pet_hunter_snake_trap::EnterEvadeMode(), npc_escortAI::EnterEvadeMode(), FollowerAI::EnterEvadeMode(), hyjalAI::EnterEvadeMode(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::HealReceived(), boss_razorgore::boss_razorgoreAI::JustDied(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustEngagedWith(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustEngagedWith(), boss_prince_valanar_icc::boss_prince_valanarAI::JustEngagedWith(), Unit::Kill(), boss_urom::boss_uromAI::LeaveCombat(), npc_target_dummy::npc_target_dummyAI::Reset(), Player::SendLoot(), setDeathState(), boss_algalon_the_observer::boss_algalon_the_observerAI::UpdateAI(), and npc_target_dummy::npc_target_dummyAI::UpdateAI().

◆ SetMeleeDamageSchool()

void Creature::SetMeleeDamageSchool ( SpellSchools  school)
inline

◆ SetNoCallAssistance()

◆ SetNoSearchAssistance()

void Creature::SetNoSearchAssistance ( bool  val)
inline

◆ SetObjectScale()

void Creature::SetObjectScale ( float  scale)
overridevirtual

◆ SetOriginalEntry()

void Creature::SetOriginalEntry ( uint32  entry)
inline
361{ m_originalEntry = entry; }

References m_originalEntry.

Referenced by CreateFromProto().

◆ SetPickPocketLootTime()

void Creature::SetPickPocketLootTime ( )
3666{
3668}
time_t const & GetRespawnTime() const
Definition: Creature.h:279
uint32 GetCorpseDelay() const
Definition: Creature.h:74

References GetCorpseDelay(), GameTime::GetGameTime(), GetRespawnTime(), lootPickPocketRestoreTime, and MINUTE.

Referenced by Player::SendLoot().

◆ SetPosition() [1/2]

void Creature::SetPosition ( const Position pos)
inline

◆ SetPosition() [2/2]

void Creature::SetPosition ( float  x,
float  y,
float  z,
float  o 
)
3073{
3074 if (!Acore::IsValidMapCoord(x, y, z, o))
3075 return;
3076
3077 GetMap()->CreatureRelocation(this, x, y, z, o);
3078}
void CreatureRelocation(Creature *creature, float x, float y, float z, float o)
Definition: Map.cpp:1025

References Map::CreatureRelocation(), WorldObject::GetMap(), and Acore::IsValidMapCoord().

Referenced by npc_power_spark::npc_power_sparkAI::DamageTaken(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::DoAction(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::DoAction(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::DoAction(), CastArmageddon::Execute(), npc_commandscript::HandleNpcMoveCommand(), npc_frost_wyrm::npc_frost_wyrmAI::JustDied(), npc_gargoyle::npc_gargoyleAI::JustDied(), boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI::JustSummoned(), boss_kiljaeden::boss_kiljaedenAI::JustSummoned(), npc_escortAI::MovementInform(), SmartAI::MovepointReached(), npc_vortex_ride::npc_vortex_rideAI::npc_vortex_rideAI(), instance_pit_of_saron::instance_pit_of_saron_InstanceScript::OnCreatureCreate(), instance_ulduar::instance_ulduar_InstanceMapScript::OnCreatureCreate(), FrostwingGauntletRespawner::operator()(), ValithriaDespawner::operator()(), RemoveCorpse(), npc_valkyr_battle_maiden::npc_valkyr_battle_maidenAI::Reset(), boss_four_horsemen::boss_four_horsemenAI::Reset(), boss_thaddius::boss_thaddiusAI::Reset(), npc_simone::npc_simoneAI::RespawnPet(), instance_naxxramas::instance_naxxramas_InstanceMapScript::SetBossState(), boss_hexlord_malacrass::boss_hex_lord_malacrassAI::SpawnAdds(), npc_highborne_lamenter::npc_highborne_lamenterAI::UpdateAI(), npc_oculus_drakegiver::npc_oculus_drakegiverAI::UpdateAI(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::UpdateAI(), npc_battle_at_valhalas::npc_battle_at_valhalasAI::UpdateAI(), boss_alar::boss_alarAI::UpdateAI(), and Unit::UpdateSplinePosition().

◆ SetReactState()

void Creature::SetReactState ( ReactStates  st)
inline
90{ m_reactState = st; }

References m_reactState.

Referenced by boss_halion::boss_halionAI::AttackStart(), boss_faction_championsAI::boss_faction_championsAI(), boss_felmyst::boss_felmystAI::boss_felmystAI(), boss_glob_of_viscidus::boss_glob_of_viscidus(), boss_gormok::boss_gormokAI::boss_gormokAI(), boss_grand_champion::boss_grand_championAI::boss_grand_championAI(), boss_icehowl::boss_icehowlAI::boss_icehowlAI(), boss_jaraxxus::boss_jaraxxusAI::boss_jaraxxusAI(), boss_jarien::boss_jarien(), boss_jormungarAI::boss_jormungarAI(), boss_kiljaeden::boss_kiljaedenAI::boss_kiljaedenAI(), boss_sothos::boss_sothos(), boss_the_lich_king::boss_the_lich_kingAI::boss_the_lich_kingAI(), boss_twin_valkyrAI::boss_twin_valkyrAI(), boss_tyrannus::boss_tyrannusAI::boss_tyrannusAI(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::boss_valithria_dreamwalkerAI(), CharmInfo::CharmInfo(), boss_thekal::CheckPhaseTransition(), boss_garfrost::boss_garfrostAI::DamageTaken(), boss_professor_putricide::boss_professor_putricideAI::DamageTaken(), boss_felblood_kaelthas::DamageTaken(), boss_kiljaeden::boss_kiljaedenAI::DamageTaken(), boss_jedoga_shadowseeker::DamageTaken(), boss_grand_champion::boss_grand_championAI::DamageTaken(), npc_terenas_menethil::npc_terenas_menethilAI::DamageTaken(), npc_crystalline_frayer::npc_crystalline_frayerAI::DamageTaken(), boss_algalon_the_observer::boss_algalon_the_observerAI::DamageTaken(), boss_freya::boss_freyaAI::DamageTaken(), boss_hodir::boss_hodirAI::DamageTaken(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::DamageTaken(), npc_ulduar_vx001::npc_ulduar_vx001AI::DamageTaken(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::DamageTaken(), npc_ulduar_arachnopod_destroyer::npc_ulduar_arachnopod_destroyerAI::DamageTaken(), boss_essence_of_suffering::boss_essence_of_sufferingAI::DamageTaken(), boss_essence_of_desire::boss_essence_of_desireAI::DamageTaken(), boss_alar::boss_alarAI::DamageTaken(), boss_taerar::boss_taerarAI::DamageTaken(), boss_thekal::DamageTaken(), boss_viscidus::DamageTaken(), boss_the_lich_king::boss_the_lich_kingAI::DamageTaken(), boss_shade_of_aran::DamageTaken(), boss_mal_ganis::boss_mal_ganisAI::DamageTaken(), boss_bug_trio::DamageTaken(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::Deactivate(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::DoAction(), boss_thekal::DoAction(), boss_bug_trio::DoAction(), boss_twinemperorsAI::DoAction(), boss_prince_keleseth_icc::boss_prince_kelesethAI::DoAction(), boss_prince_taldaram_icc::boss_prince_taldaramAI::DoAction(), boss_prince_valanar_icc::boss_prince_valanarAI::DoAction(), boss_algalon_the_observer::boss_algalon_the_observerAI::DoAction(), npc_living_constellation::npc_living_constellationAI::DoAction(), boss_the_lurker_below::DoAction(), boss_broggok::DoAction(), boss_leotheras_the_blind::DoAction(), npc_living_mojo::npc_living_mojoAI::DoAction(), boss_essence_of_suffering::boss_essence_of_sufferingAI::DoAction(), boss_essence_of_desire::boss_essence_of_desireAI::DoAction(), boss_essence_of_anger::boss_essence_of_angerAI::DoAction(), boss_kelidan_the_breaker::DoAction(), boss_nazan::DoAction(), boss_skeram::DoTeleport(), Spell::EffectSummonPet(), Spell::EffectSummonType(), boss_ouro::Emerge(), boss_the_lich_king::boss_the_lich_kingAI::EnterEvadeMode(), RestoreAttack::Execute(), OrcMoveEvent::Execute(), RestoreFight::Execute(), UtherBatteredHiltEvent::Execute(), StartMovementEvent::Execute(), VileSpiritActivateEvent::Execute(), SACActivateEvent::Execute(), SACDeactivateEvent::Execute(), AssistanceDistractMovementGenerator::Finalize(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::FlyAway(), boss_volkhan::boss_volkhanAI::GoToAnvil(), spell_mc_play_dead::spell_mc_play_dead_AuraScript::HandleEffectApply(), spell_uldaman_stoned::spell_uldaman_stoned_AuraScript::HandleEffectApply(), spell_gen_feign_death_all_flags::HandleEffectApply(), spell_gen_feign_death_no_dyn_flag::HandleEffectApply(), spell_gen_feign_death_no_prevent_emotes::HandleEffectApply(), spell_mc_play_dead::spell_mc_play_dead_AuraScript::HandleEffectRemove(), spell_uldaman_stoned::spell_uldaman_stoned_AuraScript::HandleEffectRemove(), boss_ragnaros::boss_ragnarosAI::HandleEmerge(), spell_mutate_explode_bug::HandleOnHit(), WorldSession::HandlePetActionHelper(), spell_item_draenic_pale_ale::HandleSummon(), Battlefield::HideNpc(), npc_wounded_skirmisher::Initialize(), npc_scarlet_ghoul::npc_scarlet_ghoulAI::InitializeAI(), npc_general_andorov::InitializeAI(), boss_eck::boss_eckAI::InitializeAI(), boss_prince_keleseth_icc::boss_prince_kelesethAI::InitializeAI(), boss_prince_taldaram_icc::boss_prince_taldaramAI::InitializeAI(), boss_prince_valanar_icc::boss_prince_valanarAI::InitializeAI(), boss_sapphiron::boss_sapphironAI::InitializeAI(), npc_lord_arete::npc_lord_areteAI::InitializeAI(), npc_millhouse_manastorm::npc_millhouse_manastormAI::InitializeAI(), npc_pet_mage_mirror_image::InitializeAI(), InitializeReactState(), Minion::InitStats(), Guardian::InitStats(), Puppet::InitStats(), Guardian::InitStatsForLevel(), Totem::InitSummon(), boss_jarien::IsSummonedBy(), boss_sothos::IsSummonedBy(), boss_aeonus::IsSummonedBy(), npc_lk_wicked_spirit::npc_lk_wicked_spiritAI::JustDied(), boss_venoxis::JustEngagedWith(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustEngagedWith(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustEngagedWith(), boss_prince_valanar_icc::boss_prince_valanarAI::JustEngagedWith(), boss_four_horsemen::boss_four_horsemenAI::JustEngagedWith(), boss_kelthuzad::boss_kelthuzadAI::JustEngagedWith(), boss_warchief_kargath_bladefist::JustEngagedWith(), boss_high_astromancer_solarian::JustEngagedWith(), npc_lk_wicked_spirit::npc_lk_wicked_spiritAI::JustRespawned(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::JustSummoned(), boss_skeram::JustSummoned(), boss_majordomo::boss_majordomoAI::JustSummoned(), boss_selin_fireheart::JustSummoned(), boss_hazzarah::JustSummoned(), boss_jindo::JustSummoned(), boss_baltharus_the_warborn::boss_baltharus_the_warbornAI::JustSummoned(), boss_novos::boss_novosAI::JustSummoned(), boss_bronjahm::boss_bronjahmAI::JustSummoned(), boss_drakkari_colossus::boss_drakkari_colossusAI::JustSummoned(), boss_prince_valanar_icc::boss_prince_valanarAI::JustSummoned(), boss_professor_putricide::boss_professor_putricideAI::JustSummoned(), boss_the_lich_king::boss_the_lich_kingAI::JustSummoned(), boss_illidan_stormrage::boss_illidan_stormrageAI::JustSummoned(), boss_reliquary_of_souls::boss_reliquary_of_soulsAI::JustSummoned(), npc_creature_generator_akama::JustSummoned(), boss_terestian_illhoof::JustSummoned(), boss_ick::boss_ickAI::KilledUnit(), Pet::LoadPetFromDB(), npc_shattered_hand_scout::MoveInLineOfSight(), boss_ayamiss::MovementInform(), boss_bug_trio::MovementInform(), boss_grand_champion::boss_grand_championAI::MovementInform(), boss_eck::boss_eckAI::MovementInform(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::MovementInform(), boss_sister_svalna::boss_sister_svalnaAI::MovementInform(), boss_four_horsemen::boss_four_horsemenAI::MovementInform(), boss_volkhan::boss_volkhanAI::MovementInform(), boss_lady_vashj::MovementInform(), boss_nazan::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), npc_rimefang::npc_rimefangAI::MovementInform(), boss_kaelthas::boss_kaelthasAI::MovementInform(), boss_jedoga_shadowseeker::MovementInform(), gunship_npc_AI::MovementInform(), npc_gunship_boarding_addAI::MovementInform(), npc_ball_of_flame::npc_ball_of_flameAI::MovementInform(), boss_warchief_kargath_bladefist::MovementInform(), boss_icehowl::boss_icehowlAI::MovementInform(), MotionMaster::MoveSeekAssistance(), npc_anubarak_spike::npc_anubarak_spikeAI::npc_anubarak_spikeAI(), npc_arcanite_dragonling::npc_arcanite_dragonling(), npc_argent_soldier::npc_argent_soldierAI::npc_argent_soldierAI(), npc_batrider::npc_batrider(), npc_buru_egg::npc_buru_egg(), npc_chess_move_trigger::npc_chess_move_trigger(), npc_concentrated_ball::npc_concentrated_ballAI::npc_concentrated_ballAI(), npc_dark_iron_guzzler::npc_dark_iron_guzzler(), npc_eye_of_acherus::npc_eye_of_acherus(), npc_frost_freeze_trap::npc_frost_freeze_trapAI::npc_frost_freeze_trapAI(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::npc_grand_magister_rommathAI(), npc_icc_ice_sphere::npc_icc_ice_sphereAI::npc_icc_ice_sphereAI(), npc_ice_tomb::npc_ice_tombAI::npc_ice_tombAI(), npc_koltira_deathweaver::npc_koltira_deathweaverAI::npc_koltira_deathweaverAI(), npc_living_constellation::npc_living_constellationAI::npc_living_constellationAI(), npc_lk_spirit_bomb::npc_lk_spirit_bombAI::npc_lk_spirit_bombAI(), npc_memory::npc_memoryAI::npc_memoryAI(), npc_nexus_lord::npc_nexus_lordAI::npc_nexus_lordAI(), npc_pet_gen_valkyr_guardian::npc_pet_gen_valkyr_guardian(), npc_pilgrims_bounty_chair::npc_pilgrims_bounty_chair(), npc_putricide_oozeAI::npc_putricide_oozeAI(), npc_q24545_vegard::npc_q24545_vegardAI::npc_q24545_vegardAI(), npc_saurfang_event::npc_saurfang_eventAI::npc_saurfang_eventAI(), npc_scarlet_miner::npc_scarlet_minerAI::npc_scarlet_minerAI(), npc_scion_of_eternity::npc_scion_of_eternityAI::npc_scion_of_eternityAI(), npc_snobold_vassal::npc_snobold_vassalAI::npc_snobold_vassalAI(), npc_suppresser::npc_suppresserAI::npc_suppresserAI(), npc_taldaram_flamesphere::npc_taldaram_flamesphere(), npc_target_trigger::npc_target_trigger(), npc_the_lich_king_controller::npc_the_lich_king_controllerAI::npc_the_lich_king_controllerAI(), npc_toxic_slime::npc_toxic_slime(), npc_ulduar_expedition_commander::npc_ulduar_expedition_commanderAI::npc_ulduar_expedition_commanderAI(), npc_ulduar_hodir_druid::npc_ulduar_hodir_druidAI::npc_ulduar_hodir_druidAI(), npc_ulduar_hodir_mage::npc_ulduar_hodir_mageAI::npc_ulduar_hodir_mageAI(), npc_ulduar_hodir_priest::npc_ulduar_hodir_priestAI::npc_ulduar_hodir_priestAI(), npc_ulduar_hodir_shaman::npc_ulduar_hodir_shamanAI::npc_ulduar_hodir_shamanAI(), npc_unworthy_initiate::npc_unworthy_initiateAI::npc_unworthy_initiateAI(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::npc_valkyr_shadowguardAI(), npc_zafod_boombox::npc_zafod_boomboxAI::npc_zafod_boomboxAI(), NullCreatureAI::NullCreatureAI(), spell_halion_twilight_phasing::spell_halion_twilight_phasing_AuraScript::OnApply(), instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::OnCreatureCreate(), instance_zulfarrak::instance_zulfarrak_InstanceMapScript::OnCreatureCreate(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::OnCreatureCreate(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::OnCreatureCreate(), boss_shade_of_aran::OnPowerUpdate(), spell_halion_twilight_phasing::spell_halion_twilight_phasing_AuraScript::OnRemove(), npc_ulduar_arachnopod_destroyer::npc_ulduar_arachnopod_destroyerAI::PassengerBoarded(), PassiveAI::PassiveAI(), boss_jeklik::PathEndReached(), boss_nefarian::PathEndReached(), PossessedAI::PossessedAI(), npc_dark_iron_attack_generator::PrepareEvent(), PretendToDie(), SmartScript::ProcessAction(), boss_lord_valthalak::boss_lord_valthalakAI::Reset(), boss_nefarian::Reset(), boss_vaelastrasz::boss_vaelAI::Reset(), boss_ragnaros::boss_ragnarosAI::Reset(), boss_mr_smite::boss_mr_smiteAI::Reset(), npc_chesspiece::Reset(), boss_midnight::Reset(), npc_crusade_persuaded::npc_crusade_persuadedAI::Reset(), boss_felmyst::boss_felmystAI::Reset(), boss_kalecgos::boss_kalecgosAI::Reset(), boss_muru::boss_muruAI::Reset(), boss_entropius::boss_entropiusAI::Reset(), boss_jeklik::Reset(), boss_renataki::boss_renatakiAI::Reset(), boss_thekal::Reset(), boss_venoxis::Reset(), npc_brew_bubble::Reset(), npc_hallows_end_soh::Reset(), npc_love_in_air_snivel::Reset(), boss_archimonde::boss_archimondeAI::Reset(), boss_onyxia::Reset(), npc_belnistrasz::npc_belnistraszAI::Reset(), boss_ayamiss::Reset(), boss_eye_of_cthun::Reset(), boss_sartura::Reset(), npc_sartura_royal_guard::Reset(), boss_skeram::Reset(), npc_death_ravager::npc_death_ravagerAI::Reset(), npc_murkdeep::npc_murkdeepAI::Reset(), npc_troll_volunteer::npc_troll_volunteerAI::Reset(), npc_amanitar_mushrooms::Reset(), boss_jedoga_shadowseeker::Reset(), boss_halion::boss_halionAI::Reset(), boss_twilight_halion::boss_twilight_halionAI::Reset(), boss_saviana_ragefire::boss_saviana_ragefireAI::Reset(), boss_eadric::boss_eadricAI::Reset(), boss_paletress::boss_paletressAI::Reset(), boss_black_knight::boss_black_knightAI::Reset(), npc_toc5_player_vehicle::npc_toc5_player_vehicleAI::Reset(), boss_grand_champion::boss_grand_championAI::Reset(), boss_devourer_of_souls::boss_devourer_of_soulsAI::Reset(), boss_garfrost::boss_garfrostAI::Reset(), boss_ick::boss_ickAI::Reset(), boss_prince_keleseth_icc::boss_prince_kelesethAI::Reset(), boss_prince_taldaram_icc::boss_prince_taldaramAI::Reset(), boss_prince_valanar_icc::boss_prince_valanarAI::Reset(), npc_dark_nucleus::npc_dark_nucleusAI::Reset(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::Reset(), boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::Reset(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::Reset(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::Reset(), boss_lord_marrowgar::Reset(), boss_professor_putricide::boss_professor_putricideAI::Reset(), boss_sindragosa::boss_sindragosaAI::Reset(), npc_spinestalker::npc_spinestalkerAI::Reset(), npc_rimefang::npc_rimefangAI::Reset(), boss_the_lich_king::boss_the_lich_kingAI::Reset(), npc_tirion_fordring_tft::npc_tirion_fordringAI::Reset(), npc_lk_wicked_spirit::npc_lk_wicked_spiritAI::Reset(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::Reset(), npc_crok_scourgebane::npc_crok_scourgebaneAI::Reset(), boss_sister_svalna::boss_sister_svalnaAI::Reset(), npc_impaling_spear::npc_impaling_spearAI::Reset(), boss_four_horsemen::boss_four_horsemenAI::Reset(), boss_gluth::boss_gluthAI::Reset(), boss_gothik::boss_gothikAI::Reset(), npc_boss_gothik_minion::npc_boss_gothik_minionAI::Reset(), boss_kelthuzad::boss_kelthuzadAI::Reset(), boss_noth::boss_nothAI::Reset(), boss_sapphiron::boss_sapphironAI::Reset(), npc_oculus_unstable_sphere::npc_oculus_unstable_sphereAI::Reset(), boss_volkhan::boss_volkhanAI::Reset(), brann_bronzebeard::brann_bronzebeardAI::Reset(), boss_algalon_the_observer::boss_algalon_the_observerAI::Reset(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::Reset(), npc_ulduar_iron_construct::npc_ulduar_iron_constructAI::Reset(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::Reset(), boss_thorim_sif::boss_thorim_sifAI::Reset(), npc_beryl_sorcerer::npc_beryl_sorcererAI::Reset(), npc_imprisoned_beryl_sorcerer::npc_imprisoned_beryl_sorcererAI::Reset(), npc_venture_co_straggler::npc_venture_co_stragglerAI::Reset(), npc_voidtraveler::Reset(), npc_akama_illidan::npc_akama_illidanAI::Reset(), boss_shade_of_akama::Reset(), boss_lady_vashj::Reset(), boss_leotheras_the_blind::Reset(), boss_the_lurker_below::Reset(), boss_warlord_kalithresh::Reset(), boss_broggok::Reset(), boss_kelidan_the_breaker::Reset(), boss_vazruden_the_herald::Reset(), boss_magtheridon::Reset(), boss_alar::boss_alarAI::Reset(), npc_ancestral_wolf::npc_ancestral_wolfAI::Reset(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::Reset(), npc_bessy::npc_bessyAI::Reset(), npc_enslaved_netherwing_drake::Reset(), npc_pet_dk_ebon_gargoyle::npc_pet_dk_ebon_gargoyleAI::Reset(), emerald_dragonAI::Reset(), Resurrect(), boss_magtheridon::ScheduleCombatEvents(), boss_the_lurker_below::SchedulerPhaseOne(), boss_laj::ScheduleTasks(), Unit::SetCharmedBy(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::SetData(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::SetData(), gunship_npc_AI::SetData(), npc_gunship_boarding_addAI::SetData(), CreatureAI::SetGazeOn(), BfGraveyard::SetSpirit(), npc_akama_illidan::npc_akama_illidanAI::sGossipSelect(), Battlefield::ShowNpc(), boss_viscidus::SoftReset(), npc_cult_fanatic::npc_cult_fanaticAI::SpellHit(), npc_cult_adherent::npc_cult_adherentAI::SpellHit(), npc_ulduar_iron_construct::npc_ulduar_iron_constructAI::SpellHit(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::SpellHit(), npc_ulduar_vx001::npc_ulduar_vx001AI::SpellHit(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::SpellHit(), npc_crusade_persuaded::npc_crusade_persuadedAI::SpellHit(), npc_venture_co_straggler::npc_venture_co_stragglerAI::SpellHit(), boss_garfrost::boss_garfrostAI::SpellHitTarget(), boss_devourer_of_souls::boss_devourer_of_soulsAI::SpellHitTarget(), boss_ick::boss_ickAI::SpellHitTarget(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::sQuestAccept(), boss_noth::boss_nothAI::StartBalconyPhase(), instance_violet_hold::instance_violet_hold_InstanceMapScript::StartBossEncounter(), boss_lord_valthalak::boss_lord_valthalakAI::StartFighting(), boss_heigan::boss_heiganAI::StartFightPhase(), boss_noth::boss_nothAI::StartGroundPhase(), boss_lord_valthalak::boss_lord_valthalakAI::StartTalking(), boss_ouro::Submerge(), boss_jedoga_shadowseeker::SummonedCreatureDies(), boss_vaelastrasz::boss_vaelAI::UpdateAI(), boss_ragnaros::boss_ragnarosAI::UpdateAI(), boss_mr_smite::boss_mr_smiteAI::UpdateAI(), npc_scarlet_ghoul::npc_scarlet_ghoulAI::UpdateAI(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::UpdateAI(), boss_felmyst::boss_felmystAI::UpdateAI(), boss_kalecgos::boss_kalecgosAI::UpdateAI(), boss_kiljaeden::boss_kiljaedenAI::UpdateAI(), boss_entropius::boss_entropiusAI::UpdateAI(), boss_arlokk::boss_arlokkAI::UpdateAI(), boss_grilek::boss_grilekAI::UpdateAI(), boss_renataki::boss_renatakiAI::UpdateAI(), npc_hallows_end_soh::UpdateAI(), boss_archimonde::boss_archimondeAI::UpdateAI(), npc_arthas::npc_arthasAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), boss_onyxia::UpdateAI(), npc_belnistrasz::npc_belnistraszAI::UpdateAI(), boss_sartura::UpdateAI(), npc_sartura_royal_guard::UpdateAI(), boss_skeram::UpdateAI(), npc_murkdeep::npc_murkdeepAI::UpdateAI(), boss_halion::boss_halionAI::UpdateAI(), boss_saviana_ragefire::boss_saviana_ragefireAI::UpdateAI(), npc_memory::npc_memoryAI::UpdateAI(), boss_icehowl::boss_icehowlAI::UpdateAI(), boss_ick::boss_ickAI::UpdateAI(), boss_krick::boss_krickAI::UpdateAI(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::UpdateAI(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::UpdateAI(), npc_cult_fanatic::npc_cult_fanaticAI::UpdateAI(), npc_cult_adherent::npc_cult_adherentAI::UpdateAI(), boss_lord_marrowgar::UpdateAI(), boss_professor_putricide::boss_professor_putricideAI::UpdateAI(), boss_sindragosa::boss_sindragosaAI::UpdateAI(), npc_rimefang::npc_rimefangAI::UpdateAI(), boss_the_lich_king::boss_the_lich_kingAI::UpdateAI(), npc_terenas_menethil::npc_terenas_menethilAI::UpdateAI(), boss_gothik::boss_gothikAI::UpdateAI(), boss_kelthuzad::boss_kelthuzadAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_thaddius::boss_thaddiusAI::UpdateAI(), npc_crystalline_frayer::npc_crystalline_frayerAI::UpdateAI(), boss_algalon_the_observer::boss_algalon_the_observerAI::UpdateAI(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_lurgglbr::npc_lurgglbrAI::UpdateAI(), npc_q24545_vegard::npc_q24545_vegardAI::UpdateAI(), boss_shade_of_akama::UpdateAI(), npc_millhouse_manastorm::npc_millhouse_manastormAI::UpdateAI(), boss_alar::boss_alarAI::UpdateAI(), boss_kaelthas::boss_kaelthasAI::UpdateAI(), npc_enslaved_netherwing_drake::UpdateAI(), boss_taerar::boss_taerarAI::UpdateAI(), CreatureAI::UpdateVictimWithGaze(), npc_akama_illidan::npc_akama_illidanAI::WaypointReached(), npc_arthas::npc_arthasAI::WaypointReached(), npc_general_andorov::WaypointReached(), and npc_apothecary_hanes::npc_Apothecary_HanesAI::WaypointReached().

◆ SetRegeneratingHealth()

void Creature::SetRegeneratingHealth ( bool  c)
inline
312{ m_regenHealth = c; }

References m_regenHealth.

Referenced by boss_yoggsaron_brain::boss_yoggsaron_brainAI::boss_yoggsaron_brainAI(), boss_felblood_kaelthas::DamageTaken(), boss_kiljaeden::boss_kiljaedenAI::DamageTaken(), boss_eadric::boss_eadricAI::DamageTaken(), boss_paletress::boss_paletressAI::DamageTaken(), boss_grand_champion::boss_grand_championAI::DamageTaken(), npc_crystalline_frayer::npc_crystalline_frayerAI::DamageTaken(), npc_ulduar_arachnopod_destroyer::npc_ulduar_arachnopod_destroyerAI::DamageTaken(), boss_mal_ganis::boss_mal_ganisAI::DamageTaken(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::DamageTaken(), npc_twilight_volunteer::DoAction(), boss_grand_champion::boss_grand_championAI::DoAction(), gunship_npc_AI::gunship_npc_AI(), boss_drakkari_colossus::boss_drakkari_colossusAI::JustSummoned(), boss_grand_champion::boss_grand_championAI::MovementInform(), npc_wild_wyrm::npc_wild_wyrmAI::MovementInform(), npc_amanitar_mushrooms::npc_amanitar_mushrooms(), npc_gunship_boarding_addAI::npc_gunship_boarding_addAI(), npc_gunship::npc_gunshipAI::npc_gunshipAI(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::npc_high_overlord_saurfang_igbAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::npc_muradin_bronzebeard_igbAI(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::Reset(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::Reset(), npc_ulduar_vx001::npc_ulduar_vx001AI::Reset(), npc_blessed_banner::npc_blessed_bannerAI::Reset(), npc_wild_wyrm::npc_wild_wyrmAI::Reset(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::SetData(), boss_kalecgos::boss_kalecgosAI::UpdateAI(), npc_crystalline_frayer::npc_crystalline_frayerAI::UpdateAI(), and boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI().

◆ SetRegeneratingPower()

void Creature::SetRegeneratingPower ( bool  c)
inline
313{ m_regenPower = c; }

References m_regenPower.

Referenced by boss_moam::Reset().

◆ SetRespawnDelay()

◆ SetRespawnTime()

◆ SetSwim()

bool Creature::SetSwim ( bool  enable)
overridevirtual

Reimplemented from Unit.

3147{
3148 if (!Unit::SetSwim(enable))
3149 return false;
3150
3152 data << GetPackGUID();
3153 SendMessageToSet(&data, true);
3154 return true;
3155}
@ SMSG_SPLINE_MOVE_STOP_SWIM
Definition: Opcodes.h:810
@ SMSG_SPLINE_MOVE_START_SWIM
Definition: Opcodes.h:809
virtual bool SetSwim(bool enable)
Definition: Unit.cpp:20939

References Object::GetPackGUID(), WorldObject::SendMessageToSet(), Unit::SetSwim(), SMSG_SPLINE_MOVE_START_SWIM, and SMSG_SPLINE_MOVE_STOP_SWIM.

Referenced by npc_depth_charge::npc_depth_chargeAI::Reset(), SmartAI::SetSwim(), npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI::UpdateAI(), and UpdateMovementFlags().

◆ SetTarget()

void Creature::SetTarget ( ObjectGuid  guid = ObjectGuid::Empty)
overridevirtual

Implements Unit.

3442{
3443 if (!_focusSpell)
3445}

References _focusSpell, Object::SetGuidValue(), and UNIT_FIELD_TARGET.

Referenced by boss_malygos::boss_malygosAI::AttackStart(), ClearTarget(), boss_garfrost::boss_garfrostAI::DamageTaken(), boss_kiljaeden::boss_kiljaedenAI::DamageTaken(), ConfusedMovementGenerator< T >::DoFinalize(), boss_ouro::Emerge(), RestoreAttack::Execute(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::HandleAnimation(), boss_kelthuzad::boss_kelthuzadAI::JustEngagedWith(), boss_illidan_stormrage::boss_illidan_stormrageAI::JustSummoned(), boss_bug_trio::MovementInform(), boss_essence_of_suffering::boss_essence_of_sufferingAI::MovementInform(), boss_essence_of_desire::boss_essence_of_desireAI::MovementInform(), boss_mr_smite::boss_mr_smiteAI::MovementInform(), boss_felmyst::boss_felmystAI::MovementInform(), boss_kaelthas::boss_kaelthasAI::MovementInform(), npc_arthas::OnGossipSelect(), boss_leotheras_the_blind::Reset(), npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::Reset(), boss_magtheridon::ScheduleCombatEvents(), boss_the_lurker_below::SchedulerPhaseOne(), setDeathState(), npc_harrison_jones::npc_harrison_jonesAI::SpellHit(), boss_razorscale::boss_razorscaleAI::SpellHit(), boss_garfrost::boss_garfrostAI::SpellHitTarget(), boss_mr_smite::boss_mr_smiteAI::UpdateAI(), npc_valkyr_battle_maiden::npc_valkyr_battle_maidenAI::UpdateAI(), npc_madrigosa::npc_madrigosaAI::UpdateAI(), boss_felmyst::boss_felmystAI::UpdateAI(), boss_kiljaeden::boss_kiljaedenAI::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_arthas::npc_arthasAI::UpdateAI(), boss_cthun::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), boss_illidan_stormrage::boss_illidan_stormrageAI::UpdateAI(), and boss_kaelthas::boss_kaelthasAI::UpdateAI().

◆ SetTransportHomePosition() [1/2]

void Creature::SetTransportHomePosition ( const Position pos)
inline

◆ SetTransportHomePosition() [2/2]

void Creature::SetTransportHomePosition ( float  x,
float  y,
float  z,
float  o 
)
inline

◆ SetWalk()

bool Creature::SetWalk ( bool  enable)
overridevirtual

Reimplemented from Unit.

3099{
3100 if (!Unit::SetWalk(enable))
3101 return false;
3102
3104 data << GetPackGUID();
3105 SendMessageToSet(&data, false);
3106 return true;
3107}
@ SMSG_SPLINE_MOVE_SET_RUN_MODE
Definition: Opcodes.h:811
@ SMSG_SPLINE_MOVE_SET_WALK_MODE
Definition: Opcodes.h:812
virtual bool SetWalk(bool enable)
Definition: Unit.cpp:20907

References Object::GetPackGUID(), WorldObject::SendMessageToSet(), Unit::SetWalk(), SMSG_SPLINE_MOVE_SET_RUN_MODE, and SMSG_SPLINE_MOVE_SET_WALK_MODE.

Referenced by boss_the_lich_king::boss_the_lich_kingAI::DamageTaken(), npc_weegli_blastfuse::npc_weegli_blastfuseAI::DestroyDoor(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::DoAction(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::DoAction(), npc_saurfang_event::npc_saurfang_eventAI::DoAction(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::DoAction(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::DoAction(), npc_brann_bronzebeard_algalon::npc_brann_bronzebeard_algalonAI::DoAction(), npc_scarlet_miner_cart::npc_scarlet_miner_cartAI::DoAction(), WaypointMovementGenerator< Creature >::DoFinalize(), RandomMovementGenerator< T >::DoFinalize(), ChaseMovementGenerator< T >::DoInitialize(), UtherBatteredHiltEvent::Execute(), npc_lord_arete::npc_lord_areteAI::InitializeAI(), npc_lk_spirit_bomb::npc_lk_spirit_bombAI::IsSummonedBy(), npc_strangulate_vehicle::npc_strangulate_vehicleAI::IsSummonedBy(), boss_shade_of_aran::JustEngagedWith(), npc_icc_vengeful_fleshreaper::npc_icc_vengeful_fleshreaperAI::JustReachedHome(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::JustRespawned(), npc_eris_hevenfire::npc_eris_hevenfireAI::JustSummoned(), npc_kalecgos_kj::npc_kalecgos_kjAI::JustSummoned(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::JustSummoned(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::JustSummoned(), npc_akama_shade::JustSummoned(), boss_fathomlord_karathress::JustSummoned(), npc_rinji::npc_rinjiAI::JustSummoned(), npc_maghar_captive::npc_maghar_captiveAI::JustSummoned(), npc_brann_bronzebeard_algalon::npc_brann_bronzebeard_algalonAI::MovementInform(), boss_mandokir::boss_mandokirAI::MovementInform(), boss_captain_skarloc::MovementInform(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::MovementInform(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::MovementInform(), npc_thassarian2::npc_thassarian2AI::MovementInform(), boss_kaelthas::boss_kaelthasAI::MovementInform(), npc_escortAI::MovementInform(), npc_cameron::MoveTheChildren(), npc_hor_leader_second::npc_hor_leader_secondAI::MoveToNextStopPoint(), npc_marzon_silent_blade::npc_marzon_silent_bladeAI::npc_marzon_silent_bladeAI(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::npc_valkyr_shadowguardAI(), SmartAI::OnCharmed(), npc_chesspiece::OnCharmed(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::OnCreatureCreate(), npc_chesspiece::Reset(), boss_nightbane::Reset(), npc_janalai_hatcher::npc_janalai_hatcherAI::Reset(), boss_nalorakk::boss_nalorakkAI::Reset(), boss_arlokk::boss_arlokkAI::Reset(), npc_dark_iron_guzzler::Reset(), npc_kinetic_bomb::npc_kinetic_bombAI::Reset(), npc_icc_vengeful_fleshreaper::npc_icc_vengeful_fleshreaperAI::Reset(), npc_xt002_scrapbot::npc_xt002_scrapbotAI::Reset(), npc_injured_7th_legion_soldier::npc_injured_7th_legion_soldierAI::Reset(), npc_q24545_lich_king::npc_q24545_lich_kingAI::Reset(), npc_plaguehound_tracker::npc_plaguehound_trackerAI::Reset(), boss_shade_of_akama::Reset(), boss_kaelthas::boss_kaelthasAI::Reset(), SmartAI::ReturnToLastOOCPos(), npc_escortAI::ReturnToLastPoint(), npc_dream_fog::npc_dream_fogAI::ScheduleEvents(), npc_escortAI::SetRun(), SmartAI::SetRun(), npc_tirion_fordring_tft::npc_tirion_fordringAI::sGossipSelect(), npc_injured_patient::npc_injured_patientAI::SpellHit(), npc_escortAI::Start(), hyjalAI::SummonCreature(), boss_majordomo::boss_majordomoAI::UpdateAI(), npc_scarlet_courier::npc_scarlet_courierAI::UpdateAI(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), npc_valkyr_battle_maiden::npc_valkyr_battle_maidenAI::UpdateAI(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::UpdateAI(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::UpdateAI(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::UpdateAI(), boss_arlokk::boss_arlokkAI::UpdateAI(), npc_twilight_volunteer::UpdateAI(), npc_xerestrasza::npc_xerestraszaAI::UpdateAI(), npc_hor_leader_second::npc_hor_leader_secondAI::UpdateAI(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::UpdateAI(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::UpdateAI(), npc_tirion_fordring_tft::npc_tirion_fordringAI::UpdateAI(), npc_oculus_drakegiver::npc_oculus_drakegiverAI::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), npc_thassarian2::npc_thassarian2AI::UpdateAI(), npc_shandy_dalaran::npc_shandy_dalaranAI::UpdateAI(), npc_commander_eligor_dawnbringer::npc_commander_eligor_dawnbringerAI::UpdateAI(), npc_crusade_recruit::npc_crusade_recruitAI::UpdateAI(), boss_shade_of_akama::UpdateAI(), npc_akama_shade::UpdateAI(), boss_kaelthas::boss_kaelthasAI::UpdateAI(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::UpdateAI(), npc_ranger_lilatha::WaypointReached(), npc_corporal_keeshan::npc_corporal_keeshanAI::WaypointReached(), npc_emily::npc_emilyAI::WaypointReached(), npc_ancestral_wolf::npc_ancestral_wolfAI::WaypointReached(), and npc_isla_starmane::npc_isla_starmaneAI::WaypointReached().

◆ SetWanderDistance()

void Creature::SetWanderDistance ( float  dist)
inline

◆ SetWaterWalking()

bool Creature::SetWaterWalking ( bool  enable,
bool  packetOnly = false 
)
overridevirtual

movement counter

Reimplemented from Unit.

3225{
3226 if (!packetOnly && !Unit::SetWaterWalking(enable))
3227 return false;
3228
3229 if (m_movedByPlayer)
3230 {
3232 data << GetPackGUID();
3233 data << uint32(0);
3235
3236 data.Initialize(MSG_MOVE_WATER_WALK, 64);
3237 data << GetPackGUID();
3238 BuildMovementPacket(&data);
3239 m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
3240 return true;
3241 }
3242
3244 data << GetPackGUID();
3245 SendMessageToSet(&data, true);
3246 return true;
3247}
@ SMSG_MOVE_LAND_WALK
Definition: Opcodes.h:253
@ SMSG_SPLINE_MOVE_LAND_WALK
Definition: Opcodes.h:808
@ SMSG_MOVE_WATER_WALK
Definition: Opcodes.h:252
@ MSG_MOVE_WATER_WALK
Definition: Opcodes.h:719
@ SMSG_SPLINE_MOVE_WATER_WALK
Definition: Opcodes.h:807
virtual bool SetWaterWalking(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20976

References Unit::BuildMovementPacket(), Object::GetPackGUID(), WorldPacket::Initialize(), Unit::m_movedByPlayer, MSG_MOVE_WATER_WALK, Player::SendDirectMessage(), WorldObject::SendMessageToSet(), Player::SendMessageToSet(), Unit::SetWaterWalking(), SMSG_MOVE_LAND_WALK, SMSG_MOVE_WATER_WALK, SMSG_SPLINE_MOVE_LAND_WALK, SMSG_SPLINE_MOVE_WATER_WALK, and Object::ToPlayer().

◆ Update()

void Creature::Update ( uint32  time)
overridevirtual

Reimplemented from WorldObject.

Reimplemented in Pet, TempSummon, Puppet, and Totem.

601{
603 {
604 TriggerJustRespawned = false;
605 AI()->JustRespawned();
606 if (m_vehicleKit)
608 }
609
610 switch (m_deathState)
611 {
612 case DeathState::JustRespawned:
613 // Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting.
614 LOG_ERROR("entities.unit", "Creature ({}) in wrong state: DeathState::JustRespawned (4)", GetGUID().ToString());
615 break;
616 case DeathState::JustDied:
617 // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
618 LOG_ERROR("entities.unit", "Creature ({}) in wrong state: DeathState::JustDead (1)", GetGUID().ToString());
619 break;
620 case DeathState::Dead:
621 {
622 time_t now = GameTime::GetGameTime().count();
623 if (m_respawnTime <= now)
624 {
625 Respawn();
626 }
627 break;
628 }
629 case DeathState::Corpse:
630 {
631 Unit::Update(diff);
632 // deathstate changed on spells update, prevent problems
633 if (m_deathState != DeathState::Corpse)
634 break;
635
637 {
638 if (m_groupLootTimer <= diff)
639 {
640 Group* group = sGroupMgr->GetGroupByGUID(lootingGroupLowGUID);
641 if (group)
642 group->EndRoll(&loot, GetMap());
645 }
646 else
647 {
648 m_groupLootTimer -= diff;
649 }
650 }
651 else if (m_corpseRemoveTime <= GameTime::GetGameTime().count())
652 {
653 RemoveCorpse(false);
654 LOG_DEBUG("entities.unit", "Removing corpse... {} ", GetUInt32Value(OBJECT_FIELD_ENTRY));
655 }
656 break;
657 }
658 case DeathState::Alive:
659 {
660 Unit::Update(diff);
661
662 // creature can be dead after Unit::Update call
663 // CORPSE/DEAD state will processed at next tick (in other case death timer will be updated unexpectedly)
664 if (!IsAlive())
665 break;
666
667 // if creature is charmed, switch to charmed AI
668 if (NeedChangeAI)
669 {
671 NeedChangeAI = false;
672 IsAIEnabled = true;
673
674 // xinef: update combat state, if npc is not in combat - return to spawn correctly by calling EnterEvadeMode
675 SelectVictim();
676 }
677
678 // if periodic combat pulse is enabled and we are both in combat and in a dungeon, do this now
679 if (m_combatPulseDelay > 0 && IsInCombat() && GetMap()->IsDungeon())
680 {
681 if (diff > m_combatPulseTime)
683 else
684 m_combatPulseTime -= diff;
685
686 if (m_combatPulseTime == 0)
687 {
688 if (AI())
689 AI()->DoZoneInCombat();
690 else
693 }
694 }
695
696 // periodic check to see if the creature has passed an evade boundary
697 if (IsAIEnabled && !IsInEvadeMode() && IsEngaged())
698 {
699 if (diff >= m_boundaryCheckTime)
700 {
701 AI()->CheckInRoom();
702 m_boundaryCheckTime = 2500;
703 }
704 else
705 m_boundaryCheckTime -= diff;
706 }
707
708 Unit* owner = GetCharmerOrOwner();
709 if (IsCharmed() && !IsWithinDistInMap(owner, GetMap()->GetVisibilityRange(), true, false))
710 {
712 }
713
714 if (Unit* victim = GetVictim())
715 {
716 // If we are closer than 50% of the combat reach we are going to reposition the victim
717 if (diff >= m_moveBackwardsMovementTime)
718 {
719 float MaxRange = GetCollisionRadius() + GetVictim()->GetCollisionRadius();
720
721 if (IsInDist(victim, MaxRange))
723
725 }
726 else
727 {
729 }
730
731 // Circling the target
732 if (diff >= m_moveCircleMovementTime)
733 {
734 AI()->MoveCircleChecks();
736 }
737 else
738 {
740 }
741 }
742
743 // Call for assistance if not disabled
745 {
746 if (m_assistanceTimer <= diff)
747 {
749 {
750 SetNoCallAssistance(false);
752 }
754 }
755 else
756 {
757 m_assistanceTimer -= diff;
758 }
759 }
760
761 if (!IsInEvadeMode() && IsAIEnabled)
762 {
763 // do not allow the AI to be changed during update
764 m_AI_locked = true;
765 i_AI->UpdateAI(diff);
766 m_AI_locked = false;
767 }
768
769 // creature can be dead after UpdateAI call
770 // CORPSE/DEAD state will processed at next tick (in other case death timer will be updated unexpectedly)
771 if (!IsAlive())
772 break;
773
774 m_regenTimer -= diff;
775 if (m_regenTimer <= 0)
776 {
777 if (!IsInEvadeMode())
778 {
779 // regenerate health if not in combat or if polymorphed)
780 if (!IsInCombat() || IsPolymorphed())
783 {
784 // regenerate health if cannot reach the target and the setting is set to do so.
785 // this allows to disable the health regen of raid bosses if pathfinding has issues for whatever reason
786 if (sWorld->getBoolConfig(CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID) || !GetMap()->IsRaid())
787 {
789 LOG_DEBUG("entities.unit", "RegenerateHealth() enabled because Creature cannot reach the target. Detail: {}", GetDebugInfo());
790 }
791 else
792 LOG_DEBUG("entities.unit", "RegenerateHealth() disabled even if the Creature cannot reach the target. Detail: {}", GetDebugInfo());
793 }
794 }
795
796 if (getPowerType() == POWER_ENERGY)
798 else
800
802 }
803
805 {
806 m_cannotReachTimer += diff;
808 {
809 Player* cannotReachPlayer = ObjectAccessor::GetPlayer(*this, m_cannotReachTarget);
810 if (cannotReachPlayer && IsEngagedBy(cannotReachPlayer) && IsAIEnabled && AI()->OnTeleportUnreacheablePlayer(cannotReachPlayer))
811 {
813 }
814 else if (!GetMap()->IsRaid())
815 {
816 auto EnterEvade = [&]()
817 {
818 if (CreatureAI* ai = AI())
819 {
821 }
822 };
823
824 if (GetThreatMgr().GetThreatListSize() <= 1)
825 {
826 EnterEvade();
827 }
828 else
829 {
830 if (HostileReference* ref = GetThreatMgr().GetOnlineContainer().getReferenceByTarget(m_cannotReachTarget))
831 {
832 ref->removeReference();
834 }
835 else
836 {
837 EnterEvade();
838 }
839 }
840 }
841 }
842 }
843 break;
844 }
845 default:
846 break;
847 }
848
850 {
851 // pussywizard:
852 if (GetOwnerGUID().IsPlayer())
853 {
854 if (m_transportCheckTimer <= diff)
855 {
858 if (newTransport != GetTransport())
859 {
860 if (GetTransport())
861 GetTransport()->RemovePassenger(this, true);
862 if (newTransport)
863 newTransport->AddPassenger(this, true);
865 //SendMovementFlagUpdate();
866 }
867 }
868 else
869 m_transportCheckTimer -= diff;
870 }
871
872 sScriptMgr->OnCreatureUpdate(this, diff);
873 }
874}
@ OBJECT_FIELD_ENTRY
Definition: UpdateFields.h:27
@ CONFIG_NPC_EVADE_IF_NOT_REACHABLE
Definition: IWorld.h:411
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD
Definition: IWorld.h:284
@ CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID
Definition: IWorld.h:171
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
virtual void UpdateAI(uint32)=0
void MoveCircleChecks()
Definition: CreatureAI.cpp:327
@ EVADE_REASON_NO_PATH
Definition: CreatureAI.h:93
virtual void JustRespawned()
Definition: CreatureAI.h:151
virtual bool CheckInRoom()
Definition: CreatureAI.cpp:381
void MoveBackwardsChecks()
Definition: CreatureAI.cpp:344
Definition: ThreatMgr.h:49
float GetThreatListSize() const
Definition: ThreatMgr.h:222
void SetInCombatWithZone()
Definition: Creature.cpp:2732
void Respawn(bool force=false)
Definition: Creature.cpp:1974
void RegenerateHealth()
Definition: Creature.cpp:959
void CallAssistance(Unit *target=nullptr)
Definition: Creature.cpp:2366
static constexpr uint32 MOVE_BACKWARDS_CHECK_INTERVAL
Definition: Creature.h:384
bool CanPeriodicallyCallForAssistance() const
Definition: Creature.cpp:3618
uint32 m_moveCircleMovementTime
Definition: Creature.h:385
uint32 m_moveBackwardsMovementTime
Definition: Creature.h:386
static constexpr uint32 MOVE_CIRCLE_CHECK_INTERVAL
Definition: Creature.h:383
Unit * SelectVictim()
Definition: Unit.cpp:14719
bool IsNotReachableAndNeedRegen() const
Definition: Creature.cpp:3577
void Regenerate(Powers power)
Definition: Creature.cpp:890
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
bool IsInDist(float x, float y, float z, float dist) const
Definition: Position.h:217
virtual void RemovePassenger(WorldObject *passenger, bool withAll=false)=0
virtual void AddPassenger(WorldObject *passenger, bool withAll=false)=0
bool NeedChangeAI
Definition: Unit.h:2364
float GetCollisionRadius() const override
this method gets the radius of a Unit by DB if any value is defined, otherwise it gets the value by t...
Definition: Unit.cpp:21381
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:2410
void UpdateCharmAI()
Definition: Unit.cpp:15771
Vehicle * m_vehicleKit
Definition: Unit.h:2549
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16957
void Update(uint32 time) override
Definition: Unit.cpp:403
void RemoveCharmAuras()
Definition: Unit.cpp:11191
void EndRoll(Loot *loot, Map *allowedMap)
Definition: Group.cpp:1379
Transport * GetTransportForPos(uint32 phase, float x, float y, float z, WorldObject *worldobject=nullptr)
Definition: Map.cpp:2016

References Transport::AddPassenger(), AI(), CallAssistance(), CanNotReachTarget(), CanPeriodicallyCallForAssistance(), CreatureAI::CheckInRoom(), CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD, CONFIG_NPC_EVADE_IF_NOT_REACHABLE, CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID, CREATURE_REGEN_INTERVAL, CreatureAI::DoZoneInCombat(), Group::EndRoll(), CreatureAI::EVADE_REASON_NO_PATH, Unit::GetCharmerOrOwner(), Unit::GetCollisionRadius(), GetDebugInfo(), GameTime::GetGameTime(), Object::GetGUID(), WorldObject::GetMap(), Unit::GetOwnerGUID(), WorldObject::GetPhaseMask(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::getPowerType(), ThreatMgr::GetThreatListSize(), Unit::GetThreatMgr(), WorldObject::GetTransport(), Map::GetTransportForPos(), Object::GetUInt32Value(), Unit::GetVictim(), WorldObject::GetVisibilityRange(), Unit::i_AI, IN_MILLISECONDS, Unit::IsAIEnabled, Unit::IsAlive(), Unit::IsCharmed(), Unit::IsDuringRemoveFromWorld(), Unit::IsEngaged(), Unit::IsEngagedBy(), Unit::IsInCombat(), Position::IsInDist(), IsInEvadeMode(), Object::IsInWorld(), IsNotReachableAndNeedRegen(), Object::IsPlayer(), Unit::IsPolymorphed(), WorldObject::IsWithinDistInMap(), CreatureAI::JustRespawned(), LOG_DEBUG, LOG_ERROR, loot, lootingGroupLowGUID, m_AI_locked, m_assistanceTimer, m_boundaryCheckTime, m_cannotReachTarget, m_cannotReachTimer, m_combatPulseDelay, m_combatPulseTime, m_corpseRemoveTime, Unit::m_deathState, m_groupLootTimer, m_moveBackwardsMovementTime, m_moveCircleMovementTime, Unit::m_regenTimer, m_respawnTime, m_transportCheckTimer, Unit::m_vehicleKit, MOVE_BACKWARDS_CHECK_INTERVAL, MOVE_CIRCLE_CHECK_INTERVAL, CreatureAI::MoveBackwardsChecks(), CreatureAI::MoveCircleChecks(), Unit::NeedChangeAI, OBJECT_FIELD_ENTRY, POWER_ENERGY, POWER_MANA, Regenerate(), RegenerateHealth(), Unit::RemoveCharmAuras(), RemoveCorpse(), Transport::RemovePassenger(), Vehicle::Reset(), Respawn(), SelectVictim(), SetCannotReachTarget(), SetInCombatWithZone(), SetNoCallAssistance(), sGroupMgr, sScriptMgr, Unit::StopMovingOnCurrentPos(), sWorld, Position::ToString(), TriggerJustRespawned, Unit::Update(), UnitAI::UpdateAI(), Unit::UpdateCharmAI(), and urand().

Referenced by Pet::Update(), TempSummon::Update(), Puppet::Update(), and Totem::Update().

◆ UpdateAllStats()

bool Creature::UpdateAllStats ( )
overridevirtual

Implements Unit.

Reimplemented in Guardian, and Totem.

1022{
1026
1027 for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
1029
1031
1032 return true;
1033}
@ MAX_POWERS
Definition: SharedDefines.h:276
void UpdateAttackPowerAndDamage(bool ranged=false) override
Definition: StatSystem.cpp:1066
void UpdateMaxPower(Powers power) override
Definition: StatSystem.cpp:1058
void UpdateMaxHealth() override
Definition: StatSystem.cpp:1052
virtual void UpdateAllResistances()
Definition: StatSystem.cpp:54

References MAX_POWERS, POWER_MANA, Unit::UpdateAllResistances(), UpdateAttackPowerAndDamage(), UpdateMaxHealth(), and UpdateMaxPower().

Referenced by UpdateEntry().

◆ UpdateArmor()

void Creature::UpdateArmor ( )
overridevirtual

Implements Unit.

Reimplemented in Guardian, and Totem.

1047{
1048 float value = GetTotalAuraModValue(UNIT_MOD_ARMOR);
1049 SetArmor(int32(value));
1050}
@ UNIT_MOD_ARMOR
Definition: Unit.h:275
float GetTotalAuraModValue(UnitMods unitMod) const
Definition: Unit.cpp:15304
void SetArmor(int32 val)
Definition: Unit.h:1447

References Unit::GetTotalAuraModValue(), Unit::SetArmor(), and UNIT_MOD_ARMOR.

Referenced by UpdateResistances().

◆ UpdateAttackPowerAndDamage()

void Creature::UpdateAttackPowerAndDamage ( bool  ranged = false)
overridevirtual

Implements Unit.

Reimplemented in Guardian, and Totem.

1067{
1069
1073
1074 if (ranged)
1075 {
1079 }
1080
1081 float baseAttackPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT);
1082 float attackPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
1083 float attackPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
1084
1085 SetInt32Value(index, uint32(baseAttackPower)); // UNIT_FIELD_(RANGED)_ATTACK_POWER
1086 SetInt32Value(indexMod, uint32(attackPowerMod)); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS
1087 SetFloatValue(indexMulti, attackPowerMultiplier); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER
1088
1089 // automatically update weapon damage after attack power modification
1090 if (ranged)
1092 else
1093 {
1096 }
1097}
@ UNIT_FIELD_ATTACK_POWER_MODS
Definition: UpdateFields.h:163
@ UNIT_FIELD_RANGED_ATTACK_POWER
Definition: UpdateFields.h:165
@ UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
Definition: UpdateFields.h:167
@ UNIT_FIELD_ATTACK_POWER_MULTIPLIER
Definition: UpdateFields.h:164
@ UNIT_FIELD_ATTACK_POWER
Definition: UpdateFields.h:162
@ UNIT_FIELD_RANGED_ATTACK_POWER_MODS
Definition: UpdateFields.h:166
void SetInt32Value(uint16 index, int32 value)
Definition: Object.cpp:637

References BASE_ATTACK, BASE_PCT, BASE_VALUE, Unit::GetModifierValue(), OFF_ATTACK, RANGED_ATTACK, Object::SetFloatValue(), Object::SetInt32Value(), TOTAL_PCT, TOTAL_VALUE, UNIT_FIELD_ATTACK_POWER, UNIT_FIELD_ATTACK_POWER_MODS, UNIT_FIELD_ATTACK_POWER_MULTIPLIER, UNIT_FIELD_RANGED_ATTACK_POWER, UNIT_FIELD_RANGED_ATTACK_POWER_MODS, UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER, UNIT_MOD_ATTACK_POWER, UNIT_MOD_ATTACK_POWER_RANGED, and Unit::UpdateDamagePhysical().

Referenced by UpdateAllStats().

◆ UpdateEntry() [1/2]

bool Creature::UpdateEntry ( uint32  entry,
bool  updateAI 
)
inline
176{ return UpdateEntry(entry, nullptr, true, updateAI); }

References UpdateEntry().

Referenced by UpdateEntry().

◆ UpdateEntry() [2/2]

bool Creature::UpdateEntry ( uint32  entry,
const CreatureData data = nullptr,
bool  changelevel = true,
bool  updateAI = false 
)
483{
484 if (!InitEntry(Entry, data))
485 return false;
486
487 CreatureTemplate const* cInfo = GetCreatureTemplate();
488
489 m_regenHealth = cInfo->RegenHealth;
490
491 // creatures always have melee weapon ready if any unless specified otherwise
492 if (!GetCreatureAddon())
494
495 SetFaction(cInfo->faction);
496
497 uint32 npcflag, unit_flags, dynamicflags;
498 ObjectMgr::ChooseCreatureFlags(cInfo, npcflag, unit_flags, dynamicflags, data);
499
501 ReplaceAllNpcFlags(NPCFlags(npcflag | sGameEventMgr->GetNPCFlag(this)));
502 else
504
505 // Xinef: NPC is in combat, keep this flag!
506 unit_flags &= ~UNIT_FLAG_IN_COMBAT;
507 if (IsInCombat())
508 unit_flags |= UNIT_FLAG_IN_COMBAT;
509
510 ReplaceAllUnitFlags(UnitFlags(unit_flags));
512
513 ReplaceAllDynamicFlags(dynamicflags);
514
518
519 uint32 previousHealth = GetHealth();
520 uint32 previousMaxHealth = GetMaxHealth();
521 uint32 previousPlayerDamageReq = _playerDamageReq;
522
523 SelectLevel(changelevel);
524 if (previousHealth > 0)
525 {
526 SetHealth(previousHealth);
527
528 if (previousMaxHealth && previousMaxHealth > GetMaxHealth())
529 {
530 _playerDamageReq = (uint32)(previousPlayerDamageReq * GetMaxHealth() / previousMaxHealth);
531 }
532 else
533 {
534 _playerDamageReq = previousPlayerDamageReq;
535 }
536 }
537
539 CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(GetLevel(), cInfo->unit_class);
540 float armor = stats->GenerateArmor(cInfo);
548
549 SetCanModifyStats(true);
551
552 // checked and error show at loading templates
553 if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction))
554 {
555 if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_ASSIST_PLAYERS)
556 SetPvP(true);
557 else
558 SetPvP(false);
559 }
560
561 // updates spell bars for vehicles and set player's faction - should be called here, to overwrite faction that is set from the new template
562 if (IsVehicle())
563 {
564 if (Player* owner = Creature::GetCharmerOrOwnerPlayerOrPlayerItself()) // this check comes in case we don't have a player
565 {
566 SetFaction(owner->GetFaction()); // vehicles should have same as owner faction
567 owner->VehicleSpellInitialize();
568 }
569 }
570
571 // trigger creature is always not selectable and can not be attacked
572 if (IsTrigger())
574
576
578 {
581 }
582
584
585 // Update movement
586 if (IsRooted())
589
591
592 if (updateAI)
593 {
595 }
596
597 return true;
598}
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
@ CREATURE_FLAG_EXTRA_NO_TAUNT
Definition: CreatureData.h:57
@ CREATURE_FLAG_EXTRA_WORLDEVENT
Definition: CreatureData.h:63
UnitFlags2
Definition: Unit.h:486
@ UNIT_MOD_RESISTANCE_SHADOW
Definition: Unit.h:280
@ UNIT_MOD_RESISTANCE_FROST
Definition: Unit.h:279
@ UNIT_MOD_RESISTANCE_HOLY
Definition: Unit.h:276
@ UNIT_MOD_RESISTANCE_ARCANE
Definition: Unit.h:281
@ UNIT_MOD_RESISTANCE_FIRE
Definition: Unit.h:277
@ UNIT_MOD_RESISTANCE_NATURE
Definition: Unit.h:278
@ SHEATH_STATE_MELEE
Definition: Unit.h:127
UnitFlags
Definition: Unit.h:446
@ UNIT_FLAG_IN_COMBAT
Definition: Unit.h:467
#define sGameEventMgr
Definition: GameEventMgr.h:186
@ FACTION_TEMPLATE_FLAG_ASSIST_PLAYERS
Definition: DBCEnums.h:338
@ SPELL_SCHOOL_SHADOW
Definition: SharedDefines.h:288
@ SPELL_SCHOOL_NATURE
Definition: SharedDefines.h:286
@ SPELL_SCHOOL_FROST
Definition: SharedDefines.h:287
@ SPELL_SCHOOL_FIRE
Definition: SharedDefines.h:285
@ SPELL_SCHOOL_HOLY
Definition: SharedDefines.h:284
@ SPELL_EFFECT_ATTACK_ME
Definition: SharedDefines.h:892
@ IMMUNITY_STATE
Definition: SharedDefines.h:1395
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1394
bool UpdateAllStats() override
Definition: StatSystem.cpp:1021
bool InitEntry(uint32 entry, const CreatureData *data=nullptr)
Definition: Creature.cpp:384
void SetDetectionDistance(float dist)
Definition: Creature.h:201
void LoadSpellTemplateImmunity()
Definition: Creature.cpp:2160
uint32 RangeAttackTime
Definition: CreatureData.h:203
uint32 BaseAttackTime
Definition: CreatureData.h:202
float detection_range
Definition: CreatureData.h:197
int32 resistance[MAX_SPELL_SCHOOL]
Definition: CreatureData.h:220
bool RegenHealth
Definition: CreatureData.h:236
uint32 faction
Definition: CreatureData.h:191
uint32 unit_flags2
Definition: CreatureData.h:208
float GenerateArmor(CreatureTemplate const *info) const
Definition: CreatureData.h:316
void ReplaceAllDynamicFlags(uint32 flag) override
Definition: Unit.h:1338
void SetFaction(uint32 faction)
Definition: Unit.cpp:10064
void SetPvP(bool state)
Definition: Unit.h:1533
void ReplaceAllUnitFlags(UnitFlags flags)
Definition: Unit.h:1497
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1506
void SetCanModifyStats(bool modifyStats)
Definition: Unit.h:2120
void ReplaceAllUnitFlags2(UnitFlags2 flags)
Definition: Unit.h:1503
void SetAttackTime(WeaponAttackType att, uint32 val)
Definition: Unit.h:1489
static void ChooseCreatureFlags(CreatureTemplate const *cinfo, uint32 &npcflag, uint32 &unit_flags, uint32 &dynamicflags, CreatureData const *data=nullptr)
Definition: ObjectMgr.cpp:1735
Definition: DBCStructure.h:930

References _playerDamageReq, AIM_Initialize(), Unit::ApplySpellImmune(), BASE_ATTACK, BASE_VALUE, CreatureTemplate::BaseAttackTime, ObjectMgr::ChooseCreatureFlags(), CREATURE_FLAG_EXTRA_NO_TAUNT, CREATURE_FLAG_EXTRA_WORLDEVENT, CreatureTemplate::detection_range, CreatureTemplate::dmgschool, Entry, CreatureTemplate::faction, FACTION_TEMPLATE_FLAG_ASSIST_PLAYERS, CreatureTemplate::flags_extra, CreatureBaseStats::GenerateArmor(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), GetCreatureAddon(), GetCreatureTemplate(), Unit::GetHealth(), Unit::GetLevel(), Unit::GetMaxHealth(), IMMUNITY_EFFECT, IMMUNITY_STATE, InitEntry(), InitializeReactState(), Unit::IsInCombat(), Unit::IsPet(), IsRooted(), IsTrigger(), Unit::IsVehicle(), LoadSpellTemplateImmunity(), m_regenHealth, OFF_ATTACK, CreatureTemplate::RangeAttackTime, RANGED_ATTACK, CreatureTemplate::RegenHealth, Unit::ReplaceAllDynamicFlags(), Unit::ReplaceAllNpcFlags(), Unit::ReplaceAllUnitFlags(), Unit::ReplaceAllUnitFlags2(), CreatureTemplate::resistance, SelectLevel(), Unit::SetAttackTime(), Unit::SetCanModifyStats(), Unit::SetControlled(), SetDetectionDistance(), Unit::SetFaction(), Unit::SetHealth(), SetMeleeDamageSchool(), Unit::SetModifierValue(), Unit::SetPvP(), Unit::SetSheath(), Unit::SetUnitFlag(), sFactionTemplateStore, sGameEventMgr, SHEATH_STATE_MELEE, sObjectMgr, SPELL_AURA_MOD_TAUNT, SPELL_EFFECT_ATTACK_ME, SPELL_SCHOOL_ARCANE, SPELL_SCHOOL_FIRE, SPELL_SCHOOL_FROST, SPELL_SCHOOL_HOLY, SPELL_SCHOOL_NATURE, SPELL_SCHOOL_SHADOW, CreatureTemplate::unit_class, UNIT_FLAG_IN_COMBAT, UNIT_FLAG_NOT_SELECTABLE, CreatureTemplate::unit_flags2, UNIT_MOD_ARMOR, UNIT_MOD_RESISTANCE_ARCANE, UNIT_MOD_RESISTANCE_FIRE, UNIT_MOD_RESISTANCE_FROST, UNIT_MOD_RESISTANCE_HOLY, UNIT_MOD_RESISTANCE_NATURE, UNIT_MOD_RESISTANCE_SHADOW, UNIT_STATE_ROOT, UpdateAllStats(), and UpdateMovementFlags().

Referenced by CreateFromProto(), boss_yoggsaron_influence_tentacle::boss_yoggsaron_influence_tentacleAI::DamageTaken(), npc_molten_golem::npc_molten_golemAI::DamageTaken(), npc_forest_frog::npc_forest_frogAI::DoSpawnRandom(), npc_commandscript::HandleNpcSetEntryCommand(), npc_isle_of_conquest_turret::npc_isle_of_conquest_turretAI::JustDied(), npc_scholomance_occultist::npc_scholomance_occultistAI::JustReachedHome(), npc_aged_dying_ancient_kodo::npc_aged_dying_ancient_kodoAI::JustRespawned(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::JustSummoned(), npc_kalecgos::MovementInform(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::OnCreatureCreate(), instance_forge_of_souls::instance_forge_of_souls_InstanceScript::OnCreatureCreate(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::OnCreatureCreate(), instance_pit_of_saron::instance_pit_of_saron_InstanceScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), instance_nexus::instance_nexus_InstanceMapScript::OnCreatureCreate(), instance_shattered_halls::instance_shattered_halls_InstanceMapScript::OnCreatureCreate(), npc_announcer_toc5::npc_announcer_toc5AI::Reset(), npc_phase_hunter::npc_phase_hunterAI::Reset(), Respawn(), NPCStaveQuestAI::RevealForm(), npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI::RollPath(), npc_cult_fanatic::npc_cult_fanaticAI::SpellHit(), npc_cult_adherent::npc_cult_adherentAI::SpellHit(), npc_argent_captainAI::SpellHit(), npc_isle_of_conquest_turret::npc_isle_of_conquest_turretAI::SpellHit(), npc_aged_dying_ancient_kodo::npc_aged_dying_ancient_kodoAI::SpellHit(), npc_nether_drake::npc_nether_drakeAI::SpellHit(), boss_hydross_the_unstable::SummonMovementInform(), npc_scholomance_occultist::npc_scholomance_occultistAI::UpdateAI(), npc_cult_fanatic::npc_cult_fanaticAI::UpdateAI(), npc_cult_adherent::npc_cult_adherentAI::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), and npc_tyrion_spybot::npc_tyrion_spybotAI::UpdateAI().

◆ UpdateMaxHealth()

void Creature::UpdateMaxHealth ( )
overridevirtual

Implements Unit.

Reimplemented in Guardian, and Totem.

1053{
1055 SetMaxHealth(uint32(value));
1056}

References Unit::GetTotalAuraModValue(), Unit::SetMaxHealth(), and UNIT_MOD_HEALTH.

Referenced by UpdateAllStats().

◆ UpdateMaxPower()

void Creature::UpdateMaxPower ( Powers  power)
overridevirtual

Implements Unit.

Reimplemented in Guardian, and Totem.

1059{
1060 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + power);
1061
1062 float value = GetTotalAuraModValue(unitMod);
1063 SetMaxPower(power, uint32(value));
1064}
@ UNIT_MOD_POWER_START
Definition: Unit.h:293

References Unit::GetTotalAuraModValue(), Unit::SetMaxPower(), and UNIT_MOD_POWER_START.

Referenced by UpdateAllStats().

◆ UpdateMoveInLineOfSightState()

void Creature::UpdateMoveInLineOfSightState ( )
2522{
2523 // xinef: pets, guardians and units with scripts / smartAI should be skipped
2525 GetScriptId() || GetAIName() == "SmartAI")
2526 {
2529 return;
2530 }
2531
2532 if (IsTrigger() || IsCivilian() || GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET || IsCritter() || GetAIName() == "NullCreatureAI")
2533 {
2536 return;
2537 }
2538
2539 bool nonHostile = true;
2540 if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetFaction()))
2541 if (factionTemplate->hostileMask || factionTemplate->enemyFaction[0] || factionTemplate->enemyFaction[1] || factionTemplate->enemyFaction[2] || factionTemplate->enemyFaction[3])
2542 nonHostile = false;
2543
2544 if (nonHostile)
2546 else
2548}
@ UNIT_MASK_SUMMON
Definition: Unit.h:675
@ UNIT_MASK_GUARDIAN
Definition: Unit.h:677
@ UNIT_MASK_MINION
Definition: Unit.h:676
uint32 GetCreatureType() const
Definition: Unit.cpp:15168
uint32 HasUnitTypeMask(uint32 mask) const
Definition: Unit.h:1419

References CREATURE_TYPE_NON_COMBAT_PET, GetAIName(), Unit::GetCreatureType(), Unit::GetFaction(), GetScriptId(), Unit::HasUnitTypeMask(), IsCivilian(), Unit::IsCritter(), Unit::IsPet(), IsTrigger(), m_moveInLineOfSightDisabled, m_moveInLineOfSightStrictlyDisabled, sFactionTemplateStore, UNIT_MASK_CONTROLABLE_GUARDIAN, UNIT_MASK_GUARDIAN, UNIT_MASK_MINION, and UNIT_MASK_SUMMON.

Referenced by Unit::SetFaction().

◆ UpdateMovementFlags()

void Creature::UpdateMovementFlags ( )
3341{
3342 // Do not update movement flags if creature is controlled by a player (charm/vehicle)
3343 if (m_movedByPlayer)
3344 return;
3345
3346 CreatureTemplate const* info = GetCreatureTemplate();
3347 if (!info)
3348 return;
3349
3350 // Creatures with CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE should control MovementFlags in your own scripts
3352 return;
3353
3354 float ground = GetFloorZ();
3355
3356 bool canHover = CanHover();
3357 bool isInAir = (G3D::fuzzyGt(GetPositionZ(), ground + (canHover ? GetFloatValue(UNIT_FIELD_HOVERHEIGHT) : 0.0f) + GROUND_HEIGHT_TOLERANCE) || G3D::fuzzyLt(GetPositionZ(), ground - GROUND_HEIGHT_TOLERANCE)); // Can be underground too, prevent the falling
3358
3359 if (GetMovementTemplate().IsFlightAllowed() && isInAir && !IsFalling())
3360 {
3361 if (GetMovementTemplate().Flight == CreatureFlightMovementType::CanFly)
3362 SetCanFly(true);
3363 else
3364 SetDisableGravity(true);
3365
3367 SetHover(false);
3368 }
3369 else
3370 {
3371 SetCanFly(false);
3372 SetDisableGravity(false);
3374 SetHover(true);
3375 }
3376
3377 if (!isInAir)
3379
3380 bool Swim = false;
3381 LiquidData const& liquidData = GetLiquidData();
3382 switch (liquidData.Status)
3383 {
3386 Swim = GetPositionZ() - liquidData.DepthLevel > GetCollisionHeight() * 0.75f; // Shallow water at ~75% of collision height
3387 break;
3389 Swim = true;
3390 break;
3391 default:
3392 break;
3393 }
3394
3395 SetSwim(CanSwim() && Swim);
3396}
@ CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE
Definition: CreatureData.h:58
@ LIQUID_MAP_UNDER_WATER
Definition: Map.h:148
@ LIQUID_MAP_IN_WATER
Definition: Map.h:147
@ LIQUID_MAP_WATER_WALK
Definition: Map.h:146
@ SPELL_AURA_HOVER
Definition: SpellAuraDefines.h:169
float const GROUND_HEIGHT_TOLERANCE
Definition: SharedDefines.h:26
bool SetCanFly(bool enable, bool packetOnly=false) override
Definition: Creature.cpp:3194
bool SetSwim(bool enable) override
Definition: Creature.cpp:3146
CreatureFlightMovementType Flight
Definition: CreatureData.h:129
float GetFloatValue(uint16 index) const
Definition: Object.cpp:317
LiquidData const & GetLiquidData() const
Definition: Object.cpp:3133
float GetFloorZ() const
Definition: Object.cpp:3089
float GetCollisionHeight() const override
Return collision height sent to client.
Definition: Unit.cpp:21387
Definition: Map.h:171
LiquidStatus Status
Definition: Map.h:178
float DepthLevel
Definition: Map.h:177

References CanHover(), CanSwim(), CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE, LiquidData::DepthLevel, CreatureTemplate::flags_extra, CreatureMovementData::Flight, Unit::GetCollisionHeight(), GetCreatureTemplate(), Object::GetFloatValue(), WorldObject::GetFloorZ(), WorldObject::GetLiquidData(), GetMovementTemplate(), Position::GetPositionZ(), GROUND_HEIGHT_TOLERANCE, Unit::HasAuraType(), Unit::IsAlive(), Unit::IsFalling(), CreatureMovementData::IsFlightAllowed(), LIQUID_MAP_IN_WATER, LIQUID_MAP_UNDER_WATER, LIQUID_MAP_WATER_WALK, Unit::m_movedByPlayer, MOVEMENTFLAG_FALLING, Unit::RemoveUnitMovementFlag(), SetCanFly(), SetDisableGravity(), SetHover(), SetSwim(), SPELL_AURA_HOVER, LiquidData::Status, and UNIT_FIELD_HOVERHEIGHT.

Referenced by Create(), Unit::ProcessTerrainStatusUpdate(), setDeathState(), and UpdateEntry().

◆ UpdateResistances()

void Creature::UpdateResistances ( uint32  school)
overridevirtual

Implements Unit.

Reimplemented in Totem.

1036{
1037 if (school > SPELL_SCHOOL_NORMAL)
1038 {
1040 SetResistance(SpellSchools(school), int32(value));
1041 }
1042 else
1043 UpdateArmor();
1044}
@ UNIT_MOD_RESISTANCE_START
Definition: Unit.h:291
void UpdateArmor() override
Definition: StatSystem.cpp:1046
void SetResistance(SpellSchools school, int32 val)
Definition: Unit.h:1451

References Unit::GetTotalAuraModValue(), Unit::SetResistance(), SPELL_SCHOOL_NORMAL, UNIT_MOD_RESISTANCE_START, and UpdateArmor().

◆ UpdateStats()

bool Creature::UpdateStats ( Stats  stat)
overridevirtual

Implements Unit.

Reimplemented in Guardian, and Totem.

1017{
1018 return true;
1019}

◆ UpdateVendorItemCurrentCount()

uint32 Creature::UpdateVendorItemCurrentCount ( VendorItem const *  vItem,
uint32  used_count 
)
3014{
3015 if (!vItem->maxcount)
3016 return 0;
3017
3018 VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
3019 for (; itr != m_vendorItemCounts.end(); ++itr)
3020 if (itr->itemId == vItem->item)
3021 break;
3022
3023 if (itr == m_vendorItemCounts.end())
3024 {
3025 uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount - used_count : 0;
3026 m_vendorItemCounts.push_back(VendorItemCount(vItem->item, new_count));
3027 return new_count;
3028 }
3029
3030 VendorItemCount* vCount = &*itr;
3031
3032 time_t ptime = GameTime::GetGameTime().count();
3033
3034 if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime)
3035 {
3036 ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(vItem->item);
3037
3038 uint32 diff = uint32((ptime - vCount->lastIncrementTime) / vItem->incrtime);
3039 if ((vCount->count + diff * pProto->BuyCount) < vItem->maxcount)
3040 vCount->count += diff * pProto->BuyCount;
3041 else
3042 vCount->count = vItem->maxcount;
3043 }
3044
3045 vCount->count = vCount->count > used_count ? vCount->count - used_count : 0;
3046 vCount->lastIncrementTime = ptime;
3047 return vCount->count;
3048}

References ItemTemplate::BuyCount, VendorItemCount::count, GameTime::GetGameTime(), VendorItem::incrtime, VendorItem::item, VendorItemCount::lastIncrementTime, m_vendorItemCounts, VendorItem::maxcount, and sObjectMgr.

Referenced by Player::_StoreOrEquipNewItem().

◆ UpdateWaypointID()

void Creature::UpdateWaypointID ( uint32  wpID)
inline

Member Data Documentation

◆ _damagedByPlayer

bool Creature::_damagedByPlayer
private

◆ _focusSpell

Spell const* Creature::_focusSpell
private

◆ _isMissingSwimmingFlagOutOfCombat

bool Creature::_isMissingSwimmingFlagOutOfCombat
private

‍Locks the target during spell cast for proper facing

Referenced by HasSwimmingFlagOutOfCombat(), and RefreshSwimmingFlag().

◆ _lastDamagedTime

std::shared_ptr<time_t> Creature::_lastDamagedTime
mutableprivate

◆ _playerDamageReq

◆ 

struct { ... } Creature::_spellFocusInfo

Referenced by HasSpellFocus().

◆ Delay

uint32 Creature::Delay = 0

◆ DisableReputationGain

bool Creature::DisableReputationGain
protected

◆ loot

◆ lootingGroupLowGUID

uint32 Creature::lootingGroupLowGUID

Referenced by Update().

◆ lootPickPocketRestoreTime

uint32 Creature::lootPickPocketRestoreTime
protected

◆ m_AI_locked

bool Creature::m_AI_locked
protected

Referenced by AIM_Initialize(), and Update().

◆ m_AlreadyCallAssistance

bool Creature::m_AlreadyCallAssistance
protected

◆ m_AlreadySearchedAssistance

bool Creature::m_AlreadySearchedAssistance
protected

◆ m_assistanceTimer

uint32 Creature::m_assistanceTimer
private

Referenced by SetAssistanceTimer(), and Update().

◆ m_boundaryCheckTime

uint32 Creature::m_boundaryCheckTime
protected

Referenced by DoImmediateBoundaryCheck(), and Update().

◆ m_cannotReachTarget

ObjectGuid Creature::m_cannotReachTarget
private

◆ m_cannotReachTimer

uint32 Creature::m_cannotReachTimer
private

◆ m_CombatDistance

◆ m_combatPulseDelay

uint32 Creature::m_combatPulseDelay
protected

◆ m_combatPulseTime

uint32 Creature::m_combatPulseTime
protected

Referenced by SetCombatPulseDelay(), and Update().

◆ m_corpseDelay

uint32 Creature::m_corpseDelay
protected

◆ m_corpseRemoveTime

time_t Creature::m_corpseRemoveTime
protected

◆ m_creatureData

CreatureData const* Creature::m_creatureData
protected

◆ m_creatureInfo

◆ m_CreatureSpellCooldowns

◆ m_defaultMovementType

◆ m_detectionDistance

float Creature::m_detectionDistance
protected

◆ m_equipmentId

uint8 Creature::m_equipmentId
protected

◆ m_formation

◆ m_groupLootTimer

uint32 Creature::m_groupLootTimer

Referenced by Update().

◆ m_homePosition

Position Creature::m_homePosition
protected

◆ m_isTempWorldObject

bool Creature::m_isTempWorldObject

◆ m_LootMode

uint16 Creature::m_LootMode
protected

◆ m_lootRecipient

ObjectGuid Creature::m_lootRecipient
protected

◆ m_lootRecipientGroup

◆ m_meleeDamageSchoolMask

SpellSchoolMask Creature::m_meleeDamageSchoolMask
protected

◆ m_moveBackwardsMovementTime

uint32 Creature::m_moveBackwardsMovementTime = MOVE_BACKWARDS_CHECK_INTERVAL

Referenced by Update().

◆ m_moveCircleMovementTime

uint32 Creature::m_moveCircleMovementTime = MOVE_CIRCLE_CHECK_INTERVAL

Referenced by Update().

◆ m_moveInLineOfSightDisabled

bool Creature::m_moveInLineOfSightDisabled
protected

◆ m_moveInLineOfSightStrictlyDisabled

bool Creature::m_moveInLineOfSightStrictlyDisabled
protected

◆ m_originalEntry

uint32 Creature::m_originalEntry
protected

◆ m_originalEquipmentId

int8 Creature::m_originalEquipmentId
protected

◆ m_path_id

uint32 Creature::m_path_id
private

◆ m_ProhibitSchoolTime

uint32 Creature::m_ProhibitSchoolTime[7]

◆ m_reactState

ReactStates Creature::m_reactState
protected

◆ m_regenHealth

bool Creature::m_regenHealth
protected

◆ m_regenPower

bool Creature::m_regenPower
protected

Referenced by Regenerate(), and SetRegeneratingPower().

◆ m_respawnDelay

◆ m_respawnedTime

time_t Creature::m_respawnedTime
protected

◆ m_respawnTime

◆ m_SightDistance

◆ m_spawnId

◆ m_spells

◆ m_transportCheckTimer

uint16 Creature::m_transportCheckTimer
protected

Referenced by Update().

◆ m_transportHomePosition

Position Creature::m_transportHomePosition
protected

◆ m_vendorItemCounts

VendorItemCounts Creature::m_vendorItemCounts
protected

◆ m_wanderDistance

float Creature::m_wanderDistance
protected

◆ m_waypointID

uint32 Creature::m_waypointID
private

◆ MOVE_BACKWARDS_CHECK_INTERVAL

constexpr uint32 Creature::MOVE_BACKWARDS_CHECK_INTERVAL = 2000
staticconstexpr

Referenced by Update().

◆ MOVE_CIRCLE_CHECK_INTERVAL

constexpr uint32 Creature::MOVE_CIRCLE_CHECK_INTERVAL = 3000
staticconstexpr

Referenced by Update().

◆ Orientation

float Creature::Orientation = 0.0f

◆ Spell

::Spell const* Creature::Spell = nullptr

◆ Target

ObjectGuid Creature::Target

◆ TriggerJustRespawned

bool Creature::TriggerJustRespawned
private

Referenced by Creature(), Respawn(), and Update().