Date: 2023/01/22 13:05:41 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
upgrader_inventory_logic_world:
type: world
debug: true
events:
on player clicks selecter_tools in Upgrader_GUI_select:
- inventory open destination:Upgrader_GUI_tools
on player clicks selecter_weapons in Upgrader_GUI_select:
- inventory open destination:Upgrader_GUI_weapons
on player clicks selecter_armor in Upgrader_GUI_select:
- inventory open destination:Upgrader_GUI_armor
on player clicks in Upgrader_GUI_tools:
- define inv <context.inventory>
- define click_inv <context.clicked_inventory>
- define slot <context.slot>
- define slot_mat1 <context.inventory.slot[14]>
- define sh_click <context.is_shift_click>
- if <[click_inv]> == <[inv]>:
- if <[slot]> == 41 or <[slot]> == 14:
- determine cancelled:false
- else:
- if <[slot]> == 1:
- if <[slot_mat1].raw_nbt.get[MMOITEMS_ITEM_ID]> == string:IMPURE_RUBY:
- run locally path:upgrader_process_logic def:<[inv]>
- take item:paper from:<[inv]> slot:21
- determine cancelled
- else:
- narrate "upgrade materials needed"
- determine cancelled
- else:
- determine cancelled
- if <[click_inv]> != <[inv]> && <[sh_click]>:
- determine cancelled
on player drags in Upgrader_GUI_tools:
- define inv <context.inventory>
- define click_inv <context.clicked_inventory>
- if <[click_inv]> == <[inv]>:
- determine cancelled
on player closes Upgrader_GUI_tools:
- drop <context.inventory.slot[14]>
- drop <context.inventory.slot[41]>
on player clicks in Upgrader_GUI_weapons:
- define inv <context.inventory>
- define click_inv <context.clicked_inventory>
- define slot <context.slot>
- define slot_mat1 <context.inventory.slot[14]>
- define sh_click <context.is_shift_click>
- if <[click_inv]> == <[inv]>:
- if <[slot]> == 41 or <[slot]> == 14:
- determine cancelled:false
- else:
- if <[slot]> == 1:
- if <[slot_mat1].raw_nbt.get[MMOITEMS_ITEM_ID]> == string:IMPURE_RUBY:
- run locally path:max_durability_logic def:<[inv]>
- take item:paper from:<[inv]> slot:21
- determine cancelled
- else:
- narrate "upgrade materials needed"
- determine cancelled
- else:
- determine cancelled
- if <[click_inv]> != <[inv]> && <[sh_click]>:
- determine cancelled
on player drags in Upgrader_GUI_weapons:
- define inv <context.inventory>
- define click_inv <context.clicked_inventory>
- if <[click_inv]> == <[inv]>:
- determine cancelled
on player closes Upgrader_GUI_weapons:
- drop <context.inventory.slot[14]>
- drop <context.inventory.slot[41]>
on player clicks in Upgrader_GUI_armor:
- define inv <context.inventory>
- define click_inv <context.clicked_inventory>
- define slot <context.slot>
- define slot_mat1 <context.inventory.slot[14]>
- define sh_click <context.is_shift_click>
- if <[click_inv]> == <[inv]>:
- if <[slot]> == 41 or <[slot]> == 14:
- determine cancelled:false
- else:
- if <[slot]> == 1:
- if <[slot_mat1].raw_nbt.get[MMOITEMS_ITEM_ID]> == string:IMPURE_RUBY:
- run locally path:upgrader_process_logic def:<[inv]>
- take item:paper from:<[inv]> slot:21
- determine cancelled
- else:
- narrate "upgrade materials needed"
- determine cancelled
- else:
- determine cancelled
- if <[click_inv]> != <[inv]> && <[sh_click]>:
- determine cancelled
on player drags in Upgrader_GUI_armor:
- define inv <context.inventory>
- define click_inv <context.clicked_inventory>
- if <[click_inv]> == <[inv]>:
- determine cancelled
on player closes Upgrader_GUI_armor:
- drop <context.inventory.slot[14]>
- drop <context.inventory.slot[41]>
upgrader_process_logic:
- define inv <[1]>
- if <[inv].slot[41].raw_nbt.contains[MMOITEMS_PHYSICAL_DAMAGE]>:
- define nbt <[inv].slot[41].raw_nbt>
- define phy_dmg <[inv].slot[41].raw_nbt.get[MMOITEMS_PHYSICAL_DAMAGE].after[double:]>
- define lore <[inv].slot[41].lore>
- define lore_loc <[lore].find_partial[physical damage]>
- define new_stat_value <[phy_dmg].add[99.0]>
- define new_lore_value <[lore].set[ <&color[f]>؏ <&color[8]>» <&color[f]>Physical Damage: <&color[3]><&color[l]>+<[new_stat_value]>%].at[<[lore_loc]>]>
- inventory adjust destination:<[inv]> slot:41 raw_nbt:<[nbt].with[MMOITEMS_PHYSICAL_DAMAGE].as[double:<[new_stat_value]>]>
- inventory adjust destination:<[inv]> slot:41 "lore:<[new_lore_value]>"
- else:
- narrate "no physical damage"
max_durability_logic:
- define inv <[1]>
- if <[inv].slot[41].raw_nbt.contains[MMOITEMS_MAX_DURABILITY]>:
- define nbt <[inv].slot[41].raw_nbt>
- define lore <[inv].slot[41].lore>
- define lore_loc <[lore].find_partial[durability]>
- define max_durability <[inv].slot[41].raw_nbt.get[MMOITEMS_MAX_DURABILITY].after[int:]>
- define new_max_dur <[max_durability].add[100]>
- define new_lore_value <[lore].set[ <&color[f]> <&color[8]>» <&color[f]>Durability: <&color[a]><&color[l]><[new_max_dur]> / <[new_max_dur]>].at[<[lore_loc]>]>
- inventory adjust destination:<[inv]> slot:41 raw_nbt:<[nbt].with[MMOITEMS_MAX_DURABILITY].as[int:<[new_max_dur]>]>
- inventory adjust destination:<[inv]> slot:41 "lore:<[new_lore_value]>"