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

#include "TemporarySummon.h"

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

Public Member Functions

 Guardian (SummonPropertiesEntry const *properties, ObjectGuid owner, bool isWorldObject)
 
void InitStats (uint32 duration) override
 
bool InitStatsForLevel (uint8 level)
 
void InitSummon () override
 
bool UpdateStats (Stats stat) override
 
bool UpdateAllStats () override
 
void UpdateArmor () override
 
void UpdateMaxHealth () override
 
void UpdateMaxPower (Powers power) override
 
void UpdateAttackPowerAndDamage (bool ranged=false) override
 
void UpdateDamagePhysical (WeaponAttackType attType) override
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Minion
 Minion (SummonPropertiesEntry const *properties, ObjectGuid owner, bool isWorldObject)
 
void InitStats (uint32 duration) override
 
void RemoveFromWorld () override
 
UnitGetOwner () const
 
float GetFollowAngle () const override
 
void SetFollowAngle (float angle)
 
bool IsPetGhoul () const
 
bool IsGuardianPet () const
 
void setDeathState (DeathState s, bool despawn=false) override
 A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned. The cycle follows the next order: More...
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from TempSummon
 TempSummon (SummonPropertiesEntry const *properties, ObjectGuid owner, bool isWorldObject)
 
 ~TempSummon () override=default
 
void Update (uint32 time) override
 
virtual void InitStats (uint32 lifetime)
 
virtual void InitSummon ()
 
virtual void UnSummon (uint32 msTime=0)
 
void RemoveFromWorld () override
 
void SetTempSummonType (TempSummonType type)
 
void SaveToDB (uint32, uint8, uint32) override
 
WorldObjectGetSummoner () const
 
UnitGetSummonerUnit () const
 
CreatureGetSummonerCreatureBase () const
 
GameObjectGetSummonerGameObject () const
 
ObjectGuid GetSummonerGUID () const
 
TempSummonType GetSummonType () const
 
uint32 GetTimer ()
 
void SetTimer (uint32 t)
 
void SetVisibleBySummonerOnly (bool visibleBySummonerOnly)
 
bool IsVisibleBySummonerOnly () const
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Creature
 Creature (bool isWorldObject=false)
 
 ~Creature () override
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
float GetNativeObjectScale () const override
 
void SetObjectScale (float scale) override
 
void SetDisplayId (uint32 displayId, float displayScale=1.f) override
 
void SetDisplayFromModel (uint32 modelIdx)
 
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. More...
 
bool CanEnterWater () const override
 
bool CanFly () const override
 
bool CanHover () const
 
bool IsRooted () const
 
MovementGeneratorType GetDefaultMovementType () const override
 -------—End of Pet responses methods-------— More...
 
void SetDefaultMovementType (MovementGeneratorType mgt)
 
void SetReactState (ReactStates state)
 A creature can have 3 ReactStates : Agressive, Passive, Neutral. More...
 
ReactStates GetReactState () const
 
bool HasReactState (ReactStates state) const
 
void InitializeReactState ()
 Check if the creature has the specified ReactState. More...
 
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
 Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client. More...
 
bool SetDisableGravity (bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
 Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING. Infom also the client. More...
 
bool SetSwim (bool enable) override
 
bool SetCanFly (bool enable, bool packetOnly=false) override
 Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pressing space for example. For creatures, please look for DisableGravity(). More...
 
bool SetWaterWalking (bool enable, bool packetOnly=false) override
 Allow to walk on water. Doesn't inform the client. Need to use SendMovementWaterWalking() if it's for players. More...
 
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
 
bool HasWeapon (WeaponAttackType type) const override
 
bool HasWeaponForAttack (WeaponAttackType type) const 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
 A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned. The cycle follows the next order: More...
 
bool LoadFromDB (ObjectGuid::LowType guid, Map *map, bool allowDuplicate=false)
 
bool LoadCreatureFromDB (ObjectGuid::LowType guid, Map *map, bool addToMap=true, 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
 Select nearest hostile unit within the given distance (regardless of threat list). More...
 
UnitSelectNearestTargetInAttackDistance (float dist) const
 Select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list. More...
 
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. More...
 
void SetInCombatWithZone ()
 Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled. More...
 
bool hasQuest (uint32 quest_id) const override
 
bool hasInvolvedQuest (uint32 quest_id) const override
 
bool isRegeneratingHealth ()
 
void SetRegeneratingHealth (bool enable)
 
void SetRegeneratingPower (bool enable)
 
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
 
std::shared_ptr< time_t > const & GetLastLeashExtensionTimePtr () const
 
void SetLastLeashExtensionTimePtr (std::shared_ptr< time_t > const &timer)
 
void ClearLastLeashExtensionTimePtr ()
 
time_t GetLastLeashExtensionTime () const
 
void UpdateLeashExtensionTime ()
 
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. More...
 
bool CanCastSpell (uint32 spellID) const
 Returns true if the creature is able to cast the spell. More...
 
ObjectGuid GetSummonerGUID () const
 Helper to get the creature's summoner GUID, if it is a summon. More...
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Unit
 ~Unit () override
 
void Update (uint32 time) override
 
UnitAIGetAI ()
 
void SetAI (UnitAI *newAI)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void CleanupBeforeRemoveFromMap (bool finalCleanup)
 
void CleanupsBeforeDelete (bool finalCleanup=true) override
 
virtual bool isBeingLoaded () const
 
bool IsDuringRemoveFromWorld () const
 
void SetUInt32Value (uint16 index, uint32 value)
 
UnitGetOwner () const
 
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
 
ObjectGuid GetTransGUID () const override
 
PetToPet ()
 
TotemToTotem ()
 
TempSummonToTempSummon ()
 
const TempSummonToTempSummon () const
 
void AddUnitState (uint32 f)
 
bool HasUnitState (const uint32 f) const
 
void ClearUnitState (uint32 f)
 
uint32 GetUnitState () const
 
uint32 HasUnitTypeMask (uint32 mask) const
 
void AddUnitTypeMask (uint32 mask)
 
uint32 GetUnitTypeMask () const
 
UnitFlags GetUnitFlags () const
 
bool HasUnitFlag (UnitFlags flags) const
 
void SetUnitFlag (UnitFlags flags)
 UnitFlags available in UnitDefines.h. More...
 
void RemoveUnitFlag (UnitFlags flags)
 UnitFlags available in UnitDefines.h. More...
 
void ReplaceAllUnitFlags (UnitFlags flags)
 Remove the Unit flag specify only. More...
 
UnitFlags2 GetUnitFlags2 () const
 Remove all UnitFlags and set new ones. UnitFlags available in UnitDefines.h. More...
 
bool HasUnitFlag2 (UnitFlags2 flags) const
 
void SetUnitFlag2 (UnitFlags2 flags)
 
void RemoveUnitFlag2 (UnitFlags2 flags)
 
void ReplaceAllUnitFlags2 (UnitFlags2 flags)
 
NPCFlags GetNpcFlags () const
 
bool HasNpcFlag (NPCFlags flags) const
 
void SetNpcFlag (NPCFlags flags)
 
void RemoveNpcFlag (NPCFlags flags)
 
void ReplaceAllNpcFlags (NPCFlags flags)
 
uint32 GetDynamicFlags () const override
 
void ReplaceAllDynamicFlags (uint32 flag) override
 
void AddUnitMovementFlag (uint32 f)
 
void RemoveUnitMovementFlag (uint32 f)
 
bool HasUnitMovementFlag (uint32 f) const
 
uint32 GetUnitMovementFlags () const
 
void SetUnitMovementFlags (uint32 f)
 
void AddExtraUnitMovementFlag (uint16 f)
 
void RemoveExtraUnitMovementFlag (uint16 f)
 
uint16 HasExtraUnitMovementFlag (uint16 f) const
 
uint16 GetExtraUnitMovementFlags () const
 
void SetExtraUnitMovementFlags (uint16 f)
 
bool IsSummon () const
 
bool IsGuardian () const
 
bool IsControllableGuardian () const
 
bool IsPet () const
 
bool IsHunterPet () const
 
bool IsTotem () const
 
bool IsVehicle () const
 
bool IsVendor () const
 
bool IsTrainer () const
 
bool IsQuestGiver () const
 
bool IsGossip () const
 
bool IsTaxi () const
 
bool IsGuildMaster () const
 
bool IsBattleMaster () const
 
bool IsBanker () const
 
bool IsInnkeeper () const
 
bool IsSpiritHealer () const
 
bool IsSpiritGuide () const
 
bool IsTabardDesigner () const
 
bool IsAuctioner () const
 
bool IsArmorer () const
 
bool IsServiceProvider () const
 
bool IsSpiritService () const
 
uint32 GetCreatureType () const
 
uint32 GetCreatureTypeMask () const
 
bool IsCritter () const
 
uint8 getRace (bool original=false) const
 
void setRace (uint8 race)
 
uint32 getRaceMask () const
 
DisplayRace GetDisplayRaceFromModelId (uint32 modelId) const
 
DisplayRace GetDisplayRace () const
 
uint8 getClass () const
 
virtual bool IsClass (Classes unitClass, ClassContext context=CLASS_CONTEXT_NONE) const
 
uint32 getClassMask () const
 
uint8 getGender () const
 
uint32 GetFaction () const
 
FactionTemplateEntry const * GetFactionTemplateEntry () const
 
void SetFaction (uint32 faction)
 
void RestoreFaction ()
 
uint32 GetOldFactionId () const
 
ObjectGuid GetTarget () const
 
virtual void SetTarget (ObjectGuid=ObjectGuid::Empty)=0
 
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
 
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
 
void setAttackTimer (WeaponAttackType type, int32 time)
 
void resetAttackTimer (WeaponAttackType type=BASE_ATTACK)
 
int32 getAttackTimer (WeaponAttackType type) const
 
bool isAttackReady (WeaponAttackType type=BASE_ATTACK) 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
 
UnitgetAttackerForHelper () const
 
bool Attack (Unit *victim, bool meleeAttack)
 
void CastStop (uint32 except_spellid=0, bool withInstant=true)
 Interrupt the unit cast for all the current spells. More...
 
bool AttackStop ()
 Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell, AI assistance, and call SendMeleeAttackStop() to the client. More...
 
void RemoveAllAttackers ()
 Remove all units in m_attackers list and send them AttackStop() More...
 
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)
 Send to the client SMSG_ATTACKSTOP but doesn't clear UNIT_STATE_MELEE_ATTACKING on server side or interrupt spells. Unless you know exactly what you're doing, use AttackStop() or RemoveAllAttackers() instead. More...
 
void SendMeleeAttackStart (Unit *victim, Player *sendTo=nullptr)
 
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)
 
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 CanHaveThreatList (bool skipAliveCheck=false) 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 ()
 
