Paste #3734: Untitled Paste

Date: 2014/04/24 20:14:24 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# NPC Fisherman
# Citizens 2 (build #992)
# Denizen 0.9.3 (build #1352)
#
# @author Hyruii
#
# Select the NPC and type /npc assign --set "fisherman"
freshfish:
   type: item
   material: 349
   display name: 'Fresh Fish'
   lore:
   - Fresh fish from the docks of Sushi Land
   - Sashimi anyone?
   - '-Gives extra 4 hearts-'

Sashimi:
   type: world

   events:
     on player right clicks with i@freshfish:
      - take i@freshfish qty:1 from:<player.inventory>
      - potion health_boost <player> duration:5m power:1

fisherman:
  type: assignment

  interact scripts:
      # Priority starts from 10
      - 10 fisherman 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>Ahoy, <red><player.name>!"
          - if <player.inventory.contains[rotten_flesh]> {
            - chat "<blue>You have some zombie flesh on you, I can smell the stink!"
            - chat "<blue>I could use them for fish bait. Click on me to trade for them!"
            }
            else {
              - chat "<blue>Do you have zombie flesh? I could use it for fishing bait!"
            }

"fisherman trade":
   type: interact

   steps:
      Trade:
        click trigger:
          script:
          - playsound <player.location> sound:water volume:2.0
          - if <player.inventory.contains[rotten_flesh]> {
              - if <player.inventory.qty[rotten_flesh]> OR_MORE 16 {
                - take rotten_flesh qty:16
                - give freshfish qty:4
                - chat "<blue>Thanks for the zombie flesh! Here are some of those famous fish from Sushi Land!"
                }
                else {
                - chat "<blue>You do not have enough zombie flesh to trade, <red><player.name>. <blue>Bring at least 16 zombie flesh."
                }
            }
            else {
            - chat "<blue>The fish here are quite nutritious. That was why I settled here. Hohoho!"
            }