Date: 2020/04/17 21:23:20 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
gold_broker_handler:
type: world
events:
on player clicks in gold_broker_inventory priority:3:
- if <context.raw_slot> < 46:
- determine cancelled
on player double clicks in gold_broker_inventory priority:3:
- if <context.raw_slot> < 46:
- determine cancelled
on player drags in gold_broker_inventory priority:3:
- if <context.raw_slot> < 46:
- determine cancelled
on player left clicks goldnugget1 in gold_broker_inventory priority:1:
- if <player.money> >= <server.flag[nuggetvalue]>:
- narrate "<green>You have purchased 1<gold> Gold Nugget<green> for $<server.flag[nuggetvalue]>"
- money take quantity:<server.flag[nuggetvalue]>
- give GOLD_NUGGET 1
- log "<player.name> bought 1 gold nugget for $<server.flag[nuggetvalue]>" type:info file:bank.log
- else:
- narrate "<red>You do not have enough money to purchase <gold>Gold Nugget."
on player right clicks goldnugget1 in gold_broker_inventory priority:1:
- if <player.inventory.contains.material[GOLD_NUGGET].quantity[1]> = true
- narrate "<green>You have sold 1<gold> Gold Nugget<green> for $<server.flag[nuggetvalue]>"
- money give quantity:<server.flag[nuggetvalue]>
- take GOLD_NUGGET quantity:1
- log "<player.name> sold 1 gold nugget for $<server.flag[nuggetvalue]>" type:info file:bank.log
- else:
- narrate "<red>You do not have enough <gold>Gold Nuggets<red> to sell!"
on player left clicks goldnugget2 in gold_broker_inventory priority:1:
- if <player.money> >= <server.flag[nuggetvalue]>:
- narrate "<green>You have purchased 1<gold> Gold Nugget<green> for $<server.flag[nuggetvalue]>"
- money take quantity:<server.flag[nuggetvalue]>
- give GOLD_NUGGET 1
- log "<player.name> bought 1 gold nugget for $<server.flag[nuggetvalue]>" type:info file:bank.log
- else:
- narrate "<red>You do not have enough money to purchase <gold>Gold Nugget."
on player right clicks goldnugget2 in gold_broker_inventory priority:1:
- if <player.inventory.contains.material[GOLD_NUGGET].quantity[1]> = true
- narrate "<green>You have sold 1<gold> Gold Nugget<green> for $<server.flag[nuggetvalue]>"
- money give quantity:<server.flag[nuggetvalue]>
- take GOLD_NUGGET quantity:1
- log "<player.name> sold 1 gold nugget for $<server.flag[nuggetvalue]>" type:info file:bank.log
- else:
- narrate "<red>You do not have enough <gold>Gold Nuggets<red> to sell!"
on player double_click clicks in inventory:
- determine cancelled
gold_broker:
type: assignment
actions:
on assignment:
- trigger name:click state:true
interact scripts:
- gold_broker_interact
gold_broker_interact:
type: interact
steps:
1:
click trigger:
script:
- inventory open d:Gold_Broker_Inventory
gold_broker_inventory:
type: inventory
inventory: chest
title: Gold Exchange
size: 45
definitions:
guivoid:
gold:
slots:
- [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid]
- [i@guivoid] [i@guivoid] [i@goldnugget1] [i@guivoid] [i@goldingot1] [i@guivoid] [i@goldblock1] [i@guivoid] [i@guivoid]
- [i@guivoid] [i@guivoid] [i@goldnugget2] [i@guivoid] [i@goldingot2] [i@guivoid] [i@goldblock2] [i@guivoid] [i@guivoid]
- [i@guivoid] [i@guivoid] [i@goldnugget3] [i@guivoid] [i@goldingot3] [i@guivoid] [i@goldblock3] [i@guivoid] [i@guivoid]
- [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid] [i@guivoid]
guivoid:
type: item
material: LIGHT_GRAY_STAINED_GLASS_PANE
display name: "<red>"
goldnugget1:
type: item
material: GOLD_NUGGET
display name: "<&6>Left Click to <&a>buy <&e>1 <&6>Gold Nugget"
lore:
- "<green>For $<server.flag[nuggetvalue]>"
- "<gold>Right Click to <&a>sell <yellow>1<gold> Gold Nugget"
- "<green>For $<server.flag[nuggetvalue]>"
goldnugget2:
type: item
material: GOLD_NUGGET
display name: "<&6>Left Click to <&a>buy <&e>16 <&6>Gold Nugget"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[16]>"
- "<gold>Right Click to <&a>sell <yellow>16<gold> Gold Nugget"
- "<green>For $<server.flag[nuggetvalue].mul[16]>"
goldnugget3:
type: item
material: GOLD_NUGGET
display name: "<&6>Left Click to <&a>buy <&e>64 <&6>Gold Nuggets"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[64]>"
- "<gold>Right Click to <&a>sell <yellow>64<gold> Gold Nuggets"
- "<green>For $<server.flag[nuggetvalue].mul[64]>"
goldingot1:
type: item
material: GOLD_INGOT
display name: "<&6>Left Click to <&a>buy <&e>1 <&6>Gold Ingot"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[9]>"
- "<gold>Right Click to <&a>sell <yellow>1<gold> Gold Ingot"
- "<green>For $<server.flag[nuggetvalue].mul[9]>"
goldingot2:
type: item
material: GOLD_INGOT
display name: "<&6>Left Click to <&a>buy <&e>16 <&6>Gold Ingots"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[16]>"
- "<gold>Right Click to <&a>sell <yellow>16<gold> Gold Ingots"
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[16]>"
goldingot3:
type: item
material: GOLD_INGOT
display name: "<&6>Left Click to <&a>buy <&e>64 <&6>Gold Ingots"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[64]>"
- "<gold>Right Click to <&a>sell <yellow>64<gold> Gold Ingots"
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[64]>"
goldblock1:
type: item
material: GOLD_BLOCK
display name: "<&6>Left Click to <&a>buy <&e>1 <&6>Gold Block"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[9]>"
- "<gold>Right Click to <&a>sell <yellow>1<gold> Gold Block"
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[9]>"
goldblock2:
type: item
material: GOLD_BLOCK
display name: "<&6>Left Click to <&a>buy <&e>16 <&6>Gold Blocks"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[9].mul[16]>"
- "<gold>Right Click to <&a>sell <yellow>16<gold> Gold Blocks"
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[9].mul[16]>"
goldblock3:
type: item
material: GOLD_BLOCK
display name: "<&6>Left Click to <&a>buy <&e>64 <&6>Gold Blocks"
lore:
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[9].mul[64]>"
- "<gold>Right Click to <&a>sell <yellow>64<gold> Gold Blocks"
- "<green>For $<server.flag[nuggetvalue].mul[9].mul[9].mul[64]>"
cchat2:
type: format
format: "<&b><npc.name><&c><&co> <&a><text>"