Date: 2018/08/18 18:02:54 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
###NPC Assignment###
BasicBlacksmithasn:
type: assignment
actions:
on assignment:
- trigger name:click state:true
- trigger name:chat state:true radius:5
on chat:
- if <context.message> == !Armor {
- narrate "Take a look at my wears. Various armorment to keep you safe!"
- wait 1
- inventory open d:in@BlackSmithArmorInv
}
- if <context.message> == !Arms {
- narrate "Gonna end up in a scrape or two? Check out our selection of weapons!"
- wait 1
- inventory open d:in@BlacksmithWeaponsInv
}
- if <context.message> == !Tools {
- narrate "Have a project that needs doin'? We have everything you need!"
- wait 1
- inventory open d:in@BlacksmithToolsInv
}
on click:
- narrate "Take a look at my wears. Various armorment to keep you safe!"
- wait 1
- inventory open d:in@BlacksmithArmorInv
###Shop Inventories and Items###
BlacksmithWeaponsInv:
type: inventory
title: Arms For Sale
size: 27
slots:
- "[i@ISword] [i@GSword] [i@DSword] [] [] [] [] [] []"
- "[i@BowShop] [i@ArrowShop] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [i@BlacksmithToolsIt] [i@BlacksmithArmorIt] [i@RepairIt]"
BlacksmithArmorInv:
type: inventory
title: Armor For Sale
size: 27
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [i@BlacksmithToolsIt] [i@BlacksmithWeaponsIt] [i@RepairIt]"
BlacksmithToolsInv:
type: inventory
title: Tools For Sale
size: 27
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [i@BlacksmithArmorIt] [i@BlacksmithWeaponsIt] [i@RepairIt]"
###Menu Items###
BlacksmithWeaponsIt:
type: item
material: diamond_sword
display name: Weapons
lore:
- "Click here to browse"
- "our selection of arms."
BlacksmithArmorIt:
type: item
material: diamond_chestplate
display name: Armor
lore:
- "Click here to browse"
- "our selection of armor."
BlacksmithToolsIt:
type: item
material: crafting_table
display name: Tools
lore:
- "Click here to browse"
- "our selection of tools"
RepairIt:
type: item
material: anvil
display name: Repair Item
lore:
- "Click here to repair"
- "the item currently in"
- "your hand."
###Weapons###
ISword:
type: item
material: iron_sword
display name: Iron Sword
lore:
- "Click here to purchase"
- "a Iron Sword."
- "Cost: 100"
GSword:
type: item
material: golden_sword
display name: Gold Sword
lore:
- "Click here to purchase"
- "a Gold Sword."
- "Cost: 1000"
DSword:
type: item
material: diamond_sword
display name: Diamond Sword
lore:
- "Click here to purchase"
- "a Diamond Sword."
- "Cost: 2500"
BowShop:
type: item
material: bow
display name: Bow
lore:
- "Click here to purchase"
- "a bow."
- "Cost: 100"
ArrowShop:
type: item
material: arrow
display name: Arrows
lore:
- "Click here to purchase"
- "a bundle of 32 arrows."
- "Cost: 50"
###Armor###
IChestPlate:
type: item
material: iron_chestplate
display name: Iron Chestplate
lore:
- "Click here to purchase"
- "an Iron Chest Plate."
- "Cost: "
###Shop Inventory Handler:###
BasicBlacksmithHandler:
type: world
events:
on player clicks in BlackSmithArmorInv:
- determine cancelled
on player drags in BlackSmithArmorInv:
- determine cancelled
on player clicks in BlacksmithWeaponsInv:
- determine cancelled
on player drags in BlacksmithWeaponsInv:
- determine cancelled
on player clicks in BlacksmithToolsInv:
- determine cancelled
on player drags in BlacksmithToolsInv:
- determine cancelled
on player clicks BlacksmithWeaponsIt in BlacksmithArmorInv ignorecancelled:true:
- inventory close
- inventory open d:in@BlacksmithWeaponsInv
on player clicks BlacksmithArmorIt in BlacksmithWeaponsInv ignorecancelled:true:
- inventory close
- inventory open d:in@BlacksmithArmorInv
on player clicks BlacksmithArmorIt in BlacksmithToolsInv ignorecancelled:true:
- inventory close
- inventory open d:in@BlacksmithArmorInv
on player clicks BlacksmithWeaponsIt in BlacksmithToolsInv ignorecancelled:true:
- inventory close
- inventory open d:in@BlacksmithWeaponsInv
on player clicks BlacksmithToolsIt in BlacksmithArmorInv ignorecancelled:true:
- inventory close
- inventory open d:in@BlacksmithToolsInv
on player clicks BlacksmithToolsIt in BlacksmithWeaponsInv ignorecancelled:true:
- inventory close
- inventory open d:in@BlacksmithToolsInv
###Repair Handler###
on player clicks RepairIt in BlacksmithArmorInv:
- if <player.money> >= "100" && <player.item_in_hand.durability> != null {
- money take quantity:100
- adjust <player.item_in_hand> durability:0 save:newitem
- take iteminhand
- give <entry[newitem].result>
- narrate "<&o>$100 has been deducted from your balance."
} else {
- inventory close
- narrate "You need to fix your wallet before I can fix your items."
}
on player clicks RepairIt in BlacksmithWeaponsInv:
- if <player.money> >= "100" && <player.item_in_hand.durability> != null {
- money take quantity:100
- adjust <player.item_in_hand> durability:0 save:newitem
- take iteminhand
- give <entry[newitem].result>
- narrate "<&o>$100 has been deducted from your balance."
} else {
- inventory close
- narrate "You need to fix your wallet before I can fix your items."
}
on player clicks RepairIt in BlacksmithToolsInv:
- if <player.money> >= "100" && <player.item_in_hand.durability> != null {
- money take quantity:100
- adjust <player.item_in_hand> durability:0 save:newitem
- take iteminhand
- give <entry[newitem].result>
- narrate "<&o>$100 has been deducted from your balance."
} else {
- inventory close
- narrate "You need to fix your wallet before I can fix your items."
}
###Weapons Handler###
on player clicks ISword in BlacksmithWeaponsInv:
- if <player.money> >= "100" {
- money take quantity:100
- narrate "A quality and reliable blade!"
- narrate "<&o>$100 has been deducted from your balance."
} else {
- inventory close
- narrate "No coin, no sword."
}
on player clicks GSword in BlacksmithWeaponsInv:
- if <player.money> >= "1000" {
- money take quantity:1000
- narrate "A bit brittle, but the sharpest you'll find!"
- narrate "<&o>$1000 has been deducted from your balance."
} else {
- inventory close
- narrate "No coin, no sword."
}
on player clicks DSword in BlacksmithWeaponsInv:
- if <player.money> >= "2500" {
- money take quantity:2500
- narrate "Insanely durable and a bit heavy. This won't fail you!"
- narrate "<&o>$2500 has been deducted from your balance."
} else {
- inventory close
- narrate "No coin, no sword."
}
on player clicks BowShop in BlacksmithWeaponsInv:
- if <player.money> >= "100" {
- money take quantity:100
- narrate "Looking to keep your distance or do a little hunting?"
- narrate "<&o>$100 has been deducted from your balance."
} else {
- inventory close
- narrate "No coin, no pew."
}
on player clicks ArrowShop in BlacksmithWeaponsInv:
- if <player.money> >= "50" {
- money take quantity:50
- narrate "Guaranteed to stick anything you have the skill to hit."
- narrate "<&o>$50 has been deducted from your balance."
} else {
- inventory close
- narrate "No coin, no pew."
}
###Armor Handler###