Paste #29901: Untitled Paste

Date: 2016/02/08 07:00:54 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Killquest:
    type: assignment 
    actions: 
        on assignment: 
        - trigger name:click state:true 
        - trigger name:chat state:true 
    interact scripts: 
    - 10 Killquestinteract 
cchat:
    type: format 
    format: "<&b><npc.name> <&f>to you<&co> <&2><text> " 

Killquestinteract:
    type: interact 
    steps: 
        1: 
            click trigger:
                script:
                - if <player.has_flag[npc_engaged]> queue clear 
                - if <player.flag[kill_creeper_quest_cooldown].is_expired.not> { 
                  - narrate "<&6>Highlord: <&7><&o>You can repeat this quest in <player.flag[kill_creeper_quest_cooldown].expiration.formatted>" 
                  - queue clear 
                  } 
                - flag player npc_engaged 
                - if <player.flag[kill_creeper_quest_count]||0> >= 5 { 
                 - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!" 
                 - give xp quantity:150
                 - narrate "<&2>$1000 has been added to your account."
                 - give money qty:1000
                 - narrate "<&6>Highlord: <&7>Come back to me tommorow for another quest!"
                 - flag player kill_creeper_quest_count:! 
                 - flag player kill_creeper_quest_cooldown duration:24h 
                 - disengage 
                 - flag player npc_engaged:! 
                 - queue clear 
                 } 
                - engage 
                - narrate "<&6>Highlord: <&7><&o>Hello there, would you care for a special prize?" 
                - wait 3t 
                - narrate "<&6>Highlord: <&7><&o>If so, you can kill 5 Creepers for me." 
                - wait 3t 
                - narrate "<&6>Highlord: <&7><&o>Will you accept this request?" 
                - wait 3t 
                - narrate "[<&o>Type <&b><&o>Yes<&f><&o> or <&b><&o>No<&7>]" 
                - disengage 
                - flag player npc_engaged:! 
            chat trigger:
                1: 
                    trigger: /Yes/ I accept the quest. 
                    script: 
                    - if <player.flag[kill_creeper_quest_cooldown]||false> { 
                     - queue clear 
                     } 
                    - engage 
                    - narrate "<&6>Highlord: <&7><&o>Okay great"  
                    - wait 5t 
                    - narrate "<&a>[Kill <&4>5 <&a>Creepers!]" 
                    - flag player kill_creeper_quest 
                    - flag player kill_creeper_quest_count:0.round 
                    - narrate "<&a><player.flag[kill_creeper_quest_count].round||0> Creepers!"
                    - disengage
                2:
                    trigger: /No/ I don't 
                    script: 
                    - random { 
                       - narrate format:cchat "Okay screw off then" 
                       - narrate format:cchat "Okay then" 
                       - narrate format:cchat "Maybe next time then." 
                    } 
killquest_player_world:
    type: world 
    events: 
        on  
        - flag <context.damager.as_player> kill_creeper_quest_count:++
        - narrate "<&a>You have killed <player.flag[kill_creeper_quest_count].round> Creepers!"
        - if <context.damager.as_player.flag[kill_creeper_quest_count]> >= 5 { 
          - narrate "<&b>[Return to the Highlord]" targets:<context.damager.as_player> 
          - flag <context.damager.as_player> kill_creeper_quest:! 
          }