Paste #37931: stuff

Date: 2016/11/23 22:15:47 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


on player clicks in sp_buy_inv:
    - if <context.raw_slot> < 55 {
      - determine passively cancelled
      - if <context.raw_slot> > 9 && <context.item> != <i@sp_glass> {
        - define worth "<context.item.lore.get[<context.item.lore.size>].after[: ]>"
        - define region "<yaml[sp].read[shops.<player.flag[shopinfo].get[1]>.currency]||default>"
        - define money "<proc[emoney].context[<def[region]>]>"
        - if <context.is_shift_click> {
          - if <proc[invspace].sub[<context.item.quantity.mul[8].div[64].round_up>]> >= 0 {  
            - if <def[money]> >= <def[worth].mul[8]> {
              - narrate "<&6><def[worth].mul[8]> <&f><s@g_var.constant[m_<def[region]>_pl]> entfernt."
              - run s@emoney_take def:<def[region]>|<def[worth].mul[8]>
              - adjust <context.item> "lore:<context.item.lore.remove[<context.item.lore.size>]>" save:item
              - repeat 8 {
                - give <entry[item].result>
                }
              }
              else {
              - narrate "<&4>Du hast nicht genug Geld !"
              }
            }
            else {
            - narrate "<&4>Du hast kein Platz!"
            }
          }
          else {
          - if <proc[invspace].sub[<context.item.quantity.div[64].round_up>]> >= 0 {
    # todo        - if <player.flag[sp_<npc.id>]||<yaml[sp].read[]>> >= <def[worth]>  {
              - if <def[money]> >= <def[worth]> {
                - narrate "<&6><def[worth]> <&f><s@g_var.constant[m_<def[region]>_pl]> entfernt."
                - run s@emoney_take def:<def[region]>|<def[worth]>
                - adjust <context.item> "lore:<context.item.lore.remove[<context.item.lore.size>]>" save:item
                - give <entry[item].result>
                }
                else {
                - narrate "<&4>Du hast nicht genug Geld !"
    # end of the if            }
              }
              else {
              - narrate "<&6><npc.name> <&4>nicht genug Geld um tauschen!"
              }
            }
            else {
            - narrate "<&4>Du has nicht genug Platz!"
            }
          }
        }
      }
      else if <context.is_shift_click> {
      - determine cancelled
      }