public static bool FindLocation(ref int x, ref int y, ref int z, ref int facet) { Ultima.LocationPointer locationPointer = Client.LocationPointer; System.ProcessStream processStream = Client.ProcessStream; if (processStream == null || locationPointer == null) { return(false); } processStream.BeginAccess(); if (locationPointer.PointerX > 0) { processStream.Seek((long)locationPointer.PointerX, SeekOrigin.Begin); x = Client.Read(processStream, locationPointer.SizeX); } if (locationPointer.PointerY > 0) { processStream.Seek((long)locationPointer.PointerY, SeekOrigin.Begin); y = Client.Read(processStream, locationPointer.SizeY); } if (locationPointer.PointerZ > 0) { processStream.Seek((long)locationPointer.PointerZ, SeekOrigin.Begin); z = Client.Read(processStream, locationPointer.SizeZ); } if (locationPointer.PointerF > 0) { processStream.Seek((long)locationPointer.PointerF, SeekOrigin.Begin); facet = Client.Read(processStream, locationPointer.SizeF); } processStream.EndAccess(); return(true); }
public static void Calibrate(CalibrationInfo[] info) { Client.m_LocationPointer = null; System.ProcessStream processStream = Client.ProcessStream; if (processStream == null) { return; } int num = 0; int num1 = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; for (int i = 0; i < (int)info.Length; i++) { CalibrationInfo calibrationInfo = info[i]; int num8 = Client.Search(processStream, calibrationInfo.Mask, calibrationInfo.Vals); if (num8 != 0) { if (num == 0 && (int)calibrationInfo.DetX.Length > 0) { Client.GetCoordDetails(processStream, num8, calibrationInfo.DetX, out num, out num1); } if (num2 == 0 && (int)calibrationInfo.DetY.Length > 0) { Client.GetCoordDetails(processStream, num8, calibrationInfo.DetY, out num2, out num3); } if (num4 == 0 && (int)calibrationInfo.DetZ.Length > 0) { Client.GetCoordDetails(processStream, num8, calibrationInfo.DetZ, out num4, out num5); } if (num6 == 0 && (int)calibrationInfo.DetF.Length > 0) { Client.GetCoordDetails(processStream, num8, calibrationInfo.DetF, out num6, out num7); } if (num != 0 && num2 != 0 && num4 != 0 && num6 != 0) { break; } } } if (num != 0 || num2 != 0 || num4 != 0 || num6 != 0) { Client.m_LocationPointer = new Ultima.LocationPointer(num, num2, num4, num6, num1, num3, num5, num7); } }
public static void Calibrate(int x, int y, int z) { Client.m_LocationPointer = null; System.ProcessStream processStream = Client.ProcessStream; if (processStream == null) { return; } byte[] numArray = new byte[] { (byte)z, (byte)(z >> 8), (byte)(z >> 16), (byte)(z >> 24), (byte)y, (byte)(y >> 8), (byte)(y >> 16), (byte)(y >> 24), (byte)x, (byte)(x >> 8), (byte)(x >> 16), (byte)(x >> 24) }; int num = Client.Search(processStream, numArray); if (num == 0) { return; } Client.m_LocationPointer = new Ultima.LocationPointer(num + 8, num + 4, num, 0, 4, 4, 4, 0); }