Date: 2017/06/11 04:06:57 UTC-07:00
Type: Denizen Script
MakeYamlFolders:
type: world
debug: false
events:
on craftrealms command:
- determine passively FULFILLED
- if <context.args.get[1]||false> == cp {
- if <player.has_flag[lastcheckpointdungeon]||false> {
- flag <player> teleportationallowednow:true duration:10s
- teleport <player> <player.flag[lastcheckpointdungeon]>
}
}
on player teleports:
- if <yaml[worldconfig_<player.location.world.name>].read[DungeonScript]||false> == FALSE {
- queue clear
}
- if <yaml[dungeon-chunks].read[dungeonchunks].contains[<context.destination.chunk>]||false> && <yaml[dungeon-chunks].read[dungeonchunks].contains[<player.location.chunk>]||false> {
- narrate "Teleportation within dungeonchunks not allowed."
- determine destination:<player.location>
}
else if <yaml[dungeon-chunks].read[dungeonchunks].contains[<context.destination.chunk>]||false> && <player.has_flag[teleportationallowednow]||false> {
- flag <player> respawnprotection:true duration:20s
- narrate "You have been teleported to your most recent <&4>Dungeon Checkpoint<&r>"
- run s@respawnprotection player:<player>
- determine fulfilled
}
else if <yaml[dungeon-chunks].read[dungeonchunks].contains[<context.destination.chunk>]||false> {
- narrate "Please use <&4>/craftrealms cp<&r> to teleport to your latest checkpoint within a dungeon."
- determine destination:<player.location>
}