Reverted Lumbridge random event teleport fix due to trapping players in random event

Spam clicking maze shrine now handled
This commit is contained in:
Player Name 2025-04-02 21:48:11 +00:00 committed by Ryan
parent bcc3bc069e
commit 3d7f1689f3
2 changed files with 4 additions and 10 deletions

View file

@ -7,7 +7,7 @@ import core.game.node.entity.player.link.TeleportManager.TeleportType
import core.game.world.map.Location
fun kidnapPlayer(player: Player, loc: Location, type: TeleportType) {
setAttribute(player, "kidnapped-by-random", true)
setAttribute(player, "kidnapped-by-random", true) //only used in POH code when you leave the hut, so does not need /save. Do not rely on this outside of its intended POH use case.
if (getAttribute(player, "/save:original-loc", null) == null) {
setAttribute(player, "/save:original-loc", player.location)
}
@ -15,14 +15,9 @@ fun kidnapPlayer(player: Player, loc: Location, type: TeleportType) {
}
fun returnPlayer(player: Player) {
// Prevent returning more than once and sending the player back to HOME_LOCATION
if (getAttribute<Location?>(player, "kidnapped-by-random", null) == null) {
return
}
player.locks.unlockTeleport()
val destination = getAttribute(player, "/save:original-loc", ServerConstants.HOME_LOCATION ?: Location.create(3222, 3218, 0))
teleport(player, destination)
unlock(player)
removeAttributes(player, "/save:original-loc", "kidnapped-by-random")
}
}

View file

@ -199,17 +199,16 @@ class MazeInterface : InteractionListener, EventHook<TickEvent>, MapArea {
on(Scenery.STRANGE_SHRINE_3634, IntType.SCENERY, "touch") { player, node ->
player.unhook(this)
lock(player, 12)
closeOverlay(player)
queueScript(player, 0, QueueStrength.SOFT) { stage: Int ->
when (stage) {
0 -> {
lock(player, 6)
sendGraphics(Graphics(86, 0, 3), player.location)
animate(player,862)
return@queueScript delayScript(player, 6)
}
1 -> {
lock(player, 6)
sendGraphics(Graphics(1576, 0, 0), player.location)
animate(player,8939)
playAudio(player, Sounds.TELEPORT_ALL_200)
@ -274,4 +273,4 @@ class MazeInterface : InteractionListener, EventHook<TickEvent>, MapArea {
}
}
}
}