diff --git a/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt b/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt index aca18fc7f..829e6f46a 100644 --- a/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt +++ b/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt @@ -70,6 +70,7 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){ var obj: Scenery? = null notify(player,"Absolute: " + l + ", regional: [" + l.localX + ", " + l.localY + "], chunk: [" + l.chunkOffsetX + ", " + l.chunkOffsetY + "], flag: [" + RegionManager.isTeleportPermitted(l) + ", " + RegionManager.getClippingFlag(l) + ", " + RegionManager.isLandscape(l) + "].") notify(player,"Region: [id=" + l.regionId + ", active=" + r.isActive + ", instanced=" + (r is DynamicRegion) + "], obj=" + RegionManager.getObject(l) + ".") + notify(player, "Jagex: ${l.z}_${l.regionId shr 8}_${l.regionId and 0xFF}_${l.localX}_${l.localY}") notify(player,"Object: " + RegionManager.getObject(l).also{obj = it} + ".") notify(player,"Object Varp: " + obj?.definition?.configFile?.configId + " offset: " + obj?.definition?.configFile?.bitShift + " size: " + (obj?.definition?.configFile?.bitShift?.minus(obj?.definition?.configFile?.bitShift!!))) SystemLogger.logInfo("Viewport: " + l.getSceneX(player.playerFlags.lastSceneGraph) + "," + l.getSceneY(player.playerFlags.lastSceneGraph)) diff --git a/Server/src/main/kotlin/rs09/game/system/command/sets/TeleportCommandSet.kt b/Server/src/main/kotlin/rs09/game/system/command/sets/TeleportCommandSet.kt index fb64e5b2a..29848ba8b 100644 --- a/Server/src/main/kotlin/rs09/game/system/command/sets/TeleportCommandSet.kt +++ b/Server/src/main/kotlin/rs09/game/system/command/sets/TeleportCommandSet.kt @@ -52,24 +52,45 @@ class TeleportCommandSet : CommandSet(Privilege.ADMIN){ if (args.size == 2 && args[1].contains("_")) { val tokens = args[1].split("_") - if(tokens.size == 4) { - val regionX = tokens[0].toInt() - val regionY = tokens[1].toInt() - val offsetX = tokens[2].toInt() - val offsetY = tokens[3].toInt() + when (tokens.size) { + 2 -> { + val regionX = tokens[0].toInt() + val regionY = tokens[1].toInt() - val xCoord = (regionX shl 6) or offsetX - val yCoord = (regionY shl 6) or offsetY + player.properties.teleportLocation = Location.create((regionX shl 6) or 15, (regionY shl 6) or 15, 0) + } + 3 -> { + val plane = tokens[0].toInt() + val regionX = tokens[1].toInt() + val regionY = tokens[2].toInt() - player.properties.teleportLocation = Location.create(xCoord, yCoord, 0) + player.properties.teleportLocation = Location.create((regionX shl 6) or 15, (regionY shl 6) or 15, plane) + } + 4 -> { + val regionX = tokens[0].toInt() + val regionY = tokens[1].toInt() + val offsetX = tokens[2].toInt() + val offsetY = tokens[3].toInt() + + val xCoord = (regionX shl 6) or offsetX + val yCoord = (regionY shl 6) or offsetY + + player.properties.teleportLocation = Location.create(xCoord, yCoord, 0) + } + 5 -> { + val plane = tokens[0].toInt() + val regionX = tokens[1].toInt() + val regionY = tokens[2].toInt() + val offsetX = tokens[3].toInt() + val offsetY = tokens[4].toInt() + + val xCoord = (regionX shl 6) or offsetX + val yCoord = (regionY shl 6) or offsetY + + player.properties.teleportLocation = Location.create(xCoord, yCoord, plane) + } + else -> reject(player, "Usage: regionX_regionY OR regionX_regionY_offsetX_offsetY") } - else if(tokens.size == 2){ - val regionX = tokens[0].toInt() - val regionY = tokens[1].toInt() - - player.properties.teleportLocation = Location.create((regionX shl 6) or 15, (regionY shl 6) or 15, 0) - } - else reject(player, "Usage: regionX_regionY OR regionX_regionY_offsetX_offsetY") return@define } if (args.size < 2) {