mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Reverted Lumbridge random event teleport fix due to trapping players in random event
Spam clicking maze shrine now handled
This commit is contained in:
parent
bcc3bc069e
commit
3d7f1689f3
2 changed files with 4 additions and 10 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue