Paste #68370: Untitled Paste

Date: 2020/04/30 21:16:40 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


nature_spellbook:
    type: item
    display name: "<&a><&l>Spellbook of Nature"
    mechanisms:
        custom_model_data: 123456
    material: stick
entangle:
    type: item
    display name: <&5><&l>Entangle
    material: cobweb
    lore:
    - "<&o>Summon soul sand to slow your target's movement!"
nature_heal:
    type: item
    display name: <&a><&l>Heal
    material: legacy_red_rose
    lore:
    - "<&o>Summon powerful redstone ores"
    - "<&o>to heal yourself and other around you!"
spring:
    type: item
    display name: <&2><&l>Spring
    material: ender_pearl
    lore:
    - "<&o>Summon slime blocks beneath you to"
    - "<&o>launch yourself and others into the air!"
glow:
    type: item
    display name: <&e><&l>Glow
    material: glowstone
    lore:
    - "<&o>Make everything visible in your strike!"
nature_spellbook_gui:
    type: inventory
    inventory: chest
    title: <&a><&l>Spellbook of Nature
    size: 9
    slots:
        - [entangle] [nature_heal] [spring] [glow] [] [] [] [] []
clear_nature_spells:
    type: command
    name: clearnaturespells
    usage: /clearnaturespells
    script:
    - flag player natureheal:!
    - flag player entangle:!
    - flag player spring:!
    - flag player glow:!
opennaturebook:
    type: world
    events:
        on player right clicks with nature_spellbook:
        - inventory open d:nature_spellbook_gui
        on player drags in nature_spellbook_gui:
        - determine cancelled
        on player clicks entangle in nature_spellbook_gui:
        - execute as_op clearnaturespells silent
        - narrate "<&a><&l>You selected <&5><&l>Entangle<&a><&l>!"
        - flag player entangle
        - inventory close d:<context.inventory>
        on player clicks nature_heal in nature_spellbook_gui:
        - execute as_op clearnaturespells silent
        - narrate "<&a><&l>You selected <&5><&l>Heal<&a><&l>!"
        - flag player natureheal
        - inventory close d:<context.inventory>
        on player clicks spring in nature_spellbook_gui:
        - execute as_op clearnaturespells silent
        - narrate "<&a><&l>You selected <&2><&l>Spring<&a><&l>!"
        - flag player spring
        - inventory close d:<context.inventory>
        on player clicks glow in nature_spellbook_gui:
        - execute as_op clearnaturespells silent
        - narrate "<&a><&l>You selected <&e><&l>Glow<&a><&l>!"
        - flag player glow
        - inventory close d:<context.inventory>
nature_heal_spell:
    type: world
    events:
        on player right clicks with nature_staff:
        - if !<player.has_flag[natureheal]>:
            - stop
        - if <context.item.nbt[charge]> == 0:
            - narrate "<&c>Your Nature Staff is out of charges!"
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - if <player.has_flag[magic_cooldown]>:
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - define charge:<context.item.nbt[charge].sub[1]>
        - define target <player.cursor_on.simple.as_location>
        - define nearplayers <[target].find.players.within[5]>
        - define area <[target].find.surface_blocks.within[5]>
        - define path <[target].points_between[<player.location>].distance[1]>
        - define distance <[target].distance[<player.location>]>
        - if <[distance]> >= 5:
            - narrate "<&c>Target area too far."
            - stop
        - flag player magicxp:+:20
        - actionbar "<&a><&l>+20 Magic XP"
        - if <player.flag[magicxp]> >= <server.flag[magiclevels].get_sub_items[1].get[<player.flag[magiclvl]>]>:
            - flag player magiclvl:+:1
            - playsound <player.location> ENTITY_PLAYER_LEVELUP
            - toast "Congratulations! Your magic level is now <player.flag[magiclvl]>."
        - inventory adjust slot:<player.held_item_slot> nbt:charge/<[charge]>
        - inventory adjust slot:<player.held_item_slot> "display_name:<&a><italic>Nature Staff <&5>Charges <&e><&l>[<[charge]>]"
        - flag player magic_cooldown duration:1s
        - foreach <[path].reverse>:
            - wait 1t
            - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:1
            - playeffect redstone <[value].simple.as_location> special_data:1|white visibility:1000 quantity:25
        - foreach <[area]>:
            - showfake redstone_ore <[value]> players:<server.list_online_players> d:1s
        - playeffect heart <[target]> visibility:1000 quantity:500 offset:3
        - wait 4t
        - playeffect heart <[target]> visibility:1000 quantity:500 offset:3
        - wait 4t
        - playeffect heart <[target]> visibility:1000 quantity:500 offset:3
        - foreach <[nearplayers]>:
            - heal 4 <[value]>
            - narrate "<&a>You healed <[value].name>."
        - if <[charge]> == 0:
            - narrate "<&c>Your Nature Staff has ran out of charges!"
