Date: 2020/09/15 21:37:05 UTC-07: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
MobSpawningEvent:
type: world
debug: false
events:
on system time secondly every:7:
- define disabledSpawnAreas <list[]>
- foreach <server.online_players> as:targetPlayer:
- define area <[targetPlayer].flag[ActiveArea]||null>
- if <yaml[areainfo].read[<[Area]>.Hostile]||false> == true:
- define disabledSpawnAreas <[disabledSpawnAreas].include[<[area]>]>
- if <server.has_flag[MobSpawnDebug]>:
- announce "Areas with disabled spawning: <[disabledSpawnAreas]>"
NotifyAreaLocations:
type: task
script:
- foreach <server.online_players> as:targetPlayer:
- define area <[targetPlayer].flag[ActiveArea]||null>
- debug LOG <[area]>
- announce "<[area]>"
StandardMobAssignment:
type: assignment
debug: false
actions:
on spawn:
- debug LOG "Spawning a new mob <npc.name> at <npc.location>"
- trigger name:proximity state:true cooldown:5 radius:15
- trigger name:death
on death:
- if !<npc.has_flag[Template]>:
- debug LOG "Permanently removing mob <npc.name>"
- remove <npc>
StandardMobCombat:
type: interact
steps:
1:
click trigger:
script:
- some commands
death trigger:
script:
- if !<npc.has_flag[Template]>:
- debug LOG "Permanently removing mob"
- remove <npc>