public void CheckArea(Zone_Area Area) { if (!Area.IsLoaded()) { Area.Information.Loaded = true; string FileName = Program.Config.ZoneFolder + "zone" + String.Format("{0:000}", ZoneID) + "/piece" + String.Format("{0:00}", Area.Information.PieceId) + ".jpg"; try { Area.Information.File = new Bitmap(FileName); } catch (Exception e) { Log.Error("AreaMapMgr", "Invalid Piece File : " + FileName + "\n" + e.ToString()); } } }
static public void AddZoneArea(Zone_Area Area) { List<Zone_Area> Areas; if (!_Zone_Area.TryGetValue(Area.ZoneId, out Areas)) { Areas = new List<Zone_Area>(); _Zone_Area.Add(Area.ZoneId, Areas); } Areas.Add(Area); }
public bool IsOnExploreArea(Zone_Area Area, ushort PinX, ushort PinY) { if (Area == null || Area.Information == null) return false; if (!Area.IsOnArea(PinX, PinY)) return false; CheckArea(Area); if(Area.Information.File == null) return false; PinX = (ushort)(PinX / 64); PinY = (ushort)(PinY / 64); PinX -= Area.Information.OffsetX; PinY -= Area.Information.OffsetY; if (PinX >= Area.Information.Width || PinY >= Area.Information.Height || PinX < 0 || PinY < 0) { Log.Error("IsOnExplore", "PinX=" + PinX + ",PinY=" + PinY+",ZoneId="+Area.ZoneId+",Piece="+Area.PieceId); return false; } System.Drawing.Color Col = Area.Information.File.GetPixel(PinX, PinY); if (Col.R == 255 && Col.G == 255 && Col.B == 255) return false; return true; }