entangle_spell:
    type: world
    events:
        on player right clicks with nature_staff:
        - if !<player.has_flag[entangle]>:
            - stop
        - if <context.item.nbt[charge]> == 0:
            - narrate "<&c>Your Nature Staff is out of charges!"
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - if <player.has_flag[magic_cooldown]>:
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - flag player magicxp:+:20
        - actionbar "<&a><&l>+20 Magic XP"
        - if <player.flag[magicxp]> >= <server.flag[magiclevels].get_sub_items[1].get[<player.flag[magiclvl]>]>:
            - flag player magiclvl:+:1
            - playsound <player.location> ENTITY_PLAYER_LEVELUP
            - toast "Congratulations! Your magic level is now <player.flag[magiclvl]>."
        - define charge:<context.item.nbt[charge].sub[1]>
        - inventory adjust slot:<player.held_item_slot> nbt:charge/<[charge]>
        - inventory adjust slot:<player.held_item_slot> "display_name:<&a><italic>Nature Staff <&5>Charges <&e><&l>[<[charge]>]"
        - flag player magic_cooldown duration:5s
        - define target <player.cursor_on.simple.as_location>
        #in the future target distance is dependent on mage level
        - define area <[target].find.surface_blocks.within[3]>
        - define path <[target].points_between[<player.location>].distance[1]>
        - playeffect enchantment_table <player.location> visibility:100 quantity:100
        - foreach <[path].reverse>:
            - wait 1t
            #- playsound entity_fox_screech <player.location> pitch:-3
            - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:1
            - playeffect redstone <[value].simple.as_location> special_data:1|green visibility:1000 quantity:100
        - playeffect totem <[target]> visibility:1000 quantity:2000 offset:1
        - foreach <[area]>:
            - showfake soul_sand <[value]> players:<server.list_online_players> duration:5s
        - playeffect totem <[target]> visibility:100 quantity:3000
        - if <[charge]> == 0:
            - narrate "<&c>Your Nature Staff has ran out of charges!"
        on player right clicks with nature_staff in ardeenlibrary:
        - if <player.has_flag[libspellcasting]>:
            - yaml id:locations load:locations.yml
            - define magma <yaml[locations].read[ardeenlibmagmaspell].get_sub_items[1].get[1]>
            - define path <[magma].points_between[<player.location>].distance[1]>
            - narrate "<&c>A blazing beam of heat shoots you from the globe!"
            - hurt 10 <player>
            - foreach <[path]>:
                - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:1
                - playeffect redstone <[value].simple.as_location> special_data:2|red visibility:100 quantity:100
            - stop
        - flag player libspellcasting
        - narrate "<&c>Librarian<&f>: Do not spellcast in my Library!"
