Date: 2018/11/25 08:45:53 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# For usage by Naruto
# Created by g221
# World Guard Region to Cuboid from GrandPartyMask and Modified for simple usage
# The script will automatically look for new and removed regions whenever you use the WorldGuard "/region" command.
# All locations created by this script will have names like this: wgregion_W_<world name>_R_<region name>
# To simply change the spawn location just follow the template above.
# The global npc spawn script spawns npcs in random areas across the map.
# If you need to customize your npc. Modify the command listed after "execute as_server"
NpcSpawnRegion:
type: world
events:
on system time minutely:
- execute as_server "/npc wgregion_W_<world name>_R_<region name>"
worldguard_regions_to_notable_cuboids:
type: task
debug: false
speed: 0
script:
- flag server worldguard_to_notable_cuboids:!
- foreach <server.list_worlds> {
- define w <def[value]>
- foreach <def[w].list_regions> {
- note <def[value].cuboid> as:wgregion_W_<def[w].name>_R_<def[value].id>
- flag server worldguard_to_notable_cuboids:->:<def[value]>
}
}
- foreach <server.list_notables[cuboids].filter[starts_with[cu@wgregion_]].exclude[<server.flag[worldguard_to_notable_cuboids].as_list>]> {
- note remove as:<def[value]>
}
worldguard_regions_to_notable_cuboids_evts:
type: world
debug: false
events:
on rg|region command:
- wait 1t
- if '<li@define|create|d|remove|rem|delete|del|redefine|update|move|load|reload.contains[<context.raw_args.trim.before[ ]>]>' {
- define rg_list li@
- foreach <server.list_worlds> {
- define rg_list <def[rg_list].include[<def[value].list_regions>]>
}
- define add li@
- foreach <def[rg_list].exclude[<server.flag[worldguard_to_notable_cuboids].as_list||li@>]> {
- note <def[value].cuboid> as:wgregion_W_<def[value].world.name>_R_<def[value].id>
- define add <def[add].include[<def[value]>]>
}
- define sub li@
- foreach <server.flag[worldguard_to_notable_cuboids].as_list.exclude[<def[rg_list]>]||li@> {
- note remove as:wgregion_W_<def[value].world.name>_R_<def[value].id>
- define sub <def[sub].include[<def[value]>]>
}
- define new_list <server.flag[worldguard_to_notable_cuboids].as_list.exclude[<def[sub]>].include[<def[add]>]||<def[add]>>
- flag server worldguard_to_notable_cuboids:!
- flag server worldguard_to_notable_cuboids:|:<def[new_list]>
}