Paste #105523: a

Date: 2023/01/19 13:42:30 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


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]>