Advertisement
Guest User

tile.js

a guest
Aug 28th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* tile.js by 059
  2.  
  3. MAPINFO
  4.     int width
  5.     int height
  6.     string name
  7.     string obf0
  8.     int obf1
  9.     int fp
  10.     int background
  11.     boolean allowPlayerTeleport
  12.     boolean showDisplays
  13.     string[] clientXML
  14.     string[] extraXML
  15.  
  16. UPDATE
  17.     Tile[] tiles
  18.     Entity[] newObjs
  19.     int[] drops
  20.     string obf2
  21.  
  22. Tile
  23.     short x
  24.     short y
  25.     int type
  26. */
  27. var ID_UPDATE = $.findPacketId("UPDATE");
  28. var ID_MAPINFO = $.findPacketId("MAPINFO");
  29.  
  30. var mapName = "";
  31.  
  32. function onServerPacket(event) { //when rr receives a packet from the server
  33.     var packet = event.getPacket(); //get the packet so we can edit it and shit
  34.  
  35.     if (packet.id() == ID_UPDATE) { //check if it is an update packet
  36.         for (var j = 0; j < packet.tiles.length; j++) { //go through every tile in the update packet
  37.             if (packet.tiles[j].type == 254) { //if it is tile 254 (unwalkable "void" tile)
  38.                 packet.tiles[j].type = 88; //change it to 88 (walkable tile)
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement