Paste #47072: Untitled Paste

Date: 2018/03/29 16:59:49 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


zombiekillquestten:
  type: assignment
  actions:
    on assignment:
    - trigger name: click state:true
    - trigger name: chat state:true
  interact scripts:
    - 10 zombiekillquestteninteract
  cchat:
    type: format
    format: "<green><npc.name> <white><text>"

zombiekillquestteninteract:
  type: interact
  steps:
    1:
      click trigger:
        scripts:
          - engage
          - if <player.has_flag[killZombieTenQuestCount.count]> == 10 {  #check if the quest has been completed.
            - narrate format:cchat "Great work! Take this for your trouble..."
            - narrate "[You recieved a diamond!]"
            - give i@diamond
            - disengage
            - flag player killZombieTenQuestCount:! # if quest completed, remove quest count.
            - queue clear
          }
          # if the player is currently doing the quest.
          - else if <player.has_flag[killZombieTenQuestCount]> {
            - narrate format:cchat "Did you kill 10 zombies yet?"
            - disengage
            - queue clear
          }
          # if the player has not started and has not completed the quest.
          # check if the player has talked to the npc or not.
          - if <player.has_flag[killZombieTenTalked]> {
            - narrate format:cchat "Can you kill 10 zombies for me?"
            - wait 5t
            - narrate "[Will you accept? Type <aqua>yes <white> or <aqua>no]"
            - disengage
            - queue clear
          }
          # if the player has not talked to the npc.
          - narrate format:cchat "Hello there <aqua><player.name><white>. Would you care for a special prize?"
          - wait 5t
          - narrate format:cchat "If so, can you kill 10 zombies for me?"
          - wait 5t
          - narrate "[Will you accept? Type <aqua>yes <white> or <aqua> no]"
          - flag player killZombieTenTalked
          - disengage
      chat trigger:
        1:
          trigger: /yes/ I accept!
          script:
            # if player is already doing the quest, do nothing.
            - if <player.has_flag[killZombieTenQuestCount]> {
              - queue clear
            }
            # if player is not currently doing the quest...
            - engage
            - narrate format:cchat "Great!"
            - wait 5t
            - narrate "[You have accepted the quest!]"
            - wait 5t
            - narrate "[Kill 10 zombies and then return.]"
            - flag player killZombieTenQuestCount:0 # assign the quest and count.
            - disengage
            - flag player killZombieTenTalked:!
        2:
          trigger: /no/ I don't.
          script:
            - engage
            - narrate format:cchat "Fine then..."
            - disengage
            - flag player killZombieTenTalked:!


killzombietenworld:
  type: world
  events:
    on player kills zombie:
      - if !<player.has_flag[killZombieTenQuestCount]> queue clear # checks if player has the quest.
      # if the player has the quest...
      # Gain a kill count
      - flag player killZombieTenQuestCount.count++
      # check if the kill count is less than 10.
      - if <player.flag[killZombieTenQuestCount.count]> < 10> {
        - narrate "[Zombies killed <player.flag[killZombieTenQuestCount.count]>/10]"
      }
      # check if the kill count is equal to 10.
      - if <player.flag[killZombieTenQuestCount.count]> == 10> {
        - narrate "[Zombies killed <player.flag[killZombieTenQuestCount.count]>/10]"
        - wait 5t
        - narrate "[Quest completed! Return to the NPC]"
      }
      # check if the kill count is greater than 10.
      - if <player.flag[killZombieTenQuestCount]> > 10> {
        - flag player killZombieTenQuestCount.count = 10
      }