Date: 2020/01/22 14:01:13 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
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
# Example Inv Script
enchanter_menu:
type: inventory
title: Shard Infusion
size: 27
slots:
- "[<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_shard]>] [<item[enchanter_shard]>] [<item[enchanter_shard]>] [<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_null]>]"
- "[<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_shard]>] [<item[enchanter_core]>] [<item[enchanter_shard]>] [<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_null]>]"
- "[<item[enchanter_charge]>] [<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_shard]>] [<item[enchanter_shard]>] [<item[enchanter_shard]>] [<item[enchanter_null]>] [<item[enchanter_null]>] [<item[enchanter_null]>]"
enchanter_s1:
type: item
material: PAPER
display name: Name
lore:
- "lore here"
- "second line"
enchantments:
- name:level
enchanter_null:
type: item
material: GRAY_STAINED_GLASS_PANE
display name: Table Level Too Low
enchanter_shard:
type: item
material: GLASS_PANE
display name: Fragments Here
enchanter_core:
type: item
material: END_CRYSTAL
display name: Click here to forge a completed shard
enchanter_charge:
type: item
material: BLAZE_POWDER
display name: Enchantment Charge
lore:
- "Current Charge: <player.flag[ench_charge]>"
enchanter_handler:
type: world
events:
on player opens enchanter_menu:
- flag <player> ench_charge:0
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
on player clicks enchanter_core in enchanter_menu:
- if <player.flag[ench_charge]> < 4:
- determine cancelled
- else if <player.flag[ench_charge]> < 8:
- define enchLevel:1
- else if <player.flag[ench_charge]> < 10:
- define enchLevel:2
- else if <player.flag[ench_charge]> < 13:
- define enchLevel:3
- else if <player.flag[ench_charge]> < 16:
- define enchLevel:4
- else if <player.flag[ench_charge]> < 18:
- define enchLevel:5
- else if <player.flag[ench_charge]> < 23:
- define enchLevel:6
- else:
- define enchLevel:7
- execute as_server "ae givercbook <proc[enchanter_num2tier].context[<[enchLevel]>]> <player.name> 1"
- foreach <list[4|5|6|13|15|22|23|24]>:
- if <context.inventory.slot[<[value]>]> != <<item[enchanter_shard]>>:
- inventory set d:<context.inventory> o:<<item[enchanter_shard]>> slot:<[value]>
- flag <player> ench_charge:0
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
on player clicks enchanter_null in enchanter_menu priority:100:
- determine cancelled
on player clicks enchanter_charge in enchanter_menu:
- determine cancelled
on player clicks in enchanter_menu priority:50:
- if <context.clicked_inventory> == <context.inventory>:
- if <context.item> != <<item[enchanter_shard]>> && <context.item> != <<item[enchanter_null]>> && <context.item> != <<item[enchanter_core]>> & <context.item> != <<item[enchanter_charge]>>:
- if <context.cursor_item> == <i@air>:
- choose <context.item.display.strip_color>:
- case "Enchantment Shard":
- flag <player> ench_charge:-:1
- wait 1t
- inventory set d:<context.inventory> o:<<item[enchanter_shard]>> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine i@air
- case "Greater Enchantment Shard":
- flag <player> ench_charge:-:2
- wait 1t
- inventory set d:<context.inventory> o:<<item[enchanter_shard]>> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine i@air
- case "Overloaded Enchantment Shard":
- flag <player> ench_charge:-:3
- wait 1t
- inventory set d:<context.inventory> o:<<item[enchanter_shard]>> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine i@air
- default:
- determine cancelled
- else:
- determine cancelled
on player drags in enchanter_menu priority:100:
- determine cancelled
on player right clicks enchanter_shard in enchanter_menu:
- choose <context.cursor_item.display.strip_color>:
- case "Enchantment Shard":
- flag <player> ench_charge:+:1
- take slot:<context.slot> from:<context.inventory>
- wait 1t
- inventory set d:<context.inventory> o:<context.cursor_item.with[quantity=1]> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
- case "Greater Enchantment Shard":
- flag <player> ench_charge:+:2
- take slot:<context.slot> from:<context.inventory>
- wait 1t
- inventory set d:<context.inventory> o:<context.cursor_item.with[quantity=1]> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
- case "Overloaded Enchantment Shard":
- flag <player> ench_charge:+:3
- take slot:<context.slot> from:<context.inventory>
- wait 1t
- inventory set d:<context.inventory> o:<context.cursor_item.with[quantity=1]> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
- default:
- narrate "<context.cursor_item.display.strip_color||Nothing> is an invalid item"
- determine cancelled
on player left clicks enchanter_shard in enchanter_menu:
- choose <context.cursor_item.display.strip_color>:
- case "Enchantment Shard":
- flag <player> ench_charge:+:1
- take slot:<context.slot> from:<context.inventory>
- give <context.cursor_item.with[quantity=<context.cursor_item.quantity.sub[1]>]>
- wait 1t
- inventory set d:<context.inventory> o:<context.cursor_item.with[quantity=1]> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
- case "Greater Enchantment Shard":
- flag <player> ench_charge:+:2
- take slot:<context.slot> from:<context.inventory>
- give <context.cursor_item.with[quantity=<context.cursor_item.quantity.sub[1]>]>
- wait 1t
- inventory set d:<context.inventory> o:<context.cursor_item.with[quantity=1]> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
- case "Overloaded Enchantment Shard":
- flag <player> ench_charge:+:3
- take slot:<context.slot> from:<context.inventory>
- give <context.cursor_item.with[quantity=<context.cursor_item.quantity.sub[1]>]>
- wait 1t
- inventory set d:<context.inventory> o:<context.cursor_item.with[quantity=1]> slot:<context.slot>
- wait 1t
- inventory adjust d:<context.inventory> slot:19 "lore:Current Charge: <player.flag[ench_charge]>"
- determine cancelled
- default:
- narrate "<context.cursor_item.display.strip_color||Nothing> is an invalid item"
- determine cancelled
on player closes enchanter_menu:
- flag <player> ench_charge:!
- foreach <list[4|5|6|13|15|22|23|24]>:
- if <context.inventory.slot[<[value]>]> != <item[enchanter_shard]>:
- give <context.inventory.slot[<[value]>]>
enchanter_npc:
type: assignment
actions:
on assignment:
- trigger name:click state:true
on click:
- inventory open d:<inventory[enchanter_menu]>
# 6 Categories for enchants
enchanter_num2tier:
type: procedure
definitions: inNum
script:
- choose <[inNum]>:
- case 1:
- determine SIMPLE
- case 2:
- determine UNIQUE
- case 3:
- determine ELITE
- case 4:
- determine ULTIMATE
- case 5:
- determine LEGENDARY
- case 6:
- determine HEROIC
- case 7:
- determine SOUL
enchanter_alch:
type: assignment
actions:
on assignment:
- trigger name:click state:true
on click:
- execute as_op "alchem"
enchanter_tink:
type: assignment
actions:
on assignment:
- trigger name:click state:true
on click:
- execute as_op "tinker"
#enchanter_block_handler:
#type: world
#events:
#on player right clicks enchanting_table:
#- determine passively cancelled
#- inventory open d:<inventory[enchanter_menu]>
#on player right clicks dragon_head:
#- determine passively cancelled
#- execute as_op "alchem"
#on player right clicks lectern:
#- determine passively cancelled
#- execute as_op "tinker"