30#include <forward_list>
35#define VISUAL_WAYPOINT 1
36#define WORLD_TRIGGER 12999
37#define SPELL_DAZED 1604
38#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE 197886
39#define SPELL_DH_DOUBLE_JUMP 196055
40#define DISPLAYID_HIDDEN_MOUNT 73200
42#define WARMODE_ENLISTED_SPELL_OUTSIDE 269083
44#define MAX_AGGRO_RESET_TIME 10
45#define MAX_AGGRO_RADIUS 45.0f
117 struct SpellEffectExtraData;
134 bool RollDispel()
const;
365#define MAX_COMBAT_RATING 32
455 void ModifyDamage(
int32 amount);
456 void AbsorbDamage(
uint32 amount);
457 void ResistDamage(
uint32 amount);
458 void BlockDamage(
uint32 amount);
491 void AbsorbHeal(
uint32 amount);
503 uint32 GetHitMask()
const;
615#define CURRENT_FIRST_NON_MELEE_SPELL 1
616#define CURRENT_MAX_SPELL 4
621#define REACTIVE_TIMER_START 4000
643#define ATTACK_DISPLAY_DELAY 200
644#define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f
654 typedef std::pair<AuraMap::const_iterator, AuraMap::const_iterator>
AuraMapBounds;
667 typedef std::array<DiminishingReturn, DIMINISHING_MAX>
Diminishing;
674 static std::vector<AuraEffect*> CopyAuraEffectList(
AuraEffectList const& list);
679 void AIUpdateTick(
uint32 diff);
681 void ScheduleAIChange();
682 void PushAI(
UnitAI* newAI);
685 void SetAI(
UnitAI* newAI);
688 UnitAI* GetScheduledChangeAI();
689 bool HasScheduledAIChange()
const;
692 void AddToWorld()
override;
693 void RemoveFromWorld()
override;
695 void CleanupBeforeRemoveFromMap(
bool finalCleanup);
696 void CleanupsBeforeDelete(
bool finalCleanup =
true)
override;
700 void IncrDiminishing(
SpellInfo const* auraSpellInfo);
703 void ClearDiminishings();
705 virtual void Update(
uint32 time)
override;
707 void Heartbeat()
override;
708 void TriggerAuraHeartbeat();
714 bool haveOffhandWeapon()
const;
721 bool IsWithinCombatRange(
Unit const* obj,
float dist2compare)
const;
723 bool IsWithinMeleeRangeAt(
Position const& pos,
Unit const* obj)
const;
724 float GetMeleeRange(
Unit const* target)
const;
726 bool IsWithinBoundaryRadius(
const Unit* obj)
const;
729 void _addAttacker(
Unit* pAttacker);
730 void _removeAttacker(
Unit* pAttacker);
731 Unit* getAttackerForHelper()
const;
733 void CastStop(
uint32 except_spellid = 0);
735 void RemoveAllAttackers();
737 bool isAttackingPlayer()
const;
746 void ValidateAttackersAndOwnTarget();
747 void CombatStop(
bool includingCast =
false,
bool mutualPvP =
true,
bool (*unitFilter)(
Unit const* otherUnit) =
nullptr);
748 void CombatStopWithPets(
bool includingCast =
false);
749 void StopAttackFaction(
uint32 faction_id);
751 void SendMeleeAttackStop(
Unit const* victim =
nullptr)
const;
752 void SendMeleeAttackStart(
Unit* victim);
757 bool CanFreeMove()
const;
772 void SetLevel(
uint8 lvl,
bool sendUpdate =
true);
775 uint64 GetRaceMask()
const;
784 float GetStat(
Stats stat)
const {
return float(m_unitData->Stats[stat]); }
804 bool HealthBelowPct(
float pct)
const {
return GetHealth() < CountPctFromMaxHealth(pct); }
806 bool HealthAbovePct(
float pct)
const {
return GetHealth() > CountPctFromMaxHealth(pct); }
808 float GetHealthPct()
const {
return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; }
812 void SetHealth(
uint64 val);
813 void SetMaxHealth(
uint64 val);
817 void TriggerOnHealthChangeAuras(
uint64 oldVal,
uint64 newVal);
824 void SetPowerType(
Powers power,
bool sendUpdate =
true,
bool onInit =
false);
825 void SetInitialPowerValue(
Powers powerType);
827 Powers CalculateDisplayPowerType()
const;
828 void UpdateDisplayPower();
832 float GetPowerPct(
Powers power)
const {
return GetMaxPower(power) ? 100.f * GetPower(power) / GetMaxPower(power) : 0.0f; }
834 void SetPower(
Powers power,
int32 val,
bool withPowerUpdate =
true);
847 void ApplyAttackTimePercentMod(
WeaponAttackType att,
float val,
bool apply);
848 void ApplyCastTimePercentMod(
float val,
bool apply);
849 void ApplySpellHastePercentMod(
float val,
bool apply);
850 void ApplyHasteRegenPercentMod(
float val,
bool apply);
889 bool IsInPartyWith(
Unit const* unit)
const;
890 bool IsInRaidWith(
Unit const* unit)
const;
891 void GetPartyMembers(std::list<Unit*> &units);
892 bool IsContestedGuard()
const;
903 virtual void SetPvP(
bool state);
911 uint32 GetCreatureType()
const;
912 uint32 GetCreatureTypeMask()
const;
913 void UpdateCreatureType();
916 bool IsSitState()
const;
917 bool IsStandState()
const;
925 void SetAnimTier(
AnimTier animTier,
bool notifyClient =
true);
934 void CancelMountAura(
bool force =
false);
936 void UpdateMountCapability();
938 void SendDurabilityLoss(
Player* receiver,
uint32 percent);
939 void PlayOneShotAnimKitId(
uint16 animKitId);
940 void SetAIAnimKitId(
uint16 animKitId);
942 void SetMovementAnimKitId(
uint16 animKitId);
944 void SetMeleeAnimKitId(
uint16 animKitId);
948 static void DealDamageMods(
Unit const* attacker,
Unit const* victim,
uint32& damage,
uint32* absorb);
950 static void Kill(
Unit* attacker,
Unit* victim,
bool durabilityLoss =
true,
bool skipSettingDeathState =
false);
951 void KillSelf(
bool durabilityLoss =
true,
bool skipSettingDeathState =
false) {
Unit::Kill(
this,
this, durabilityLoss, skipSettingDeathState); }
952 static void DealHeal(
HealInfo& healInfo);
958 void GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTriggeringProc, AuraApplicationList* procAuras,
ProcEventInfo& eventInfo);
959 void TriggerAurasProcOnEvent(AuraApplicationList* myProcAuras, AuraApplicationList* targetProcAuras,
963 void TriggerAurasProcOnEvent(
ProcEventInfo& eventInfo, AuraApplicationProcContainer& procAuras);
966 void DoMeleeAttackIfReady();
970 void DealMeleeDamage(
CalcDamageInfo* damageInfo,
bool durabilityLoss);
971 void HandleProcExtraAttackFor(
Unit* victim,
uint32 count);
975 void AddExtraAttacks(
uint32 count);
985 virtual bool CanApplyResilience()
const;
986 static void ApplyResilience(
Unit const* victim,
int32* damage);
988 int32 CalculateAOEAvoidance(
int32 damage,
uint32 schoolMask,
bool npcCaster)
const;
996 float GetUnitMissChance()
const;
998 float GetUnitCriticalChanceTaken(
Unit const* attacker,
WeaponAttackType attackType,
float critDone)
const;
1000 float GetMechanicResistChance(
SpellInfo const* spellInfo)
const;
1001 bool CanUseAttackType(
uint8 attacktype)
const;
1005 float GetWeaponProcChance()
const;
1006 float GetPPMProcChance(
uint32 WeaponSpeed,
float PPM,
SpellInfo const* spellProto)
const;
1037 bool IsServiceProvider()
const;
1050 bool IsEngagedBy(
Unit const* who)
const {
return CanHaveThreatList() ? IsThreatenedBy(who) : IsInCombatWith(who); }
1051 void EngageWithTarget(
Unit* who);
1055 void AtTargetAttacked(
Unit* target,
bool canInitialAggro);
1058 void SetImmuneToAll(
bool apply,
bool keepCombat);
1061 void SetImmuneToPC(
bool apply,
bool keepCombat);
1064 void SetImmuneToNPC(
bool apply,
bool keepCombat);
1068 void SetUninteractible(
bool apply);
1071 void SetCannotTurn(
bool apply);
1075 void SetInCombatWith(
Unit* enemy,
bool addSecondUnitSuppressed =
false) {
if (enemy) m_combatManager.SetInCombatWith(enemy, addSecondUnitSuppressed); }
1077 void UpdatePetCombatState();
1080 virtual void SetInteractionAllowedWhileHostile(
bool interactionAllowed);
1083 virtual void SetInteractionAllowedInCombat(
bool interactionAllowed);
1085 virtual void UpdateNearbyPlayersInteractions();
1088 bool IsThreatened()
const;
1096 void SendClearTarget();
1100 bool HasBreakableByDamageAuraType(
AuraType type,
uint32 excludeAura = 0)
const;
1101 bool HasBreakableByDamageCrowdControlAura(
Unit const* excludeCasterChannel =
nullptr)
const;
1107 bool IsPolymorphed()
const;
1110 bool isTargetableForAttack(
bool checkFakeDeath =
true)
const;
1112 bool IsInWater()
const;
1113 bool IsUnderWater()
const;
1114 bool IsOnOceanFloor()
const;
1115 bool isInAccessiblePlaceFor(
Creature const* c)
const;
1117 void SendHealSpellLog(
HealInfo& healInfo,
bool critical =
false);
1118 int32 HealBySpell(
HealInfo& healInfo,
bool critical =
false);
1126 void SendPlaySpellVisual(
Unit* target,
uint32 spellVisualId,
uint8 missReason,
uint8 reflectStatus,
float travelSpeed,
bool speedAsTime =
false,
float launchDelay = 0.0f);
1127 void SendPlaySpellVisual(
Position const& targetPosition,
uint32 spellVisualId,
uint8 missReason,
uint8 reflectStatus,
float travelSpeed,
bool speedAsTime =
false,
float launchDelay = 0.0f);
1128 void SendCancelSpellVisual(
uint32 id);
1131 void SendCancelSpellVisualKit(
uint32 id);
1133 void CancelSpellMissiles(
uint32 spellId,
bool reverseMissile =
false,
bool abortSpell =
false);
1141 void SendSpellDamageResist(
Unit* target,
uint32 spellId);
1142 void SendSpellDamageImmune(
Unit* target,
uint32 spellId,
bool isPeriodic);
1145 void NearTeleportTo(
Position const& pos,
bool casting =
false);
1148 virtual bool UpdatePosition(
float x,
float y,
float z,
float ang,
bool teleport =
false);
1150 virtual bool UpdatePosition(
Position const& pos,
bool teleport =
false);
1151 void UpdateOrientation(
float orientation);
1152 void UpdateHeight(
float newZ);
1154 void SendMoveKnockBack(
Player* player,
float speedXY,
float speedZ,
float vcos,
float vsin);
1157 void MonsterMoveWithSpeed(
float x,
float y,
float z,
float speed,
bool generatePath =
false,
bool forceDestination =
false);
1160 void SetPlayHoverAnim(
bool enable,
bool sendUpdate =
true);
1161 void CalculateHoverHeight();
1167 bool SetWalk(
bool enable);
1168 bool SetDisableGravity(
bool disable,
bool updateAnimTier =
true,
bool updatePlayHoverAnim =
true);
1169 bool SetFall(
bool enable);
1170 bool SetSwim(
bool enable);
1171 bool SetCanFly(
bool enable);
1172 bool SetWaterWalking(
bool enable);
1173 bool SetFeatherFall(
bool enable);
1174 bool SetHover(
bool enable,
bool updateAnimTier =
true);
1175 bool SetCollision(
bool disable);
1176 bool SetStrafingDisabled(
bool disable);
1177 bool SetJumpingDisabled(
bool disable);
1178 bool SetEnableFullSpeedTurning(
bool enable);
1179 bool SetEnableFullSpeedPitching(
bool enable);
1180 bool SetAlwaysAllowPitching(
bool enable);
1181 bool SetCanTransitionBetweenSwimAndFly(
bool enable);
1182 bool SetCanTurnWhileFalling(
bool enable);
1183 bool SetCanDoubleJump(
bool enable);
1184 bool SetDisableInertia(
bool disable);
1185 bool SetCanAdvFly(
bool enable);
1186 bool SetMoveCantSwim(
bool cantSwim);
1187 void SendSetVehicleRecId(
uint32 vehicleId);
1192 bool SetIgnoreMovementForces(
bool ignore);
1193 void UpdateMovementForcesModMagnitude();
1196 void RemoveInertia(
int32 id);
1198 void SetGravityModifier(
float gravityModifier);
1201 void SetFacingTo(
float ori,
bool force =
true,
uint32 movementId =
EVENT_FACE);
1203 void SetFacingToPoint(
Position const& point,
bool force =
true);
1225 Unit* GetDemonCreator()
const;
1226 Player* GetDemonCreatorPlayer()
const;
1235 Player* GetControllingPlayer()
const;
1240 Minion* GetFirstMinion()
const;
1243 void SetMinion(
Minion *minion,
bool apply);
1244 void GetAllMinionsByEntry(std::list<TempSummon*>& Minions,
uint32 entry);
1245 void RemoveAllMinionsByEntry(
uint32 entry);
1246 void SetCharm(
Unit* target,
bool apply);
1247 Unit* GetNextRandomRaidMemberOrPet(
float radius);
1249 void RemoveCharmedBy(
Unit* charmer);
1250 void RestoreFaction();
1253 Unit* GetFirstControlled()
const;
1254 void RemoveAllControlled();
1256 bool IsCharmed()
const {
return !GetCharmerGUID().IsEmpty(); }
1258 bool isPossessedByPlayer()
const;
1259 bool isPossessing()
const;
1260 bool isPossessing(
Unit* u)
const;
1264 void DeleteCharmInfo();
1269 void SetMovedUnit(
Unit* target);
1276 void AddPlayerToVision(
Player* player);
1277 void RemovePlayerFromVision(
Player* player);
1279 void RemoveBindSightAuras();
1280 void RemoveCharmAuras();
1297 void _ApplyAuraEffect(
Aura* aura,
uint8 effIndex);
1299 void _UnapplyAura(AuraApplicationMap::iterator& i,
AuraRemoveMode removeMode);
1301 void _RemoveNoStackAurasDueToAura(
Aura* aura,
bool owned);
1302 void _RegisterAuraEffect(
AuraEffect* aurEff,
bool apply);
1339 void RemoveNotOwnSingleTargetAuras(
bool onPhaseChange =
false);
1340 template <
typename InterruptFlags>
1341 void RemoveAurasWithInterruptFlags(InterruptFlags flag,
SpellInfo const* source =
nullptr);
1345 void RemoveMovementImpairingAuras(
bool withRoot);
1346 void RemoveAurasByShapeShift();
1348 void RemoveAreaAurasDueToLeaveWorld();
1349 void RemoveAllAuras();
1350 void RemoveArenaAuras();
1351 void RemoveAurasOnEvade();
1352 void RemoveAllAurasOnDeath();
1353 void RemoveAllAurasRequiringDeadTarget();
1354 void RemoveAllAurasExceptType(
AuraType type);
1356 void RemoveAllGroupBuffsFromCaster(
ObjectGuid casterGUID);
1359 void _RemoveAllAuraStatMods();
1360 void _ApplyAllAuraStatMods();
1375 AuraApplication* GetAuraApplication(std::function<
bool(
Aura const*)>
const& predicate)
const;
1378 Aura* GetAura(
uint32 spellId, std::function<
bool(
Aura const*)>
const& predicate)
const;
1379 Aura* GetAura(std::function<
bool(
Aura const*)>
const& predicate)
const;
1389 bool HasAura(std::function<
bool(
Aura const*)>
const& predicate)
const;
1390 bool HasAuraType(
AuraType auraType)
const;
1392 bool HasAuraTypeWithMiscvalue(
AuraType auraType,
int32 miscValue)
const;
1393 bool HasAuraTypeWithAffectMask(
AuraType auraType,
SpellInfo const* affectedSpell)
const;
1394 bool HasAuraTypeWithValue(
AuraType auraType,
int32 value)
const;
1395 bool HasAuraTypeWithTriggerSpell(
AuraType auratype,
uint32 triggerSpell)
const;
1396 template <
typename InterruptFlags>
1398 bool HasAuraWithMechanic(
uint64 mechanicMask)
const;
1399 bool HasStrongerAuraWithDR(
SpellInfo const* auraSpellInfo,
Unit* caster)
const;
1405 float GetTotalAuraModifier(
AuraType auraType)
const;
1406 float GetTotalAuraMultiplier(
AuraType auraType)
const;
1407 float GetMaxPositiveAuraModifier(
AuraType auraType)
const;
1408 float GetMaxNegativeAuraModifier(
AuraType auraType)
const;
1410 float GetTotalAuraModifier(
AuraType auraType, std::function<
bool(
AuraEffect const*)>
const& predicate)
const;
1411 float GetTotalAuraMultiplier(
AuraType auraType, std::function<
bool(
AuraEffect const*)>
const& predicate)
const;
1412 float GetMaxPositiveAuraModifier(
AuraType auraType, std::function<
bool(
AuraEffect const*)>
const& predicate)
const;
1413 float GetMaxNegativeAuraModifier(
AuraType auraType, std::function<
bool(
AuraEffect const*)>
const& predicate)
const;
1415 float GetTotalAuraModifierByMiscMask(
AuraType auraType,
uint32 misc_mask)
const;
1416 float GetTotalAuraMultiplierByMiscMask(
AuraType auraType,
uint32 misc_mask)
const;
1417 float GetMaxPositiveAuraModifierByMiscMask(
AuraType auraType,
uint32 misc_mask,
AuraEffect const* except =
nullptr)
const;
1418 float GetMaxNegativeAuraModifierByMiscMask(
AuraType auraType,
uint32 misc_mask)
const;
1420 float GetTotalAuraModifierByMiscValue(
AuraType auraType,
int32 misc_value)
const;
1421 float GetTotalAuraMultiplierByMiscValue(
AuraType auraType,
int32 misc_value)
const;
1422 float GetMaxPositiveAuraModifierByMiscValue(
AuraType auraType,
int32 misc_value)
const;
1423 float GetMaxNegativeAuraModifierByMiscValue(
AuraType auraType,
int32 misc_value)
const;
1425 float GetTotalAuraModifierByAffectMask(
AuraType auraType,
SpellInfo const* affectedSpell)
const;
1426 float GetTotalAuraMultiplierByAffectMask(
AuraType auraType,
SpellInfo const* affectedSpell)
const;
1427 float GetMaxPositiveAuraModifierByAffectMask(
AuraType auraType,
SpellInfo const* affectedSpell)
const;
1428 float GetMaxNegativeAuraModifierByAffectMask(
AuraType auraType,
SpellInfo const* affectedSpell)
const;
1430 void InitStatBuffMods();
1431 void UpdateStatBuffMod(
Stats stat);
1432 void UpdateStatBuffModForClient(
Stats stat);
1433 void SetCreateStat(
Stats stat,
float val);
1438 virtual int32 GetCreatePowerValue(
Powers power)
const;
1441 float GetCreateStat(
Stats stat)
const;
1446 SetUpdateFieldValue(m_values
1455 SetUpdateFieldValue(m_values
1463 void ClearChannelObjects();
1473 void SetCurrentCastSpell(
Spell* pSpell);
1474 void InterruptSpell(
CurrentSpellTypes spellType,
bool withDelayed =
true,
bool withInstant =
true,
1478 void CancelAutoRepeatSpell();
1483 bool IsNonMeleeSpellCast(
bool withDelayed,
bool skipChanneled =
false,
bool skipAutorepeat =
false,
bool isAutoshoot =
false,
1484 bool skipInstant =
true,
bool skipChanneledAllowingActions =
false)
const;
1488 void InterruptNonMeleeSpells(
bool withDelayed,
uint32 spellid = 0,
bool withInstant =
true);
1491 Spell* FindCurrentSpellBySpellId(
uint32 spell_id)
const;
1492 int32 GetCurrentSpellCastTime(
uint32 spell_id)
const;
1495 std::array<uint32, 5> VisitedSpells = { };
1496 bool AddSpell(
uint32 spellId);
1511 uint32 GetCastSpellXSpellVisualId(
SpellInfo const* spellInfo)
const override;
1514 virtual bool IsMovementPreventedByCasting()
const;
1515 bool CanCastSpellWhileMoving(
SpellInfo const* spellInfo)
const;
1532 bool IsInFeralForm()
const;
1534 bool IsInDisallowedMountForm()
const;
1556 void UpdateUnitMod(
UnitMods unitMod);
1565 void UpdateAllDamageDoneMods();
1568 void UpdateAllDamagePctDoneMods();
1570 float GetTotalStatValue(
Stats stat)
const;
1571 float GetTotalAuraModValue(
UnitMods unitMod)
const;
1578 virtual void UpdateResistances(
uint32 school);
1579 virtual void UpdateAllResistances();
1598 float GetTotalAttackPowerValue(
WeaponAttackType attType,
bool includeWeapon =
true)
const;
1605 bool isInFrontInMap(
Unit const* target,
float distance,
float arc =
float(
M_PI))
const;
1606 bool isInBackInMap(
Unit const* target,
float distance,
float arc =
float(
M_PI))
const;
1609 bool IsVisible()
const;
1610 void SetVisible(
bool x);
1613 virtual void OnPhaseChange();
1614 void UpdateObjectVisibility(
bool forced =
true)
override;
1630 m_interruptMask |=
flags;
1631 m_interruptMask2 |= flags2;
1633 void UpdateInterruptMask();
1636 virtual void RecalculateObjectScale();
1639 virtual void SetDisplayId(
uint32 displayId,
bool setNative =
false);
1642 void RestoreDisplayId(
bool ignorePositiveAurasPreventingMounting =
false);
1650 std::vector<DynamicObject*> GetDynObjects(
uint32 spellId)
const;
1651 void RemoveDynObject(
uint32 spellId);
1652 void RemoveAllDynObjects();
1655 std::vector<GameObject*> GetGameObjects(
uint32 spellId)
const;
1657 void RemoveGameObject(
GameObject* gameObj,
bool del);
1658 void RemoveGameObject(
uint32 spellid,
bool del);
1659 void RemoveAllGameObjects();
1662 void _RegisterAreaTrigger(
AreaTrigger* areaTrigger);
1663 void _UnregisterAreaTrigger(
AreaTrigger* areaTrigger);
1665 std::vector<AreaTrigger*> GetAreaTriggers(
uint32 spellId)
const;
1673 void RemoveAreaTrigger(
uint32 spellId);
1674 void RemoveAreaTrigger(
AuraEffect const* aurEff);
1675 void RemoveAllAreaTriggers(AreaTriggerRemoveReason reason = AreaTriggerRemoveReason::Default);
1681 void ExitAllAreaTriggers();
1684 uint32 BuildAuraStateUpdateForTarget(
Unit const* target)
const;
1686 void UnsummonAllTotems();
1687 bool IsMagnet()
const;
1688 Unit* GetMeleeHitRedirectTarget(
Unit* victim,
SpellInfo const* spellInfo =
nullptr);
1696 float SpellHealingPctDone(
Unit* victim,
SpellInfo const* spellProto)
const;
1701 float SpellAbsorbPctDone(
Unit* victim,
SpellInfo const* spellProto)
const;
1707 bool IsBlockCritical()
const;
1714 bool IsImmunedToSpell(
SpellInfo const* spellInfo,
uint32 effectMask,
WorldObject const* caster,
bool requireImmunityPurgesEffectAttribute =
false)
const;
1715 uint32 GetSchoolImmunityMask()
const;
1716 uint32 GetDamageImmunityMask()
const;
1717 uint64 GetMechanicImmunityMask()
const;
1722 virtual bool IsImmunedToSpellEffect(
SpellInfo const* spellInfo,
SpellEffectInfo const& spellEffectInfo,
WorldObject const* caster,
bool requireImmunityPurgesEffectAttribute =
false)
const;
1729 static void CalcAbsorbResist(
DamageInfo& damageInfo,
Spell* spell =
nullptr);
1730 static void CalcHealAbsorb(
HealInfo& healInfo);
1739 void SetFlightCapabilityID(
int32 flightCapabilityId,
bool clientUpdate);
1748 void RemoveAllFollowers();
1755 void StopMoving(
bool force =
false);
1756 void PauseMovement(
uint32 timer = 0,
uint8 slot = 0,
bool forced =
true);
1757 void ResumeMovement(
uint32 timer = 0,
uint8 slot = 0);
1765 bool IsSplineEnabled()
const;
1767 void SetControlled(
bool apply,
UnitState state);
1768 void ApplyControlStatesIfNeeded();
1772 void SendPetActionSound(
PetAction action)
const;
1773 void SendPetDismissSound()
const;
1774 void SendPetAIReaction(
ObjectGuid guid)
const;
1777 void PropagateSpeedChange();
1780 void ClearAllReactives();
1782 void UpdateReactives(
uint32 p_time);
1785 void UpdateAuraForGroup();
1789 void SetCantProc(
bool apply);
1796 bool CreateVehicleKit(
uint32 id,
uint32 creatureEntry,
bool loading =
false);
1797 void RemoveVehicleKit(
bool onRemoveFromWorld =
false);
1802 bool IsOnVehicle(
Unit const* vehicle)
const;
1803 Unit* GetVehicleBase()
const;
1804 Unit* GetVehicleRoot()
const;
1805 Creature* GetVehicleCreatureBase()
const;
1810 void HandleSpellClick(
Unit* clicker,
int8 seatId = -1);
1812 void EnterVehicle(
Unit* base,
int8 seatId = -1);
1813 virtual void ExitVehicle(
Position const* exitPosition =
nullptr);
1814 void ChangeSeat(
int8 seatId,
bool next =
true);
1817 void _ExitVehicle(
Position const* exitPosition =
nullptr);
1824 bool IsFalling()
const;
1826 virtual bool CanSwim()
const;
1834 void OutDebugInfo()
const;
1838 Pet*
ToPet() {
return IsPet() ?
reinterpret_cast<Pet*
>(
this) :
nullptr; }
1839 Pet const*
ToPet()
const {
return IsPet() ?
reinterpret_cast<Pet const*
>(
this) :
nullptr; }
1857 bool IsHighestExclusiveAura(
Aura const* aura,
bool removeOtherAuraApplications =
false);
1862 virtual void Yell(std::string_view text,
Language language,
WorldObject const* target =
nullptr);
1863 virtual void TextEmote(std::string_view text,
WorldObject const* target =
nullptr,
bool isBossEmote =
false);
1864 virtual void Whisper(std::string_view text,
Language language,
Player* target,
bool isBossWhisper =
false);
1868 virtual void TextEmote(
uint32 textId,
WorldObject const* target =
nullptr,
bool isBossEmote =
false);
1869 virtual void Whisper(
uint32 textId,
Player* target,
bool isBossWhisper =
false);
1878 float GetCollisionHeight()
const override;
1888 void AddWorldEffect(
int32 worldEffectId);
1889 void RemoveWorldEffect(
int32 worldEffectId);
1890 void ClearWorldEffects();
1893 void SetVignette(
uint32 vignetteId);
1900 explicit Unit (
bool isWorldObject);
1904 void DestroyForPlayer(
Player const* target)
const override;
1905 void ClearValuesChangesMask()
override;
1907 void _UpdateSpells(
uint32 time);
1908 void _DeleteRemovedAuras();
1910 void _UpdateAutoRepeatSpell();
1929 void RemoveGameObjectImpl(
GameObject* gameObj,
bool del);
1985 bool IsAlwaysVisibleFor(
WorldObject const* seer)
const override;
1986 bool IsAlwaysDetectableFor(
WorldObject const* seer)
const override;
1988 void DisableSpline();
1994 virtual void AtEnterCombat();
1995 virtual void AtExitCombat();
1997 virtual void AtEngage(
Unit* target);
2006 void UpdateSplineMovement(
uint32 t_diff);
2007 void UpdateSplinePosition();
2008 void SendFlightSplineSyncUpdate();
2009 void InterruptMovementBasedAuras();
2018 void SetFeared(
bool apply);
2019 void SetConfused(
bool apply);
2020 void SetStunned(
bool apply);
2021 void SetRooted(
bool apply);
2037 void UpdateCharmAI();
2038 void RestoreDisabledAI();
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::string GetDebugInfo()
@ MOVEMENTFLAG_MASK_MOVING
@ MOVEMENTFLAG_DISABLE_GRAVITY
@ MOVEMENTFLAG_MASK_TURNING
#define NOMINAL_MELEE_RANGE
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_FAILED_INTERRUPTED
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TRIGGERED_NONE
Not triggered.
@ UNIT_FLAG2_INTERACT_WHILE_HOSTILE
NPCFlags
Non Player Character flags.
@ UNIT_NPC_FLAG_TABARDDESIGNER
@ UNIT_NPC_FLAG_SPIRIT_HEALER
@ UNIT_NPC_FLAG_AUCTIONEER
@ UNIT_NPC_FLAG_AREA_SPIRIT_HEALER
@ UNIT_NPC_FLAG_BATTLEMASTER
@ UNIT_NPC_FLAG_QUESTGIVER
@ UNIT_NPC_FLAG_INNKEEPER
@ UNIT_NPC_FLAG_FLIGHTMASTER
@ UNIT_NPC_FLAG_PETITIONER
@ UNIT_NPC_FLAG_WILD_BATTLE_PET
@ UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT
@ UNIT_NPC_FLAG_2_AREA_SPIRIT_HEALER_INDIVIDUAL
@ UNIT_BYTE2_FLAG_FFA_PVP
@ UNIT_BYTE2_FLAG_SANCTUARY
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_UNINTERACTIBLE
std::unordered_multimap< uint32, uint32 > SpellImmuneContainer
@ UNIT_MASK_CONTROLABLE_GUARDIAN
@ UNIT_MOD_DAMAGE_OFFHAND
@ UNIT_MOD_STAT_INTELLECT
@ UNIT_MOD_RESISTANCE_SHADOW
@ UNIT_MOD_RESISTANCE_FROST
@ UNIT_MOD_RESISTANCE_HOLY
@ UNIT_MOD_RESISTANCE_START
@ UNIT_MOD_RESISTANCE_ARCANE
@ UNIT_MOD_ARCANE_CHARGES
@ UNIT_MOD_BURNING_EMBERS
@ UNIT_MOD_RESISTANCE_FIRE
@ UNIT_MOD_RESISTANCE_NATURE
@ UNIT_MOD_ALTERNATE_ENCOUNTER
@ UNIT_MOD_ALTERNATE_QUEST
@ UNIT_MOD_ALTERNATE_MOUNT
@ UNIT_MOD_RESISTANCE_END
@ UNIT_MOD_DAMAGE_MAINHAND
TC_GAME_API float playerBaseMoveSpeed[MAX_MOVE_TYPE]
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ISOLATED_DEPRECATED
@ UNIT_STATE_FOLLOW_FORMATION
@ UNIT_STATE_ATTACK_PLAYER
@ UNIT_STATE_ROAMING_MOVE
@ UNIT_STATE_UNATTACKABLE
@ UNIT_STATE_LOST_CONTROL
@ UNIT_STATE_ALL_STATE_SUPPORTED
@ UNIT_STATE_CANNOT_AUTOATTACK
@ UNIT_STATE_FOLLOW_FORMATION_MOVE
@ UNIT_STATE_FLEEING_MOVE
@ UNIT_STATE_CONFUSED_MOVE
@ UNIT_STATE_IGNORE_PATHFINDING
@ UNIT_STATE_MELEE_ATTACKING
@ UNIT_STATE_ALL_ERASABLE
std::list< Player * > SharedVisionList
@ OFFHAND_CRIT_PERCENTAGE
std::vector< DispelableAura > DispelChargesList
@ CR_VERSATILITY_DAMAGE_TAKEN
@ CR_RESILIENCE_PLAYER_DAMAGE
@ CR_VERSATILITY_HEALING_DONE
@ CR_CORRUPTION_RESISTANCE
@ CR_VERSATILITY_DAMAGE_DONE
@ CR_RESILIENCE_CRIT_TAKEN
ProcFlagsHit createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
std::list< Unit * > UnitList
#define REACTIVE_TIMER_START
TC_GAME_API float baseMoveSpeed[MAX_MOVE_TYPE]
T CalculatePct(T base, U pct)
uint32 const m_originalDamage
WeaponAttackType m_attackType
Unit * GetAttacker() const
SpellInfo const *const m_spellInfo
uint32 GetOriginalDamage() const
SpellInfo const * GetSpellInfo() const
DamageEffectType GetDamageType() const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
SpellSchoolMask const m_schoolMask
DamageEffectType const m_damageType
uint32 GetDispellerSpellId() const
DispelInfo(WorldObject *dispeller, uint32 dispellerSpellId, uint8 chargesRemoved)
WorldObject * GetDispeller() const
void SetRemovedCharges(uint8 amount)
uint8 GetRemovedCharges() const
bool DecrementCharge(uint8 charges)
uint8 GetDispelCharges() const
uint32 GetEffectiveHeal() const
SpellInfo const *const _spellInfo
SpellInfo const * GetSpellInfo() const
uint32 const _originalHeal
uint32 GetOriginalHeal() const
void SetEffectiveHeal(uint32 amount)
SpellSchoolMask GetSchoolMask() const
SpellSchoolMask const _schoolMask
static ObjectGuid const Empty
HealInfo * GetHealInfo() const
Unit * GetActionTarget() const
ProcFlagsSpellType GetSpellTypeMask() const
ProcFlagsSpellType _spellTypeMask
Spell const * GetProcSpell() const
Unit *const _actionTarget
ProcFlagsHit GetHitMask() const
ProcFlagsInit GetTypeMask() const
ProcFlagsSpellPhase GetSpellPhaseMask() const
DamageInfo * GetDamageInfo() const
ProcFlagsSpellPhase _spellPhaseMask
Utility class to enable range for loop syntax for multimap.equal_range uses.
Specialized variant of std::shared_ptr that enforces unique ownership and/or std::unique_ptr with std...
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
Unit * GetCharmed() const
void ClearUnitState(uint32 f)
uint32 GetChannelSpellId() const
int32 GetContentTuning() const
void SetLastDamagedTargetGuid(ObjectGuid guid)
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
void SetOverrideDisplayPowerId(uint32 powerDisplayId)
bool IsWithinMeleeRange(Unit const *obj) const
bool m_duringRemoveFromWorld
float GetBoundingRadius() const
Vehicle * GetVehicle() const
EnumFlag< SpellAuraInterruptFlags2 > m_interruptMask2
float GetPosStat(Stats stat) const
bool IsBattleMaster() const
std::list< GameObject * > GameObjectList
bool HasPetFlag(UnitPetFlag flags) const
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
void SetSilencedSchoolMask(SpellSchoolMask schoolMask)
std::unique_ptr< SpellHistory > _spellHistory
float GetHealthPct() const
uint32 GetChannelSpellXSpellVisualId() const
float m_baseSpellCritChance
uint32 m_lastSanctuaryTime
void SetOffHandWeaponAttackPower(int32 attackPower)
void SetStat(Stats stat, int32 val)
bool HasPvpFlag(UnitPVPStateFlags flags) const
void RemoveUnitMovementFlag(MovementFlags f)
uint64 CountPctFromCurHealth(float pct) const
LiquidTypeEntry const * _lastLiquid
bool IsGuildMaster() const
uint16 GetMovementAnimKitId() const override
AreaTriggerList m_areaTrigger
void AddUnitMovementFlag(MovementFlags f)
uint64 CountPctFromMaxHealth(float pct) const
bool IsInteractionAllowedInCombat() const
ObjectGuid GetDemonCreatorGUID() const
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
std::unique_ptr< MotionMaster > i_motionMaster
void SetUnitFlag3(UnitFlags3 flags)
void SetGender(Gender gender)
std::unordered_map< ObjectGuid, uint32 > extraAttacksTargets
std::array< uint32, MAX_REACTIVE > m_reactiveTimer
std::shared_ptr< UnitAI > i_AI
bool HasUnitFlag3(UnitFlags3 flags) const
void SetMinionGUID(ObjectGuid guid)
Diminishing m_Diminishing
bool IsTabardDesigner() const
void SetHoverHeight(float hoverHeight)
void ReplaceAllNpcFlags2(NPCFlags2 flags)
std::array< Spell *, CURRENT_MAX_SPELL > m_currentSpells
float GetDisplayScale() const
ThreatManager & GetThreatManager()
void ReplaceAllPvpFlags(UnitPVPStateFlags flags)
virtual float GetArmorMultiplierForTarget(WorldObject const *) const
void SetModRangedHaste(float rangedHaste)
void ApplyModManaCostModifier(SpellSchools school, int32 mod, bool apply)
void ReplaceAllUnitFlags3(UnitFlags3 flags)
virtual ClassPowerTypes GetPowerTypes() const =0
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
void SetLastExtraAttackSpell(uint32 spellId)
virtual void SetCanDualWield(bool value)
std::array< ObjectGuid, MAX_SUMMON_SLOT > m_SummonSlot
void SetArmor(int32 val, int32 bonusVal)
void SetVisFlag(UnitVisFlags flags)
void SetCreateHealth(uint32 val)
uint32 GetClassMask() const
virtual bool UpdateAllStats()=0
uint32 GetLastExtraAttackSpell() const
uint32 GetMountDisplayId() const
std::unique_ptr< CharmInfo > m_charmInfo
ThreatManager const & GetThreatManager() const
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Emote GetEmoteState() const
NPCFlags GetNpcFlags() const
void CancelTravelShapeshiftForm(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool force=false)
bool IsAreaSpiritHealer() const
ShapeshiftForm GetShapeshiftForm() const
void SetFaction(uint32 faction) override
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value)
ObjectGuid GetOwnerGUID() const override
void SetCosmeticMountDisplayId(uint32 mountDisplayId)
void RemoveNpcFlag2(NPCFlags2 flags)
bool HealthAbovePctHealed(float pct, uint32 heal) const
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
virtual SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType attackType=BASE_ATTACK) const =0
Unit * GetCharmer() const
std::forward_list< AuraEffect * > AuraEffectList
UnitPetFlag GetPetFlags() const
Trinity::unique_trackable_ptr< Vehicle > m_vehicleKit
std::vector< AreaTrigger * > AreaTriggerList
VisibleAuraContainer m_visibleAuras
uint32 GetCosmeticMountDisplayId() const
UnitPVPStateFlags GetPvpFlags() const
std::forward_list< AuraApplication * > AuraApplicationList
uint32 GetTransformSpell() const
void SetAttackPowerModNeg(int32 attackPowerMod)
bool IsAreaSpiritHealerIndividual() const
uint32 _lastExtraAttackSpell
virtual bool CanFly() const =0
void ReplaceAllUnitFlags(UnitFlags flags)
MotionMaster * GetMotionMaster()
AuraApplicationMap const & GetAppliedAuras() const
Powers GetPowerType() const
bool HasUnitFlag(UnitFlags flags) const
std::array< ObjectGuid, MAX_GAMEOBJECT_SLOT > m_ObjectSlot
ObjectGuid GetCharmedGUID() const
void SetCreatedBySpell(int32 spellId)
bool CanDualWield() const
bool CanInstantCast() const
void StartReactiveTimer(ReactiveType reactive)
NPCFlags2 GetNpcFlags2() const
bool HasInterruptFlag(SpellAuraInterruptFlags flags) const
void SetModHaste(float haste)
virtual void AtDisengage()
std::unique_ptr< MovementForces > _movementForces
MovementForces const * GetMovementForces() const
void SetChannelSpellId(uint32 channelSpellId)
MovementFlags GetUnitMovementFlags() const
virtual void SetImmuneToAll(bool apply)
uint32 GetDamageReduction(uint32 damage) const
std::array< float, MAX_STATS > m_floatStatPosBuff
bool IsFullHealth() const
void SetUnitFlag2(UnitFlags2 flags)
bool HasUnitFlag2(UnitFlags2 flags) const
bool IsInSanctuary() const
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
virtual bool IsLoading() const
void ReplaceAllPetFlags(UnitPetFlag flags)
void SetNpcFlag2(NPCFlags2 flags)
float GetNegStat(Stats stat) const
std::vector< DynamicObject * > DynObjectList
void SetDemonCreatorGUID(ObjectGuid guid)
bool HasVisibleAura(AuraApplication *aurApp) const
void SetPetNameTimestamp(uint32 timestamp)
std::array< uint32, MAX_ATTACK > m_baseAttackSpeed
void SetRangedWeaponAttackPower(int32 attackPower)
std::stack< std::shared_ptr< UnitAI > > UnitAIStack
Vignettes::VignetteData const * GetVignette() const
float m_modRangedHitChance
float GetCombatReach() const override
void ReplaceAllVisFlags(UnitVisFlags flags)
float GetAdvFlyingSpeedMax(AdvFlyingRateTypeRange speedType) const
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false)
void SetModCastingSpeedNeg(float castingSpeedNeg)
void SetBonusResistanceMod(SpellSchools school, int32 val)
void SetRangedAttackPowerModNeg(int32 attackPowerMod)
std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
void RemoveNpcFlag(NPCFlags flags)
int32 GetFlightCapabilityID() const
uint32 m_removedAurasCount
uint32 m_movementCounter
Incrementing counter used in movement packets.
void SetPetFlag(UnitPetFlag flags)
bool IsSilenced(SpellSchoolMask schoolMask) const
TempSummon * ToTempSummon()
bool IsGravityDisabled() const
bool IsQuestGiver() const
CharmInfo * GetCharmInfo()
bool HasStealthAura() const
void SetBattlePetCompanionExperience(uint32 experience)
void RemoveVisFlag(UnitVisFlags flags)
bool IsInCombatWith(Unit const *who) const
ObjectGuid GetCharmerOrOwnerGUID() const override
void RemoveUnitFlag3(UnitFlags3 flags)
AuraMap::iterator m_auraUpdateIterator
ObjectGuid _lastDamagedTargetGuid
void SetRangedAttackPowerModPos(int32 attackPowerMod)
void SetModHasteRegen(float hasteRegen)
float GetNativeDisplayScale() const
bool HasNpcFlag2(NPCFlags2 flags) const
float GetAdvFlyingSpeedMin(AdvFlyingRateTypeRange speedType) const
AnimTier GetAnimTier() const
std::set< Unit * > ControlList
bool HasInterruptFlag(SpellAuraInterruptFlags2 flags) const
TempSummon const * ToTempSummon() const
Player * GetPlayerMovingMe() const
void SetChannelVisual(SpellCastVisual channelVisual)
virtual bool HasSpell(uint32) const
virtual bool IsAffectedByDiminishingReturns() const
std::pair< AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator > AuraStateAurasMapBounds
void AddUnitState(uint32 f)
ObjectGuid GetCreatorGUID() const override
AreaTriggerList m_insideAreaTriggers
std::multimap< AuraStateType, AuraApplication * > AuraStateAurasMap
ObjectGuid GetLastDamagedTargetGuid() const
void SetUnitMovementFlags(MovementFlags f)
void SetBoundingRadius(float boundingRadius)
void SetCreateMana(uint32 val)
bool IsCharmedOwnedByPlayerOrPlayer() const
int32 GetMinPower(Powers power) const
bool IsImmuneToNPC() const
virtual bool CanEnterWater() const =0
Pet const * ToPet() const
Unit * EnsureVictim() const
uint32 getAttackTimer(WeaponAttackType type) const
void SetModSpellHaste(float spellHaste)
bool IsDuringRemoveFromWorld() const
bool m_ControlledByPlayer
void SetMainHandWeaponAttackPower(int32 attackPower)
Unit * GetCharmerOrOwner() const
virtual Gender GetNativeGender() const
bool IsPlayingHoverAnim() const
void SetBattlePetCompanionNameTimestamp(uint32 timestamp)
AuraMap const & GetOwnedAuras() const
void SetInstantCast(bool set)
void SetRangedAttackPowerMultiplier(float attackPowerMult)
virtual void SetImmuneToNPC(bool apply)
void SetCombatReach(float combatReach)
void SetChannelSpellData(uint32 startTimeMs, uint32 durationMs)
void SetEmoteState(Emote emote)
MotionMaster const * GetMotionMaster() const
int32 CountPctFromMaxPower(Powers power, int32 pct) const
bool IsImmuneToAll() const
PositionUpdateInfo _positionUpdateInfo
void SetPvpFlag(UnitPVPStateFlags flags)
AuraApplicationList m_interruptableAuras
void SetResistance(SpellSchools school, int32 val)
Trinity::unique_weak_ptr< Vehicle > GetVehicleKitWeakPtr() const
uint32 GetDisplayId() const
Unit * GetUnitBeingMoved() const
UnitAI * GetTopAI() const
uint32 GetNativeDisplayId() const
virtual void UpdateArmor()=0
uint64 GetMaxHealth() const
ThreatManager m_threatManager
uint32 _oldFactionId
faction before charm
std::forward_list< Aura * > AuraList
uint16 GetMeleeAnimKitId() const override
SpellHistory const * GetSpellHistory() const
ObjectGuid GetMinionGUID() const
uint32 GetChannelScriptVisualId() const
float GetHoverOffset() const
virtual float GetDamageMultiplierForTarget(WorldObject const *) const
SharedVisionList const & GetSharedVisionList()
uint16 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
virtual void UpdateMaxPower(Powers power)=0
uint32 GetFaction() const override
uint32 GetCreateHealth() const
AuraEffectList & GetAuraEffectsByType(AuraType type)
CombatManager const & GetCombatManager() const
AttackerSet const & getAttackers() const
void RemoveUnitFlag2(UnitFlags2 flags)
void RemovePvpFlag(UnitPVPStateFlags flags)
void SetSpellEmpowerStage(int8 stage)
std::multimap< uint32, Aura * > AuraMap
void SetNpcFlag(NPCFlags flags)
std::unique_ptr< Vignettes::VignetteData > m_vignette
bool HealthBelowPctDamaged(float pct, uint32 damage) const
int8 GetSpellEmpowerStage() const
Totem const * ToTotem() const
void AddInterruptMask(SpellAuraInterruptFlags flags, SpellAuraInterruptFlags2 flags2)
void RemovePetFlag(UnitPetFlag flags)
void setAttackTimer(WeaponAttackType type, uint32 time)
virtual bool UpdateStats(Stats stat)=0
bool HasNpcFlag(NPCFlags flags) const
std::array< DiminishingReturn, DIMINISHING_MAX > Diminishing
float m_modMeleeHitChance
virtual bool CheckAttackFitToAuraRequirement(WeaponAttackType, AuraEffect const *) const
ObjectGuid GetCritterGUID() const
void SetNameplateAttachToGUID(ObjectGuid guid)
uint8 GetLevelForTarget(WorldObject const *) const override
void SetFullPower(Powers power)
AuraList const & GetSingleCastAuras() const
bool CanModifyStats() const
Trinity::Containers::FlatSet< AuraApplication *, VisibleAuraSlotCompare > m_visibleAurasToUpdate
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage) const =0
void SetAttackPower(int32 attackPower)
float GetSpeedRate(UnitMoveType mtype) const
std::set< Unit * > AttackerSet
virtual void SetTarget(ObjectGuid const &)=0
virtual uint32 GetPowerIndex(Powers power) const =0
virtual float GetFollowAngle() const
std::vector< Unit * > UnitVector
UF::UpdateField< UF::UnitData, int32(WowCS::EntityFragment::CGObject), TYPEID_UNIT > m_unitData
void SetModTimeRate(float timeRate)
void SetBattlePetCompanionGUID(ObjectGuid guid)
DeathState getDeathState() const
int32 GetBonusResistanceMod(SpellSchools school) const
uint8 GetEffectiveLevel() const
std::set< AuraApplication *, VisibleAuraSlotCompare > VisibleAuraContainer
bool IsEngagedBy(Unit const *who) const
float GetAdvFlyingSpeed(AdvFlyingRateTypeSingle speedType) const
bool HealthAbovePct(float pct) const
virtual float GetHealthMultiplierForTarget(WorldObject const *) const
bool HealthBelowPct(float pct) const
uint16 _movementAnimKitId
bool HasUnitState(const uint32 f) const
std::unordered_set< AbstractFollower * > m_followingMe
std::unique_ptr< Movement::MoveSpline > movespline
float GetPowerPct(Powers power) const
void SetCanModifyStats(bool modifyStats)
std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
std::array< float, ADV_FLYING_MAX_SPEED_TYPE > m_advFlyingSpeed
AuraApplicationMap m_appliedAuras
void SetVehicle(Vehicle *vehicle)
void SetClass(uint8 classId)
virtual float GetNativeObjectScale() const
bool HasInvisibilityAura() const
int32 GetProcChainLength() const
bool HasUnitMovementFlag(MovementFlags f) const
virtual void UpdateMaxHealth()=0
uint16 GetAIAnimKitId() const override
uint32 HasUnitTypeMask(uint32 mask) const
std::array< float, MAX_MOVE_TYPE > m_speed_rate
float GetStat(Stats stat) const
bool IsInteractionAllowedWhileHostile() const
virtual float GetBlockPercent(uint8) const
SpellHistory * GetSpellHistory()
void ReplaceAllUnitFlags2(UnitFlags2 flags)
std::array< float, MAX_ATTACK > m_modAttackSpeedPct
bool IsControlledByPlayer() const
bool IsWildBattlePet() const
ObjectGuid GetCharmerGUID() const
bool IsCombatDisallowed() const
SheathState GetSheath() const
UnitStandStateType GetStandState() const
void SetPetGUID(ObjectGuid guid)
virtual bool HasSpellFocus(Spell const *=nullptr) const
bool HasSharedVision() const
std::vector< std::pair< uint32, AuraApplication * > > AuraApplicationProcContainer
void SetCreatorGUID(ObjectGuid creator)
ObjectGuid LastCharmerGUID
CombatManager & GetCombatManager()
void SetUnitFlag(UnitFlags flags)
void SetCritterGUID(ObjectGuid guid)
AuraApplicationMap & GetAppliedAuras()
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
bool IsUninteractible() const
void SetPetNumberForClient(uint32 petNumber)
bool IsSpiritHealer() const
uint32 GetCreateMana() const
std::array< uint32, MAX_ATTACK > m_attackTimer
CombatManager m_combatManager
void SetRangedAttackPower(int32 attackPower)
virtual void SetNativeGender(Gender gender)
AuraStateAurasMap m_auraStateAuras
int32 GetResistance(SpellSchools school) const
AuraList & GetSingleCastAuras()
void AddUnitTypeMask(uint32 mask)
void SetModCastingSpeed(float castingSpeed)
ObjectGuid GetBattlePetCompanionGUID() const
Vehicle * GetVehicleKit() const
virtual void SetImmuneToPC(bool apply)
float m_modSpellHitChance
void KillSelf(bool durabilityLoss=true, bool skipSettingDeathState=false)
std::vector< AreaTrigger * > const & GetInsideAreaTriggers() const
virtual bool IsEngaged() const
void ReplaceAllNpcFlags(NPCFlags flags)
uint32 GetBattlePetCompanionExperience() const
VisibleAuraContainer const & GetVisibleAuras() const
void SetAttackPowerMultiplier(float attackPowerMult)
void ReplaceAllSilencedSchoolMask(SpellSchoolMask schoolMask)
uint32 GetWildBattlePetLevel() const
AuraMap & GetOwnedAuras()
bool IsSpiritService() const
std::array< float, MAX_STATS > m_floatStatNegBuff
void SetTransformSpell(uint32 spellid)
bool IsImmuneToPC() const
void ApplyModManaCostMultiplier(float manaCostMultiplier, bool apply)
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
SharedVisionList m_sharedVision
EnumFlag< SpellAuraInterruptFlags > m_interruptMask
std::array< AuraEffectList, TOTAL_AURAS > m_modAuras
ObjectGuid GetTarget() const
bool _isWalkingBeforeCharm
Are we walking before we were charmed?
void SetAttackPowerModPos(int32 attackPowerMod)
void SetMountDisplayId(uint32 mountDisplayId)
void SetWildBattlePetLevel(uint32 wildBattlePetLevel)
void SetIsCombatDisallowed(bool apply)
bool IsThreatenedBy(Unit const *who) const
GetCastSpellInfoResult GetCastSpellInfo(SpellInfo const *spellInfo) const
void RemoveUnitFlag(UnitFlags flags)
uint32 GetBattlePetCompanionNameTimestamp() const
Player * m_playerMovingMe
ObjectGuid GetPetGUID() const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
WeaponAttackType AttackType
ProcFlagsInit ProcAttacker
MeleeHitOutcome HitOutCome
MeleeHitOutcome hitOutCome
CleanDamage(uint32 mitigated, uint32 absorbed, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome)
WeaponAttackType attackType
SpellCastVisual SpellVisual
SpellPeriodicAuraLogInfo(AuraEffect const *_auraEff, uint32 _damage, uint32 _originalDamage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
AuraEffect const * auraEff
UF::SpellCastVisual SpellVisual
UpdateField< uint32, 32, 37 > OverrideDisplayPowerID
UpdateFieldArray< int32, 7, 208, 216 > BonusResistanceMods
UpdateField< int32, 32, 62 > CosmeticMountDisplayID
UpdateField< int32, 64, 91 > AttackPower
UpdateField< float, 96, 111 > HoverHeight
UpdateField< uint8, 32, 34 > Sex
UpdateField< int32, 96, 117 > BattlePetCompanionExperience
UpdateField< float, 96, 100 > RangedAttackPowerMultiplier
UpdateField< float, 32, 54 > BoundingRadius
UpdateField< float, 96, 109 > ManaCostMultiplier
UpdateField< uint32, 32, 49 > Flags2
UpdateField< float, 64, 81 > ModHasteRegen
UpdateField< uint32, 32, 50 > Flags3
UpdateField< ObjectGuid, 128, 137 > NameplateAttachToGUID
UpdateField< uint8, 64, 70 > VisFlags
UpdateField< float, 64, 78 > ModSpellHaste
UpdateField< int32, 96, 103 > OffHandWeaponAttackPower
UpdateField< uint8, 0, 31 > ClassId
UpdateField< int32, 64, 92 > AttackPowerModPos
UpdateField< float, 64, 80 > ModRangedHaste
UpdateField< int32, 64, 86 > BaseHealth
UpdateFieldArray< int32, 7, 208, 209 > Resistances
UpdateField< int32, 96, 116 > WildBattlePetLevel
UpdateField< int32, 96, 97 > RangedAttackPower
UpdateField< int8, 0, 28 > SpellEmpowerStage
UpdateField< int32, 64, 85 > BaseMana
UpdateField< int32, 64, 93 > AttackPowerModNeg
UpdateField< ObjectGuid, 0, 19 > CreatedBy
UpdateField< uint32, 128, 133 > SilencedSchoolMask
UpdateField< UF::UnitChannel, 0, 27 > ChannelData
UpdateField< float, 64, 79 > ModHaste
UpdateField< int32, 64, 83 > CreatedBySpell
UpdateField< uint8, 0, 30 > Race
UpdateField< ObjectGuid, 0, 15 > Summon
UpdateField< uint32, 96, 118 > BattlePetCompanionNameTimestamp
UpdateField< int32, 96, 104 > RangedWeaponAttackPower
UpdateField< int32, 96, 98 > RangedAttackPowerModPos
UpdateField< uint32, 64, 72 > PetNumber
UpdateField< uint32, 0, 8 > NpcFlags2
UpdateFieldArray< int32, 7, 208, 223 > ManaCostModifier
UpdateField< int32, 32, 61 > MountDisplayID
UpdateField< float, 64, 94 > AttackPowerMultiplier
UpdateField< uint8, 64, 89 > PetFlags
UpdateFieldArray< int32, 5, 187, 188 > Stats
UpdateField< uint32, 64, 73 > PetNameTimestamp
UpdateField< ObjectGuid, 0, 23 > BattlePetCompanionGUID
UpdateField< int32, 32, 47 > FactionTemplate
UpdateField< ObjectGuid, 0, 16 > Critter
UpdateField< int32, 96, 102 > MainHandWeaponAttackPower
UpdateField< float, 64, 82 > ModTimeRate
UpdateField< int32, 64, 84 > EmoteState
UpdateField< float, 32, 55 > CombatReach
UpdateField< ObjectGuid, 0, 20 > DemonCreator
UpdateField< uint8, 64, 88 > PvpFlags
UpdateField< float, 64, 77 > ModCastingSpeedNeg
UpdateField< uint32, 0, 7 > NpcFlags
UpdateField< int32, 96, 99 > RangedAttackPowerModNeg
UpdateField< float, 64, 76 > ModCastingSpeed
UpdateField< uint32, 32, 48 > Flags
::SpellInfo const * SpellInfo
TriggerCastFlags TriggerFlag