Paste #20528: Untitled Paste

Date: 2015/09/29 04:56:34 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


test:
    type: assignment
    actions:
        on assignment:
        - trigger name: click state:true
        - trigger name: chat state:true
    interact scripts:
    - 1 npc_killQuest_interact
cchat:
    type: format
    format: "<&b><npc.name> <&f>to you<&co> <&2><text>"

npc_killQuest_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.has_flag[npc_engaged]> queue clear
                - flag player npc_engaged
                - if <player.flag[quest_kill_cow_count> == 5{
                    - narrate format:cchat "Thank you so much."
                    - flag player npc_engaged:!
                    - flag player quest_kill_cow_count:!
                    - queue clear
                }
                - narrate format:cchat "Hello there! can you help me?!"
                - wait 5t
                - narrate format:cchat "If so, you can kill 5 cows for me."
                - wait 5t
                - narrate format:cchat "Will you help me?!"
                - wait 5t
                - narrate "[<&>Type <&b><&o>Yes<&f> or <&b><&o>No<&7>]"
                - flag player npc_engaged:!
            chat trigger:
                1:
                    chat trigger: /Yes/ I accept the quest.
                        script:
                        - if <player.has_flag[quest_kill_cow> queue clear
                        - flag player npc_engaged
                        - wait 5t
                        - narrate "[Kill 5 Cows!]"
                        - flag player quest_kill_cow
                        - flag player quest_kill_cow_count:0
                        - flag player npc_engaged:!

                2:
                    trigger: /No/, sorry i'm kinda busy.
                        script:
                        - if <player.has_flag[quest_kill_cow]> queue clear
                        - random
                        {
                            - narrate format:cchat "Oh okay then, come back when you're not busy."
                            - narrate format:cchat "Well sorry for the trouble."
                            - narrate format:cchat "<npc.name> is now sad"
                        }

quest_kill_cow:
    type: world
    events:
        on player killss cow:
        - if !<player.has_flag[quest_kill_cow]> queue clear
        - flag player quest_kill_cow_count:++
        - if <player.flag[quest_kill_cow_count> == 5{
            - narrate "[Return to the npc]"
            - flag player quest_kill_cow:!
        }