Paste #44121: Untitled Paste

Date: 2017/09/04 06:39:44 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


- case "claim": 
            - if <player.flag[rank] == leader> { 
                - define unclaimed true 
                - foreach <li@ek|fn|wt|nat|eat|sat|wat|bht|bhs|sw|fst> { 
                    - if <yaml[<def[value]>].read[claimed_chunks].contains[<player.location.chunk>]> && <yaml[<def[value]>].read[power]> > <yaml[<player.flag[nation]>].read[power]> && !<yaml[<player.flag[nation]>].read[enemies].contains[<def[value]>]> { 
                        - define unclaimed false 
                        - narrate "<&c>This chunk has been claimed by <def[value]>. You may not claim it." 
                        - break 
                    } 
                } 
                if <def[unclaimed]> { 
                    - narrate "<&a>Chunk is unclaimed. Adding it to this nation's territory." 
                    - yaml id:<player.flag[nation]> set claimed_chunks:->:<player.location.chunk> 
                } 
            } 
            else { 
               - narrate "<&c>Only nation leaders can claim land!"