Paste #9614: Untitled Paste

Date: 2014/09/13 18:36:21 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


npcManager:
  type: world
  events:
    on player joins:
    - if <player.location.world.name.is[!=].to[<s@config.constant[nameofworld]>]> queue clear
    - potion BLINDNESS duration:10s
    - wait 1s
    - narrate "<&a>Loading Quest State!"
    - foreach <player.flag[e.npcs].as_list> {
      - define loc <def[value].as_npc.flag[loc]>
      - spawn %value% %loc%
      }
    on player quits:
    - if <player.location.world.name.is[!=].to[<s@config.constant[nameofworld]>]> queue clear
    - foreach <player.flag[e.npcs].as_list> {
      - if !<def[value].as_npc.is_spawned> {
        - remove %value%
        - flag player e.npcs:<-:%value%
        - queue clear
        } else {
        - flag %value% loc:<def[value].as_npc.location>
        - despawn %value%
        }
      }