Paste #42667: Untitled Paste

Date: 2017/06/15 22:25:26 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


use_rpg_cmd_handler:
  type: world
  debug: true
  events:
    on leave command:
    - inject locally erpg_leave
    on verlassen command:
    - inject locally erpg_leave
  #
  # ERPG LEAVE
  #
  erpg_leave:
  - determine passively fulfilled
  - define region "<player.flag[erpg_region]>"
  - choose "<def[region]>":
    - case "ERPG":
      - define 1 1
    - case "ST":
      - define 1 1
    - default:
      - if <player.location.world> == w@erpg {
        #- narrate "<&2>Bringing you out of ERPG!"
        - teleport <player> <server.flag[erpg_npc].as_npc.location||<player.player.location>>
        } else {
        #- narrate "<&4>ERROR You haven't joined ERPG!"
        }
      - queue clear
  - if <server.flag[erpg_npc].as_npc.location||x> == x {
    #- narrate "[erpg] <&4>Warnung! NPC konnte nicht mehr gefunden werden!"
    #- narrate "[erpg] <&4>Bitte einen Administrator darum diesen wieder aufzustellen via <&6>/erpg_npc"
    #- narrate "[erpg] <&4>Nutze dann <&6>/verlassen. <&4>Manuelle Teleporte k<&oouml>nnen zu Fehlern f<&uuml>hren!"
    }
    else {
    #- narrate "[erpg] <&2>Du hast <&6>ERPG <&2>verlassen. Bis bald!<&f>
    #      <&nl>[erpg] <&2>Teleportiere zur<&uuml>ck zum NPC."
    - flag player <def[region]>_backport:<player.location>
    - yaml id:lt_<player> set "erpginvs.<def[region]>.inv:!"
    - yaml id:lt_<player> set "erpginvs.<def[region]>.inv:|:<player.inventory.list_contents||li@>"
    - yaml id:lt_<player> set "erpginvs.<def[region]>.armor:!"
    - yaml id:lt_<player> set "erpginvs.<def[region]>.armor:|:<player.equipment>"
    - yaml id:lt_<player> set "erpginvs.<def[region]>.food_level:<player.food_level>"
    - yaml id:lt_<player> set "erpginvs.<def[region]>.health:<player.health>"
    - adjust <player> health:20
    - adjust <player> food_level:20
    - foreach <pl.flag[quit_channel]||li@> {
      - inject s@use_login_logout_handler path:<def[value]>
      }
    #- teleport <player> <server.flag[erpg_npc].as_npc.location>
    #- inventory set d:<player.inventory> o:<yaml[lt_<player>].read[erpginvs.outside_erpg]||li@>
    - adjust <player> "equipment:<yaml[lt_<player>].read[erpginvs.outside_armor]||li@i@air|i@air|i@air|i@air>"
    - flag player erpg_region:!
    }