Paste #46920: Quest1

Date: 2018/03/16 16:07:11 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Quest1:
    type: assignment

    default constants:
        MobType: player
        name: <dark_purple><Bold>Ashley
        skin: "0HHH" 

    Interact Scripts:
    - 10 Quest1Interact

    actions:
        on assignment:
        - trigger name:proximity toggle:true range:4
        - trigger name:click state:true
        - trigger name:chat state:true
        - execute as_op "npc sel"
        - execute as_op "npc type <cons:MobType>"
        - execute as_op "npc rename <cons:name>"
        - execute as_op "npc look"
        - execute as_op "npc skin <cons:Skin>"

Quest1Interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.flag[quest1]> == Finished{
                    - random 5
                    - narrate "<white><cons:name>: <green>These flowers are beatifull"
                    - narrate "<white><cons:name>: <green>Thank you so much for your help"
                    - narrate "<white><cons:name>: <green>Im happy now that they are gone"
                    - narrate "<white><cons:name>: <green>Sometimes i still have nightmares about those boars"
                    - narrate "<white><cons:name>: <green>I wish I was a strong as you"
                } else {
                    - narrate "<white><cons:name>: <green>Hey you those <white>[<red>Boars<white>]<green> over there?"
                    - wait 2s
                    - narrate "<white><cons:name>: <green>I wanted to pick some flowers over there but these <white>[<red>Boars<white>]<green> keep attacking me"
                    - wait 2s
                    - narrate "<white><cons:name>: <green>Can you clear the field for me, so I can pick some flowers?"
                    - wait 1s
                    - narrate "<red>[<gold>Cardinal<red>]<white>: <green> type <white>[<blue>yes<white>]<green> to accept <white>[<red>Annoying Boars<white>]<green>"
                    - zap step:2
                }

        2:
            chat trigger:
                1:
                    trigger: /Yes/, I accept!
                    script:
                    - narrate "<white><cons:name>: <green>Thank you so much for helping me. I cant wait to pick those rare flowers"
                    - wait 2s
                    - narrate "<red>[<gold>Cardinal<red>]<white>: You have accepted the quest <white>[<red>Annoying Boars<white>]"
                    - flag player CurrentQuest:"<white>[<red>Annoying Boars<white>]<green> Kill 10 <white>[<red>Boars<white>]"
                    - run Questregister
                    - flag player quest1:active
                    - flag player quest1progress:0
                    - zap step:3
                    - wait 10s
                    - flag player CurrentQuest:!
                2:
                    trigger: /No/, I am to busy
                    script:
                    - zap step:1
                    - random 5
                    - narrate "<white><cons:name>: <green>I quess you are just scared"
                    - narrate "<white><cons:name>: <green>I thought you where a nice guy"
                    - narrate "<white><cons:name>: <green>No problem I will ask someon else"
                    - narrate "<white><cons:name>: <green>Then I will try approaching them on my own"
                    - narrate "<white><cons:name>: <green>You know I had a great reward for you"

        3:
            click trigger:
                script:
                - if <player.flag[quest1]> == Completed {
                    - narrate "<white><cons:name>: <green>Thank you so much for your help"
                    - wait 2s
                    - narrate "<red>[<gold>Cardinal<red>]<white>: You have completed the quest <white>[<red>Annoying Boars<white>]"
                    - give i@GoldCoin qty:10
                    - execute as_server "class exp <player.name> 10"
                    - flag quest1:Finished
                    - flag player CurrentQuestRemove:"<white>[<red>Annoying Boars<white>]<green> Kill 10 <white>[<red>Boars<white>]"
                    - run QuestRemove
                    - zap step:1
                    - wait 10s
                    - flag player CurrentQuestRemove:!
                } else {
                    - narrate "<white><cons:name>: <green>Come back once all the boars are gone"
                }