Paste #3200: Untitled Paste

Date: 2014/04/05 23:24:49 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# Dough Trade
# Select the NPC and type /npc assign --set "Dough_Trade"
Dough:
   type: item
   material: 337
   display name: 'Dough'


Bread:
   type: world

   events:
     on player consumes i@Dough:
      - potion health_boost <player> duration:30s power:1

Dough_Trade:
  type: assignment

  interact scripts:
      # Priority starts from 10
      - 10 Dough_Trade trade

  actions:
       on assignment:
          # These triggers enable/disable interaction with an NPC via chatting, clicking and entering proximity.
          - trigger name:chat toggle:true
          - trigger name:click toggle:true
          - trigger name:proximity toggle:true radius:6
          - equip fishing_rod

       on enter proximity:
          - narrate "<blue><npc.name> grins at you."
          - chat "<blue>Welcome to my kitchen <red><player.name>!"
          - if <player.inventory.contains[i@clay_ball[display_name=Dough] ]> {
            - chat "<blue>Oh, I see you have some dough I cook the best bread
            - chat "<blue> Click on me and I will whip it up quickly so you can be on your way!"
            }
            else {
              - chat "<blue>Do you have any dough? I cook the best bread!"
            }

"Dough_Trade trade":
   type: interact

   steps:
      Trade:
        click trigger:
          script:
          - playsound <player.location> sound:fire volume:2.0
          - if <player.inventory.contains i@clay_ball[display_name=Dough] > {
              - if <player.inventory.qty i@clay_ball[display_name=Dough] > OR_MORE 1 {
                - take i@clay_ball[display_name=Dough]  qty:1
                - give bread qty:64
                - chat "<blue>Here is your bread, enjoy!"
                }
                else {
                - chat "<blue>YOu do not have any dough<red><player.name>. <blue>Bring me some dough so I can cook you bread."
                }
            }
            else {
            - chat "<blue>Get me some dough!"
            }