Date: 2023/01/19 13:42:30 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
upgrader_inventory_logic_world:
type: world
debug: true
events:
on player clicks in Upgrader_GUI:
- if <context.clicked_inventory> == <context.inventory>:
- if <context.slot> == 21 or <context.slot> == 22 or <context.slot> == 23:
- announce "click correct slot"
- else:
- if <context.slot> == 25:
- narrate "<&[base]>upgrade button clicked! - <context.inventory.slot[21].raw_nbt.get[MMOITEMS_PHYSICAL_DAMAGE]>"
- run locally upgrader_process_logic def: <context.inventory>
- determine cancelled
- else:
- narrate "click cancelled"
- determine cancelled
- if <context.clicked_inventory> == <context.inventory> && <context.is_shift_click>:
- narrate "shift click correct slot"
- else:
- if <context.is_shift_click>:
- narrate "shift cancelled"
- determine cancelled
on player drags in Upgrader_GUI:
- if <context.clicked_inventory> == <context.inventory>:
- announce "drag cancelled"
- determine cancelled
on player closes Upgrader_GUI:
- drop <context.inventory.slot[21]>
- drop <context.inventory.slot[22]>
- drop <context.inventory.slot[23]>
upgrader_process_logic:
- if <context.inventory.slot[21].raw_nbt.contains[MMOITEMS_PHYSICAL_DAMAGE]>:
- narrate <context.inventory.slot[21].raw_nbt.get[MMOITEMS_PHYSICAL_DAMAGE]>
- narrate "yes physical damage"
- else:
- narrate <context.inventory.slot[21].raw_nbt.contains[MMOITEMS_PHYSICAL_DAMAGE]>
- narrate <context.inventory.slot[21].raw_nbt.get[MMOITEMS_PHYSICAL_DAMAGE]>