Paste #16117: Testing

Date: 2015/05/31 23:36:34 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


ZHchat:
  type: format
  format: "<dark_red><npc.name>: <white><text>"

ZHunter:
    type: assignment
    interact scripts:
    - 10 ZombieTestTQuest
    actions:
        on assignment:
          - announce "Questing ready!"

ZombieTestTQuest:
    type: interact
    steps:
        1:
            click trigger:
                script:
                    - if <player.has_flag[TalkToZHunter]> {
                        - narrate format:ZHchat "Yo, over here!"
                        - wait 1
                        - narrate format:ZHchat "Really? They sent a weakling like you?"
                        - wait 0.8
                        - narrate format:ZHchat "<dark_red>...Geez that Guardian's Guild is useless..."
                        - wait 1
                        - narrate format:ZHchat "Anyway..... Your assignment is to kill 25 <dark_green>Zombies."
                        - narrate "<yellow> You stopped talking to the <dark_red> Zombie Hunter."
                        - listen kill type:entity name:zombie qty:2 script:ZQCheck
                        - flag player ZKills:0
                        - flag player TalkToZHunter:!
                        - queue clear
                    }
                    - if !<player.has_flag[TalkToZHunter]> {
                        - random 5
                        - narrate format:ZHchat "Hey, Beat it!"
                        - narrate format:ZHchat "You have to talk to the Guardian's Guild Knight first."
                        - narrate format:ZHchat "...That Guardian's Guild is full of naive and dimwitted adventurers..."
                        - narrate format:ZHchat "...I wonder how many marshmallows I can fit in my mouth..."
                        - narrate format:ZHchat "I've never seen the owner of C.O.R.E but I think he's an idiot, Dont tell anyone I said that."
                        - queue clear
                        - disengage
                    }

ZQuestReward:
    type: interact
    steps:
        1:
            click trigger:
                script:
                    - if <player.has_flag[ZKilled]> {
                        - narrate format:ZHchat "Well would you look at that!"
                        - wait 1
                        - narrate format:ZHchat "It seems some people aren't so bad in the Guardian's Guild."
                        - wait 1
                        - narrate format:ZHchat "I guess I should give you your reward."
                        - zap step:2
                        - queue clear
                    }
                    - if !<player.has_flag[ZKilled]> {
                        - narrate format:ZHchat "You have only killed <player.flag[ZKills].as_int> Zombies."
                        - wait 1
                        - narrate format:ZHchat "Come back when you have killed enough."
                        - narrate "<yellow>You stop talking to the <dark_red>Zombie Hunter<yellow>."
                        - zap step:1
                        - queue clear
                        - disengage
                    }
            2:
                script:
                    - random 15
                    - give item:266 qty:6
                    - give item:265 qty:12
                    - give item:396 qty:32
                    - give item:320 qty:20
                    - give item:263 qty:32
                    - give item:116 qty:20
                    - give item:322 qty:4
                    - give item:331 qty:64
                    - give item:348 qty:32
                    - give item:354 qty:1
                    - give item:357 qty:32
                    - give item:362 qty:8
                    - give item:388 qty:18
                    - give item:364 qty:16
                    - give item:368 qty:4

                    - give xp qty:10000
                    - give money qty:1000
                    - narrate "<blue>You have recieved <gold>$1000<blue>,<yellow>10000XP <blue>and a random reward."
                    - wait 1
                    - narrate format:ZHchat "Return to the Guild Knight for another assignment."
                    - wait 1
                    - narrate "<yellow>You stopped talking to the <dark_red>Zombie Hunter <yellow>."
                    - flag player ZKills:!
                    - flag player ZKilled:1
                    - flag player ZKills_Cooldown duration:60s
                    - flag player TalkToKnight
                    - zap step:1 script ZombieTestTQuest
                    - queue clear
                    - disengage
ZQContinue:
    type: task
    script:
        - listen kill type:entity name:zombie qty:2 script:ZQCheck       
ZombieQReward:
    type: task
    script:
        - narrate "<yellow>Return to the Zombie Hunter to claim your reward."
        - flag player ZKilled
        - zap step:1 script:ZQuestReward
ZQCheck:
    type: task
    script:
        - flag player ZKills:++
        - narrate "<yellow>You have killed <player.flag[ZKills].as_int>/2 <green>Zombies<yellow>!"
        - if <player.has_flag[ZKills].as_int> >= 2 run script: ZombieQReward
        - if <player.has_flag[ZKills].as_int> < 2 run script: ZQContinue