Paste #3737: Edit of P#3667 - Zombie kill quest

Date: 2014/04/25 05:43:54 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#Part 1: KillQuest. Quest to kill 10 Zombies
Zombie:
    type: assignment
    interact scripts:
    - 10 KillQuest
KillQuest:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - chat "You must be <player.name>! Please, help me kill those Zombies!"
                - wait 1
                - chat "The Zombies killed my entire family!"
                - wait 1 
                - chat "Killing some Zombies would help ease my pain."
                - wait 1 
                - chat "Can you kill 10 of those bastards for me?"
            chat trigger:
                1:
                    trigger: /Yes/, I shall slaughter them!
                    script:
                    - chat "Hell yeah! Kill them bastards!"
                    - wait 1 
                    - chat "Please hurry!"
                    - listen kill type:entity target:Zombie qty:1 script:ZombieQuestCheck
                    - flag player ZombieCount:0
                    - zap step:2
                2:
                    trigger: /No/, I am far too busy.
                    script:
                    - chat "Then leave coward!"
        2: 
            click trigger:
                script:
                - chat "Kill more of them bastards!"
                - wait 1
                - chat "You've only killed <player.flag[ZombieCount].asint> zombies!"
        3: 
            click trigger:
                script:
                - chat "Thanks <player.name>! May my family rest in peace.."
                - wait 1
                - chat "Here take this!" 
                - narrate "You were rewarded $300 and 1,000 exp"
                - give money qty:300
                - give xp qty:1000
                - zap step:4
        4:
            click trigger:
                script:
                - chat "Thanks for killing those Zombies for me <player.name>!"
                - wait 1
                - chat "Come back later, I might have something else for you to do."
                - zap step:5
#Part 2: Gather materials.
        5:  
            click trigger:
                script:
                - chat "Welcome back <player.name>! So happy to see you."
                - wait 1
                - chat "Why? Because we are trying to rebuild around here."
                - wait 1
                - chat "With your muscle, we can rebuild in no time!"
                - wait 1
                - chat "What do you say, can you help?"
            chat trigger:
                1:
                    trigger: /Yes/, what can I do to help?
                    script:
                    - chat "I knew we could count on you, <player.name>!"
                    - wait 1
                    - chat "Help us gather materials. We'll need 10 Wood."
                    - wait 1
                    - chat "Come back when you have enough Wood for us."
                    - listen block type:break block:Wood qty:1 script:MaterialsQuestCheck
                    - flag player LogCount:0
                    - zap step:6
                2:
                    trigger: /No/, I have no time for this!
                    script:
                    - chat "I suppose I understand. Come back when you are ready."
        6:        
            click trigger:
                script:
                - chat "That's not enough wood!" 
                - wait 1
                - chat "You only have <player.flag[LogCount].asint> Wood!"
                - wait 1
                - chat "Come back when you have it all."
        7:
            click trigger:
                script:
                - chat "What a fine job! Nice looking batch of Wood!"
                - wait 1
                - take:log qty:10
                - chat "Here's your reward!"
                - narrate "$100 and 300 exp"
                - give money:100
                - give xp:300
                - zap step:8
        8:
            click trigger:
                script:
                - chat "Thanks for gathering that Wood <player.name>!"
                - wait 1
                - chat "Come back later, and I might have another task."
                - zap step:9

#Part 3: Build        
        9:
            click trigger:
                script:
                - chat "Welcome back <player.name>!"
                - wait 1
                - chat "Now that we have our materials, we can start building!"
                - wait 1
                - chat "I bet you'd make a fine builder, <player.name>!"
                - wait 1
                - chat "Will you help us?"
            chat trigger:
                1:
                    trigger:/yes/, I will help build.
                    script:
                    - chat "I knew you would!"
                    - wait 1
                    - Chat "Help us build at least 10 blocks worth."
                    - wait 1
                    - chat "Come back when you have finished."
                    - listen block type:build block:log|wood planks qty:1 script:BuildQuestCheck
                    - flag player BuildCount:0
                    - zap step: 10
                2:
                    trigger:/No/, I am a fighter, not a builder!
                    script:
                    - chat "Oh, yes I see. Very well then."
        10:            
            click trigger:
                script:
                - chat "You haven't helped us build enough yet!"
                - wait 1
                - chat "You've only placed <player.flag[BuildCount].asint>
        11:
            click trigger:
                script:
                - Chat "What a fine job of building <player.name>!"
                - wait 1
                - chat "Here's your reward!"
                - give money:100
                - give xp:300
                - narrate "You received $100 and 300 exp."
                - zap step:12
        12:
            click trigger:
                script:
                - chat "Thanks for helping us rebuild <player.name>!"
                - wait 1
                - chat "Come back later for some more work!"

ZombieQuestCheck:
    type: task
    script:
    - flag player ZombieCount:++
    - narrate "You have slaughtered <player.flag[ZombieCount].asint>/10 zombies!"
    - if <player.flag[ZombieCount].asint> >= 10 run ZombieQuestReward
      else run ZombieQuestContinue
ZombieQuestContinue:
    type: task
    script:
    - listen kill type:entity name:Zombie qty:1 script:ZombieQuestCheck

ZombieQuestReward:
    type: task
    script:
    - narrate "You have killed <player.flag[ZombieCount].asint>/10 zombies! return back to Zombie Hater!"
    - zap step:3 script:KillQuest
#Part 2: Quest to gather 10 Wood.


MaterialsQuestCheck:
    type: task
    script:
    - flag player logCount:++
    - narrate "You have gathered <player.flag[logCount].asint>/10 Wood!"
    - if <player.flag[LogCount].asint> >= 10 run MaterialsQuestReward
      else run MaterialsQuestContinue
MaterialsQuestContinue:
    type: task
    Script:
    - listen block type:break block:Wood qty:1 script:MaterialsQuestCheck
MaterialsQuestReward:
    type: task
    script:
    - narrate "You have gathered <player.flag[LogCount].asint>/10 Wood! Return to Zombie Hater!"
    - zap step:7  script:KillQuest
#Part 3: Build.

BuildQuestChecK:
    type: task
    script:
    - flag player BuildCount:++
    - narrate "You have built <player.flag[BuildCount].asint>/10 blocks!"
    - if <player.flag[BuildCount].asint> >= 10 run BuildQuestReward
      else run BuildQuestContinue
BuildQuestContinue:
    type: task
    script:
    - listen block type:build block:log|wood planks qty:1 script:BuildQuestCheck
BuildQuestReward:
    type: task
    script:
    - narrate "You have built <player.flag[BuildCount].asint>/10 blocks! Return to Zombie Hater!"
    - zap step:11