void SetRedirectThreat (ObjectGuid guid, uint32 pct)
 
void ResetRedirectThreat ()
 
void ModifyRedirectThreat (int32 amount)
 
uint32 GetRedirectThreatPercent ()
 
UnitGetRedirectThreatTarget () const
 
void SetLastDamagedTargetGuid (ObjectGuid const &guid)
 
ObjectGuid const & GetLastDamagedTargetGuid () const
 
void AttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
 
bool haveOffhandWeapon () const
 
bool CanDualWield () const
 
virtual void SetCanDualWield (bool value)
 
virtual bool HasWeapon (WeaponAttackType type) const =0
 
bool HasMainhandWeapon () const
 
bool HasOffhandWeapon () const
 
bool HasRangedWeapon () const
 
bool hasMainhandWeaponForAttack () const
 
virtual bool HasWeaponForAttack (WeaponAttackType type) const
 
bool HasMainhandWeaponForAttack () const
 
bool HasOffhandWeaponForAttack () const
 
bool HasRangedWeaponForAttack () const
 
bool CanUseAttackType (uint8 attacktype) const
 
void HandleProcExtraAttackFor (Unit *victim, uint32 count)
 
void SetLastExtraAttackSpell (uint32 spellId)
 
uint32 GetLastExtraAttackSpell () const
 
void AddExtraAttacks (uint32 count)
 
uint8 GetComboPoints (Unit const *who=nullptr) const
 
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 AddComboPointHolder (Unit *unit)
 
void RemoveComboPointHolder (Unit *unit)
 
void ClearComboPointHolders ()
 
void SetContestedPvP (Player *attackedPlayer=nullptr, bool lookForNearContestedGuards=true)
 
bool IsContestedGuard () const
 
bool IsInSanctuary () const
 
bool IsPvP () const
 
bool IsFFAPvP () const
 
void SetPvP (bool state)
 
float GetStat (Stats stat) const
 
void SetStat (Stats stat, int32 val)
 
Stats GetStatByAuraGroup (UnitMods unitMod) const
 
float GetCreateStat (Stats stat) const
 
void SetCreateStat (Stats stat, float val)
 
float GetPosStat (Stats stat) const
 
float GetNegStat (Stats stat) const
 
void InitStatBuffMods ()
 
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
 
void SetCanModifyStats (bool modifyStats)
 
bool CanModifyStats () const
 
void ApplyStatBuffMod (Stats stat, float val, bool apply)
 
void ApplyStatPercentBuffMod (Stats stat, float val, bool apply)
 
uint8 GetLevel () const
 
uint8 getLevelForTarget (WorldObject const *) const override
 
void SetLevel (uint8 lvl, bool showLevelChange=true)
 
uint32 GetHealth () const
 
uint32 GetMaxHealth () const
 
float GetHealthPct () const
 
int32 GetHealthGain (int32 dVal)
 
uint32 GetCreateHealth () 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
 
uint32 CountPctFromMaxHealth (int32 pct) const
 
uint32 CountPctFromCurHealth (int32 pct) const
 
void SetHealth (uint32 val)
 
void SetMaxHealth (uint32 val)
 
void SetFullHealth ()
 
int32 ModifyHealth (int32 val)
 
void SetCreateHealth (uint32 val)
 
Powers getPowerType () const
 
virtual bool HasActivePowerType (Powers power)
 
Powers GetPowerTypeByAuraGroup (UnitMods unitMod) const
 
uint32 GetPower (Powers power) const
 
uint32 GetMaxPower (Powers power) const
 
float GetPowerPct (Powers power) const
 
uint32 GetCreatePowers (Powers power) const
 
void setPowerType (Powers power)
 
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)
 
void RewardRage (uint32 damage, uint32 weaponSpeedHitFactor, bool attacker)
 
uint32 GetCreateMana () const
 
void SetCreateMana (uint32 val)
 
bool CanRestoreMana (SpellInfo const *spellInfo) const
 
void SetLastManaUse (uint32 spellCastTime)
 
bool IsUnderLastManaUseEffect () const
 
float GetAPMultiplier (WeaponAttackType attType, bool normalized)
 
uint32 GetArmor () const
 
void SetArmor (int32 val)
 
float GetUnitDodgeChance () const
 
float GetUnitParryChance () const
 
float GetUnitBlockChance () const
 
float GetUnitMissChance (WeaponAttackType attType) const
 
float GetUnitCriticalChance (WeaponAttackType attackType, Unit const *victim) 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
 
bool CanApplyResilience () 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
 
int32 GetMechanicResistChance (SpellInfo const *spell)
 
uint32 GetResistance (SpellSchoolMask mask) const
 
uint32 GetResistance (SpellSchools school) const
 
float GetResistanceBuffMods (SpellSchools school, bool positive) const
 
void SetResistance (SpellSchools school, int32 val)
 
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)
 
uint16 GetMaxSkillValueForLevel (Unit const *target=nullptr) const
 
float GetTotalAuraModValue (UnitMods unitMod) const
 
SpellSchools GetSpellSchoolByAuraGroup (UnitMods unitMod) const
 
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 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)
 
void DealMeleeDamage (CalcDamageInfo *damageInfo, bool durabilityLoss)
 
void DealSpellDamage (SpellNonMeleeDamage *damageInfo, bool durabilityLoss, Spell const *spell=nullptr)
 
void KillSelf (bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
 
uint32 CalculateDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, uint8 itemDamagesMask=0)
 
virtual void CalculateMinMaxDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage, uint8 damageIndex=0)=0
 
void CalculateMeleeDamage (Unit *victim, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK, const bool sittingVictim=false)
 
void CalculateSpellDamageTaken (SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
 
int32 CalculateSpellDamage (Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
 
float CalculateDefaultCoefficient (SpellInfo const *spellInfo, DamageEffectType damagetype) const
 
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)
 
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 CalculateAOEDamageReduction (int32 damage, uint32 schoolMask, Unit *caster) const
 
uint32 GetMeleeDamageReduction (uint32 damage) const
 
uint32 GetRangedDamageReduction (uint32 damage) const
 
uint32 GetSpellDamageReduction (uint32 damage) const
 
float GetMeleeCritChanceReduction () const
 
float GetRangedCritChanceReduction () const
 
float GetSpellCritChanceReduction () const
 
uint32 GetMeleeCritDamageReduction (uint32 damage) const
 
uint32 GetRangedCritDamageReduction (uint32 damage) const
 
uint32 GetSpellCritDamageReduction (uint32 damage) const
 
CharmInfoGetCharmInfo ()
 
CharmInfoInitCharmInfo ()
 
UnitGetCharmer () const
 
UnitGetCharm () const
 
UnitGetCharmerOrOwner () const
 
UnitGetCharmerOrOwnerOrSelf () const
 
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
 
ObjectGuid GetCharmerOrOwnerGUID () const
 
ObjectGuid GetCharmerOrOwnerOrOwnGUID () const
 
PlayerGetAffectingPlayer () const
 
UnitGetFirstControlled () const
 
bool IsControlledByPlayer () const
 
bool IsCreatedByPlayer () const
 
bool IsCharmedOwnedByPlayerOrPlayer () const
 
bool IsCharmed () const
 
bool isPossessed () const
 
bool isPossessedByPlayer () const
 
bool isPossessing () const
 
bool isPossessing (Unit *u) const
 
void SetCharm (Unit *target, bool apply)
 
bool SetCharmedBy (Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
 
void UpdateCharmAI ()
 
void RemoveCharmedBy (Unit *charmer)
 
void RemoveCharmAuras ()
 
void RemoveAllControlled (bool onDeath=false)
 
void DeleteCharmInfo ()
 
virtual bool HasSpellCooldown (uint32) const
 
virtual bool HasSpellItemCooldown (uint32, uint32) const
 
virtual void AddSpellCooldown (uint32, uint32, uint32, bool needSendToClient=false, bool forceSendToSpectator=false)
 
void BuildCooldownPacket (WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown)
 
void BuildCooldownPacket (WorldPacket &data, uint8 flags, PacketCooldowns const &cooldowns)
 
AuraAddAura (uint32 spellId, Unit *target)
 
AuraAddAura (SpellInfo const *spellInfo, uint8 effMask, Unit *target)
 
void SetAuraStack (uint32 spellId, Unit *target, uint32 stack)
 
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 RemoveBindSightAuras ()
 
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
 
bool HasAuraTypeWithFamilyFlags (AuraType auraType, uint32 familyName, uint32 familyFlags) const
 
bool HasBreakableByDamageAuraType (AuraType type, uint32 excludeAura=0) const
 
bool HasBreakableByDamageCrowdControlAura (Unit *excludeCasterChannel=nullptr) 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
 
VisibleAuraMap const * GetVisibleAuras ()
 
AuraApplicationGetVisibleAura (uint8 slot)
 
void SetVisibleAura (uint8 slot, AuraApplication *aur)
 
void RemoveVisibleAura (uint8 slot)
 
void ModifyAuraState (AuraStateType flag, bool apply)
 
uint32 BuildAuraStateUpdateForTarget (Unit *target) const
 
bool HasAuraState (AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
 
bool CanProc ()
 
void SetCantProc (bool apply)
 
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)
 
float GetWeaponProcChance () const
 
float GetPPMProcChance (uint32 WeaponSpeed, float PPM, SpellInfo const *spellProto) const
 
PlayerGetSpellModOwner () const
 
SpellGetCurrentSpell (CurrentSpellTypes spellType) const
 
SpellGetCurrentSpell (uint32 spellType) const
 
SpellFindCurrentSpellBySpellId (uint32 spell_id) const
 
int32 GetCurrentSpellCastTime (uint32 spell_id) const
 
virtual bool HasSpell (uint32) const
 
void SetCurrentCastedSpell (Spell *pSpell)
 
virtual void ProhibitSpellSchool (SpellSchoolMask, uint32)
 
void SetInstantCast (bool set)
 
bool CanInstantCast () const
 
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)
 
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
uint32 GetInterruptMask () const
 
void AddInterruptMask (uint32 mask)
 
void UpdateInterruptMask ()
 
void InterruptSpell (CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
 
bool isSpellBlocked (Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=BASE_ATTACK)
 
void FinishSpell (CurrentSpellTypes spellType, bool ok=true)
 
UnitGetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
 
UnitGetMeleeHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo=nullptr)
 
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)
 
