Paste #45506: Untitled Paste

Date: 2017/11/13 02:49:43 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


NODES_COMMAND:
    type: command
    name: nodes
    script:
    - choose "<context.args.get[1]>":
        - case "create":
            - choose "<context.args.get[2]>":
                - case "copper":
                    - flag server nodes.quartz_ore:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a copper node at <player.location.chunk>!"
                - case "iron":
                    - flag server nodes.iron_ore:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created an iron at <player.location.chunk>!"
                - case "gold":
                    - flag server nodes.gold_ore:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a gold node at <player.location.chunk>!"
                - case "sapphire":
                    - flag server nodes.lapis_ore:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a sapphire node at <player.location.chunk>!"
                - case "stone":
                    - flag server nodes.stone:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a stone node at <player.location.chunk>!"
                - case "misc":
                    - flag server nodes.misc:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a misc node at <player.location.chunk>!"
                - case "sparkstone":
                    - flag server nodes.sparkstone:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a sparkstone node at <player.location.chunk>!"
                - case "whitestone":
                    - flag server nodes.whitestone:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a whitestone node at <player.location.chunk>!"
                - case "wood":
                    - flag server nodes.wood:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a wood node at <player.location.chunk>!"
                - case "herb":
                    - flag server nodes.herb:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a herb node at <player.location.chunk>!"
                - case "fauna":
                    - flag server nodes.fauna:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a fauna node at <player.location.chunk>!"
                - case "clay":
                    - flag server nodes.clay:->:<player.location.chunk>
                    - narrate "<&a>You have successfully created a clay node at <player.location.chunk>!"
                - default:
                    - narrate "<&c>That is not a valid node type! Valid node types are:"
                    - narrate "<&c>copper, iron, gold, sapphire, stone, whitestone, wood, herb, fauna, clay, misc, sparkstone."
        - case "remove":
            - foreach <server.list_flags[nodes.]> {
                - if <server.flag[<def[value]>].contains[<player.location.chunk>]> {
                    - flag server <server.flag[nodes.].before[<&dot>]>:->:<player.location.chunk>:!
                }
            }
        - default:
            - narrate "<&c>That is not a valid nodes command! Valid nodes commands are: create, remove."

NODES_REPLENISH:
    type: world
    events:
        on player breaks block:
        - foreach <server.list_flags[nodes.].after[<&dot>]> {
            - narrate "<server.list_flags[nodes.].after[<&dot>]>"
            - if <def[value].contains[<context.location>]> {
                - flag server replenishing.<context.location>:<context.material> duration:30s
                - narrate "replenishing.<context.location>:<context.material>"
            }
        }
        on system time minutely:
        - foreach <server.list_flags[replenishing.]> {
            - if <def[value].is_expired> == true {
                - modifyblock <def[value].after[replenishing.]> <server.flag[<def[value]>]>
            }
        }