Paste #32884: SheepQuestv5

Date: 2016/04/18 19:30:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


WilcoxQuest:
    type: assignment
    actions:
        on assignment:
        - trigger name:chat toggle:true
    interact scripts:
    - 10 Initiation

WilcoxMain:
    Type: Interact
    Steps:
        1:
            Click Trigger:
                script:
                - chat "Hey, how did you get to my farm?"
                - wait 2
                - chat "Would you like to do me a favor and retrieve some wool?"
                - narrate "You can say,<&7> Yes<&f>, or<&7> No<&f>."
            chat trigger:
                1:
                    trigger: /Yes/ , I think I can handle that!
                    script:
                    - if <player.inventory.contains_any[SHEARS]> {
                        - chat "Okay it appears you have some shears, already."
                        - wait 2
                        - chat "Feel free to shear my sheep for wool."
                        } else {
                        - give i@shears qty:1
                        - chat "Here are some shears to get the job done!"
                        - wait 2
                        - zap step:2
                        }
                2:
                    trigger: /No/, I am too busy
                    script:
                    - chat "Oh, alrighty... Come back when you need some extra money."
        2:
            click trigger:
                script:
                - if <player.inventory.contains_any[WOOL]> {
                    - define woolamount <player.inventory.quantity[WOOL]>
                    - take i@wool qty:woolamount
                    - define moneyamount <def[woolamount].mul[2]>
                    - give money qty:moneyamount
                    - narrate "You have traded <npc.name> <def[woolamount]> for <def[moneyamount]> coins."
                    - chat "Thanks for the Wool!"
                    } else {
                    - if <player.inventory.contains_any[SHEARS]> {
                        - chat "What're you waiting around for? There's sheep to shear, <player.name>!"
                        } else {
                            - give i@shears qty:1
                            - chat "Here are some shears to get the job done!"
                            - wait 2
                            }
                    }