Jump to content

Dbcrazy

Members
  • Joined

  • Last visited

Everything posted by Dbcrazy

  1. good one
  2. Dbcrazy replied to Cryptic's post in a topic in 317
    Nice one mate
  3. Dbcrazy replied to  omg fd up's post in a topic in RSPS Help
    The code will tell you the coords. All you do is run the class in an IDE and it will ask you to input the region id and it will spit out the coords for that region. If you packed the map then the mapfile should be named as the region ID, or the folder the map files were in. Again im not sure about lower revision as I normally work with 667+ so it could be a little different. Could also try this public final class MapDefinitionParser { private MapDefinitionParser() { } public static Map<Integer, MapDefinition> parse(Cache cache) throws IOException { final Map<Integer, MapDefinition> definitions = new HashMap<>(); byte[] data = cache.getArchive(ArchiveType.VERSION_LIST).readFile("map_index"); Buffer buffer = Buffer.wrap(data); int mapCount = buffer.getCapacity() / (3 * Short.BYTES + Byte.BYTES); for (int map = 0; map < mapCount; map++) { int regionId = buffer.readUShort(); int terrainFileId = buffer.readUShort(); int objectFileId = buffer.readUShort(); boolean members = buffer.readByte() == 1; definitions.put(regionId, new MapDefinition(regionId, terrainFileId, objectFileId, members)); } decodeStaticObjects(cache, definitions); return definitions; } private static void decodeStaticObjects(Cache cache, Map<Integer, MapDefinition> definitions) throws IOException { Store mapStore = cache.getStore(StoreType.MAP); for (Entry<Integer, MapDefinition> entry : definitions.entrySet()) { MapDefinition def = entry.getValue(); int hash = def.getRegionId(); int x = (hash >> 8 & 0xFF) * 64; int y = (hash & 0xFF) * 64; ByteBuffer gameObjectData = ByteBuffer.wrap(mapStore.readFile(def.getObjectFileId())); parseGameObject(gameObjectData, x, y); Buffer terrainData = Buffer.wrap(mapStore.readFile(def.getTerrainFileId())); parseTerrain(terrainData, x, y); } } private static void parseGameObject(ByteBuffer gameObjectBuffer, int x, int y) { for (int deltaId, id = -1; (deltaId = BufferUtils.readSmart(gameObjectBuffer)) != 0;) { id += deltaId; for (int deltaPos, hash = 0; (deltaPos = BufferUtils.readSmart(gameObjectBuffer)) != 0;) { hash += deltaPos - 1; int localX = hash >> 6 & 0x3F; int localY = hash & 0x3F; int height = hash >> 12 & 0x3; int attributeHashCode = gameObjectBuffer.get() & 0xFF; Optional<GameObjectType> type = GameObjectType.valueOf(attributeHashCode >> 2); Optional<GameObjectOrientation> orientation = GameObjectOrientation.valueOf(attributeHashCode & 0x3); Position position = new Position(x + localX, y + localY, height); if (type.isPresent() && orientation.isPresent()) { World.gameObjects.add(new GameObject(id, position, type.get().getId(), orientation.get().getId())); } } } } private static void parseTerrain(Buffer mapBuffer, int x, int y) { for (int height = 0; height < 4; height++) { for (int localX = 0; localX < 64; localX++) { for (int localY = 0; localY < 64; localY++) { Position position = new Position(x + localX, y + localY, height); int flags = 0; for (;;) { int attributeId = mapBuffer.readUByte(); if (attributeId == 0) { terrainDecoded(flags, position); break; } else if (attributeId == 1) { mapBuffer.readByte(); terrainDecoded(flags, position); break; } else if (attributeId <= 49) { mapBuffer.readByte(); } else if (attributeId <= 81) { flags = attributeId - 49; } } } } } } all you have to do is grab map_index, and then use that file to parse maps located in index 4 of the cache.
  4. Dbcrazy replied to  omg fd up's post in a topic in RSPS Help
    I haven't used RSPSi much but here is what I use to generate coords from a RegionId package com.rs.jagex.tools; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; /** * * @author Tyler * */ public class CoordinateGenerator { public static void main(String[] args) throws IOException { Scanner input = new Scanner(System.in); BufferedWriter writer = null; File file = new File("Coords.txt"); writer = new BufferedWriter(new FileWriter(file)); System.out.println("Please enter the region id."); while(input.hasNextLine()) { if(!input.hasNextInt()) { break; } int regionId = input.nextInt(); int x = (regionId >> 8) << 6; int y = (regionId & 0xFF) << 6; System.out.println("Coords : "+x+ ": "+y+ " Region ID: "+regionId); writer.append("Coords : "+x+ ": "+y+ " Region ID: "+regionId); writer.newLine(); writer.flush(); } writer.close(); } }
  5. Dbcrazy replied to Jack's post in a topic in HTML RSPS Templates
    pog
  6. Dbcrazy replied to Flub's post in a topic in RSPS WEB Downloads
    Noice!
  7. Dbcrazy replied to Walied's post in a topic in Other (377-742)
    Nice ty!
  8. Dbcrazy replied to AtraixRSPS's post in a topic in RSPS Help
    68825 should be the model id not 18908
  9. Dbcrazy replied to Sanity's post in a topic in RSPS Tools Downloads
    Thanks brotha
  10. Thank you for this, will use!
  11. Dbcrazy replied to IExplicitIKaos's post in a topic in RSPS Models
    This is mad sick! Thank you!
  12. Dbcrazy replied to  omg fd up's post in a topic in RSPS Models
    Good stuff, thanks!
  13. Sorry if this is a grave dig, however I wanted to use and abuse the models and in order to do so I must reply! Very nice models, and I appreciate you uploading these
  14. Dbcrazy posted a post in a topic in Introductions
    Hello everyone, My name is Nate or Dbcrazy in most servers, and I am 21 years old located here in the USA. I have been a part of RuneScape and RSPS for well over 10 years now, and have recently started working on a 718/742 in hopes of making an enjoyable higher revision PVP server. I am have a lot of time in messing around with sources and files seeing how things work, and now that I'm older I want to take it more seriously and see what I can learn. Hopefully I can provide help and meet some awesome people the RSPS community has to offer.