Date: 2014/12/13 13:02:02 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Cream Trade
# Select the NPC and type /npc assign --set "Cream_assignment"
Cream_assignment:
type: assignment
interact scripts:
# Priority starts from 10
- 10 Cream_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
on enter proximity:
- narrate "<blue><npc.name> grins at you."
- chat "<blue>Welcome To The Creamery!<red><player.name>!"
- if <player.inventory.contains[mbucket]> {
- chat "<blue>Oh, I see you have some milk, would you like for me to whip that into cream for you?"
- chat "<blue> Click on me and I will make this trade happen quickly so you can be on your way!"
}
else {
- chat "<blue>If you bring me some milk I will give you some cream in trade"
}
"Cream_trade":
type: interact
steps:
Trade:
click trigger:
script:
- playsound <player.location> sound:fire volume:2.0
- if <player.inventory.contains[i@mbucket]> {
- if <player.inventory.qty[i@mbucket]> OR_MORE 1{
- take i@milk_bucket qty:1
- give i@Cream qty:1
- chat "<blue>Here is your Cream, don't let it spoil!"
}
else {
- chat "<blue>You do not have any milk<red><player.name>. <blue>Bring me a some milk in exchange for cream."
}
}
else {
- chat "<blue> I have other customers so please get some milk and I await your return"
}