Date: 2016/09/18 12:17:30 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Trade:
type: assignment
actions:
on assignment:
- trigger name:click state:true
interact scripts:
- 1 Trade_Interact
Trade_Interact:
type: interact
steps:
1:
chat trigger:
1:
trigger: /Hello/ /Sup/ /Hey/ /Hi/
script:
- chat "Hello, my name is <npc.name>. How can I help?"
2:
trigger: /regex:.*What.*/
script:
- chat "Here it is:"
- wait 1
- inventory open d:in@Trading
Trading:
type: inventory
title: Trading
size: 27
slots:
- "[i@trading_slot1] [i@trading_slot2] [i@trading_slot3] [i@trading_slot4] [i@trading_slot5] [i@trading_slot6]"
trading_slot1:
type: item
material: diamond_sword
display name: Chainsaw
lore:
- "£100"
trading_slot2:
type: item
material: iron_sword
display name: Machete
lore:
- "£50"
trading_slot3:
type: item
material: stone_sword
display name: Fireaxe
lore:
- "£20"
trading_slot4:
type: item
material: wood_sword
display name: Crowbar
lore:
- "£20"
trading_slot5:
type: item
material: bow
display name: Gun
lore:
- "£200"
trading_slot6:
type: item
material: arrow
display name: Bullet
lore:
- "£100"
trading_handler:
type: world
events:
on player clicks in Trading:
- determine cancelled
on player drags in Trading:
- determine cancelled
on player clicks trading_slot1 in Trading:
- if <player.inventory.contains[i@gold_ingot]> {
- take i@gold_ingot:1
- give trading_slot1:1
}
else {
- chat "What are you trying to do?"
}
on player clicks trading_slot2 in Trading:
- if <player.inventory.contains[i@quartz]> {
- take i@quartz:1
- give trading_slot2:1
}
else {
- chat "What are you trying to do?"
}
on player clicks trading_slot3 in Trading:
- if <player.inventory.contains[i@emerald]> {
- take i@emerald:1
- give trading_slot3:1
}
else {
- chat "What are you trying to do?"
}
on player clicks trading_slot4 in Trading:
- if <player.inventory.contains[i@emerald]> {
- take i@emerald: 1
- give trading_slot4:1
}
else {
- chat "What are you trying to do?"
}
on player clicks trading_slot5 in Trading:
- if <player.inventory.contains[i@gold_ingot].quantity[2]> {
- take i@gold_ingot quantity:2
- give trading_slot5:1
}
else {
- chat "What are you trying to do?"
}
on player clicks trading_slot6 in Trading:
- if <player.inventory.contains[i@gold_ingot]> {
- take i@gold_ingot:1
- give trading_slot6:10
}
else {
- chat "What are you trying to do?"
}