Date: 2014/04/05 23:24:49 UTC-07: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
51
52
53
54
55
56
57
58
59
60
61
62
# 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!"
}