public void LoadMapPieces() { string FilePath = Path.Combine(Folder, "mappieces.csv"); if (!File.Exists(FilePath)) { return; } int x, y; using (FileStream Stream = File.OpenRead(FilePath)) { using (StreamReader Reader = new StreamReader(Stream)) { Reader.ReadLine(); string Line = null; while ((Line = Reader.ReadLine()) != null) { string[] Datas = Line.Split(','); MapPiece Piece = new MapPiece(); Piece.ZoneId = ZoneId; Piece.Id = byte.Parse(Datas[0]); Piece.PositionX = ushort.Parse(Datas[1]); Piece.PositionY = ushort.Parse(Datas[2]); Piece.SizeX = ushort.Parse(Datas[3]); Piece.SizeY = ushort.Parse(Datas[4]); FilePath = Path.Combine(Folder, "piece" + String.Format("{0:00}", Piece.Id) + ".jpg"); using (Bitmap Map = new Bitmap(FilePath)) { Piece.Colors = new System.Drawing.Color[Map.Width, Map.Height]; for (x = 0; x < Map.Width; ++x) { for (y = 0; y < Map.Height; ++y) { Piece.Colors[x, y] = Map.GetPixel(x, y); } } } Pieces.Add(Piece); Piece.Area = GetArea(Piece.Id); } } } }
public override void OnRangeUpdate() { if (CurrentPiece == null || !CurrentPiece.IsOn((ushort)(X / 64), (ushort)(Y / 64), Zone.ZoneId)) { CurrentPiece = Zone.ClientInfo.GetWorldPiece((ushort)X, (ushort)Y, Zone.ZoneId); if (CurrentPiece != null) { if (CurrentPiece.Area != null) { TokInterface.AddTok(CurrentPiece.Area.TokExploreEntry); } if (CurrentPiece.IsPvp((byte)Realm)) { CbtInterface.EnablePvp(); } } } }
public void LoadMapPieces() { string FilePath = Path.Combine(Folder, "mappieces.csv"); if (!File.Exists(FilePath)) return; int x, y; using (FileStream Stream = File.OpenRead(FilePath)) { using (StreamReader Reader = new StreamReader(Stream)) { Reader.ReadLine(); string Line = null; while ((Line = Reader.ReadLine()) != null) { string[] Datas = Line.Split(','); MapPiece Piece = new MapPiece(); Piece.ZoneId = ZoneId; Piece.Id = byte.Parse(Datas[0]); Piece.PositionX = ushort.Parse(Datas[1]); Piece.PositionY = ushort.Parse(Datas[2]); Piece.SizeX = ushort.Parse(Datas[3]); Piece.SizeY = ushort.Parse(Datas[4]); FilePath = Path.Combine(Folder, "piece" + String.Format("{0:00}", Piece.Id) + ".jpg"); using (Bitmap Map = new Bitmap(FilePath)) { Piece.Colors = new System.Drawing.Color[Map.Width, Map.Height]; for (x = 0; x < Map.Width; ++x) { for (y = 0; y < Map.Height; ++y) { Piece.Colors[x, y] = Map.GetPixel(x, y); } } } Pieces.Add(Piece); Piece.Area = GetArea(Piece.Id); } } } }
public override void OnRangeUpdate() { if (CurrentPiece == null || !CurrentPiece.IsOn((ushort)(X / 64), (ushort)(Y / 64), Zone.ZoneId)) { CurrentPiece = Zone.ClientInfo.GetWorldPiece((ushort)X, (ushort)Y, Zone.ZoneId); if (CurrentPiece != null) { if (CurrentPiece.Area != null) TokInterface.AddTok(CurrentPiece.Area.TokExploreEntry); if (CurrentPiece.IsPvp((byte)Realm)) CbtInterface.EnablePvp(); } } }
public override void OnRangeUpdate() { if (CurrentPiece == null || !CurrentPiece.IsOn((ushort)(X / 64), (ushort)(Y / 64), Zone.ZoneId)) { CurrentPiece = Zone.ClientInfo.GetWorldPiece((ushort)X, (ushort)Y, Zone.ZoneId); if (CurrentPiece != null) { if (Realm == GameData.Realms.REALMS_REALM_DESTRUCTION && CurrentPiece.DestruArea != null) TokInterface.AddTok(CurrentPiece.DestruArea.TokExploreEntry); if (Realm == GameData.Realms.REALMS_REALM_ORDER && CurrentPiece.OrderArea != null) TokInterface.AddTok(CurrentPiece.OrderArea.TokExploreEntry); if (CurrentPiece.IsPvp((byte)Realm)) CbtInterface.EnablePvp(); } } }