Misc fixes/Misc DB updates
This commit is contained in:
@@ -147,6 +147,15 @@ namespace Framework.Constants
|
||||
ArenaSkirmish = 4
|
||||
}
|
||||
|
||||
public enum BattlegroundPointCaptureStatus
|
||||
{
|
||||
AllianceControlled,
|
||||
AllianceCapturing,
|
||||
Neutral,
|
||||
HordeCapturing,
|
||||
HordeControlled
|
||||
}
|
||||
|
||||
public enum BattlegroundQueueInvitationType
|
||||
{
|
||||
NoBalance = 0, // no balance: N+M vs N players
|
||||
|
||||
@@ -28,6 +28,13 @@ namespace Framework.Dynamic
|
||||
_values[i] = parts[i];
|
||||
}
|
||||
|
||||
public FlagArray128(int[] parts)
|
||||
{
|
||||
_values = new uint[4];
|
||||
for (var i = 0; i < parts.Length; ++i)
|
||||
_values[i] = (uint)parts[i];
|
||||
}
|
||||
|
||||
public bool IsEqual(params uint[] parts)
|
||||
{
|
||||
for (var i = 0; i < _values.Length; ++i)
|
||||
|
||||
@@ -855,7 +855,6 @@ namespace Game.BattleGrounds
|
||||
|
||||
RemovePlayer(player, guid, team); // BG subclass specific code
|
||||
|
||||
BattlegroundTypeId bgTypeId = GetTypeID();
|
||||
BattlegroundQueueTypeId bgQueueTypeId = GetQueueId();
|
||||
|
||||
if (participant) // if the player was a match participant, remove auras, calc rating, update queue
|
||||
@@ -867,8 +866,6 @@ namespace Game.BattleGrounds
|
||||
// if arena, remove the specific arena auras
|
||||
if (IsArena())
|
||||
{
|
||||
bgTypeId = BattlegroundTypeId.AA; // set the bg type to all arenas (it will be used for queue refreshing)
|
||||
|
||||
// unsummon current and summon old pet if there was one and there isn't a current pet
|
||||
player.RemovePet(null, PetSaveMode.NotInSlot);
|
||||
player.ResummonPetTemporaryUnSummonedIfAny();
|
||||
|
||||
@@ -20,6 +20,7 @@ using Framework.Constants;
|
||||
using System.Collections.Generic;
|
||||
using Game.Network.Packets;
|
||||
using Game.DataStorage;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
namespace Game.BattleGrounds.Zones
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Game.BattleGrounds.Zones
|
||||
public BgEyeofStorm(BattlegroundTemplate battlegroundTemplate) : base(battlegroundTemplate)
|
||||
{
|
||||
m_BuffChange = true;
|
||||
BgObjects = new ObjectGuid[ABObjectTypes.Max];
|
||||
BgObjects = new ObjectGuid[EotSObjectTypes.Max];
|
||||
BgCreatures= new ObjectGuid[EotSCreaturesTypes.Max];
|
||||
m_Points_Trigger[EotSPoints.FelReaver] = EotSPointsTrigger.FelReaverBuff;
|
||||
m_Points_Trigger[EotSPoints.BloodElf] = EotSPointsTrigger.BloodElfBuff;
|
||||
@@ -52,6 +53,7 @@ namespace Game.BattleGrounds.Zones
|
||||
m_PointOwnedByTeam[i] = Team.Other;
|
||||
m_PointState[i] = EotSPointState.Uncontrolled;
|
||||
m_PointBarStatus[i] = EotSProgressBarConsts.ProgressBarStateMiddle;
|
||||
m_LastPointCaptureStatus[i] = BattlegroundPointCaptureStatus.Neutral;
|
||||
}
|
||||
|
||||
for (byte i = 0; i < EotSPoints.PointsMax + 1; ++i)
|
||||
@@ -96,7 +98,7 @@ namespace Game.BattleGrounds.Zones
|
||||
/*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times
|
||||
but we can count of players on current point in CheckSomeoneLeftPoint
|
||||
*/
|
||||
CheckSomeoneJoinedPo();
|
||||
CheckSomeoneJoinedPoint();
|
||||
//check if player left point
|
||||
CheckSomeoneLeftPo();
|
||||
UpdatePointStatuses();
|
||||
@@ -161,7 +163,23 @@ namespace Game.BattleGrounds.Zones
|
||||
UpdateTeamScore(team_index);
|
||||
}
|
||||
|
||||
void CheckSomeoneJoinedPo()
|
||||
BattlegroundPointCaptureStatus GetPointCaptureStatus(uint point)
|
||||
{
|
||||
if (m_PointBarStatus[point] >= EotSProgressBarConsts.ProgressBarAliControlled)
|
||||
return BattlegroundPointCaptureStatus.AllianceControlled;
|
||||
|
||||
if (m_PointBarStatus[point] <= EotSProgressBarConsts.ProgressBarHordeControlled)
|
||||
return BattlegroundPointCaptureStatus.HordeControlled;
|
||||
|
||||
if (m_CurrentPointPlayersCount[2 * point] == m_CurrentPointPlayersCount[2 * point + 1])
|
||||
return BattlegroundPointCaptureStatus.Neutral;
|
||||
|
||||
return m_CurrentPointPlayersCount[2 * point] > m_CurrentPointPlayersCount[2 * point + 1]
|
||||
? BattlegroundPointCaptureStatus.AllianceCapturing
|
||||
: BattlegroundPointCaptureStatus.HordeCapturing;
|
||||
}
|
||||
|
||||
void CheckSomeoneJoinedPoint()
|
||||
{
|
||||
GameObject obj;
|
||||
for (byte i = 0; i < EotSPoints.PointsMax; ++i)
|
||||
@@ -244,52 +262,63 @@ namespace Game.BattleGrounds.Zones
|
||||
{
|
||||
for (byte point = 0; point < EotSPoints.PointsMax; ++point)
|
||||
{
|
||||
if (m_PlayersNearPoint[point].Empty())
|
||||
continue;
|
||||
//count new point bar status:
|
||||
m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < (int)EotSProgressBarConsts.PointMaxCapturersCount) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : (int)EotSProgressBarConsts.PointMaxCapturersCount;
|
||||
|
||||
if (m_PointBarStatus[point] > EotSProgressBarConsts.ProgressBarAliControlled)
|
||||
//point is fully alliance's
|
||||
m_PointBarStatus[point] = EotSProgressBarConsts.ProgressBarAliControlled;
|
||||
if (m_PointBarStatus[point] < EotSProgressBarConsts.ProgressBarHordeControlled)
|
||||
//point is fully horde's
|
||||
m_PointBarStatus[point] = EotSProgressBarConsts.ProgressBarHordeControlled;
|
||||
|
||||
uint pointOwnerTeamId;
|
||||
//find which team should own this point
|
||||
if (m_PointBarStatus[point] <= EotSProgressBarConsts.ProgressBarNeutralLow)
|
||||
pointOwnerTeamId = (uint)Team.Horde;
|
||||
else if (m_PointBarStatus[point] >= EotSProgressBarConsts.ProgressBarNeutralHigh)
|
||||
pointOwnerTeamId = (uint)Team.Alliance;
|
||||
else
|
||||
pointOwnerTeamId = (uint)Team.Other;
|
||||
|
||||
for (byte i = 0; i < m_PlayersNearPoint[point].Count; ++i)
|
||||
if (!m_PlayersNearPoint[point].Empty())
|
||||
{
|
||||
Player player = Global.ObjAccessor.FindPlayer(m_PlayersNearPoint[point][i]);
|
||||
if (player)
|
||||
//count new point bar status:
|
||||
int pointDelta = (int)(m_CurrentPointPlayersCount[2 * point]) - (int)(m_CurrentPointPlayersCount[2 * point + 1]);
|
||||
MathFunctions.RoundToInterval(ref pointDelta, -(int)EotSProgressBarConsts.PointMaxCapturersCount, EotSProgressBarConsts.PointMaxCapturersCount);
|
||||
m_PointBarStatus[point] += pointDelta;
|
||||
|
||||
if (m_PointBarStatus[point] > EotSProgressBarConsts.ProgressBarAliControlled)
|
||||
//point is fully alliance's
|
||||
m_PointBarStatus[point] = EotSProgressBarConsts.ProgressBarAliControlled;
|
||||
if (m_PointBarStatus[point] < EotSProgressBarConsts.ProgressBarHordeControlled)
|
||||
//point is fully horde's
|
||||
m_PointBarStatus[point] = EotSProgressBarConsts.ProgressBarHordeControlled;
|
||||
|
||||
uint pointOwnerTeamId;
|
||||
//find which team should own this point
|
||||
if (m_PointBarStatus[point] <= EotSProgressBarConsts.ProgressBarNeutralLow)
|
||||
pointOwnerTeamId = (uint)Team.Horde;
|
||||
else if (m_PointBarStatus[point] >= EotSProgressBarConsts.ProgressBarNeutralHigh)
|
||||
pointOwnerTeamId = (uint)Team.Alliance;
|
||||
else
|
||||
pointOwnerTeamId = (uint)EotSPointState.NoOwner;
|
||||
|
||||
for (byte i = 0; i < m_PlayersNearPoint[point].Count; ++i)
|
||||
{
|
||||
player.SendUpdateWorldState(EotSWorldStateIds.ProgressBarStatus, (uint)m_PointBarStatus[point]);
|
||||
//if point owner changed we must evoke event!
|
||||
if (pointOwnerTeamId != (uint)m_PointOwnedByTeam[point])
|
||||
Player player = Global.ObjAccessor.FindPlayer(m_PlayersNearPoint[point][i]);
|
||||
if (player)
|
||||
{
|
||||
//point was uncontrolled and player is from team which captured point
|
||||
if (m_PointState[point] == EotSPointState.Uncontrolled && (uint)player.GetTeam() == pointOwnerTeamId)
|
||||
EventTeamCapturedPoint(player, point);
|
||||
player.SendUpdateWorldState(EotSWorldStateIds.ProgressBarStatus, (uint)m_PointBarStatus[point]);
|
||||
//if point owner changed we must evoke event!
|
||||
if (pointOwnerTeamId != (uint)m_PointOwnedByTeam[point])
|
||||
{
|
||||
//point was uncontrolled and player is from team which captured point
|
||||
if (m_PointState[point] == EotSPointState.Uncontrolled && (uint)player.GetTeam() == pointOwnerTeamId)
|
||||
EventTeamCapturedPoint(player, point);
|
||||
|
||||
//point was under control and player isn't from team which controlled it
|
||||
if (m_PointState[point] == EotSPointState.UnderControl && player.GetTeam() != m_PointOwnedByTeam[point])
|
||||
EventTeamLostPoint(player, point);
|
||||
//point was under control and player isn't from team which controlled it
|
||||
if (m_PointState[point] == EotSPointState.UnderControl && player.GetTeam() != m_PointOwnedByTeam[point])
|
||||
EventTeamLostPoint(player, point);
|
||||
}
|
||||
|
||||
// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side.
|
||||
if (point == EotSPoints.FelReaver && m_PointOwnedByTeam[point] == player.GetTeam())
|
||||
if (m_FlagState != 0 && GetFlagPickerGUID() == player.GetGUID())
|
||||
if (player.GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f)
|
||||
EventPlayerCapturedFlag(player, EotSObjectTypes.FlagFelReaver);
|
||||
}
|
||||
|
||||
// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side.
|
||||
if (point == EotSPoints.FelReaver && m_PointOwnedByTeam[point] == player.GetTeam())
|
||||
if (m_FlagState != 0 && GetFlagPickerGUID() == player.GetGUID())
|
||||
if (player.GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f)
|
||||
EventPlayerCapturedFlag(player, EotSObjectTypes.FlagFelReaver);
|
||||
}
|
||||
}
|
||||
|
||||
BattlegroundPointCaptureStatus captureStatus = GetPointCaptureStatus(point);
|
||||
if (m_LastPointCaptureStatus[point] != captureStatus)
|
||||
{
|
||||
UpdateWorldState(EotSMisc.m_PointsIconStruct[point].WorldStateAllianceStatusBarIcon, (uint)(captureStatus == BattlegroundPointCaptureStatus.AllianceControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.AllianceCapturing ? 1 : 0)));
|
||||
UpdateWorldState(EotSMisc.m_PointsIconStruct[point].WorldStateHordeStatusBarIcon, (uint)(captureStatus == BattlegroundPointCaptureStatus.HordeControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.HordeCapturing ? 1 : 0)));
|
||||
m_LastPointCaptureStatus[point] = captureStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -811,6 +840,9 @@ namespace Game.BattleGrounds.Zones
|
||||
if (m_TeamPointsCount[team_id] > 0)
|
||||
AddPoints(player.GetTeam(), EotSMisc.FlagPoints[m_TeamPointsCount[team_id] - 1]);
|
||||
|
||||
UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateHorde, (int)EotSFlagState.OnBase);
|
||||
UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateAlliance, (int)EotSFlagState.OnBase);
|
||||
|
||||
UpdatePlayerScore(player, ScoreType.FlagCaptures, 1);
|
||||
}
|
||||
|
||||
@@ -860,14 +892,22 @@ namespace Game.BattleGrounds.Zones
|
||||
packet.AddState(0xAD2, 0x1);
|
||||
packet.AddState(0xAD1, 0x1);
|
||||
|
||||
packet.AddState(0xABE, (int)GetTeamScore(TeamId.Horde));
|
||||
packet.AddState(0xABD, (int)GetTeamScore(TeamId.Alliance));
|
||||
packet.AddState(EotSWorldStateIds.HordeResources, (int)GetTeamScore(TeamId.Horde));
|
||||
packet.AddState(EotSWorldStateIds.AllianceResources, (int)GetTeamScore(TeamId.Alliance));
|
||||
packet.AddState(EotSWorldStateIds.MaxResources, (int)EotSScoreIds.MaxTeamScore);
|
||||
|
||||
packet.AddState(0xA05, 0x8E);
|
||||
packet.AddState(0xAA0, 0x0);
|
||||
packet.AddState(0xA9F, 0x0);
|
||||
packet.AddState(0xA9E, 0x0);
|
||||
packet.AddState(0xC0D, 0x17B);
|
||||
|
||||
for (byte point = 0; point < EotSPoints.PointsMax; ++point)
|
||||
{
|
||||
BattlegroundPointCaptureStatus captureStatus = GetPointCaptureStatus(point);
|
||||
packet.AddState(EotSMisc.m_PointsIconStruct[point].WorldStateAllianceStatusBarIcon, captureStatus == BattlegroundPointCaptureStatus.AllianceControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.AllianceCapturing ? 1 : 0));
|
||||
packet.AddState(EotSMisc.m_PointsIconStruct[point].WorldStateHordeStatusBarIcon, captureStatus == BattlegroundPointCaptureStatus.HordeControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.HordeCapturing ? 1 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
public override WorldSafeLocsEntry GetClosestGraveYard(Player player)
|
||||
@@ -949,14 +989,10 @@ namespace Game.BattleGrounds.Zones
|
||||
public override ObjectGuid GetFlagPickerGUID(int team = -1) { return m_FlagKeeper; }
|
||||
void SetFlagPicker(ObjectGuid guid) { m_FlagKeeper = guid; }
|
||||
bool IsFlagPickedup() { return !m_FlagKeeper.IsEmpty(); }
|
||||
byte GetFlagState() { return (byte)m_FlagState; }
|
||||
|
||||
public override void SetDroppedFlagGUID(ObjectGuid guid, int TeamID = -1) { m_DroppedFlagGUID = guid; }
|
||||
ObjectGuid GetDroppedFlagGUID() { return m_DroppedFlagGUID; }
|
||||
|
||||
void RemovePo(Team TeamID, uint Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; }
|
||||
void SetTeamPo(Team TeamID, uint Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; }
|
||||
|
||||
uint[] m_HonorScoreTics = new uint[2];
|
||||
uint[] m_TeamPointsCount = new uint[2];
|
||||
|
||||
@@ -972,6 +1008,7 @@ namespace Game.BattleGrounds.Zones
|
||||
Team[] m_PointOwnedByTeam = new Team[EotSPoints.PointsMax];
|
||||
EotSPointState[] m_PointState = new EotSPointState[EotSPoints.PointsMax];
|
||||
EotSProgressBarConsts[] m_PointBarStatus = new EotSProgressBarConsts[EotSPoints.PointsMax];
|
||||
BattlegroundPointCaptureStatus[] m_LastPointCaptureStatus = new BattlegroundPointCaptureStatus[EotSPoints.PointsMax];
|
||||
List<ObjectGuid>[] m_PlayersNearPoint = new List<ObjectGuid>[EotSPoints.PointsMax + 1];
|
||||
byte[] m_CurrentPointPlayersCount = new byte[2 * EotSPoints.PointsMax];
|
||||
|
||||
@@ -1010,16 +1047,20 @@ namespace Game.BattleGrounds.Zones
|
||||
|
||||
struct BattlegroundEYPointIconsStruct
|
||||
{
|
||||
public BattlegroundEYPointIconsStruct(uint _WorldStateControlIndex, uint _WorldStateAllianceControlledIndex, uint _WorldStateHordeControlledIndex)
|
||||
public BattlegroundEYPointIconsStruct(uint worldStateControlIndex, uint worldStateAllianceControlledIndex, uint worldStateHordeControlledIndex, uint worldStateAllianceStatusBarIcon, uint worldStateHordeStatusBarIcon)
|
||||
{
|
||||
WorldStateControlIndex = _WorldStateControlIndex;
|
||||
WorldStateAllianceControlledIndex = _WorldStateAllianceControlledIndex;
|
||||
WorldStateHordeControlledIndex = _WorldStateHordeControlledIndex;
|
||||
WorldStateControlIndex = worldStateControlIndex;
|
||||
WorldStateAllianceControlledIndex = worldStateAllianceControlledIndex;
|
||||
WorldStateHordeControlledIndex = worldStateHordeControlledIndex;
|
||||
WorldStateAllianceStatusBarIcon = worldStateAllianceStatusBarIcon;
|
||||
WorldStateHordeStatusBarIcon = worldStateHordeStatusBarIcon;
|
||||
}
|
||||
|
||||
public uint WorldStateControlIndex;
|
||||
public uint WorldStateAllianceControlledIndex;
|
||||
public uint WorldStateHordeControlledIndex;
|
||||
public uint WorldStateAllianceStatusBarIcon;
|
||||
public uint WorldStateHordeStatusBarIcon;
|
||||
}
|
||||
|
||||
struct BattlegroundEYLosingPointStruct
|
||||
@@ -1090,10 +1131,10 @@ namespace Game.BattleGrounds.Zones
|
||||
|
||||
public static BattlegroundEYPointIconsStruct[] m_PointsIconStruct =
|
||||
{
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.FelReaverUncontrol, EotSWorldStateIds.FelReaverAllianceControl, EotSWorldStateIds.FelReaverHordeControl),
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.BloodElfUncontrol, EotSWorldStateIds.BloodElfAllianceControl, EotSWorldStateIds.BloodElfHordeControl),
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.DraeneiRuinsUncontrol, EotSWorldStateIds.DraeneiRuinsAllianceControl, EotSWorldStateIds.DraeneiRuinsHordeControl),
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.MageTowerUncontrol, EotSWorldStateIds.MageTowerAllianceControl, EotSWorldStateIds.MageTowerHordeControl)
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.FelReaverUncontrol, EotSWorldStateIds.FelReaverAllianceControl, EotSWorldStateIds.FelReaverHordeControl, EotSWorldStateIds.FelReaverAllianceControlState, EotSWorldStateIds.FelReaverHordeControlState),
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.BloodElfUncontrol, EotSWorldStateIds.BloodElfAllianceControl, EotSWorldStateIds.BloodElfHordeControl, EotSWorldStateIds.BloodElfAllianceControlState, EotSWorldStateIds.BloodElfHordeControlState),
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.DraeneiRuinsUncontrol, EotSWorldStateIds.DraeneiRuinsAllianceControl, EotSWorldStateIds.DraeneiRuinsHordeControl, EotSWorldStateIds.DraeneiRuinsAllianceControlState, EotSWorldStateIds.DraeneiRuinsHordeControlState),
|
||||
new BattlegroundEYPointIconsStruct(EotSWorldStateIds.MageTowerUncontrol, EotSWorldStateIds.MageTowerAllianceControl, EotSWorldStateIds.MageTowerHordeControl, EotSWorldStateIds.MageTowerAllianceControlState, EotSWorldStateIds.MageTowerHordeControlState)
|
||||
};
|
||||
public static BattlegroundEYLosingPointStruct[] m_LosingPointTypes =
|
||||
{
|
||||
@@ -1142,8 +1183,9 @@ namespace Game.BattleGrounds.Zones
|
||||
|
||||
struct EotSWorldStateIds
|
||||
{
|
||||
public const uint AllianceResources = 2749;
|
||||
public const uint HordeResources = 2750;
|
||||
public const uint AllianceResources = 1776;
|
||||
public const uint HordeResources = 1777;
|
||||
public const uint MaxResources = 1780;
|
||||
public const uint AllianceBase = 2752;
|
||||
public const uint HordeBase = 2753;
|
||||
public const uint DraeneiRuinsHordeControl = 2733;
|
||||
@@ -1163,8 +1205,17 @@ namespace Game.BattleGrounds.Zones
|
||||
public const uint ProgressBarShow = 2718; //1 Init; 0 Druhy Send - Bez Messagu; 1 = Controlled Aliance
|
||||
public const uint NetherstormFlag = 2757;
|
||||
//Set To 2 When Flag Is Picked Up; And To 1 If It Is Dropped
|
||||
public const uint NetherstormFlagStateAlliance = 2769;
|
||||
public const uint NetherstormFlagStateHorde = 2770;
|
||||
public const uint NetherstormFlagStateAlliance = 9808;
|
||||
public const uint NetherstormFlagStateHorde = 9809;
|
||||
|
||||
public const uint DraeneiRuinsHordeControlState = 17362;
|
||||
public const uint DraeneiRuinsAllianceControlState = 17366;
|
||||
public const uint MageTowerHordeControlState = 17361;
|
||||
public const uint MageTowerAllianceControlState = 17368;
|
||||
public const uint FelReaverHordeControlState = 17364;
|
||||
public const uint FelReaverAllianceControlState = 17367;
|
||||
public const uint BloodElfHordeControlState = 17363;
|
||||
public const uint BloodElfAllianceControlState = 17365;
|
||||
}
|
||||
|
||||
enum EotSProgressBarConsts
|
||||
|
||||
@@ -919,8 +919,6 @@ namespace Game.BattleGrounds.Zones
|
||||
ObjectGuid GetDroppedFlagGUID(Team team) { return m_DroppedFlagGUID[GetTeamIndexByTeamId(team)]; }
|
||||
|
||||
void AddPoint(Team team, uint Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] += Points; }
|
||||
void SetTeamPoint(Team team, uint Points = 0) { m_TeamScores[GetTeamIndexByTeamId(team)] = Points; }
|
||||
void RemovePoint(Team team, uint Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= Points; }
|
||||
|
||||
ObjectGuid[] m_FlagKeepers = new ObjectGuid[2]; // 0 - alliance, 1 - horde
|
||||
ObjectGuid[] m_DroppedFlagGUID = new ObjectGuid[2];
|
||||
|
||||
@@ -45,11 +45,10 @@ namespace Game.DataStorage
|
||||
{
|
||||
do
|
||||
{
|
||||
var id = result.Read<uint>(indexField == -1 ? 0 : indexField);
|
||||
|
||||
var obj = new T();
|
||||
|
||||
int dbIndex = 0;
|
||||
var fields = typeof(T).GetFields();
|
||||
foreach (var f in typeof(T).GetFields())
|
||||
{
|
||||
Type type = f.FieldType;
|
||||
@@ -81,6 +80,12 @@ namespace Game.DataStorage
|
||||
case TypeCode.UInt32:
|
||||
f.SetValue(obj, ReadArray<uint>(result, dbIndex, array.Length));
|
||||
break;
|
||||
case TypeCode.Int64:
|
||||
f.SetValue(obj, ReadArray<long>(result, dbIndex, array.Length));
|
||||
break;
|
||||
case TypeCode.UInt64:
|
||||
f.SetValue(obj, ReadArray<ulong>(result, dbIndex, array.Length));
|
||||
break;
|
||||
case TypeCode.Single:
|
||||
f.SetValue(obj, ReadArray<float>(result, dbIndex, array.Length));
|
||||
break;
|
||||
@@ -89,8 +94,18 @@ namespace Game.DataStorage
|
||||
break;
|
||||
case TypeCode.Object:
|
||||
if (arrayElementType == typeof(Vector3))
|
||||
f.SetValue(obj, new Vector3(ReadArray<float>(result, dbIndex, 3)));
|
||||
break;
|
||||
{
|
||||
float[] values = ReadArray<float>(result, dbIndex, array.Length * 3);
|
||||
|
||||
Vector3[] vectors = new Vector3[array.Length];
|
||||
for (var i = 0; i < array.Length; ++i)
|
||||
vectors[i] = new Vector3(values[(i * 3)..(3 + (i * 3))]);
|
||||
|
||||
f.SetValue(obj, vectors);
|
||||
|
||||
dbIndex += array.Length * 3;
|
||||
}
|
||||
continue;
|
||||
default:
|
||||
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", arrayElementType.Name);
|
||||
break;
|
||||
@@ -123,6 +138,12 @@ namespace Game.DataStorage
|
||||
case TypeCode.UInt32:
|
||||
f.SetValue(obj, result.Read<uint>(dbIndex++));
|
||||
break;
|
||||
case TypeCode.Int64:
|
||||
f.SetValue(obj, result.Read<long>(dbIndex++));
|
||||
break;
|
||||
case TypeCode.UInt64:
|
||||
f.SetValue(obj, result.Read<ulong>(dbIndex++));
|
||||
break;
|
||||
case TypeCode.Single:
|
||||
f.SetValue(obj, result.Read<float>(dbIndex++));
|
||||
break;
|
||||
@@ -150,7 +171,7 @@ namespace Game.DataStorage
|
||||
}
|
||||
else if (type == typeof(FlagArray128))
|
||||
{
|
||||
f.SetValue(obj, new FlagArray128(ReadArray<uint>(result, dbIndex, 4)));
|
||||
f.SetValue(obj, new FlagArray128(ReadArray<int>(result, dbIndex, 4)));
|
||||
dbIndex += 4;
|
||||
}
|
||||
break;
|
||||
@@ -161,6 +182,7 @@ namespace Game.DataStorage
|
||||
}
|
||||
}
|
||||
|
||||
var id = (uint)fields[indexField == -1 ? 0 : indexField].GetValue(obj);
|
||||
base[id] = obj;
|
||||
}
|
||||
while (result.NextRow());
|
||||
|
||||
@@ -439,6 +439,9 @@ namespace Game.DataStorage
|
||||
case TypeCode.UInt32:
|
||||
f.SetValue(obj, GetFieldValueArray<uint>(fieldIndex, atr.Length));
|
||||
break;
|
||||
case TypeCode.Int64:
|
||||
f.SetValue(obj, GetFieldValueArray<long>(fieldIndex, atr.Length));
|
||||
break;
|
||||
case TypeCode.UInt64:
|
||||
f.SetValue(obj, GetFieldValueArray<ulong>(fieldIndex, atr.Length));
|
||||
break;
|
||||
|
||||
@@ -79,13 +79,13 @@ namespace Game.DataStorage
|
||||
public ushort UwAmbience;
|
||||
public ushort ZoneMusic;
|
||||
public ushort UwZoneMusic;
|
||||
public byte ExplorationLevel;
|
||||
public sbyte ExplorationLevel;
|
||||
public ushort IntroSound;
|
||||
public uint UwIntroSound;
|
||||
public byte FactionGroupMask;
|
||||
public float AmbientMultiplier;
|
||||
public byte MountFlags;
|
||||
public ushort PvpCombastWorldStateID;
|
||||
public short PvpCombastWorldStateID;
|
||||
public byte WildBattlePetLevelMin;
|
||||
public byte WildBattlePetLevelMax;
|
||||
public byte WindSettingsID;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
public sealed class FactionRecord
|
||||
{
|
||||
public ulong[] ReputationRaceMask = new ulong[4];
|
||||
public long[] ReputationRaceMask = new long[4];
|
||||
public LocalizedString Name;
|
||||
public string Description;
|
||||
public uint Id;
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace Game.DataStorage
|
||||
public uint VendorStackCount;
|
||||
public float PriceVariance;
|
||||
public float PriceRandomValue;
|
||||
public uint[] Flags = new uint[4];
|
||||
public int[] Flags = new int[4];
|
||||
public int FactionRelated;
|
||||
public ushort ItemNameDescriptionID;
|
||||
public ushort RequiredTransmogHoliday;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Game.DataStorage
|
||||
|
||||
public sealed class PlayerConditionRecord
|
||||
{
|
||||
public ulong RaceMask;
|
||||
public long RaceMask;
|
||||
public string FailureDescription;
|
||||
public uint Id;
|
||||
public ushort MinLevel;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Game.DataStorage
|
||||
|
||||
public sealed class SkillLineAbilityRecord
|
||||
{
|
||||
public ulong RaceMask;
|
||||
public long RaceMask;
|
||||
public uint Id;
|
||||
public ushort SkillLine;
|
||||
public uint Spell;
|
||||
@@ -326,8 +326,8 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public byte DifficultyID;
|
||||
public short InterruptFlags;
|
||||
public uint[] AuraInterruptFlags = new uint[2];
|
||||
public uint[] ChannelInterruptFlags = new uint[2];
|
||||
public int[] AuraInterruptFlags = new int[2];
|
||||
public int[] ChannelInterruptFlags = new int[2];
|
||||
public uint SpellID;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public Vector3 AttachmentOffset;
|
||||
public Vector3 CameraOffset;
|
||||
public VehicleSeatFlags Flags;
|
||||
public VehicleSeatFlagsB FlagsB;
|
||||
public int Flags;
|
||||
public int FlagsB;
|
||||
public int FlagsC;
|
||||
public sbyte AttachmentID;
|
||||
public float EnterPreDelay;
|
||||
@@ -111,17 +111,27 @@ namespace Game.DataStorage
|
||||
|
||||
public bool CanEnterOrExit()
|
||||
{
|
||||
return (Flags.HasAnyFlag(VehicleSeatFlags.CanEnterOrExit) ||
|
||||
return (HasSeatFlag(VehicleSeatFlags.CanEnterOrExit) ||
|
||||
//If it has anmation for enter/ride, means it can be entered/exited by logic
|
||||
Flags.HasAnyFlag(VehicleSeatFlags.HasLowerAnimForEnter | VehicleSeatFlags.HasLowerAnimForRide));
|
||||
HasSeatFlag(VehicleSeatFlags.HasLowerAnimForEnter | VehicleSeatFlags.HasLowerAnimForRide));
|
||||
}
|
||||
public bool CanSwitchFromSeat() { return (Flags & VehicleSeatFlags.CanSwitch) != 0; }
|
||||
public bool CanSwitchFromSeat() { return Flags.HasAnyFlag((int)VehicleSeatFlags.CanSwitch); }
|
||||
public bool IsUsableByOverride()
|
||||
{
|
||||
return Flags.HasAnyFlag(VehicleSeatFlags.Uncontrolled | VehicleSeatFlags.Unk18)
|
||||
|| FlagsB.HasAnyFlag(VehicleSeatFlagsB.UsableForced | VehicleSeatFlagsB.UsableForced2 |
|
||||
return HasSeatFlag(VehicleSeatFlags.Uncontrolled | VehicleSeatFlags.Unk18)
|
||||
|| HasSeatFlag(VehicleSeatFlagsB.UsableForced | VehicleSeatFlagsB.UsableForced2 |
|
||||
VehicleSeatFlagsB.UsableForced3 | VehicleSeatFlagsB.UsableForced4);
|
||||
}
|
||||
public bool IsEjectable() { return FlagsB.HasAnyFlag(VehicleSeatFlagsB.Ejectable); }
|
||||
public bool IsEjectable() { return HasSeatFlag(VehicleSeatFlagsB.Ejectable); }
|
||||
|
||||
public bool HasSeatFlag(VehicleSeatFlags flag)
|
||||
{
|
||||
return Flags.HasAnyFlag((int)flag);
|
||||
}
|
||||
|
||||
public bool HasSeatFlag(VehicleSeatFlagsB flag)
|
||||
{
|
||||
return FlagsB.HasAnyFlag((int)flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1600,7 +1600,7 @@ namespace Game.Entities
|
||||
|
||||
void LearnSkillRewardedSpells(uint skillId, uint skillValue)
|
||||
{
|
||||
ulong raceMask = GetRaceMask();
|
||||
long raceMask = GetRaceMask();
|
||||
uint classMask = GetClassMask();
|
||||
|
||||
List<SkillLineAbilityRecord> skillLineAbilities = Global.DB2Mgr.GetSkillLineAbilitiesBySkill(skillId);
|
||||
|
||||
@@ -6352,11 +6352,11 @@ namespace Game.Entities
|
||||
if (exploration_percent < 0)
|
||||
exploration_percent = 0;
|
||||
|
||||
XP = (uint)(Global.ObjectMgr.GetBaseXP(areaEntry.ExplorationLevel) * exploration_percent / 100 * WorldConfig.GetFloatValue(WorldCfg.RateXpExplore));
|
||||
XP = (uint)(Global.ObjectMgr.GetBaseXP((byte)areaEntry.ExplorationLevel) * exploration_percent / 100 * WorldConfig.GetFloatValue(WorldCfg.RateXpExplore));
|
||||
}
|
||||
else
|
||||
{
|
||||
XP = (uint)(Global.ObjectMgr.GetBaseXP(areaEntry.ExplorationLevel) * WorldConfig.GetFloatValue(WorldCfg.RateXpExplore));
|
||||
XP = (uint)(Global.ObjectMgr.GetBaseXP((byte)areaEntry.ExplorationLevel) * WorldConfig.GetFloatValue(WorldCfg.RateXpExplore));
|
||||
}
|
||||
|
||||
GiveXP(XP, null);
|
||||
@@ -7220,7 +7220,7 @@ namespace Game.Entities
|
||||
}
|
||||
public bool IsSpellFitByClassAndRace(uint spell_id)
|
||||
{
|
||||
ulong racemask = GetRaceMask();
|
||||
long racemask = GetRaceMask();
|
||||
uint classmask = GetClassMask();
|
||||
|
||||
var bounds = Global.SpellMgr.GetSkillLineAbilityMapBounds(spell_id);
|
||||
|
||||
@@ -2904,7 +2904,7 @@ namespace Game.Entities
|
||||
uint mechanicMask = spellProto.GetAllEffectsMechanicMask();
|
||||
|
||||
// Shred, Maul - "Effects which increase Bleed damage also increase Shred damage"
|
||||
if (spellProto.SpellFamilyName == SpellFamilyNames.Druid && spellProto.SpellFamilyFlags[0].HasAnyFlag<uint>(0x00008800))
|
||||
if (spellProto.SpellFamilyName == SpellFamilyNames.Druid && spellProto.SpellFamilyFlags[0].HasAnyFlag(0x00008800u))
|
||||
mechanicMask |= (1 << (int)Mechanics.Bleed);
|
||||
|
||||
if (mechanicMask != 0)
|
||||
|
||||
@@ -2092,7 +2092,7 @@ namespace Game.Entities
|
||||
|
||||
public Race GetRace() { return (Race)(byte)m_unitData.Race; }
|
||||
public void SetRace(Race race) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Race), (byte)race); }
|
||||
public ulong GetRaceMask() { return 1ul << ((int)GetRace() - 1); }
|
||||
public long GetRaceMask() { return 1L << ((int)GetRace() - 1); }
|
||||
public Class GetClass() { return (Class)(byte)m_unitData.ClassId; }
|
||||
public void SetClass(Class classId) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ClassId), (byte)classId); }
|
||||
public uint GetClassMask() { return (uint)(1 << ((int)GetClass() - 1)); }
|
||||
|
||||
@@ -348,16 +348,16 @@ namespace Game.Entities
|
||||
_me.AddNpcFlag(_me.IsTypeId(TypeId.Player) ? NPCFlags.PlayerVehicle : NPCFlags.SpellClick);
|
||||
|
||||
// Enable gravity for passenger when he did not have it active before entering the vehicle
|
||||
if (seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.DisableGravity) && !seat.Value.Passenger.IsGravityDisabled)
|
||||
if (seat.Value.SeatInfo.HasSeatFlag(VehicleSeatFlags.DisableGravity) && !seat.Value.Passenger.IsGravityDisabled)
|
||||
unit.SetDisableGravity(false);
|
||||
|
||||
// Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle
|
||||
if (seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.PassengerNotSelectable) && !seat.Value.Passenger.IsUnselectable)
|
||||
if (seat.Value.SeatInfo.HasSeatFlag(VehicleSeatFlags.PassengerNotSelectable) && !seat.Value.Passenger.IsUnselectable)
|
||||
unit.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
|
||||
seat.Value.Passenger.Reset();
|
||||
|
||||
if (_me.IsTypeId(TypeId.Unit) && unit.IsTypeId(TypeId.Player) && seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.CanControl))
|
||||
if (_me.IsTypeId(TypeId.Unit) && unit.IsTypeId(TypeId.Player) && seat.Value.SeatInfo.HasSeatFlag(VehicleSeatFlags.CanControl))
|
||||
_me.RemoveCharmedBy(unit);
|
||||
|
||||
if (_me.IsInWorld)
|
||||
@@ -591,14 +591,14 @@ namespace Game.Entities
|
||||
player.StopCastingCharm();
|
||||
player.StopCastingBindSight();
|
||||
player.SendOnCancelExpectedVehicleRideAura();
|
||||
if (!veSeat.FlagsB.HasAnyFlag(VehicleSeatFlagsB.KeepPet))
|
||||
if (!veSeat.HasSeatFlag(VehicleSeatFlagsB.KeepPet))
|
||||
player.UnsummonPetTemporaryIfAny();
|
||||
}
|
||||
|
||||
if (veSeat.Flags.HasAnyFlag(VehicleSeatFlags.DisableGravity))
|
||||
if (veSeat.HasSeatFlag(VehicleSeatFlags.DisableGravity))
|
||||
Passenger.SetDisableGravity(true);
|
||||
|
||||
if (Seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.PassengerNotSelectable))
|
||||
if (Seat.Value.SeatInfo.HasSeatFlag(VehicleSeatFlags.PassengerNotSelectable))
|
||||
Passenger.AddUnitFlag(UnitFlags.NotSelectable);
|
||||
|
||||
Passenger.m_movementInfo.transport.pos.Relocate(veSeat.AttachmentOffset.X, veSeat.AttachmentOffset.Y, veSeat.AttachmentOffset.Z);
|
||||
@@ -607,7 +607,7 @@ namespace Game.Entities
|
||||
Passenger.m_movementInfo.transport.guid = Target.GetBase().GetGUID();
|
||||
|
||||
if (Target.GetBase().IsTypeId(TypeId.Unit) && Passenger.IsTypeId(TypeId.Player) &&
|
||||
Seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.CanControl))
|
||||
Seat.Value.SeatInfo.HasSeatFlag(VehicleSeatFlags.CanControl))
|
||||
Cypher.Assert(Target.GetBase().SetCharmedBy(Passenger, CharmType.Vehicle)); // SMSG_CLIENT_CONTROL
|
||||
|
||||
Passenger.SendClearTarget(); // SMSG_BREAK_TARGET
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Game
|
||||
{
|
||||
VehicleSeatRecord seat = vehicle.GetSeatForPassenger(GetPlayer());
|
||||
Cypher.Assert(seat != null);
|
||||
if (!seat.Flags.HasAnyFlag(VehicleSeatFlags.CanAttack))
|
||||
if (!seat.HasSeatFlag(VehicleSeatFlags.CanAttack))
|
||||
{
|
||||
SendAttackStop(enemy);
|
||||
return;
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Game
|
||||
VehicleSeatRecord seat = vehicle.GetSeatForPassenger(mover);
|
||||
if (seat != null)
|
||||
{
|
||||
if (seat.Flags.HasAnyFlag(VehicleSeatFlags.AllowTurning))
|
||||
if (seat.HasSeatFlag(VehicleSeatFlags.AllowTurning))
|
||||
{
|
||||
if (movementInfo.Pos.GetOrientation() != mover.GetOrientation())
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Game
|
||||
if (factionEntry == null)
|
||||
return 0;
|
||||
|
||||
ulong raceMask = _player.GetRaceMask();
|
||||
long raceMask = _player.GetRaceMask();
|
||||
uint classMask = _player.GetClassMask();
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -149,7 +149,7 @@ namespace Game
|
||||
if (factionEntry == null)
|
||||
return 0;
|
||||
|
||||
ulong raceMask = _player.GetRaceMask();
|
||||
long raceMask = _player.GetRaceMask();
|
||||
uint classMask = _player.GetClassMask();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
@@ -190,9 +190,8 @@ namespace Game.Spells
|
||||
if (_interrupt != null)
|
||||
{
|
||||
InterruptFlags = (SpellInterruptFlags)_interrupt.InterruptFlags;
|
||||
// TODO: 6.x these flags have 2 parts
|
||||
AuraInterruptFlags = _interrupt.AuraInterruptFlags;
|
||||
ChannelInterruptFlags = _interrupt.ChannelInterruptFlags;
|
||||
Array.Copy(_interrupt.AuraInterruptFlags, AuraInterruptFlags, 2);
|
||||
Array.Copy(_interrupt.ChannelInterruptFlags, ChannelInterruptFlags, 2);
|
||||
}
|
||||
|
||||
// SpellLevelsEntry
|
||||
@@ -1271,11 +1270,11 @@ namespace Game.Spells
|
||||
|
||||
var vehicleSeat = vehicle.GetSeatForPassenger(caster);
|
||||
if (!HasAttribute(SpellAttr6.CastableWhileOnVehicle) && !HasAttribute(SpellAttr0.CastableWhileMounted)
|
||||
&& (vehicleSeat.Flags & checkMask) != checkMask)
|
||||
&& (vehicleSeat.Flags & (int)checkMask) != (int)checkMask)
|
||||
return SpellCastResult.CantDoThatRightNow;
|
||||
|
||||
// Can only summon uncontrolled minions/guardians when on controlled vehicle
|
||||
if (vehicleSeat.Flags.HasAnyFlag((VehicleSeatFlags.CanControl | VehicleSeatFlags.Unk2)))
|
||||
if (vehicleSeat.HasSeatFlag(VehicleSeatFlags.CanControl | VehicleSeatFlags.Unk2))
|
||||
{
|
||||
foreach (SpellEffectInfo effect in GetEffectsForDifficulty(caster.GetMap().GetDifficultyID()))
|
||||
{
|
||||
|
||||
@@ -3640,7 +3640,7 @@ namespace Game.Entities
|
||||
return false;
|
||||
|
||||
if (raceMask != 0) // not in expected race
|
||||
if (player == null || !Convert.ToBoolean(raceMask & player.GetRaceMask()))
|
||||
if (player == null || !Convert.ToBoolean(raceMask & (ulong)player.GetRaceMask()))
|
||||
return false;
|
||||
|
||||
if (areaId != 0) // not in expected zone
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `hotfix_blob` ADD COLUMN `VerifiedBuild` INT(11) NOT NULL DEFAULT '0' AFTER `Blob`;
|
||||
ALTER TABLE `hotfix_data` ADD COLUMN `VerifiedBuild` INT(11) NOT NULL DEFAULT '0' AFTER `Deleted`;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user