void SendHealSpellLog (HealInfo const &healInfo, bool critical=false)
 
int32 HealBySpell (HealInfo &healInfo, bool critical=false)
 
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)
 
void SendEnergizeSpellLog (Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
 
void EnergizeBySpell (Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
 
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
 
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
 
float ApplyEffectModifiers (SpellInfo const *spellProto, uint8 effect_index, float value) 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
 
uint32 GetCastingTimeForBonus (SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
 
void CastDelayedSpellWithPeriodicAmount (Unit *caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex=0)
 
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)
 
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 ()
 
bool IsPolymorphed () const
 
bool isFrozen () const
 
bool IsInFlight () const
 
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 IsMovementPreventedByCasting () const
 
virtual bool CanEnterWater () const =0
 
virtual bool CanSwim () const
 this method checks the current flag of a unit More...
 
bool CanFreeMove () const
 
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 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)
 
void propagateSpeedChange ()
 
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)
 
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)
 Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pressing space for example. For creatures, please look for DisableGravity(). More...
 
virtual bool SetWaterWalking (bool enable, bool packetOnly=false)
 Allow to walk on water. Doesn't inform the client. Need to use SendMovementWaterWalking() if it's for players. More...
 
virtual bool SetFeatherFall (bool enable, bool packetOnly=false)
 
virtual bool SetHover (bool enable, bool packetOnly=false, bool updateAnimationTier=true)
 
MotionMasterGetMotionMaster ()
 
const MotionMasterGetMotionMaster () const
 
virtual MovementGeneratorType GetDefaultMovementType () const
 -------—End of Pet responses methods-------— More...
 
bool IsStopped () const
 
void StopMoving ()
 
void StopMovingOnCurrentPos ()
 
virtual void PauseMovement (uint32 timer=0, uint8 slot=0)
 Disable the unit movement by clearing UNIT_STATE_MOVING and stopping the spline. More...
 
void ResumeMovement (uint32 timer=0, uint8 slot=0)
 
void SetControlled (bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
 
void DisableRotate (bool apply)
 
void DisableSpline ()
 
SheathState GetSheath () const
 
virtual void SetSheath (SheathState sheathed)
 
uint8 getStandState () const
 
bool IsSitState () const
 
bool IsStandState () const
 
void SetStandState (uint8 state)
 
void SetStandFlags (uint8 flags)
 
void RemoveStandFlags (uint8 flags)
 
DeathState getDeathState ()
 
virtual void setDeathState (DeathState s, bool despawn=false)
 
bool IsAlive () const
 
bool isDying () const
 
bool isDead () const
 
bool HasGhostAura () const
 
bool HasMountedAura () const
 
bool HasWaterWalkAura () const
 
bool HasFeatherFallAura () const
 
bool HasHoverAura () const
 
bool HasFlyAura () const
 
bool HasSpiritOfRedemptionAura () const
 
bool HasPreventsFleeingAura () const
 
bool HasPreventDurabilityLossAura () const
 
bool HasPreventResurectionAura () const
 
bool HasTransformAura () const
 
bool HasInterruptRegenAura () const
 
bool HasNoPVPCreditAura () const
 
bool HasWaterBreathingAura () const
 
bool HasIgnoreHitDirectionAura () const
 
bool HasSpellMagnetAura () const
 
bool HasOpenStableAura () const
 
bool HasCloneCasterAura () const
 
bool HasReflectSpellsAura () const
 
bool HasDetectAmoreAura () const
 
bool HasAllowOnlyAbilityAura () const
 
bool HasPeriodicDummyAura () const
 
bool HasControlVehicleAura () const
 
bool HasAOECharmAura () const
 
bool HasDetectSpellsAura () const
 
bool HasPacifySilenceAura () const
 
bool HasSilenceAura () const
 
bool HasShapeshiftAura () const
 
bool HasDecreaseSpeedAura () const
 
bool HasPacifyAura () const
 
bool HasIgnoreTargetResistAura () const
 
bool HasIncreaseMountedSpeedAura () const
 
bool HasIncreaseMountedFlightSpeedAura () const
 
bool HasThreatAura () const
 
bool HasAttackerSpellCritChanceAura () const
 
bool HasUnattackableAura () const
 
bool HasHealthRegenInCombatAura () const
 
bool HasRegenDuringCombatAura () const
 
bool HasFearAura () const
 
bool HasConfuseAura () const
 
bool HasRootAura () const
 
bool HasStunAura () const
 
bool HasTauntAura () const
 
bool HasStealthAura () const
 
bool HasStealthDetectAura () const
 
bool HasInvisibilityAura () const
 
bool HasInvisibilityDetectAura () const
 
bool IsHostileTo (Unit const *unit) const
 
bool IsHostileToPlayers () const
 
bool IsFriendlyTo (Unit const *unit) const
 
bool IsNeutralToAll () const
 
void ClearAllReactives ()
 
void StartReactiveTimer (ReactiveType reactive)
 
void UpdateReactives (uint32 p_time)
 
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 ()
 
bool IsInPartyWith (Unit const *unit) const
 
bool IsInRaidWith (Unit const *unit) const
 
void GetPartyMembers (std::list< Unit * > &units)
 
UnitGetNextRandomRaidMemberOrPet (float radius)
 
void UpdateAuraForGroup (uint8 slot)
 
ReputationRank GetReactionTo (Unit const *target, bool checkOriginalFaction=false) const
 
ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, Unit const *target) const
 
SharedVisionList const & GetSharedVisionList ()
 
void AddPlayerToVision (Player *player)
 
void RemovePlayerFromVision (Player *player)
 
bool HasSharedVision () const
 
uint32 GetVirtualItemId (uint32 slot) const
 
void SetVirtualItem (uint32 slot, uint32 itemId)
 
bool IsMounted () const
 
uint32 GetMountID () const
 
void Mount (uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
 
void Dismount ()
 
bool IsInDisallowedMountForm () const
 
void addFollower (FollowerReference *pRef)
 
void removeFollower (FollowerReference *)
 
virtual float GetFollowAngle () const
 
GuardianGetGuardianPet () const
 
MinionGetFirstMinion () const
 
CreatureGetCompanionPet () const
 
PetCreateTamedPetFrom (Creature *creatureTarget, uint32 spell_id=0)
 
PetCreateTamedPetFrom (uint32 creatureEntry, uint32 spell_id=0)
 
bool InitTamedPet (Pet *pet, uint8 level, uint32 spell_id)
 
void SetMinion (Minion *minion, bool apply)
 
void GetAllMinionsByEntry (std::list< Creature * > &Minions, uint32 entry)
 
void RemoveAllMinionsByEntry (uint32 entry)
 
void AddPetAura (PetAura const *petSpell)
 
void RemovePetAura (PetAura const *petSpell)
 
void CastPetAura (PetAura const *aura)
 
bool IsPetAura (Aura const *aura)
 
void PetSpellFail (SpellInfo const *spellInfo, Unit *target, uint32 result)
 
void UnsummonAllTotems (bool onDeath=false)
 
TransportBaseGetDirectTransport () const
 
bool CreateVehicleKit (uint32 id, uint32 creatureEntry)
 Returns the transport this unit is on directly (if on vehicle and transport, return vehicle) More...
 
void RemoveVehicleKit ()
 
VehicleGetVehicleKit () const
 
VehicleGetVehicle () const
 
bool IsOnVehicle (Unit const *vehicle) const
 
UnitGetVehicleBase () const
 
CreatureGetVehicleCreatureBase () const
 
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)
 
bool HandleSpellClick (Unit *clicker, int8 seatId=-1)
 
void _ExitVehicle (Position const *exitPosition=nullptr)
 
void _EnterVehicle (Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
 
void HandleEmoteCommand (uint32 emoteId)
 
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)
 
ShapeshiftForm GetShapeshiftForm () const
 
void SetShapeshiftForm (ShapeshiftForm form)
 
bool IsAttackSpeedOverridenShapeShift () const
 
bool IsInFeralForm () const
 
void setTransForm (uint32 spellid)
 
uint32 getTransForm () const
 
void DeMorph ()
 
virtual float GetNativeObjectScale () const
 
virtual void RecalculateObjectScale ()
 
uint32 GetDisplayId () const
 
virtual void SetDisplayId (uint32 modelId, float displayScale=1.f)
 
uint32 GetNativeDisplayId () const
 
void RestoreDisplayId ()
 
void SetNativeDisplayId (uint32 displayId)
 
uint32 GetModelForForm (ShapeshiftForm form, uint32 spellId) const
 
uint32 GetModelForTotem (PlayerTotemType totemType)
 
virtual bool IsInWater () const
 
virtual bool IsUnderWater () const
 
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 SetInFront (WorldObject const *target)
 
void SetFacingTo (float ori)
 
void SetFacingToObject (WorldObject *object)
 
bool isInAccessiblePlaceFor (Creature const *c) const
 
bool isInFrontInMap (Unit const *target, float distance, float arc=M_PI) const
 
bool isInBackInMap (Unit const *target, float distance, float arc=M_PI) const
 
float GetCollisionHeight () const override
 Return collision height sent to client. More...
 
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 More...
 
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 More...
 
void UpdateOrientation (float orientation)
 Only server-side orientation update, does not broadcast to client. More...
 
void UpdateHeight (float newZ)
 Only server-side height update, does not broadcast to client. More...
 
virtual bool UpdatePosition (float x, float y, float z, float ang, bool teleport=false)
 
bool UpdatePosition (const Position &pos, bool teleport=false)
 
void ProcessPositionDataChanged (PositionFullTerrainStatus const &data) override
 
virtual void ProcessTerrainStatusUpdate ()
 
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
 
void AddPointedBy (SafeUnitPointer *sup)
 
void RemovePointedBy (SafeUnitPointer *sup)
 
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 SendComboPoints ()
 
void SendPlaySpellVisual (uint32 id)
 
void SendPlaySpellImpact (ObjectGuid guid, uint32 id)
 
