# Shopkeeper
# Citizens 2 (build #992)
# Denizen 0.9.3 (build #1352)
#
# To assign to an NPC, type:
# /npc assign --set "shopkeeper"
#
# @author Hyruii
"shopkeeper":
type: assignment
default constants:
interact scripts:
- 10 Enter Shop
actions:
on assignment:
# These triggers enable 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
# The NPC will equip a feather.
- equip feather
"Enter Shop":
type: interact
steps:
1:
proximity trigger:
entry:
script:
- ^run "Shop Keeper Greeting"
exit:
script:
- ^run "Shop Keeper Farewell"
2:
click trigger:
script:
- chat "<yellow>Take a look at our wares!"
3:
chat trigger:
'Buy':
trigger: I want to /buy/ something.
script:
- chat "<yellow>Right click on me to buy."
'Sell':
trigger: I want to /sell/ something.
script:
- chat "<yellow>Right click on me and go to the sell menu to sell."
'What Did You Say':
trigger: /REGEX:\w+/
# This is a catch-all trigger that will repeat what the player said if what they
# typed didn't match any of the chat triggers above.
script:
- chat "<yellow>Sorry <white><player.name><yellow>, but I don<&sq>t get what <&sq><white><context.message><yellow><&sq> means."
"Shop Keeper Greeting":
type: task
speed: 0
script:
- random {
- chat "<yellow>You look very nice today, <player.name>."
- chat "<yellow>I hope the guards stop the zombies tonight."
- chat "<yellow>The price of our tools are very good!"
- chat "<yellow>Talk to me if you want to buy anything."
- chat "<yellow>This town is growing very fast!"
- chat "<yellow>Nice <player.item_in_hand>, wanna sell to me?"
- chat "<yellow>You look <player.health.formatted>."
- chat "<yellow>Endermen are so scary..."
- chat "<yellow>Welcome to my shop!"
}
"Shop Keeper Farewell":
type: task
speed: 0
script:
- random {
- chat "<yellow>Stay safe <player.name>."
- chat "<yellow>Come back again."
- chat "<yellow>See you again!"
- chat "<yellow>Watch out for the Endermen!"
}
###############################################################