Core/DataStores: Updated db2 structures to 8.2.5

Port From (https://github.com/TrinityCore/TrinityCore/commit/3ac790287aba5f7d7c3bccf79e608de9119e461a)
This commit is contained in:
hondacrx
2019-10-29 13:09:23 -04:00
parent c6e53b2ba7
commit e95115dc94
54 changed files with 4589 additions and 349 deletions
+7 -6
View File
@@ -550,7 +550,7 @@ namespace Game.Chat
static bool HandleDebugNearGraveyard(StringArguments args, CommandHandler handler)
{
Player player = handler.GetSession().GetPlayer();
WorldSafeLocsRecord nearestLoc = null;
WorldSafeLocsEntry nearestLoc = null;
if (args.NextString().Equals("linked"))
{
@@ -573,22 +573,23 @@ namespace Game.Chat
float z = player.GetPositionZ();
float distNearest = float.MaxValue;
foreach (var loc in CliDB.WorldSafeLocsStorage.Values)
foreach (var pair in Global.ObjectMgr.GetWorldSafeLocs())
{
if (loc.MapID == player.GetMapId())
var worldSafe = pair.Value;
if (worldSafe.Loc.GetMapId() == player.GetMapId())
{
float dist = (loc.Loc.X - x) * (loc.Loc.X - x) + (loc.Loc.Y - y) * (loc.Loc.Y - y) + (loc.Loc.Z - z) * (loc.Loc.Z - z);
float dist = (worldSafe.Loc.GetPositionX() - x) * (worldSafe.Loc.GetPositionX() - x) + (worldSafe.Loc.GetPositionY() - y) * (worldSafe.Loc.GetPositionY() - y) + (worldSafe.Loc.GetPositionZ() - z) * (worldSafe.Loc.GetPositionZ() - z);
if (dist < distNearest)
{
distNearest = dist;
nearestLoc = loc;
nearestLoc = worldSafe;
}
}
}
}
if (nearestLoc != null)
handler.SendSysMessage(CypherStrings.CommandNearGraveyard, nearestLoc.Id, nearestLoc.Loc.X, nearestLoc.Loc.Y, nearestLoc.Loc.Z);
handler.SendSysMessage(CypherStrings.CommandNearGraveyard, nearestLoc.Id, nearestLoc.Loc.GetPositionX(), nearestLoc.Loc.GetPositionY(), nearestLoc.Loc.GetPositionZ());
else
handler.SendSysMessage(CypherStrings.CommandNearGraveyardNotfound);
+4 -4
View File
@@ -113,16 +113,16 @@ namespace Game.Chat.Commands
if (graveyardId == 0)
return false;
WorldSafeLocsRecord gy = CliDB.WorldSafeLocsStorage.LookupByKey(graveyardId);
WorldSafeLocsEntry gy = Global.ObjectMgr.GetWorldSafeLoc(graveyardId);
if (gy == null)
{
handler.SendSysMessage(CypherStrings.CommandGraveyardnoexist, graveyardId);
return false;
}
if (!GridDefines.IsValidMapCoord(gy.MapID, gy.Loc.X, gy.Loc.Y, gy.Loc.Z))
if (!GridDefines.IsValidMapCoord(gy.Loc))
{
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, gy.Loc.X, gy.Loc.Y, gy.MapID);
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, gy.Loc.GetPositionX(), gy.Loc.GetPositionY(), gy.Loc.GetMapId());
return false;
}
@@ -136,7 +136,7 @@ namespace Game.Chat.Commands
else
player.SaveRecallPosition();
player.TeleportTo(gy.MapID, gy.Loc.X, gy.Loc.Y, gy.Loc.Z, (gy.Facing * MathFunctions.PI) / 180); // Orientation is initially in degrees
player.TeleportTo(gy.Loc);
return true;
}
+2 -2
View File
@@ -1069,7 +1069,7 @@ namespace Game.Chat
else
return false;
WorldSafeLocsRecord graveyard = CliDB.WorldSafeLocsStorage.LookupByKey(graveyardId);
WorldSafeLocsEntry graveyard = Global.ObjectMgr.GetWorldSafeLoc(graveyardId);
if (graveyard == null)
{
handler.SendSysMessage(CypherStrings.CommandGraveyardnoexist, graveyardId);
@@ -1112,7 +1112,7 @@ namespace Game.Chat
Player player = handler.GetSession().GetPlayer();
uint zone_id = player.GetZoneId();
WorldSafeLocsRecord graveyard = Global.ObjectMgr.GetClosestGraveYard(player, team, null);
WorldSafeLocsEntry graveyard = Global.ObjectMgr.GetClosestGraveYard(player, team, null);
if (graveyard != null)
{
uint graveyardId = graveyard.Id;