void SendPetActionFeedback (uint8 msg)
 -------—Pet responses methods--------------— More...
 
void SendPetTalk (uint32 pettalk)
 
void SendPetAIReaction (ObjectGuid guid)
 
void SendPeriodicAuraLog (SpellPeriodicAuraLogInfo *pInfo)
 
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 SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
 
void SendSpellDamageResist (Unit *target, uint32 spellId)
 
void SendSpellDamageImmune (Unit *target, uint32 spellId)
 
void SendTameFailure (uint8 result)
 
void SendTeleportPacket (Position &pos)
 
void SendMovementFlagUpdate (bool self=false)
 
void SendMovementWaterWalking (Player *sendTo)
 
void SendMovementFeatherFall (Player *sendTo)
 
void SendMovementHover (Player *sendTo)
 
void SendChangeCurrentVictimOpcode (HostileReference *pHostileReference)
 
void SendClearThreatListOpcode ()
 
void SendRemoveFromThreatListOpcode (HostileReference *pHostileReference)
 
void SendThreatListUpdate ()
 
void SendClearTarget ()
 
void ExecuteDelayedUnitRelocationEvent ()
 
void ExecuteDelayedUnitAINotifyEvent ()
 
void BuildHeartBeatMsg (WorldPacket *data) const
 
void BuildMovementPacket (ByteBuffer *data) const
 
void OutDebugInfo () const
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from WorldObject
 ~WorldObject () override
 
virtual void Update (uint32 diff)
 
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, bool disableWarning=false)
 
Position GetNearPosition (float dist, float angle, bool disableWarning=false)
 
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, bool disableWarning=false)
 
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 self) 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 PlayRadiusSound (uint32 sound_id, float radius)
 
void PlayDirectMusic (uint32 music_id, Player *target=nullptr)
 
void PlayRadiusMusic (uint32 music_id, float radius)
 
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. More...
 
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)
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target)
 
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 &)
 
void SetFieldNotifyFlag (uint16 flag)
 
void RemoveFieldNotifyFlag (uint16 flag)
 
void ForceValuesUpdateAtIndex (uint32)
 
bool IsPlayer () const
 
PlayerToPlayer ()
 
Player const * ToPlayer () const
 
bool IsCreature () const
 
CreatureToCreature ()
 
Creature const * ToCreature () const
 
bool IsUnit () const
 
UnitToUnit ()
 
Unit const * ToUnit () const
 
bool IsGameObject () const
 
GameObjectToGameObject ()
 
GameObject const * ToGameObject () const
 
bool IsCorpse () const
 
CorpseToCorpse ()
 
Corpse const * ToCorpse () const
 
bool IsDynamicObject () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
bool IsItem () const
 
virtual void Heartbeat ()
 
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 ()
 

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
 
- Static Public Member Functions inherited from Creature
static float _GetDamageMod (int32 Rank)
 
- Static Public Member Functions inherited from Unit
static void ApplyResilience (Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
 
static float GetEffectiveResistChance (Unit const *owner, SpellSchoolMask schoolMask, Unit const *victim)
 
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 DealDamageMods (Unit const *victim, uint32 &damage, uint32 *absorb)
 
static void Kill (Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
 
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 uint32 SpellCriticalDamageBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
 
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 int32 DealHeal (Unit *healer, Unit *victim, uint32 addhealth)
 
static uint32 SpellCriticalHealingBonus (Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
 
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 inherited from TempSummon
const SummonPropertiesEntry *const m_Properties
 
- Public Attributes inherited from Creature
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]
 
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
 
EventProcessor m_Events
 
- 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 inherited from Creature
static constexpr uint32 MOVE_CIRCLE_CHECK_INTERVAL = 3000
 
static constexpr uint32 MOVE_BACKWARDS_CHECK_INTERVAL = 2000
 
- Protected Types inherited from Unit
typedef std::list< DynamicObject * > DynObjectList
 
typedef GuidList GameObjectList
 
typedef std::map< ObjectGuid, float > CharmThreatMap
 
- Protected Member Functions inherited from Creature
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) 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)
 
virtual void AddToObjectUpdate ()=0
 
virtual void RemoveFromObjectUpdate ()=0
 
void AddToObjectUpdateIfNeeded ()
 
- Protected Member Functions inherited from MovableMapObject
 MovableMapObject ()=default
 
- Static Protected Member Functions inherited from Creature
static float _GetHealthMod (int32 Rank)
 
- Protected Attributes inherited from Minion
const ObjectGuid m_owner
 
float m_followAngle
 
- Protected Attributes inherited from Creature
VendorItemCounts m_vendorItemCounts
 
ObjectGuid m_lootRecipient
 
ObjectGuid::LowType m_lootRecipientGroup
 
time_t m_corpseRemoveTime
 Timers. More...
 
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. More...
 
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
 

Detailed Description

Constructor & Destructor Documentation

◆ Guardian()

Guardian::Guardian ( SummonPropertiesEntry const *  properties,
ObjectGuid  owner,
bool  isWorldObject 
)
419 : Minion(properties, owner, isWorldObject)
420{
422 if (properties && (properties->Type == SUMMON_TYPE_PET || properties->Category == SUMMON_CATEGORY_PET))
423 {
426 }
427}
@ SUMMON_TYPE_PET
Definition: SharedDefines.h:3295
@ SUMMON_CATEGORY_PET
Definition: SharedDefines.h:3285
@ UNIT_MASK_CONTROLABLE_GUARDIAN
Definition: UnitDefines.h:143
@ UNIT_MASK_GUARDIAN
Definition: UnitDefines.h:137
Definition: TemporarySummon.h:76
uint32 m_unitTypeMask
Definition: Unit.h:2062
CharmInfo * InitCharmInfo()
Definition: Unit.cpp:15811

References SummonPropertiesEntry::Category, Unit::InitCharmInfo(), Unit::m_unitTypeMask, SUMMON_CATEGORY_PET, SUMMON_TYPE_PET, SummonPropertiesEntry::Type, UNIT_MASK_CONTROLABLE_GUARDIAN, and UNIT_MASK_GUARDIAN.

Member Function Documentation

◆ GetDebugInfo()

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

Reimplemented from Minion.

Reimplemented in Pet.

458{
459 std::stringstream sstr;
460 sstr << Minion::GetDebugInfo();
461 return sstr.str();
462}
std::string GetDebugInfo() const override
Definition: TemporarySummon.cpp:410

References Minion::GetDebugInfo().

Referenced by Pet::GetDebugInfo().

◆ InitStats()

void Guardian::InitStats ( uint32  duration)
overridevirtual

Reimplemented from Minion.

430{
431 Minion::InitStats(duration);
432
433 if (Unit* m_owner = GetOwner())
434 {
435 InitStatsForLevel(m_owner->GetLevel());
436
439 }
440
442}
@ REACT_AGGRESSIVE
Definition: Unit.h:550
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
const ObjectGuid m_owner
Definition: TemporarySummon.h:90
Unit * GetOwner() const
Definition: TemporarySummon.cpp:385
void InitStats(uint32 duration) override
Definition: TemporarySummon.cpp:360
bool InitStatsForLevel(uint8 level)
Definition: Pet.cpp:1015
bool IsPlayer() const
Definition: ObjectGuid.h:168
void InitCharmCreateSpells()
Definition: CharmInfo.cpp:98
Definition: Unit.h:630
CharmInfo * m_charmInfo
Definition: Unit.h:2047
uint32 HasUnitTypeMask(uint32 mask) const
Definition: Unit.h:706

References Minion::GetOwner(), Unit::HasUnitTypeMask(), CharmInfo::InitCharmCreateSpells(), Minion::InitStats(), InitStatsForLevel(), ObjectGuid::IsPlayer(), Unit::m_charmInfo, Minion::m_owner, REACT_AGGRESSIVE, Creature::SetReactState(), and UNIT_MASK_CONTROLABLE_GUARDIAN.

◆ InitStatsForLevel()

