Added support for many common variations of the jagex coordinate format for admin command ::tele, including:
regionX_regionY plane_regionX_regionY regionX_regionY_localX_localY plane_regionX_regionY_localX_localY
This commit is contained in:
@@ -70,6 +70,7 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
|
|||||||
var obj: Scenery? = null
|
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,"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,"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: " + 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!!)))
|
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))
|
SystemLogger.logInfo("Viewport: " + l.getSceneX(player.playerFlags.lastSceneGraph) + "," + l.getSceneY(player.playerFlags.lastSceneGraph))
|
||||||
|
|||||||
@@ -52,24 +52,45 @@ class TeleportCommandSet : CommandSet(Privilege.ADMIN){
|
|||||||
if (args.size == 2 && args[1].contains("_"))
|
if (args.size == 2 && args[1].contains("_"))
|
||||||
{
|
{
|
||||||
val tokens = args[1].split("_")
|
val tokens = args[1].split("_")
|
||||||
if(tokens.size == 4) {
|
when (tokens.size) {
|
||||||
val regionX = tokens[0].toInt()
|
2 -> {
|
||||||
val regionY = tokens[1].toInt()
|
val regionX = tokens[0].toInt()
|
||||||
val offsetX = tokens[2].toInt()
|
val regionY = tokens[1].toInt()
|
||||||
val offsetY = tokens[3].toInt()
|
|
||||||
|
|
||||||
val xCoord = (regionX shl 6) or offsetX
|
player.properties.teleportLocation = Location.create((regionX shl 6) or 15, (regionY shl 6) or 15, 0)
|
||||||
val yCoord = (regionY shl 6) or offsetY
|
}
|
||||||
|
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
|
return@define
|
||||||
}
|
}
|
||||||
if (args.size < 2) {
|
if (args.size < 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user