Paste #40594: Untitled Paste

Date: 2017/03/09 03:00:12 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


EventDamage:
  debug: false
  type: task
  script:
  - inject FindItemAttack instantly
  - define Damage <util.random.int[<def[aMin]>].to[<def[aMax]>]>

UpdateHandDurability:
  debug: false
  type: task
  script:
  - inject FindHandDurability instantly
  - if <def[dCurrent]> <= 0 {
    - adjust <player> "action_bar:<red>Your item has zero durability!"
    - determine cancelled passively
    - queue clear
  } else {
    - define nDurability <def[dCurrent].sub[1].as_int>
    - define nLore <def[iLore].set[<blue>Durability<&co><&sp><gray><def[nDurability]>/<def[dMaximum]>].at[<def[iLore].find_partial[Durability]>]>
    - adjust <pl.item_in_hand> "lore:<def[nLore]>" save:item
    - equip <c.damager> hand:<entry[item].result>
  }