bool Guardian::InitStatsForLevel ( uint8  petlevel)
Todo:
: Move stat mods code to pet passive auras
1016{
1017 CreatureTemplate const* cinfo = GetCreatureTemplate();
1018 ASSERT(cinfo);
1019
1020 SetLevel(petlevel);
1021 SetCanModifyStats(true);
1022
1023 Unit* owner = GetOwner();
1024 if (!owner) // just to be sure, asynchronous now
1025 {
1026 DespawnOrUnsummon(1000);
1027 return false;
1028 }
1029
1030 //Determine pet type
1031 PetType petType = MAX_PET_TYPE;
1032 if (owner->IsPlayer())
1033 {
1034 sScriptMgr->OnBeforeGuardianInitStatsForLevel(owner->ToPlayer(), this, cinfo, petType);
1035
1036 if (IsPet())
1037 {
1038 if (petType == MAX_PET_TYPE)
1039 {
1040 // The petType was not overwritten by the hook, continue with default initialization
1042 owner->IsClass(CLASS_SHAMAN, CLASS_CONTEXT_PET) || // Fire Elemental
1043 owner->IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_PET) || // Risen Ghoul
1044 owner->IsClass(CLASS_MAGE, CLASS_CONTEXT_PET)) // Water Elemental with glyph
1045 petType = SUMMON_PET;
1046 else if (owner->IsClass(CLASS_HUNTER, CLASS_CONTEXT_PET))
1047 {
1048 petType = HUNTER_PET;
1049 }
1050 }
1051
1052 if (petType == HUNTER_PET)
1054 else if (petType != SUMMON_PET)
1055 LOG_ERROR("entities.pet", "Unknown type pet {} is summoned by player class {}", GetEntry(), owner->getClass());
1056 }
1057
1058 if (petType == HUNTER_PET || petType == SUMMON_PET)
1059 {
1060 SetSpeed(MOVE_RUN, 1.15f);
1061 }
1062 }
1063
1064 uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry;
1065
1066 if (petType == HUNTER_PET)
1067 {
1069 }
1070 else
1071 {
1073 }
1074
1075 SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(petlevel * 50));
1076
1077 uint32 attackTime = BASE_ATTACK_TIME;
1078 if (!owner->IsClass(CLASS_HUNTER, CLASS_CONTEXT_PET) && cinfo->BaseAttackTime >= 1000)
1079 attackTime = cinfo->BaseAttackTime;
1080
1081 SetAttackTime(BASE_ATTACK, attackTime);
1082 SetAttackTime(OFF_ATTACK, attackTime);
1084
1086
1087 // scale
1089
1090 // Resistance
1091 // xinef: hunter pets should not inherit template resistances
1092 if (!IsHunterPet())
1093 for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
1095
1096 //health, mana, armor and resistance
1097 PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(creature_ID, petlevel);
1098 if (pInfo) // exist in DB
1099 {
1100 // Default scale value of 1 to use if Pet.RankMod.Health = 0
1101 float factorHealth = 1;
1102 // If config is set to allow pets to use health modifiers, apply it to creatures with a DB entry
1103 // Pet.RankMod.Health = 1 use the factor value based on the rank of the pet, most pets have a rank of 0 and so use
1104 // the Elite rank which is set as the default in Creature::_GetHealthMod(int32 Rank)
1106 {
1107 factorHealth *= _GetHealthMod(cinfo->rank);
1108 }
1109
1110 SetCreateHealth(pInfo->health*factorHealth);
1112 if (petType != HUNTER_PET) //hunter pet use focus
1113 {
1114 SetCreateMana(pInfo->mana);
1116 }
1117
1118 if (pInfo->armor > 0)
1120
1121 for (uint8 stat = 0; stat < MAX_STATS; ++stat)
1122 SetCreateStat(Stats(stat), float(pInfo->stats[stat]));
1123 }
1124 else // not exist in DB, use some default fake data
1125 {
1126 // remove elite bonuses included in DB values
1127 CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(petlevel, cinfo->unit_class);
1128 // xinef: multiply base values by creature_template factors!
1129 float factorHealth = owner->IsPlayer() ? std::min(1.0f, cinfo->ModHealth) : cinfo->ModHealth;
1130 float factorMana = owner->IsPlayer() ? std::min(1.0f, cinfo->ModMana) : cinfo->ModMana;
1131
1133 {
1134 factorHealth *= _GetHealthMod(cinfo->rank);
1135 }
1136
1137 SetCreateHealth(std::max<uint32>(1, stats->BaseHealth[cinfo->expansion]*factorHealth));
1139 SetCreateMana(stats->BaseMana * factorMana);
1141
1142 // xinef: added some multipliers so debuffs can affect pets in any way...
1148 }
1149
1150 switch (petType)
1151 {
1152 case HUNTER_PET:
1153 {
1154 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
1155 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
1157 break;
1158 }
1159 case SUMMON_PET:
1160 {
1161 if (pInfo)
1162 {
1165 }
1166 else
1167 {
1168 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
1169 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
1170 }
1171
1172 switch (GetEntry())
1173 {
1174 case NPC_FELGUARD:
1175 {
1176 // xinef: Glyph of Felguard, so ugly im crying... no appropriate spell
1178 {
1179 HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), true);
1180 }
1181
1182 break;
1183 }
1184 case NPC_VOIDWALKER:
1185 {
1187 {
1188 HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_PCT, aurEff->GetAmount(), true);
1189 }
1190 break;
1191 }
1193 {
1200 break;
1201 }
1202 }
1203 break;
1204 }
1205 default:
1206 {
1207 switch (GetEntry())
1208 {
1209 case NPC_FIRE_ELEMENTAL:
1210 {
1211 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 3.5f - petlevel));
1212 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 3.5f + petlevel));
1219 break;
1220 }
1222 {
1223 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.0f - petlevel));
1224 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.0f + petlevel));
1231 break;
1232 }
1233 case NPC_INFERNAL:
1234 {
1235 if (pInfo)
1236 {
1239 }
1246 break;
1247 }
1248 case NPC_DOOMGUARD:
1249 {
1250 float highAmt = petlevel / 11.0f;
1251 float lowAmt = petlevel / 12.0f;
1252 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, lowAmt * lowAmt * lowAmt);
1253 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, highAmt * highAmt * highAmt);
1254
1261 break;
1262 }
1264 {
1271 break;
1272 }
1273 case NPC_TREANT: //force of nature
1274 {
1275 if (!pInfo)
1276 SetCreateHealth(30 + 30 * petlevel);
1277
1278 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.5f - petlevel));
1279 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.5f + petlevel));
1280
1287 break;
1288 }
1289 case NPC_SHADOWFIEND:
1290 {
1291 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.5f - petlevel));
1292 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.5f + petlevel));
1293
1300 break;
1301 }
1302 case NPC_FERAL_SPIRIT:
1303 {
1304 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4.0f - petlevel));
1305 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4.0f + petlevel));
1306
1313
1314 if (owner->getRace() == RACE_ORC)
1315 {
1316 CastSpell(this, SPELL_ORC_RACIAL_COMMAND_SHAMAN, true, nullptr, nullptr, owner->GetGUID());
1317 }
1318
1319 break;
1320 }
1321 case NPC_MIRROR_IMAGE: // Mirror Image
1322 {
1323 SetDisplayId(owner->GetDisplayId());
1324 if (!pInfo)
1325 {
1326 SetCreateMana(28 + 30 * petlevel);
1327 SetCreateHealth(28 + 10 * petlevel);
1328 }
1329
1336 break;
1337 }
1338 case NPC_EBON_GARGOYLE: // Ebon Gargoyle
1339 {
1340 if (!pInfo)
1341 {
1342 SetCreateMana(28 + 10 * petlevel);
1343 SetCreateHealth(28 + 30 * petlevel);
1344 }
1345
1350 break;
1351 }
1352 case NPC_BLOODWORM:
1353 {
1354 // Xinef: Hit / Expertise scaling
1357 SetCreateHealth(4 * petlevel);
1358 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - 30 - (petlevel / 4) + owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f));
1359 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel - 30 + (petlevel / 4) + owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f));
1361 break;
1362 }
1364 {
1370
1371 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
1372 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
1373 break;
1374 }
1375 case NPC_VENOMOUS_SNAKE:
1376 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 0.7 - 38));
1377 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 0.8 - 40));
1378 break;
1379 case NPC_VIPER:
1380 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(1.3 * petlevel - 64));
1381 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(1.5 * petlevel - 68));
1382 break;
1383 case NPC_GENERIC_IMP:
1385 {
1386 SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
1387 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
1388 break;
1389 }
1390 }
1391 break;
1392 }
1393 }
1394
1395 // Can be summon and guardian
1396 if (GetEntry() == NPC_RISEN_GHOUL)
1397 {
1398 // 100% energy after summon
1400
1401 // xinef: fixes orc death knight command racial
1402 if (owner->getRace() == RACE_ORC)
1403 CastSpell(this, SPELL_ORC_RACIAL_COMMAND_DK, true, nullptr, nullptr, owner->GetGUID());
1404
1405 // Avoidance, Night of the Dead
1408 if (aur->GetEffect(0))
1409 aur->GetEffect(0)->SetAmount(-aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue());
1410
1412 // Added to perm ghoul by default
1413 if (!IsPet())
1414 {
1417 }
1418 }
1419
1420 sScriptMgr->OnInitStatsForLevel(this, petlevel);
1421
1423
1424 SetFullHealth();
1426
1427 if (owner->IsPlayer())
1428 sScriptMgr->OnAfterGuardianInitStatsForLevel(owner->ToPlayer(), this);
1429
1430 return true;
1431}
#define ASSERT
Definition: Errors.h:68
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
@ EFFECT_2
Definition: SharedDefines.h:33
#define MAX_STATS
Definition: SharedDefines.h:265
@ POWER_ENERGY
Definition: SharedDefines.h:272
@ POWER_MANA
Definition: SharedDefines.h:269
SpellSchools
Definition: SharedDefines.h:282
@ SPELL_SCHOOL_NORMAL
Definition: SharedDefines.h:283
@ SPELL_SCHOOL_HOLY
Definition: SharedDefines.h:284
constexpr auto MAX_SPELL_SCHOOL
Definition: SharedDefines.h:292
@ CLASS_HUNTER
Definition: SharedDefines.h:143
@ CLASS_SHAMAN
Definition: SharedDefines.h:147
@ CLASS_WARLOCK
Definition: SharedDefines.h:149
@ CLASS_MAGE
Definition: SharedDefines.h:148
@ CLASS_DEATH_KNIGHT
Definition: SharedDefines.h:146
@ SPELLFAMILY_DEATHKNIGHT
Definition: SharedDefines.h:3543
@ RACE_ORC
Definition: SharedDefines.h:72
Stats
Definition: SharedDefines.h:257
@ STAT_SPIRIT
Definition: SharedDefines.h:262
@ STAT_INTELLECT
Definition: SharedDefines.h:261
@ STAT_AGILITY
Definition: SharedDefines.h:259
@ STAT_STRENGTH
Definition: SharedDefines.h:258
@ STAT_STAMINA
Definition: SharedDefines.h:260
#define sObjectMgr
Definition: ObjectMgr.h:1635
@ SPELL_AURA_ADD_FLAT_MODIFIER
Definition: SpellAuraDefines.h:170
@ CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH
Definition: IWorld.h:183
@ RATE_XP_PET_NEXT_LEVEL
Definition: IWorld.h:479
@ UNIT_MOD_CAST_SPEED
Definition: UpdateFields.h:137
@ UNIT_FIELD_PETNEXTLEVELEXP
Definition: UpdateFields.h:135
@ MINDAMAGE
Definition: Unit.h:135
@ MAXDAMAGE
Definition: Unit.h:136
UnitMods
Definition: Unit.h:142
@ UNIT_MOD_ARMOR
Definition: Unit.h:156
@ UNIT_MOD_ATTACK_POWER
Definition: Unit.h:163
@ UNIT_MOD_RESISTANCE_START
Definition: Unit.h:172
@ UNIT_MOD_HEALTH
Definition: Unit.h:148
@ UNIT_MOD_MANA
Definition: Unit.h:149
@ UNIT_MOD_STAT_STAMINA
Definition: Unit.h:145
@ REACT_DEFENSIVE
Definition: Unit.h:549
#define BASE_ATTACK_TIME
Definition: Unit.h:41
@ OFF_ATTACK
Definition: Unit.h:210
@ BASE_ATTACK
Definition: Unit.h:209
@ RANGED_ATTACK
Definition: Unit.h:211
@ BASE_VALUE
Definition: Unit.h:126
@ TOTAL_PCT
Definition: Unit.h:129
@ UNIT_MASK_HUNTER_PET
Definition: UnitDefines.h:142
@ CLASS_CONTEXT_PET
Definition: UnitDefines.h:215
@ MOVE_RUN
Definition: UnitDefines.h:329
@ SPELL_WARLOCK_PET_SCALING_02
Definition: PetDefines.h:145
@ SPELL_MAGE_PET_SCALING_02
Definition: PetDefines.h:186
@ SPELL_FIRE_ELEMENTAL_SCALING_02
Definition: PetDefines.h:163
@ SPELL_EARTH_ELEMENTAL_SCALING_02
Definition: PetDefines.h:167
@ SPELL_INFERNAL_SCALING_02
Definition: PetDefines.h:152
@ SPELL_FERAL_SPIRIT_SCALING_03
Definition: PetDefines.h:161
@ SPELL_FIRE_ELEMENTAL_SCALING_03
Definition: PetDefines.h:164
@ SPELL_TREANT_SCALING_04
Definition: PetDefines.h:182
@ SPELL_SHADOWFIEND_SCALING_03
Definition: PetDefines.h:175
@ SPELL_PET_AVOIDANCE
Definition: PetDefines.h:136
@ SPELL_MAGE_PET_SCALING_01
Definition: PetDefines.h:185
@ SPELL_INFERNAL_SCALING_03
Definition: PetDefines.h:153
@ SPELL_SHADOWFIEND_SCALING_01
Definition: PetDefines.h:173
@ SPELL_WARLOCK_PET_SCALING_04
Definition: PetDefines.h:147
@ SPELL_FIRE_ELEMENTAL_SCALING_01
Definition: PetDefines.h:162
@ SPELL_EARTH_ELEMENTAL_SCALING_04
Definition: PetDefines.h:169
@ SPELL_DK_PET_SCALING_03
Definition: PetDefines.h:195
@ SPELL_WARLOCK_PET_SCALING_01
Definition: PetDefines.h:144
@ SPELL_TREANT_SCALING_01
Definition: PetDefines.h:179
@ SPELL_DK_PET_SCALING_01
Definition: PetDefines.h:193
@ SPELL_INFERNAL_SCALING_04
Definition: PetDefines.h:154
@ SPELL_WARLOCK_PET_SCALING_05
Definition: PetDefines.h:148
@ SPELL_TREANT_SCALING_03
Definition: PetDefines.h:181
@ SPELL_WARLOCK_PET_SCALING_03
Definition: PetDefines.h:146
@ SPELL_FERAL_SPIRIT_SCALING_02
Definition: PetDefines.h:160
@ SPELL_MAGE_PET_SCALING_03
Definition: PetDefines.h:187
@ SPELL_FERAL_SPIRIT_SPIRIT_HUNT
Definition: PetDefines.h:158
@ SPELL_FERAL_SPIRIT_SCALING_01
Definition: PetDefines.h:159
@ SPELL_GLYPH_OF_FELGUARD
Definition: PetDefines.h:149
@ SPELL_EARTH_ELEMENTAL_SCALING_03
Definition: PetDefines.h:168
@ SPELL_FIRE_ELEMENTAL_SCALING_04
Definition: PetDefines.h:165
@ SPELL_INFERNAL_SCALING_01
Definition: PetDefines.h:151
@ SPELL_DK_PET_SCALING_02
Definition: PetDefines.h:194
@ SPELL_TREANT_SCALING_02
Definition: PetDefines.h:180
@ SPELL_GLYPH_OF_VOIDWALKER
Definition: PetDefines.h:150
@ SPELL_HUNTER_PET_SCALING_04
Definition: PetDefines.h:141
@ SPELL_EARTH_ELEMENTAL_SCALING_01
Definition: PetDefines.h:166
@ SPELL_SHADOWFIEND_SCALING_02
Definition: PetDefines.h:174
@ SPELL_MAGE_PET_SCALING_04
Definition: PetDefines.h:188
@ SPELL_ORC_RACIAL_COMMAND_SHAMAN
Definition: PetDefines.h:170
@ SPELL_NIGHT_OF_THE_DEAD_AVOIDANCE
Definition: PetDefines.h:192
@ SPELL_ORC_RACIAL_COMMAND_DK
Definition: PetDefines.h:191
@ SPELL_SHADOWFIEND_SCALING_04
Definition: PetDefines.h:176
@ NPC_WATER_ELEMENTAL_TEMP
Definition: PetDefines.h:104
@ NPC_FERAL_SPIRIT
Definition: PetDefines.h:117
@ NPC_EARTH_ELEMENTAL
Definition: PetDefines.h:116
@ NPC_DOOMGUARD
Definition: PetDefines.h:99
@ NPC_RISEN_GHOUL
Definition: PetDefines.h:120
@ NPC_EBON_GARGOYLE
Definition: PetDefines.h:123
@ NPC_TREANT
Definition: PetDefines.h:109
@ NPC_SHADOWFIEND
Definition: PetDefines.h:112
@ NPC_INFERNAL
Definition: PetDefines.h:94
@ NPC_ARMY_OF_THE_DEAD
Definition: PetDefines.h:122
@ NPC_VENOMOUS_SNAKE
Definition: PetDefines.h:126
@ NPC_BLOODWORM
Definition: PetDefines.h:121
@ NPC_VIPER
Definition: PetDefines.h:127
@ NPC_FIRE_ELEMENTAL
Definition: PetDefines.h:115
@ NPC_FELGUARD
Definition: PetDefines.h:100
@ NPC_GENERIC_VOIDWALKER
Definition: PetDefines.h:131
@ NPC_MIRROR_IMAGE
Definition: PetDefines.h:105
@ NPC_WATER_ELEMENTAL_PERM
Definition: PetDefines.h:106
@ NPC_VOIDWALKER
Definition: PetDefines.h:97
@ NPC_GENERIC_IMP
Definition: PetDefines.h:130
PetType
Definition: PetDefines.h:30
@ SUMMON_PET
Definition: PetDefines.h:31
@ HUNTER_PET
Definition: PetDefines.h:32
@ MAX_PET_TYPE
Definition: PetDefines.h:33
#define sScriptMgr
Definition: ScriptMgr.h:709
#define sWorld
Definition: World.h:443
void SetObjectScale(float scale) override
Definition: Creature.cpp:3499
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition: Creature.cpp:3518
static float _GetHealthMod(int32 Rank)
Definition: Creature.cpp:1573
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:205
float GetNativeObjectScale() const override
Definition: Creature.cpp:3494
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
void SetMeleeDamageSchool(SpellSchools school)
Definition: Creature.h:165
Definition: CreatureData.h:186
float ModHealth
Definition: CreatureData.h:237
float ModMana
Definition: CreatureData.h:238
uint32 Entry
Definition: CreatureData.h:187
uint32 rank
Definition: CreatureData.h:206
uint32 BaseAttackTime
Definition: CreatureData.h:209
int32 resistance[MAX_SPELL_SCHOOL]
Definition: CreatureData.h:227
uint32 dmgschool
Definition: CreatureData.h:207
uint32 expansion
Definition: CreatureData.h:197
uint32 unit_class
Definition: CreatureData.h:213
Definition: CreatureData.h:303
uint32 BaseMana
Definition: CreatureData.h:305
uint32 BaseHealth[MAX_EXPANSIONS]
Definition: CreatureData.h:304
bool UpdateAllStats() override
Definition: StatSystem.cpp:1193
bool IsPlayer() const
Definition: Object.h:200
Player * ToPlayer()
Definition: Object.h:201
uint32 GetEntry() const
Definition: Object.h:115
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:737
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool IsHunterPet() const
Definition: Unit.h:755
void SetCreateStat(Stats stat, float val)
Definition: Unit.h:1001
void SetFullHealth()
Definition: Unit.h:1047
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim=nullptr) const
Definition: Unit.cpp:15428
void SetCreateHealth(uint32 val)
Definition: Unit.h:1049
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15566
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value, uint8 damageIndex=0)
Definition: Unit.h:1137
bool IsPet() const
Definition: Unit.h:754
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18863
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:5494
uint8 getClass() const
Definition: Unit.h:800
virtual bool IsClass(Classes unitClass, ClassContext context=CLASS_CONTEXT_NONE) const
Definition: Unit.h:801
uint8 getRace(bool original=false) const
Definition: Unit.cpp:21006
AuraEffect * GetAuraEffectDummy(uint32 spellid) const
Definition: Unit.cpp:5550
void SetCreateMana(uint32 val)
Definition: Unit.h:1071
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition: Unit.cpp:15203
void SetLevel(uint8 lvl, bool showLevelChange=true)
Definition: Unit.cpp:15460
uint32 GetDisplayId() const
Definition: Unit.h:1837
uint32 GetMaxPower(Powers power) const
Definition: Unit.h:1057
uint32 GetCreateHealth() const
Definition: Unit.h:1033
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)
Definition: Unit.cpp:1167
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14429
void SetModifierValue(UnitMods unitMod, UnitModifierType modifierType, float value)
Definition: Unit.h:1013
void SetCanModifyStats(bool modifyStats)
Definition: Unit.h:1017
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21316
void SetAttackTime(WeaponAttackType att, uint32 val)
Definition: Unit.h:870
uint32 GetCreateMana() const
Definition: Unit.h:1070
Definition: ObjectMgr.h:528
uint32 max_dmg
Definition: ObjectMgr.h:539
uint32 mana
Definition: ObjectMgr.h:536
uint32 min_dmg
Definition: ObjectMgr.h:538
uint32 health
Definition: ObjectMgr.h:535
std::array< uint32, MAX_STATS > stats
Definition: ObjectMgr.h:534
uint32 armor
Definition: ObjectMgr.h:537
Definition: SpellAuraEffects.h:39
Definition: SpellAuras.h:87

