diff --git a/Server.MirForms/Server.csproj b/Server.MirForms/Server.csproj
index 939b7e78c..fe7fb60b8 100644
--- a/Server.MirForms/Server.csproj
+++ b/Server.MirForms/Server.csproj
@@ -29,7 +29,7 @@
-
+
diff --git a/Server/MirEnvir/Map.cs b/Server/MirEnvir/Map.cs
index 9e4f2dcfb..87846cae6 100644
--- a/Server/MirEnvir/Map.cs
+++ b/Server/MirEnvir/Map.cs
@@ -1,5 +1,5 @@
using System.Drawing;
-using Server.MirDatabase;
+using Server.MirDatabase;
using Server.MirObjects;
using Shared;
using S = ServerPackets;
@@ -41,6 +41,8 @@ protected static MessageQueue MessageQueue
public List Conquest = new List();
public ConquestObject tempConquest;
+ public readonly MapGrid mapGrid = new();
+
public Map(MapInfo info)
{
Info = info;
@@ -57,7 +59,7 @@ public Door AddDoor(byte DoorIndex, Point location)
Doors.Add(DoorInfo);
return DoorInfo;
}
-
+
public bool OpenDoor(byte DoorIndex)
{
for (int i = 0; i < Doors.Count; i++)
@@ -150,7 +152,7 @@ private void LoadMapCellsv0(byte[] fileBytes)
Cells[x, y].FishingAttribute = (sbyte)(light - 100);
}
}
-
+
private void LoadMapCellsv1(byte[] fileBytes)
{
int offSet = 21;
@@ -426,7 +428,7 @@ private void LoadMapCellsV100(byte[] Bytes)
if (light >= 100 && light <= 119)
Cells[x, y].FishingAttribute = (sbyte)(light - 100);
}
-
+
}
public bool Load()
@@ -437,7 +439,7 @@ public bool Load()
if (File.Exists(fileName))
{
byte[] fileBytes = File.ReadAllBytes(fileName);
- switch(FindType(fileBytes))
+ switch (FindType(fileBytes))
{
case 0:
LoadMapCellsv0(fileBytes);
@@ -469,7 +471,7 @@ public bool Load()
}
GetWalkableCells();
-
+
for (int i = 0; i < Info.Respawns.Count; i++)
{
MapRespawn info = new MapRespawn(Info.Respawns[i]);
@@ -570,14 +572,14 @@ private void CreateSafeZone(SafeZoneInfo info)
if (!Cells[x, y].Valid) continue;
SpellObject spell = new SpellObject
- {
- ExpireTime = long.MaxValue,
- Value = 25,
- TickSpeed = 2000,
- Spell = Spell.Healing,
- CurrentLocation = new Point(x, y),
- CurrentMap = this
- };
+ {
+ ExpireTime = long.MaxValue,
+ Value = 25,
+ TickSpeed = 2000,
+ Spell = Spell.Healing,
+ CurrentLocation = new Point(x, y),
+ CurrentMap = this
+ };
Cells[x, y].Add(spell);
@@ -601,7 +603,7 @@ private void CreateMine()
Settings.MineSetList[Info.MineIndex - 1].SetDrops(Envir.ItemInfoList);
for (int i = 0; i < Width; i++)
for (int j = 0; j < Height; j++)
- Mine[i,j].Mine = Settings.MineSetList[Info.MineIndex - 1];
+ Mine[i, j].Mine = Settings.MineSetList[Info.MineIndex - 1];
}
if (Info.MineZones.Count > 0)
{
@@ -611,7 +613,7 @@ private void CreateMine()
if (Zone.Mine != 0)
Settings.MineSetList[Zone.Mine - 1].SetDrops(Envir.ItemInfoList);
if (Settings.MineSetList.Count < Zone.Mine) continue;
- for (int x = Zone.Location.X - Zone.Size; x < Zone.Location.X + Zone.Size; x++)
+ for (int x = Zone.Location.X - Zone.Size; x < Zone.Location.X + Zone.Size; x++)
for (int y = Zone.Location.Y - Zone.Size; y < Zone.Location.Y + Zone.Size; y++)
{
if ((x < 0) || (x >= Width) || (y < 0) || (y >= Height)) continue;
@@ -673,7 +675,7 @@ public void Process()
Point location;
if (Envir.Random.Next(4) == 0)
{
- location = player.CurrentLocation;
+ location = player.CurrentLocation;
}
else
location = new Point(player.CurrentLocation.X - 10 + Envir.Random.Next(20), player.CurrentLocation.Y - 10 + Envir.Random.Next(20));
@@ -799,7 +801,7 @@ public void Process(DelayedAction action)
case DelayedType.Spawn:
MapObject obj = (MapObject)action.Params[0];
- switch(obj.Race)
+ switch (obj.Race)
{
case ObjectType.Monster:
{
@@ -820,11 +822,11 @@ public void Process(DelayedAction action)
}
}
- /**
- * return the coordinates of effect coordinates within an n x n square (n should be odd number. i.e. 3x3, 5x5, 7x7)
- * then use GetCell() in Map.cs to retrive real objects
- * default 3x3
- */
+ /**
+ * return the coordinates of effect coordinates within an n x n square (n should be odd number. i.e. 3x3, 5x5, 7x7)
+ * then use GetCell() in Map.cs to retrive real objects
+ * default 3x3
+ */
public static List GetPointsInEffectiveSquare(Point location, int mapWidth, int mapHeight, int squareEdgeLength = 3)
{
var pointsWithinTheMap = new List();
@@ -833,7 +835,8 @@ public static List GetPointsInEffectiveSquare(Point location, int mapWidt
if (squareEdgeLength > 1)
{
spread = (int)((squareEdgeLength - 1) / 2);
- } else
+ }
+ else
{
spread = fallBackSpread; // 3x3
}
@@ -1468,25 +1471,25 @@ private void CompleteMagic(IList