Paste #3970: script

Date: 2014/05/02 11:55:40 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Tutorial-shop:
    type: assignment
    interact scripts:
    - 10 Tutorial-shop1
    actions:
        on assignment:
        - trigger name:proximity toggle:true
        - trigger name:chat toggle:true
        - trigger name:click toggle:true

Tutorial-shop1:
    type: interact
    requierments:
        mode: all
        list:
        - - flagged player 'Tutorial-shop-bought'
    steps:
        1:
            proximity trigger:
                entry:
                    script:
                    - chat "<yellow>Hello there and Welcome to Tutorial Shop!"
                    - wait 1
                    - chat "<yellow>Here i will teach you how to use them"
                    - wait 1
                    - chat "<yellow>If You want to see what we offer take a look on list of items "
                    - narrate '<yellow>Say <red>List <yellow>to see list of items'
                    - zap 'step:2'
                exit:
                    script:
                    - chat '<yellow>Good bye and have a nice day!'
                    - queue clear
                    - zap 'step:1'
        2:
            chat trigger:
                list-of-items:
                    trigger: Can i see the /list/ Please
                    script:
                    - chat '<yellow>We offer'
                    - wait 1
                    - chat '<red>Food'
                    - wait 1
                    - chat '<yellow>What would you like to buy? '
                    - narrate '<yellow>Now , if you say <red>Food<yellow> he will tell you what food does he sell'
                    - zap 'step:3'
            proximity trigger:
                exit:
                    script:
                    - chat '<yellow>Good bye and have a nice day!'
                    - queue clear
                    - zap 'step:1'
        3:
            chat trigger:
                1:
                    trigger: I would like to buy /Food/
                    script:
                    - chat '<yellow>Okay , We Offer'
                    - wait 1
                    - Chat '<red>Steak<Yellow> 20 units --- 5 Gold ingots'
                    - wait 1
                    - chat '<yellow>What would you like to buy?'
                    - zap 'step:4'
            proximity trigger:
                exit:
                    script:
                    - chat '<yellow>Good bye and have a nice day!'
                    - queue clear
                    - zap 'step:1'

        4:
            chat trigger:
                Steak:
                    trigger: I would like to buy /Steak/ .
                    script:
                    - wait 1
                    - chat '<yellow>Okay that would be 5 Gold ingots!'
                    - if <player.inventory.qty[266]> >= 5 runtask "script:Steak" else runtask "script:Mine-undone"




Steak:
    type: task
    Script:
    - take item:gold_ingot qty:5
    - narrate '<yellow>You pay <npc.name> 5 Golden bars'
    - wait 1
    - give item 364:0 qty:20
    - narrate '<yellow>You recieved 20 Steaks'
    - wait 1
    - flag player 'Tutorial-shop-bought'
    - chat '<yellow>There go, now you know how to use Shops '
    - chat 'You can go and proceed to next tutorial'



Mine-undone:
    type: task
    script:
    - chat '<yellow>You dont have enough Gold, Are you sure you visited Mine?'
    - zap 'script:tutorial-shop1' 'step:1'