Hello everyone,
Since neobot has been buried and we could back to tibia development, ive decide to start a new project after all. My libraries was a few years old, but wasnt that hard to update them all, with a single exception, my map reader isnt working anymore.
Can someone tell me what is wrong with this code? Maybe some increase in distances or change map structure?
PHP Code:
public int GetPlayerTile() {
var MapPointerAddr = 0x9E6E88; //version 9.44
var PlayerId = Player.Id;
var MapBegin = Client.Memory.ReadUInt32(MapPointerAddr);
int MaxTiles = 2015, TileDist = 168, ObjectDist = 12;
//Loop through tiles in map.
for (var i = 0; i < MaxTiles; i++) {
var TileAddress = MapBegin + (TileDist * i);
var StackSize = Client.Memory.ReadByte(TileAddress);
//Loot through objects in tile.
for (var t = 0; t < StackSize; t++) {
var ObjectAddr = TileAddress + (t * ObjectDist);
var ObjectId = Client.Memory.ReadUInt32(ObjectAddr + 4);
var ObjectData = Client.Memory.ReadUInt32(ObjectAddr + 8);
//Check if its the tile with the player.
if (ObjectId == 99 && ObjectData == PlayerId) {
return i;
}
}
}
return -1;
}
Thanks everyone...