Paste #13435: zozer-crystal item script

Date: 2015/01/28 17:41:51 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


itemgiver:
  type: assignment
  interact scripts:
  - 10 items

items:
  type: interact
  steps:
    1:
      click trigger:
        script:
        - give i@Red_Crystal
        - give i@Black_Crystal
        - give i@Blue_Crystal
        - give i@Green_Crystal
        - give i@Brown_Crystal
        - give i@Yellow_Crystal

Crystal:
  type: item
  material: White_Stained_Glass
  display name: Blank Crystal
  lore: 
  - a blank Crystal
  no-id: false
  bound: flase
Red_Crystal:
  type: item
  material: Red_Stained_Glass
  display name: Fire Crystal
  lore: 
  - a fire Crystal
  - use this to make
  - powerful weapons
  no-id: false
  bound: flase
Black_Crystal:
  type: item
  material: Black_Stained_Glass
  display name: Death Crystal
  lore: 
  - a Death Crystal
  - use this to make
  - powerful weapons
  no-id: false
  bound: flase
Green_Crystal:
  type: item
  material: Green_Stained_Glass
  display name: Nature Crystal
  lore: 
  - a Nature Crystal
  - use this to make
  - powerful weapons
  no-id: false
  bound: flase
Brown_Crystal:
  type: item
  material: Brown_Stained_Glass
  display name: Earth Crystal
  lore: 
  - an Earth Crystal
  - use this to make
  - powerful weapons
  no-id: false
  bound: flase
Blue_Crystal:
  type: item
  material: Blue_Stained_Glass
  display name: Water Crystal
  lore: 
  - a Water Crystal
  - use this to make
  - powerful weapons
  no-id: false
  bound: flase
Yellow_Crystal:
  type: item
  material: Yellow_Stained_Glass
  display name: Light Crystal
  lore: 
  - a light Crystal
  - use this to make
  - powerful weapons
  no-id: false
  bound: flase
Fire_Staff:
  type: item
  material: Blaze_Rod
  display name: Fire Staff
  lore:
  - a powerful Fire Staff
  - made with the Fire Crystal
  recipe:
  - i@Red_Crystal|i@air|i@air
  - i@air|i@Blaze_Rod|i@air
  - i@air|i@air|i@Blaze_Rod
Fire_Sword:
  type: item
  material: stone_sword
  display name: Fire Sword
  lore:
  - a Sword with the
  - power of fire
  enchantments: 
  - FIRE_ASPECT:2
  recipe:
  - i@air|i@Red_Crystal|i@air
  - i@air|i@stone|i@air
  - i@air|i@stick|i@air
Nature_Staff:
  type: item
  material: stick
  display name: Nature Staff
  lore:
  - a powerful Nature Staff
  - made with the Nature Crystal
  recipe:
  - i@Green_Crystal|i@air|i@air
  - i@air|i@Blaze_Rod|i@air
  - i@air|i@air|i@Blaze_Rod
Death_Staff:
  type: item
  material: Blaze_Rod
  display name: Death Staff
  lore:
  - a powerful Death Staff
  - made with the Death Crystal
  recipe:
  - i@Black_Crystal|i@air|i@air
  - i@air|i@Blaze_Rod|i@air
  - i@air|i@air|i@Blaze_Rod
Water_staff:
  type: item
  material: Blaze_Rod
  display name: Water Staff
  lore:
  - a powerful Water Staff
  - made with the Water Crystal
  recipe:
  - i@Blue_Crystal|i@air|i@air
  - i@air|i@Blaze_Rod|i@air
  - i@air|i@air|i@Blaze_Rod
Earth_Staff:
  type: item
  material: Blaze_Rod
  display name: Earth Staff
  lore:
  - a powerful Earth Staff
  - made with the Earth Crystal
  recipe:
  - i@Brown_Crystal|i@air|i@air
  - i@air|i@Blaze_Rod|i@air
  - i@air|i@air|i@Blaze_Rod  
Light_Sword:
  type: item
  material: gold_sword
  display name: Sword of Light
  lore:
  - a Sword with the
  - power of light
  - can use to attack ghost
  recipe:
  - i@air|i@Yellow_Crystal|i@air
  - i@air|i@stone|i@air
  - i@air|i@stick|i@air
Light_Helm:
  type: item
  material: gold_helmet
  display name: Helm of Light
  lore:
  - a Helm with
  - the power of light
  - can allow you to see ghost
  recipe:
  - i@iron_ingot|i@Yellow_Crystal|i@iron_ingot
  - i@iron_ingot|i@air|i@iron_ingot
  - i@air|i@air|i@air
Light_Chestplate:
  type: item
  material: gold_chestplate
  display name: Chestplate of Light
  lore:
  - a Chestplate with
  - the Power of Light
  recipe:
  - i@iron_ingot|i@air|i@iron_ingot
  - i@iron_ingot|i@Yellow_Crystal|i@iron_ingot
  - i@iron_ingot|i@iron_ingot|i@iron_ingot
