Merge branch 'master' into Playerbot

# Conflicts:
#	src/server/game/World/World.h
This commit is contained in:
郑佩茹
2023-02-09 12:40:25 -07:00
1253 changed files with 114535 additions and 40950 deletions

View File

@@ -1415,8 +1415,10 @@ public:
[[nodiscard]] bool IsTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
[[nodiscard]] bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
/// @deprecated Use GetLevel() instead!
[[nodiscard]] uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
[[nodiscard]] uint8 GetLevel() const { return getLevel(); }
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); }
void SetLevel(uint8 lvl, bool showLevelChange = true);
[[nodiscard]] uint8 getRace(bool original = false) const;
void setRace(uint8 race);
@@ -1458,7 +1460,7 @@ public:
void setPowerType(Powers power);
[[nodiscard]] uint32 GetPower(Powers power) const { return GetUInt32Value(static_cast<uint16>(UNIT_FIELD_POWER1) + power); }
[[nodiscard]] uint32 GetMaxPower(Powers power) const { return GetUInt32Value(static_cast<uint16>(UNIT_FIELD_MAXPOWER1) + power); }
void SetPower(Powers power, uint32 val, bool withPowerUpdate = true);
void SetPower(Powers power, uint32 val, bool withPowerUpdate = true, bool fromRegenerate = false);
void SetMaxPower(Powers power, uint32 val);
// returns the change in power
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate = true);
@@ -1543,10 +1545,11 @@ public:
void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0);
void Dismount();
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : GetLevel()) * 5; }
static void DealDamageMods(Unit const* victim, uint32& damage, uint32* absorb);
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = nullptr, bool durabilityLoss = true, bool allowGM = false, Spell const* spell = nullptr);
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr, Spell const* spell = nullptr);
void KillSelf(bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr, Spell const* spell = nullptr) { Kill(this, this, durabilityLoss, attackType, spellProto, spell); };
static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth);
static void ProcDamageAndSpell(Unit* actor, Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpellInfo = nullptr, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/);
@@ -1631,7 +1634,7 @@ public:
return value;
}
uint32 GetUnitMeleeSkill(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
uint32 GetUnitMeleeSkill(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : GetLevel()) * 5; }
uint32 GetDefenseSkillValue(Unit const* target = nullptr) const;
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = nullptr) const;
[[nodiscard]] float GetWeaponProcChance() const;
@@ -1711,7 +1714,7 @@ public:
bool isTargetableForAttack(bool checkFakeDeath = true, Unit const* byWho = nullptr) const;
bool IsValidAttackTarget(Unit const* target) 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;
@@ -2162,6 +2165,8 @@ public:
void AddInterruptMask(uint32 mask) { m_interruptMask |= mask; }
void UpdateInterruptMask();
virtual float GetNativeObjectScale() const { return 1.0f; }
virtual void RecalculateObjectScale();
[[nodiscard]] uint32 GetDisplayId() const { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
virtual void SetDisplayId(uint32 modelId);
[[nodiscard]] uint32 GetNativeDisplayId() const { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }
@@ -2278,7 +2283,7 @@ public:
[[nodiscard]] uint16 GetExtraUnitMovementFlags() const { return m_movementInfo.flags2; }
void SetExtraUnitMovementFlags(uint16 f) { m_movementInfo.flags2 = f; }
void SetControlled(bool apply, UnitState state);
void SetControlled(bool apply, UnitState state, Unit* source = nullptr, bool isFear = false);
void DisableRotate(bool apply);
void DisableSpline();
@@ -2303,7 +2308,7 @@ public:
void SendPetAIReaction(ObjectGuid guid);
///----------End of Pet responses methods----------
void propagateSpeedChange() { GetMotionMaster()->PropagateSpeedChange(); }
void propagateSpeedChange() { GetMotionMaster()->propagateSpeedChange(); }
// reactive attacks
void ClearAllReactives();
@@ -2334,7 +2339,7 @@ public:
void CastPetAura(PetAura const* aura);
bool IsPetAura(Aura const* aura);
[[nodiscard]] uint32 GetModelForForm(ShapeshiftForm form) const;
[[nodiscard]] uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const;
uint32 GetModelForTotem(PlayerTotemType totemType);
// Redirect Threat
@@ -2559,7 +2564,7 @@ private:
[[nodiscard]] uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
protected:
void SetFeared(bool apply);
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);