Date: 2017/01/10 09:12:06 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
51
Events:
type: world
debug: true
events:
on player right clicks npc:
- choose <npc.id>:
- case "166":
- inventory open d:in@Farmer
on player clicks in Farmer:
- determine passively cancelled
- flag player GUIItem:<context.item.material.name>
- if <player.flag[GUIItem]> != black_stained_glass_pane {
- inventory open d:in@Money
}
on player clicks in Money:
- determine passively cancelled
- choose <context.item.display>:
- case "<&c>Sell 1":
- if !<player.inventory.contains[<player.flag[GUIItem]>]> {
- narrate "<&c>You do not have enough of this item."
- queue clear
}
- take <player.flag[GUIItem]> from:<player.inventory>
- define itemvalue <yaml[worth].read[worth.<player.flag[GUIItem]>]>
- give money quantity:<def[itemvalue]>
- narrate "<&e>₪<def[itemvalue]> <&A>has been added to your account."
ClickedItem:
type: item
material: <player.flag[GUIItem].as_item>
display name: <&9><&l><player.flag[GUIItem].as_item.material.name.replace[_].with[ ].replace[stalk].with[wart]>
Farmer:
type: inventory
title: <&9><&l>Available Items
size: 45
slots:
- "[Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler]"
- "[Filler] [WheatSeeds] [PumpkinSeeds] [MelonSeeds] [BeetrootSeeds] [Filler] [PotatoITEM] [CarrotITEM] [Filler]"
- "[Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler]"
- "[Filler] [EggITEM] [Filler] [RedMush] [BrownMush] [NethWart] [Filler] [ReedsITEM] [Filler]"
- "[Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler] [Filler]"
Money:
type: inventory
title: <&9><&l>Buy/Sell Goods
size: 27
slots:
- "[Filler] [Filler] [Buy1] [Buy4] [Buy8] [Buy32] [Buy64] [Filler] [Filler]"
- "[Filler] [Filler] [Filler] [Filler] [ClickedItem] [Filler] [Filler] [Filler] [Filler]"
- "[Filler] [Filler] [Sell1] [Sell4] [Sell8] [Sell32] [Sell64] [Filler] [Filler]"