Paste #54284: NPCTest

Date: 2019/05/24 12:34:52 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


NPCQuest:
    type: assignment
    interact scripts:
    - 1 NPCMain

NPCMain:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - chat "Hey <player.name>, I could use some help.>
                - wait 2
                - chat "I broke my pickaxe and need some more blocks."
                - wait 2
                - chat "Can you help me out?"
            chat trigger:
                1:
                    trigger: /Yes/, I can help you out!
                    script:
                    - chat "Okay, I need you to bring me 200 iron ore blocks, and 100 coal!"
                    - wait 2
                    - chat "If you come back to me with all of it i'll give you a reward."
                    - wait 2
                    - zap step:2
                2:
                    trigger: /No/, I am too busy.
                    script:
                    - chat "Oh, can you come back when you have more time..?"
        2:
            click trigger:
                script:
                - if <player.inventory.contains.material[IRON_ORE].quantity[200]> && <player.inventory.contains.material[COAL_BLOCK].quantity[100]> 
                    - chat "Great, you collected all of the blocks!"
                    - wait 2 
                    - chat "Here is your reward!"
                    - wait 1
                    - execute as_server "cr give <player.name> MineKey"
                    - give money qty: 75000
                    - zap step:3

                else 
                - chat "You don't have all of the blocks.."
                - wait 1
                - chat "Come back with the rest <player.name>"

        3:
            click trigger:
                script:
                - chat "Thanks again for helping me out!"