References Creature::_GetHealthMod(), Unit::AddAura(), PetLevelInfo::armor, ASSERT, BASE_ATTACK, BASE_ATTACK_TIME, BASE_VALUE, CreatureTemplate::BaseAttackTime, CreatureBaseStats::BaseHealth, CreatureBaseStats::BaseMana, Unit::CastSpell(), CLASS_CONTEXT_PET, CLASS_DEATH_KNIGHT, CLASS_HUNTER, CLASS_MAGE, CLASS_SHAMAN, CLASS_WARLOCK, CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH, Creature::DespawnOrUnsummon(), CreatureTemplate::dmgschool, EFFECT_2, CreatureTemplate::Entry, CreatureTemplate::expansion, Unit::GetAuraEffect(), Unit::GetAuraEffectDummy(), Unit::getClass(), Unit::GetCreateHealth(), Unit::GetCreateMana(), Creature::GetCreatureTemplate(), Unit::GetDisplayId(), Object::GetEntry(), Object::GetGUID(), Unit::GetMaxPower(), Creature::GetNativeObjectScale(), Minion::GetOwner(), Unit::getRace(), Unit::GetTotalAttackPowerValue(), Unit::HandleStatModifier(), PetLevelInfo::health, HUNTER_PET, Unit::IsClass(), Unit::IsHunterPet(), Unit::IsPet(), Object::IsPlayer(), LOG_ERROR, Unit::m_unitTypeMask, PetLevelInfo::mana, PetLevelInfo::max_dmg, MAX_PET_TYPE, MAX_SPELL_SCHOOL, MAX_STATS, MAXDAMAGE, PetLevelInfo::min_dmg, MINDAMAGE, CreatureTemplate::ModHealth, CreatureTemplate::ModMana, MOVE_RUN, NPC_ARMY_OF_THE_DEAD, NPC_BLOODWORM, NPC_DOOMGUARD, NPC_EARTH_ELEMENTAL, NPC_EBON_GARGOYLE, NPC_FELGUARD, NPC_FERAL_SPIRIT, NPC_FIRE_ELEMENTAL, NPC_GENERIC_IMP, NPC_GENERIC_VOIDWALKER, NPC_INFERNAL, NPC_MIRROR_IMAGE, NPC_RISEN_GHOUL, NPC_SHADOWFIEND, NPC_TREANT, NPC_VENOMOUS_SNAKE, NPC_VIPER, NPC_VOIDWALKER, NPC_WATER_ELEMENTAL_PERM, NPC_WATER_ELEMENTAL_TEMP, OFF_ATTACK, POWER_ENERGY, POWER_MANA, RACE_ORC, RANGED_ATTACK, CreatureTemplate::rank, RATE_XP_PET_NEXT_LEVEL, REACT_DEFENSIVE, CreatureTemplate::resistance, Unit::SetAttackTime(), Unit::SetBaseWeaponDamage(), Unit::SetCanModifyStats(), Unit::SetCreateHealth(), Unit::SetCreateMana(), Unit::SetCreateStat(), Creature::SetDisplayId(), Object::SetFloatValue(), Unit::SetFullHealth(), Unit::SetLevel(), Creature::SetMeleeDamageSchool(), Unit::SetModifierValue(), Creature::SetObjectScale(), Unit::SetPower(), Creature::SetReactState(), Unit::SetSpeed(), Unit::SetUInt32Value(), sObjectMgr, SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_DK_PET_SCALING_01, SPELL_DK_PET_SCALING_02, SPELL_DK_PET_SCALING_03, SPELL_EARTH_ELEMENTAL_SCALING_01, SPELL_EARTH_ELEMENTAL_SCALING_02, SPELL_EARTH_ELEMENTAL_SCALING_03, SPELL_EARTH_ELEMENTAL_SCALING_04, SPELL_FERAL_SPIRIT_SCALING_01, SPELL_FERAL_SPIRIT_SCALING_02, SPELL_FERAL_SPIRIT_SCALING_03, SPELL_FERAL_SPIRIT_SPIRIT_HUNT, SPELL_FIRE_ELEMENTAL_SCALING_01, SPELL_FIRE_ELEMENTAL_SCALING_02, SPELL_FIRE_ELEMENTAL_SCALING_03, SPELL_FIRE_ELEMENTAL_SCALING_04, SPELL_GLYPH_OF_FELGUARD, SPELL_GLYPH_OF_VOIDWALKER, SPELL_HUNTER_PET_SCALING_04, SPELL_INFERNAL_SCALING_01, SPELL_INFERNAL_SCALING_02, SPELL_INFERNAL_SCALING_03, SPELL_INFERNAL_SCALING_04, SPELL_MAGE_PET_SCALING_01, SPELL_MAGE_PET_SCALING_02, SPELL_MAGE_PET_SCALING_03, SPELL_MAGE_PET_SCALING_04, SPELL_NIGHT_OF_THE_DEAD_AVOIDANCE, SPELL_ORC_RACIAL_COMMAND_DK, SPELL_ORC_RACIAL_COMMAND_SHAMAN, SPELL_PET_AVOIDANCE, SPELL_SCHOOL_HOLY, SPELL_SCHOOL_NORMAL, SPELL_SHADOWFIEND_SCALING_01, SPELL_SHADOWFIEND_SCALING_02, SPELL_SHADOWFIEND_SCALING_03, SPELL_SHADOWFIEND_SCALING_04, SPELL_TREANT_SCALING_01, SPELL_TREANT_SCALING_02, SPELL_TREANT_SCALING_03, SPELL_TREANT_SCALING_04, SPELL_WARLOCK_PET_SCALING_01, SPELL_WARLOCK_PET_SCALING_02, SPELL_WARLOCK_PET_SCALING_03, SPELL_WARLOCK_PET_SCALING_04, SPELL_WARLOCK_PET_SCALING_05, SPELLFAMILY_DEATHKNIGHT, sScriptMgr, STAT_AGILITY, STAT_INTELLECT, STAT_SPIRIT, STAT_STAMINA, STAT_STRENGTH, PetLevelInfo::stats, SUMMON_PET, sWorld, Object::ToPlayer(), TOTAL_PCT, CreatureTemplate::unit_class, UNIT_FIELD_PETNEXTLEVELEXP, UNIT_MASK_HUNTER_PET, UNIT_MOD_ARMOR, UNIT_MOD_ATTACK_POWER, UNIT_MOD_CAST_SPEED, UNIT_MOD_HEALTH, UNIT_MOD_MANA, UNIT_MOD_RESISTANCE_START, UNIT_MOD_STAT_STAMINA, and UpdateAllStats().