spring_spell:
    type: world
    events:
        on player right clicks with nature_staff:
        - if !<player.has_flag[spring]>:
            - stop
        - if <context.item.nbt[charge]> == 0:
            - narrate "<&c>Your Nature Staff is out of charges!"
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - if <player.has_flag[magic_cooldown]>:
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - define charge:<context.item.nbt[charge].sub[1]>
        - define target <player.cursor_on.simple.as_location>
        - define nearplayers <[target].find.players.within[5]>
        - define area <[target].find.surface_blocks.within[2]>
        - define path <[target].points_between[<player.location>].distance[1]>
        - define distance <[target].distance[<player.location>]>
        - if <[distance]> >= 3:
            - narrate "<&c>Target area too far."
            - stop
        - flag player magicxp:+:20
        - actionbar "<&a><&l>+20 Magic XP"
        - if <player.flag[magicxp]> >= <server.flag[magiclevels].get_sub_items[1].get[<player.flag[magiclvl]>]>:
            - flag player magiclvl:+:1
            - playsound <player.location> ENTITY_PLAYER_LEVELUP
            - toast "Congratulations! Your magic level is now <player.flag[magiclvl]>."
        - inventory adjust slot:<player.held_item_slot> nbt:charge/<[charge]>
        - inventory adjust slot:<player.held_item_slot> "display_name:<&a><italic>Nature Staff <&5>Charges <&e><&l>[<[charge]>]"
        - flag player natureheal_cooldown duration:1s
        - foreach <[path].reverse>:
            - wait 1t
            - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:1
            - playeffect redstone <[value].simple.as_location> special_data:1|yellow visibility:1000 quantity:25
        - foreach <[area]>:
            - showfake slime_block <[value]> players:<server.list_online_players> d:1s
        - push <player>
        - playeffect slime <[target]> visibility:1000 quantity:500 offset:3
        - wait 4t
        - playeffect slime <[target]> visibility:1000 quantity:500 offset:3
        - wait 4t
        - playeffect slime <[target]> visibility:1000 quantity:500 offset:3
        - if <[charge]> == 0:
            - narrate "<&c>Your Nature Staff has ran out of charges!"
glow_spell:
    type: world
    events:
        on player right clicks with nature_staff:
        - if !<player.has_flag[glow]>:
            - stop
        - define charge:<context.item.nbt[charge].sub[1]>
        - if <context.item.nbt[charge]> == 0:
            - narrate "<&c>Your Nature Staff is out of charges!"
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - if <player.has_flag[magic_cooldown]>:
            - playsound ENTITY_LLAMA_SPIT <player.location> pitch:-1
            - stop
        - flag player magicxp:+:20
        - actionbar "<&a><&l>+20 Magic XP"
        - if <player.flag[magicxp]> >= <server.flag[magiclevels].get_sub_items[1].get[<player.flag[magiclvl]>]>:
            - flag player magiclvl:+:1
            - playsound <player.location> ENTITY_PLAYER_LEVELUP
            - toast "Congratulations! Your magic level is now <player.flag[magiclvl]>."
        - define charge:<context.item.nbt[charge].sub[1]>
        - inventory adjust slot:<player.held_item_slot> nbt:charge/<[charge]>
        - inventory adjust slot:<player.held_item_slot> "display_name:<&a><italic>Nature Staff <&5>Charges <&e><&l>[<[charge]>]"
        - flag player magic_cooldown duration:5s
        #duration dependent on mage level
        - define duration 2
        - define target <player.cursor_on.simple.as_location>
        #in the future target distance is dependent on mage level
        - define area <[target].find.surface_blocks.within[10]>
        - define path <[target].points_between[<player.location>].distance[1]>
        - playeffect enchantment_table <player.location> visibility:100 quantity:100
        - foreach <[path].reverse>:
            - wait 1t
            - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:10
            - playeffect redstone <[value].simple.as_location> special_data:1|yellow visibility:1000 quantity:100
        - define entities <[target].find.entities.within[20]>
        - playeffect flash <[target]> visibility:1000 quantity:2000 offset:5
        - playeffect totem <[target]> visibility:100 quantity:3000 offset:5
        - light <[target]> 15 duration:<[duration]>
        - foreach <[entities]>:
            - glow <[value]>
        - wait <[duration]>s
        - foreach <[entities]>:
            - glow <[value]> false
        - if <[charge]> == 0:
            - narrate "<&c>Your Nature Staff has ran out of charges!"
        on player right clicks with nature_staff in ardeenlibrary:
        - if <player.has_flag[libspellcasting]>:
            - yaml id:locations load:locations.yml
            - define magma <yaml[locations].read[ardeenlibmagmaspell].get_sub_items[1].get[1]>
            - define path <[magma].points_between[<player.location>].distance[1]>
            - narrate "<&c>A blazing beam of heat shoots you from the globe!"
            - hurt 10 <player>
            - foreach <[path]>:
                - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:1
                - playeffect redstone <[value].simple.as_location> special_data:2|red visibility:100 quantity:100
            - stop
        - flag player libspellcasting
        - narrate "<&c>Librarian<&f>: Do not spellcast in my Library!"