Core/Players: Fixed base hit chance initialization for players

Port From (https://github.com/TrinityCore/TrinityCore/commit/1f8eddc4f0cf443c45a930bc919007541210984a)
This commit is contained in:
hondacrx
2023-08-28 11:19:01 -04:00
parent c9ab9e4635
commit 8bef51cf6e
4 changed files with 13 additions and 12 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ namespace Game.Entities
{
public partial class Player
{
public WorldSession GetSession() { return Session; }
public WorldSession GetSession() { return _session; }
public PlayerSocial GetSocial() { return m_social; }
//Gossip
@@ -179,7 +179,7 @@ namespace Game.Entities
WorldLocation _corpseLocation;
//Core
WorldSession Session;
WorldSession _session;
public PlayerData m_playerData;
public ActivePlayerData m_activePlayerData;
+1 -1
View File
@@ -6204,7 +6204,7 @@ namespace Game.Entities
public void SendLoot(Loot loot, bool aeLooting = false)
{
if (!GetLootGUID().IsEmpty() && !aeLooting)
Session.DoLootReleaseAll();
_session.DoLootReleaseAll();
Log.outDebug(LogFilter.Loot, $"Player::SendLoot: Player: '{GetName()}' ({GetGUID()}), Loot: {loot.GetOwnerGUID()}");
+7 -3
View File
@@ -41,7 +41,11 @@ namespace Game.Entities
m_playerData = new PlayerData();
m_activePlayerData = new ActivePlayerData();
Session = session;
_session = session;
ModMeleeHitChance = 7.5f;
ModRangedHitChance = 7.5f;
ModSpellHitChance = 15.0f;
// players always accept
if (!GetSession().HasPermission(RBACPermissions.CanFilterWhispers))
@@ -809,7 +813,7 @@ namespace Game.Entities
//Network
public void SendPacket(ServerPacket data)
{
Session.SendPacket(data);
_session.SendPacket(data);
}
public DeclinedName GetDeclinedNames() { return _declinedname; }
@@ -6383,7 +6387,7 @@ namespace Game.Entities
}
public void SendSysMessage(string str, params object[] args)
{
new CommandHandler(Session).SendSysMessage(string.Format(str, args));
new CommandHandler(_session).SendSysMessage(string.Format(str, args));
}
public void SendBuyError(BuyResult msg, Creature creature, uint item)
{
+3 -6
View File
@@ -60,12 +60,9 @@ namespace Game.Entities
for (byte i = 0; i < (int)WeaponAttackType.Max; ++i)
m_weaponDamage[i] = new float[] { 1.0f, 2.0f };
if (IsTypeId(TypeId.Player))
{
ModMeleeHitChance = 7.5f;
ModRangedHitChance = 7.5f;
ModSpellHitChance = 15.0f;
}
ModMeleeHitChance = 0.0f;
ModRangedHitChance = 0.0f;
ModSpellHitChance = 0.0f;
BaseSpellCritChance = 5;
for (byte i = 0; i < (int)UnitMoveType.Max; ++i)