#Author: Icecapade #Date: 2021-03-15 #Version: 1.0.3 WGConverter: type: command data: syntax: Syntax<&co> /wgtodenizen [all|world|region] (<<>world<>>) (<<>region<>>) debug: false name: wgtodenizen description: converts worldguard regions to useable notables usage: /wgtodenizen [all|world|region] (<<>world<>>) (<<>region<>>) permission: wgconverter.admin tab completions: 1: all|world|region 2: ].if_true[].if_false[]> 3: ].list_regions.parse[id].if_null[]>].if_false[]> script: - choose : - case 1: - if != all: - narrate format:WGConverter_format - stop - narrate "Converting all WorldGuard-regions in useable Denizen notables.." format:WGConverter_format - foreach as:world: - narrate "Current World: <[world].name.color[gold]>" format:WGConverter_format - foreach <[world].list_regions> as:region: - if <[region].area.if_null[null]> == null: - narrate "The region <[region].id.color[gold]> is not convertable. Skipping." format:WGConverter_format - foreach next - note <[region].area> as:WG_<[region].id> - narrate "The region <[region].id> was sucessfully converted to a notable called WG_<[region].id>" format:WGConverter_format - wait 1t - case 2: - if != world: - narrate format:WGConverter_format - stop - define world ].if_null[null]> - if <[world]> == null: - narrate "This world does not exist or is not loaded." format:WGConverter_format - stop - foreach <[world].list_regions> as:region: - if <[region].area.if_null[null]> == null: - narrate "The region <[region].id.color[gold]> is not convertable. Skipping." format:WGConverter_format - foreach next - note <[region].area> as:WG_<[region].id> - narrate "The region <[region].id.color[gold]> was sucessfully converted to a notable called WG_<[region].id>" format:WGConverter_format - wait 1t - case 3: - define first_argument - if != region: - narrate format:WGConverter_format - stop - define world_name - define world ].if_null[null]> - if ].if_null[null]> == null: - narrate "This world <[world_name].color[gold]> does not exist or is not loaded." format:WGConverter_format - stop - define id - if !<[world].has_region[<[id]>]>: - narrate "This world does not have a region called <[id].color[gold]>!" format:WGConverter_format - stop - define area ,<[world_name]>].area.if_null[null]> - if <[area]> == null: - narrate "The region is not convertable." format:WGConverter_format - stop - narrate "The region <[id].color[gold]> was sucessfully converted to a notable called WG_<[id]>" format:WGConverter_format - note <[area]> as:WG_<[id]> WGConverter_format: type: format debug: false format: [WGConverter]