Paste #13888: Dreamworld

Date: 2015/02/15 19:36:42 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# <context.location> returns location of the bed 
# command script containers: http://mcmonkey.org/denizen/lngs/command%20script%20containers

Awaken:
    type: command
    name: awaken
    description: Wakes you up when you're dreaming.
    usage: /awaken
    permission: asleep.and.dreaming
    permission message: Sorry <player.name>, you can't use that command because you're currently awake!
    script:
    - wait 1
    - narrate "You suddenly realize you can fly. That's not possible!"
    - wait 1
    - narrate "This must be a dream!"
    - wait 1
    # this is using the plugin BedHome: http://dev.bukkit.org/bukkit-plugins/bedhome/
    - execute as_player "bedhome tele <player.name> world" silent

Dreamworld:
    type: world
    events:
        on player enters bed:
        - run SleepMenu

SleepMenu:
    type: interact
    steps:
        1:
            script:
            - narrate "You climb into bed, would you like to sleep or dream?"
            chat trigger:
                1:
                    trigger: /sleep/
                    script:
                    - narrate "You close your eyes and sleep peacefully"
                2:
                    trigger: /dream?
                    script:
                    - narrate "You feel your mind begin to slip into darkness..."
                    - wait 1
                    - narrate "The world as you know it fades away, along with it's limitations."
                    - wait 1
                    - narrate "3"
                    - wait 1
                    - narrate "2"
                    - wait 1
                    - narrate "1"
                    - execute as_server "mvtp <player.name> world" silent
                    - permission add asleep.and.dreaming world2
                    - permission add plots.use world2
                    # or use "- execute as_server "pex user <player.name> add asleep.and.dreaming world2""?
                    # or use "- execute as_server "pex user <player.name> add plots.use world2""?
                    - wait 1
                    - narrate "To wake up, use '/Awaken'!"