Paste #37280: Untitled Paste

Date: 2016/10/28 20:36:25 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Nokasn:
  type: assignment
  actions:
    on assignment:
      - trigger name:click state:true
      - trigger name:chat state:true radius:5
    on chat:
####Choose Gold####
    - if <player.has_flag[choosegold]> && <context.message> !matches number {
      - wait 1
      - narrate "You must enter in a number."
      - queue clear
      }
    - if <player.has_flag[choosegold]> && <player.money> < <context.message.mul_int[75]> {
      - wait 1
      - narrate "Ironic isn't it, not having enough gold for more gold?"
      - flag player choosegold:!
      - queue clear
      }
    - if <player.has_flag[choosegold]> && <player.inventory.can_fit[266].quantity[<context.message>]> == false {
      - wait 1
      - narrate "How are you planning to transport all of that?" 
      - flag player choosegold:!
      - queue clear
      }
    - if <player.has_flag[choosegold]> && <player.inventory.can_fit[266].quantity[<context.message>]> == true && <context.message.mul_int[75]> <= <player.money> {
      - narrate "Ah gold, an essential components to many engineering pursuits."
      - money take quantity:<context.message.mul_int[75]>
      - flag player choosegold:!
      - give 266 quantity:<context.message>
      - narrate "Hope to have the pleasure of your patronage again soon."
      - queue clear
      }
####Choose Iron####
    - if <player.has_flag[chooseiron]> && <context.message> !matches number {
      - wait 1
      - narrate "You must enter in a number."
      - queue clear
      }
    - if <player.has_flag[chooseiron]> && <player.money> < <context.message.mul_int[25]> {
      - wait 1
      - narrate "With so little money, perhaps you should concern yourself with food before tools and supplies."
      - flag player chooseiron:!
      - queue clear
      }
    - if <player.has_flag[chooseiron]> && <player.inventory.can_fit[265].quantity[<context.message>]> == false {
      - wait 1
      - narrate "How are you planning to transport all of that?" 
      - flag player chooseiron:!
      - queue clear
      }
    - if <player.has_flag[chooseiron]> && <player.inventory.can_fit[265].quantity[<context.message>]> == true && <context.message.mul_int[25]> <= <player.money> {
      - narrate "Ah iron, an essential components to many engineering pursuits."
      - money take quantity:<context.message.mul_int[25]>
      - flag player chooseiron:!
      - give 265 quantity:<context.message>
      - narrate "Hope to have the pleasure of your patronage again soon."
      - queue clear
      }
    on click:
      - narrate "Greetings friend. Take a moment and browse my fine wares!"
      - wait 1
      - inventory open d:in@nokores

noksupplies:
  type: inventory
  title: 
  size: 27
  slots:
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"

nokbuilding:
  type: inventory
  title: 
  size: 27
  slots:
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"

noktools:
  type: inventory
  title: Tools and Redstone
  size: 27
  slots:
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"

nokores:
  type: inventory
  title: Ores and Ingots
  size: 18
  slots:
  - "[i@goldchoosei] [i@goldstacki] [i@ironchoosei] [i@ironstacki] [] [] [] [] []"
  - "[] [] [] [] [] [] [] [] []"

####Ore items####
goldstacki:
  type: item
  material: 266
  display name: Stack of Gold
  lore:
  - "A stack of gold ingots"
  - "Cost: $4500"
goldchoosei:
  type: item
  material: 266
  display name: Gold Ingots (Choose Amount)
  lore:
  - "Gold ingots. When clicked you"
  - "will be prompted to enter in"
  - "the desired amount."
  - "Cost: $75 per ingot."
ironstacki:
  type: item
  material: 265
  display name: Stack of Iron
  lore:
  - "A stack of iron ingots"
  - "Cost: $1600"
ironchoosei:
  type: item
  material: 265
  display name: Iron Ingots (Choose Amount)
  lore:
  - "Iron ingots. When clicked you"
  - "will be prompted to enter in"
  - "the desired amount."
  - "Cost: $25 per ingot."
####################
####Item Handler####
####################
noks_store:
  type: world
  events:
    on player clicks in nokores:
    - determine cancelled
    on player drags in nokores:
    - determine cancelled
    on player clicks in nokbuilding:
    - determine cancelled
    on player drags in nokbuilding:
    - determine cancelled
    on player clicks in noksupplies:
    - determine cancelled
    on player drags in noksupplies:
    - determine cancelled
    on player clicks in noktools:
    - determine cancelled
    on player drags in noktools:
    - determine cancelled
################
####Ore Menu####
################
    on player clicks goldstacki in nokores:
    - if <player.money> < "4800" {
      - inventory close
      - narrate "Ironic as it is, one must have gold for gold."
      - queue clear
       }
    - if <player.money> >= "4800" && <player.inventory.can_fit[266].quantity[64]> == false {
      - inventory close
      - narrate "How do you propose to transport the goods? (Inventory Full)"
      - queue clear
      }
    - if <player.money> >= "4800" && <player.inventory.can_fit[266].quantity[64]> == true {
      - money take quantity:4800
      - give 266 quantity:64
      - narrate "<&o>$4800 has been deducted from your balance."
    on player clicks ironstacki in nokores:
    - if <player.money> < "1600" {
      - inventory close
      - narrate "With so little money, perhaps you should concern yourself with food before tools and supplies."
      - queue clear
       }
    - if <player.money> >= "1600" && <player.inventory.can_fit[265].quantity[64]> == false {
      - inventory close
      - narrate "How do you propose to transport the goods? (Inventory Full)"
      - queue clear
      }
    - if <player.money> >= "1600" && <player.inventory.can_fit[265].quantity[64]> == true {
      - money take quantity:2600
      - give 266 quantity:64
      - narrate "<&o>$1600 has been deducted from your balance."
    on player clicks goldchoosei in nokores:
    - inventory close
    - narrate "How many would you like? (Please type a number in chat)"
    - flag player choosegold duration:2m
    on player clicks ironchoosei in nokores:
    - inventory close
    - narrate "How many would you like? (Please type a number in chat)"
    - flag player chooseiron duration:2m