Paste #47115: Untitled Paste

Date: 2018/04/01 07:59:57 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


cchat:
  type: format
  format: "<green><npc.name>: <white><text>"

skeletonkillquestten:
  type: assignment
  actions:
    on assignment:
      - trigger name:click state:true
      - trigger name:chat state:true
      - trigger name:proximity state:true radius:5
  interact scripts:
  - 10 skeletonKillQuestTenInteract


skeletonKillQuestTenInteract:
  type: interact
  steps:
    1:
      proximity trigger:
        entry:
          script:
           - random {
             - narrate format:cchat "<white>Hello <aqua><player.name>!"
             - narrate format:cchat "<white>Can you help me?!"
             - narrate format:cchat "<white>Up for hunting?"
            }
      click trigger:
        script:
          - engage
          # check if player have completed the quest.
          - if <player.flag[killSkeletonTenQuestCount]> == 10 {
            - narrate format:cchat "Great work! Take this for your trouble..."
            - narrate "[You recieved a <aqua>Sword of Fire<white>!]"
            - give i@SwordOfFire qty:1
            - disengage
            # if quest completed, remove quest count.
            - flag player killSkeletonTenQuestCount:!
            - queue clear
          }
          # if the player is currently doing the quest.
          - if <player.has_flag[killSkeletonTenQuestCount]> {
            - narrate format:cchat "Did you kill 10 skeletons 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[killSkeletonTenTalked]> {
            - narrate format:cchat "Can you kill 10 skeletons for me?"
            - wait 5t
            - narrate "[Will you accept? Type <aqua>accept <white> or <aqua>deny]"
            - 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 skeletons for me?"
          - wait 5t
          - narrate "[Will you accept? Type <aqua>accept <white> or <aqua> deny]"
          - flag player killSkeletonsTenTalked
          - disengage
      chat trigger:
        1:
          trigger: /accept/
          script:
            # if player is already doing the quest, do nothing.
            - if <player.has_flag[killSkeletonTenQuestCount]> {
              - 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 skeletons and then return.]"
            # assign the quest and count.
            - flag player killSkeletonTenQuestCount:0
            - disengage
            - flag player killSkeletonTenTalked:!
        2:
          trigger: /deny/
          script:
            # if player is already doing the quest, do nothing.
            - if <player.has_flag[killSkeletonTenQuestCount]> {
              - queue clear
            }
            - engage
            - narrate format:cchat "Fine then..."
            - disengage
            - flag player killSkeletonTenTalked:!


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

# Custom Items
SwordOfFire:
  type: item
  material: diamond_sword
  display name: Sword of Sword
  lore:
    - A sword forged by fire.
  enchantments:
    - FIRE_ASPECT: 2