Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -86,10 +86,7 @@ namespace Server.Items
if (map == null || map == Map.Internal)
return Point3D.Zero;
int xCenter, yCenter;
int xWidth, yHeight;
if (!ComputeMapDetails(map, 0, 0, out xCenter, out yCenter, out xWidth, out yHeight))
if (!ComputeMapDetails(map, 0, 0, out int xCenter, out int yCenter, out int xWidth, out int yHeight))
return Point3D.Zero;
double absLong = xLong + (double)xMins / 60;
@ -101,10 +98,8 @@ namespace Server.Items
if (!ySouth)
absLat = 360.0 - absLat;
int x, y, z;
x = xCenter + (int)(absLong * xWidth / 360);
y = yCenter + (int)(absLat * yHeight / 360);
int x = xCenter + (int)(absLong * xWidth / 360);
int y = yCenter + (int)(absLat * yHeight / 360);
if (x < 0)
x += xWidth;
@ -116,7 +111,7 @@ namespace Server.Items
else if (y >= yHeight)
y -= yHeight;
z = map.GetAverageZ(x, y);
int z = map.GetAverageZ(x, y);
return new Point3D(x, y, z);
}
@ -128,10 +123,8 @@ namespace Server.Items
return false;
int x = p.X, y = p.Y;
int xCenter, yCenter;
int xWidth, yHeight;
if (!ComputeMapDetails(map, x, y, out xCenter, out yCenter, out xWidth, out yHeight))
if (!ComputeMapDetails(map, x, y, out int xCenter, out int yCenter, out int xWidth, out int yHeight))
return false;
double absLong = (double)((x - xCenter) * 360) / xWidth;

View file

@ -38,7 +38,7 @@ namespace Server.Items
#region IShipwreckedItem Members
public bool IsShipwreckedItem
bool IShipwreckedItem.IsShipwreckedItem
{
get => true;
set { }

View file

@ -163,8 +163,10 @@ namespace Server.Items
Effects.SendLocationEffect(p, map, 0x352D, 16, 4);
Effects.PlaySound(p, map, 0x364);
Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 14, new TimerStateCallback(DoEffect),
new object[] { p, 0, from });
int index = 0;
Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 14,
() => DoEffect(from, p, index++));
from.SendLocalizedMessage(RequireDeepWater
? 1010487
@ -178,19 +180,11 @@ namespace Server.Items
}
}
private void DoEffect(object state)
private void DoEffect(Mobile from, Point3D p, int index)
{
if (Deleted)
return;
object[] states = (object[])state;
Point3D p = (Point3D)states[0];
int index = (int)states[1];
Mobile from = (Mobile)states[2];
states[1] = ++index;
if (index == 1)
{
Effects.SendLocationEffect(p, Map, 0x352D, 16, 4);