Referenced by Pet::GivePetLevel(), InitStats(), Unit::InitTamedPet(), Pet::LoadPetFromDB(), and Player::SummonPet().

◆ InitSummon()

void Guardian::InitSummon ( )
overridevirtual

Reimplemented from TempSummon.

445{
447
448 if (Unit* m_owner = GetOwner())
449 {
450 if (m_owner->IsPlayer() && m_owner->GetMinionGUID() == GetGUID() && !m_owner->GetCharmGUID())
451 {
452 m_owner->ToPlayer()->CharmSpellInitialize();
453 }
454 }
455}
virtual void InitSummon()
Definition: TemporarySummon.cpp:252
ObjectGuid GetGUID() const
Definition: Object.h:113

References Object::GetGUID(), Minion::GetOwner(), TempSummon::InitSummon(), ObjectGuid::IsPlayer(), and Minion::m_owner.

◆ UpdateAllStats()

bool Guardian::UpdateAllStats ( )
overridevirtual

Reimplemented from Creature.

1194{
1195 for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
1196 UpdateStats(Stats(i));
1197
1198 for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
1200
1202 return true;
1203}
Powers
Definition: SharedDefines.h:268
@ MAX_POWERS
Definition: SharedDefines.h:276
void UpdateMaxPower(Powers power) override
Definition: StatSystem.cpp:1260
bool UpdateStats(Stats stat) override
Definition: StatSystem.cpp:1164
virtual void UpdateAllResistances()
Definition: StatSystem.cpp:54

References MAX_POWERS, MAX_STATS, POWER_MANA, STAT_STRENGTH, Unit::UpdateAllResistances(), UpdateMaxPower(), and UpdateStats().

Referenced by InitStatsForLevel().

◆ UpdateArmor()

void Guardian::UpdateArmor ( )
overridevirtual

Reimplemented from Creature.

1206{
1209 value += std::max<float>(GetStat(STAT_AGILITY) - GetCreateStat(STAT_AGILITY), 0.0f) * 2.0f;
1212 SetArmor(int32(value));
1213}
std::int32_t int32
Definition: Define.h:103
@ TOTAL_VALUE
Definition: Unit.h:128
@ BASE_PCT
Definition: Unit.h:127
float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const
Definition: Unit.cpp:15288
float GetCreateStat(Stats stat) const
Definition: Unit.h:1000
void SetArmor(int32 val)
Definition: Unit.h:1080
float GetStat(Stats stat) const
Definition: Unit.h:995

References BASE_PCT, BASE_VALUE, Unit::GetCreateStat(), Unit::GetModifierValue(), Unit::GetStat(), Unit::SetArmor(), STAT_AGILITY, TOTAL_PCT, TOTAL_VALUE, and UNIT_MOD_ARMOR.

Referenced by UpdateStats().

◆ UpdateAttackPowerAndDamage()

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

Reimplemented from Creature.

1295{
1296 if (ranged)
1297 return;
1298
1299 float val = 0.0f;
1301
1302 if (GetEntry() == NPC_IMP) // imp's attack power
1303 val = GetStat(STAT_STRENGTH) - 10.0f;
1304 else if (IsPetGhoul()) // DK's ghoul attack power
1305 val = 589 /*xinef: base ap!*/ + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY);
1306 else
1307 val = 2 * GetStat(STAT_STRENGTH) - 20.0f;
1308
1309 SetModifierValue(unitMod, BASE_VALUE, val);
1310
1311 //in BASE_VALUE of UNIT_MOD_ATTACK_POWER for creatures we store data of meleeattackpower field in DB
1312 float base_attPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT);
1313 float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
1314 float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
1315
1316 //UNIT_FIELD_(RANGED)_ATTACK_POWER field
1318 //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
1320 //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
1322
1323 //automatically update weapon damage after attack power modification
1325}
@ UNIT_FIELD_ATTACK_POWER_MODS
Definition: UpdateFields.h:163
@ UNIT_FIELD_ATTACK_POWER_MULTIPLIER
Definition: UpdateFields.h:164
@ UNIT_FIELD_ATTACK_POWER
Definition: UpdateFields.h:162
@ NPC_IMP
Definition: PetDefines.h:95
bool IsPetGhoul() const
Definition: TemporarySummon.h:84
void UpdateDamagePhysical(WeaponAttackType attType) override
Definition: StatSystem.cpp:1327
void SetInt32Value(uint16 index, int32 value)
Definition: Object.cpp:637