Light_Leggings:
  type: item
  material: gold_leggings
  display name: Leggings of Light
  lore:
  - a pair of Leggings with
  - the Power of Light
  recipe:
  - i@iron_ingot|i@Yellow_Crystal|i@iron_ingot
  - i@iron_ingot|i@air|i@iron_ingot
  - i@iron_ingot|i@air|i@iron_ingot
Light_Boots:
  type: item
  material: gold_boots
  display name: Boots of Light
  lore:
  - a pair of Boots 
  - with the power of Light
  recipe:
  - i@air|i@air|i@air
  - i@Yellow_Crystal|i@air|i@iron_ingot
  - i@iron_ingot|i@air|i@iron_ingot
Staff_of_Light:
  type: item
  material: Blaze_Rod
  display name: Staff of Light
  lore:
  - a powerful Light Staff
  - made with the Light Crystal
  recipe:
  - i@Yellow_Crystal|i@air|i@air
  - i@air|i@Blaze_Rod|i@air
  - i@air|i@air|i@Blaze_Rod
energy:
    type: command
    name: Enegy Check
    description: check your energy
    usage: /energy
    script:
    - narrate "you have '<player.flag[energy]>'"
energy_add:
    type: command
    name: Enegy Check
    description: check your energy
    usage: /energy <&lt>arg1<&gt>
    script:
    - narrate "you have added '<context.args>' energy"
    - flag player energy:+<context.args>
energy_amount:
  type: task
  script:
  - if <player.flag[energy]> == null{
    - flag player energy:100
    }
  - if <player.flag[energy]> < 100{
    - flag player energy_increase
  - if <player.has_flag[energy_increase]>{
    - wait 60
    - flag player energy:++
    - flag player energy_increase:!
    }  
Items_event:
  type: world
  events:
    on player places i@Crystal:
    - determine CANCELLED
    on player places i@Red_Crystal:
    - determine CANCELLED
    on player places i@Blue_Crystal:
    - determine CANCELLED
    on player places i@Green_Crystal:
    - determine CANCELLED
    on player places i@Black_Crystal:
    - determine CANCELLED
    on player places i@Brown_Crystal:
    - determine CANCELLED
    on player places i@Yellow_Crystal:
    - determine CANCELLED       
    on player damages npc:
    - if <player.item_in_hand.material.name.is[=].to[Death_Staff]>{
      - if <player.flag[energy]> <= 9{
        - narrate "<red> not enough energy"
        - queue clear
        }
      - cast WITHER <context.entity>
      - flag player energy:-:10
      }
    - if <npc.has_flag[lightdamage]>{
      - if <player.item_in_hand.material.name[!=].to[Light_Sword]>{
      - determine CANCELLED
      - narrate <context.damage>
      }
    - if <player.item_in_hand.material.name.is[=].to[Nature_Staff]>{
      - if <player.flag[energy]> <= 9{
        - narrate "<red> not enough energy"
        - queue clear
        }
      - cast SLOW <context.entity>
      - flag player energy:-:10       
      }
    - if <player.item_in_hand.material.name.is[=].to[Earth_Staff]>{
      - if <player.flag[energy]> <= 9{
        - narrate "<red> not enough energy"
        - queue clear
        }
      - cast SLOW <context.entity>
      - modifyblock <entity.location> stone radius:3 height:3
      - flag player energy:-:20      
      }        
    on player left clicks dirt with i@Nature_Staff:
    - if <player.flag[energy]> <= 4{
      - narrate "<red> not enough energy"
      - queue clear
      }      
    - define plant '<until.random.int[1].to[5]>'
    - if <def[plant]> == 1{
      - modifyblock <context.relative> oak_sapling
      }
    - if <def[plant]> == 2{
      - modifyblock <context.relative> spruce_sapling
      }
    - if <def[plant]> == 3{
      - modifyblock <context.relative> birch_sapling
      }
    - if <def[plant]> == 4{
      - modifyblock <context.relative> acacia_sapling
      }
    - if <def[plant]> == 5{
      - modifyblock <context.relative> jungle_sapling
      }
    - flag player energy:-:5
    on player right clicks with i@Nature_Staff:
    - determine CANCELLED

    on player right clicks with i@Water_staff:
    - if <player.flag[energy]> <= 4{
      - narrate "<red> not enough energy"
      - queue clear
      }      
    - modifyblock <context.relative> Flowing_Water 
    on player right clicks with i@Fire_Staff:
    - if <player.flag[energy]> <= 9{
      - narrate "<red> not enough energy"
      - queue clear
      }
    - flag player energy:-:10
    - shoot small_fireball destination:<player.location.cursor_on> height:3 gravity:0 speed:1
    - flag player energy:-:10 
    on player left clicks with i@Fire_Staff:
    - cast FIRE_RESISTANCE player d:60
    on player right clicks with i@Fire_Sword:
    - if <player.flag[energy]> <= 9{
      - narrate "<red> not enough energy"
      - queue clear
      }
    - shoot small_fireball destination:<player.location.cursor_on> height:3 gravity:0 speed:1
    - flag player energy:-:10