Paste #23614: Edit of P#23613 - Edit of P#23612 - Untitled Paste

Date: 2015/12/08 05:49:48 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CreaftVigne:
    type: world
    events:
      on player breaks melon_stem,7 with sugar_cane:
      - playsound <player.location> DIG_GRASS pitch:0.1
      - take iteminhand qty:1
      - playeffect <context.location> instant_spell data:2 visibility:5 quantity:10
      - WAIT 1
      - modifyblock <context.location> dark_oak_fence
      - modifyblock <context.location.above> darkoak_leaves
      on player right clicks dark_oak_fence with shears:
      - define VIGNE <context.location>
      - if <context.location.above.material.is[==].to[m@darkoak_leaves]> || <context.location.above.material.is[==].to[m@leaves_2,9]> {
        - inject USAGE_OUTIL
      }
      else {
        - narrate "<&c>votre pied de vigne est mal en point..."
      }

USAGE_OUTIL:
    type: task
    script:
    - if <player.item_in_hand.durability.is[OR_MORE].than[238]> {
      - take iteminhand
      - playsound location:<player.location> sound:item_BREAK
    }
    else {
      - playsound <player.location> SHEEP_SHEAR pitch:0.8
      - adjust <player.item_in_hand> durability:<player.item_in_hand.durability.add[14]> save:USURE
      - inventory set o:<entry[USURE].result> d:<player.inventory> slot:<player.item_in_hand.slot>
      - if <player.location.biome.formatted> == desert {
          - INJECT RECOLTE_CHARDONNAY
        }
        else if <player.location.biome.formatted.is[==].to[forest]> {
          - INJECT RECOLTE_PINOT_NOIR
        }
        else if <player.location.biome.formatted.is[==].to[plains]> {
          - INJECT RECOLTE_PINOT_MEUNIER
        }
        else {
          - narrate "<&c>Le climat de la région ne permet pas de faire pousser du raisin..."
        }
      }

RECOLTE_CHARDONNAY:
  type: task
  script:
  - narrate "%VIGNE%"
  - define CHANCE <util.random.int[1].to[100]>
  - if <def[Chance]> >= 80 {
    - narrate "<def[Chance]>"
    - drop i@RaisinChardonnay <context.location> quantity:2
  }
  else if <def[Change]> >= 10 {
    - narrate "<def[Chance]>"
    - drop i@RaisinChardonnay <context.location> quantity:1
  }
  else {
    - narrate "<def[Chance]>"
    - narrate "<def[VIGNE]>"
    - modifyblock <def[VIGNE]> melon_stem,3
  }