References BASE_ATTACK, BASE_PCT, BASE_VALUE, Object::GetEntry(), Unit::GetModifierValue(), Unit::GetStat(), Minion::IsPetGhoul(), NPC_IMP, Object::SetFloatValue(), Object::SetInt32Value(), Unit::SetModifierValue(), STAT_AGILITY, STAT_STRENGTH, TOTAL_PCT, TOTAL_VALUE, UNIT_FIELD_ATTACK_POWER, UNIT_FIELD_ATTACK_POWER_MODS, UNIT_FIELD_ATTACK_POWER_MULTIPLIER, UNIT_MOD_ATTACK_POWER, and UpdateDamagePhysical().

Referenced by UpdateStats().

◆ UpdateDamagePhysical()

void Guardian::UpdateDamagePhysical ( WeaponAttackType  attType)
overridevirtual

Reimplemented from Unit.

1328{
1329 if (attType > BASE_ATTACK)
1330 return;
1331
1333
1334 float att_speed = float(GetAttackTime(BASE_ATTACK)) / 1000.0f;
1335
1336 float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) / 14.0f * att_speed;
1337 float base_pct = GetModifierValue(unitMod, BASE_PCT);
1338 float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
1339 float total_pct = GetModifierValue(unitMod, TOTAL_PCT);
1340
1341 float weapon_mindamage = GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE);
1342 float weapon_maxdamage = GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE);
1343
1344 float mindamage = ((base_value + weapon_mindamage) * base_pct + total_value) * total_pct;
1345 float maxdamage = ((base_value + weapon_maxdamage) * base_pct + total_value) * total_pct;
1346
1347 if (mindamage < 0.0f || mindamage > 10000000.0f)
1348 mindamage = BASE_MINDAMAGE;
1349 if (maxdamage < 0.0f || maxdamage > 10000000.0f)
1350 maxdamage = BASE_MAXDAMAGE;
1351 if (mindamage > maxdamage)
1352 mindamage = maxdamage;
1353
1354 // Pet's base damage changes depending on happiness
1355 if (IsHunterPet() && attType == BASE_ATTACK)
1356 {
1357 switch (ToPet()->GetHappinessState())
1358 {
1359 case HAPPY:
1360 // 125% of normal damage
1361 mindamage = mindamage * 1.25f;
1362 maxdamage = maxdamage * 1.25f;
1363 break;
1364 case CONTENT:
1365 // 100% of normal damage, nothing to modify
1366 break;
1367 case UNHAPPY:
1368 // 75% of normal damage
1369 mindamage = mindamage * 0.75f;
1370 maxdamage = maxdamage * 0.75f;
1371 break;
1372 }
1373 }
1374
1377}
@ UNIT_FIELD_MINDAMAGE
Definition: UpdateFields.h:127
@ UNIT_FIELD_MAXDAMAGE
Definition: UpdateFields.h:128
@ UNIT_MOD_DAMAGE_MAINHAND
Definition: Unit.h:165
#define BASE_MAXDAMAGE
Definition: Unit.h:40
#define BASE_MINDAMAGE
Definition: Unit.h:39
@ HAPPY
Definition: PetDefines.h:52
@ CONTENT
Definition: PetDefines.h:51
@ UNHAPPY
Definition: PetDefines.h:50
void SetStatFloatValue(uint16 index, float value)
Definition: Object.cpp:790
HappinessState GetHappinessState()
Definition: Pet.cpp:868
Pet * ToPet()
Definition: Unit.h:694
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type, uint8 damageIndex=0) const
Definition: Unit.cpp:15452
uint32 GetAttackTime(WeaponAttackType att) const
Definition: Unit.h:864

References BASE_ATTACK, BASE_MAXDAMAGE, BASE_MINDAMAGE, BASE_PCT, BASE_VALUE, CONTENT, Unit::GetAttackTime(), Pet::GetHappinessState(), Unit::GetModifierValue(), Unit::GetTotalAttackPowerValue(), Unit::GetWeaponDamageRange(), HAPPY, Unit::IsHunterPet(), MAXDAMAGE, MINDAMAGE, Object::SetStatFloatValue(), Unit::ToPet(), TOTAL_PCT, TOTAL_VALUE, UNHAPPY, UNIT_FIELD_MAXDAMAGE, UNIT_FIELD_MINDAMAGE, and UNIT_MOD_DAMAGE_MAINHAND.

Referenced by UpdateAttackPowerAndDamage().

◆ UpdateMaxHealth()

void Guardian::UpdateMaxHealth ( )
overridevirtual

Reimplemented from Creature.

1216{
1217 UnitMods unitMod = UNIT_MOD_HEALTH;
1218 float stamina = std::max<float>(GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA), 0.0f);
1219
1220 float multiplicator;
1221 switch (GetEntry())
1222 {
1223 case NPC_IMP:
1224 multiplicator = 8.4f;
1225 break;
1227 multiplicator = 7.5f;
1228 break;
1230 multiplicator = 7.5f;
1231 break;
1232 case NPC_VOIDWALKER:
1233 multiplicator = 11.0f;
1234 break;
1235 case NPC_SUCCUBUS:
1236 multiplicator = 9.1f;
1237 break;
1238 case NPC_FELHUNTER:
1239 multiplicator = 9.5f;
1240 break;
1241 case NPC_FELGUARD:
1242 multiplicator = 11.0f;
1243 break;
1244 case NPC_BLOODWORM:
1245 multiplicator = 1.0f;
1246 break;
1247 default:
1248 multiplicator = 10.0f;
1249 break;
1250 }
1251
1252 float value = GetModifierValue(unitMod, BASE_VALUE);// xinef: Do NOT add base health TWICE + GetCreateHealth();
1253 value *= GetModifierValue(unitMod, BASE_PCT);
1254 value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
1255 value *= GetModifierValue(unitMod, TOTAL_PCT);
1256
1257 SetMaxHealth((uint32)value);
1258}
@ NPC_FELHUNTER
Definition: PetDefines.h:96
@ NPC_SUCCUBUS
Definition: PetDefines.h:98
void SetMaxHealth(uint32 val)
Definition: Unit.cpp:15528

References BASE_PCT, BASE_VALUE, Unit::GetCreateStat(), Object::GetEntry(), Unit::GetModifierValue(), Unit::GetStat(), NPC_BLOODWORM, NPC_FELGUARD, NPC_FELHUNTER, NPC_IMP, NPC_SUCCUBUS, NPC_VOIDWALKER, NPC_WATER_ELEMENTAL_PERM, NPC_WATER_ELEMENTAL_TEMP, Unit::SetMaxHealth(), STAT_STAMINA, TOTAL_PCT, TOTAL_VALUE, and UNIT_MOD_HEALTH.

Referenced by UpdateStats().

◆ UpdateMaxPower()

void Guardian::UpdateMaxPower ( Powers  power)
overridevirtual

Reimplemented from Creature.

1261{
1262 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + power);
1263
1264 float addValue = (power == POWER_MANA) ? std::max<float>(GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT), 0.0f) : 0.0f;
1265 float multiplicator = 15.0f;
1266
1267 switch (GetEntry())
1268 {
1269 case NPC_IMP:
1272 multiplicator = 4.95f;
1273 break;
1274 case NPC_VOIDWALKER:
1275 case NPC_SUCCUBUS:
1276 case NPC_FELHUNTER:
1277 case NPC_FELGUARD:
1278 multiplicator = 11.5f;
1279 break;
1280 default:
1281 multiplicator = 15.0f;
1282 break;
1283 }
1284
1285 // xinef: Do NOT add base mana TWICE
1286 float value = GetModifierValue(unitMod, BASE_VALUE) + (power != POWER_MANA ? GetCreatePowers(power) : 0);
1287 value *= GetModifierValue(unitMod, BASE_PCT);
1288 value += GetModifierValue(unitMod, TOTAL_VALUE) + addValue * multiplicator;
1289 value *= GetModifierValue(unitMod, TOTAL_PCT);
1290
1291 SetMaxPower(power, uint32(value));
1292}
std::uint16_t uint16
Definition: Define.h:108
@ UNIT_MOD_POWER_START
Definition: Unit.h:174
uint32 GetCreatePowers(Powers power) const
Definition: Unit.cpp:15660
void SetMaxPower(Powers power, uint32 val)
Definition: Unit.cpp:15631

References BASE_PCT, BASE_VALUE, Unit::GetCreatePowers(), Unit::GetCreateStat(), Object::GetEntry(), Unit::GetModifierValue(), Unit::GetStat(), NPC_FELGUARD, NPC_FELHUNTER, NPC_IMP, NPC_SUCCUBUS, NPC_VOIDWALKER, NPC_WATER_ELEMENTAL_PERM, NPC_WATER_ELEMENTAL_TEMP, POWER_MANA, Unit::SetMaxPower(), STAT_INTELLECT, TOTAL_PCT, TOTAL_VALUE, and UNIT_MOD_POWER_START.

Referenced by UpdateAllStats(), and UpdateStats().

◆ UpdateStats()

bool Guardian::UpdateStats ( Stats  stat)
overridevirtual

Reimplemented from Creature.

1165{
1166 if (stat >= MAX_STATS)
1167 return false;
1168
1169 float value = GetTotalStatValue(stat);
1170 SetStat(stat, int32(value));
1171
1172 switch (stat)
1173 {
1174 case STAT_STRENGTH:
1176 break;
1177 case STAT_AGILITY:
1178 UpdateArmor();
1179 break;
1180 case STAT_STAMINA:
1182 break;
1183 case STAT_INTELLECT:
1185 break;
1186 case STAT_SPIRIT:
1187 break;
1188 }
1189
1190 return true;
1191}
void UpdateMaxHealth() override
Definition: StatSystem.cpp:1215
void UpdateArmor() override
Definition: StatSystem.cpp:1205
void UpdateAttackPowerAndDamage(bool ranged=false) override
Definition: StatSystem.cpp:1294
void SetStat(Stats stat, int32 val)
Definition: Unit.h:996
float GetTotalStatValue(Stats stat, float additionalValue=0.0f) const
Definition: Unit.cpp:15302

References Unit::GetTotalStatValue(), MAX_STATS, POWER_MANA, Unit::SetStat(), STAT_AGILITY, STAT_INTELLECT, STAT_SPIRIT, STAT_STAMINA, STAT_STRENGTH, UpdateArmor(), UpdateAttackPowerAndDamage(), UpdateMaxHealth(), and UpdateMaxPower().

Referenced by UpdateAllStats().