Paste #14507: Dangerous

Date: 2015/03/14 14:16:57 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"helpful citizens config":
  type: task

  "giver":
    type: giver
    items:
    - i@Iron_Sword/It's dangerous to go alone, take this!
    cooldown: 12h

    cooldown text:
    - "It's dangerous to go alone!"
    - "I am here to lend an ear."
    - "It is very cold out, please feel welcome to stay <player.name>!"




"helpful citizens":
  type: assignment

  default constants:
    configuration: giver

    on click:
    - engage duration:3s
    - look <npc> <player.eye_location>
    - define type '<proc[helpful citizen helper].context[type]>'
        - if '%type%' == 'giver' {

        - if !<player.flag[helpful_<npc.constant[configuration]>_<npc.id>_cooldown]> {
            - define items '<proc[helpful citizen helper].context[items]>'
            - flag <npc> helpful_citizen_items:!
            - flag <npc> helpful_citizen_items:|:%items%
            - define item <npc.flag[helpful_citizen_items].as_list.random.split[/].get[1]>

            - chat '<el@val[%items%].split[/].get[2]>'
            - animate <npc> arm_swing
            - give '%item%'
            - narrate '<yellow>[!]<blue> You have recieved <%item%.qty>
                "<t[<%item%.has_display>]:<%item%.display> || <%item%.material.name>>"!'
            - flag <player> helpful_<npc.constant[configuration]>_<npc.id>_cooldown:true
                'duration:<proc[helpful citizen helper].context[cooldown] || 5s>'

          } else {
            - chat '<proc[helpful citizen helper].context[cooldown text]>'

          }

        - queue clear


    - if <player.is_op>
      narrate 'I need a configuration!'
      else look <player.eye_location>