Date: 2017/01/06 15:26:55 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#Ensure all Cadavers are despawned at start of battle and before!
DHKalthaxu:
type: assignment
actions:
on assignment:
- trigger name:proximity toggle:true radius:30
- trigger name:damage toggle:true
- ^execute as_npc "npc select <npc.id>"
- ^execute as_npc "npc look"
- ^execute as_npc "npc health --respawndelay 11s"
- flag npc respawnpoint:<npc.location>
- if <npc.has_trait[sentinel]> == true queue clear
- ^execute as_npc "trait sentinel"
- ^execute as_npc "npc name"
- ^execute as_npc "sentinel addtarget PLAYERS"
- ^execute as_npc "sentinel armor 0.9"
- ^execute as_npc "sentinel health 30"
- ^execute as_npc "sentinel healrate 0"
- ^execute as_npc "sentinel targettime 300"
- ^execute as_npc "sentinel chaserange 60"
- equip hand:i@diamond_sword[enchantments=KNOCKBACK,2] offhand:i@shield[base_color=BLACK;patterns=li@GRAY/FLOWERS|SILVER/RHOMBUS_MIDDLE|BLACK/SKULL|SILVER/GRADIENT_UP|BLACK/BORDER]
on hit on player:
- ^if <player.is_blocking>
{
- ^actionbar "<&c>Your shield has been shattered!"
- ^equip <player> offhand:i@air
- ^playsound <player> sound:ITEM_SHIELD_BREAK
}
- if <util.random.int[1].to[100]> < 25 queue clear
on kill:
- flag server KalthaxuPlayers:<-:<player>
- narrate "You died!" targets:<player>
on damaged:
- if <context.damager> MATCHES PLAYER
{
- playsound <context.damager> sound:ENTITY_BLAZE_HURT
- wait 2s
- if <npc.is_spawned> == false queue clear
- run KalthaxuTP
}
on enter proximity:
- playsound <player> sound:ENTITY_BLAZE_AMBIENT
- if <npc.has_flag[locationreset]> == true
{
- flag npc locationreset:!
}
on exit proximity:
- if <location[<npc.location>].find.players.within[30].formatted> == ''
{
- if <npc.is_spawned> == false queue clear
- define npcloc <npc.flag[respawnpoint]>
- chunkload <npc.location.chunk> duration:3m
- chunkload <location[%npcloc%].chunk> duration:3m
- if <location[<npc.location>].distance[%npcloc%]> == 0 queue clear
- flag npc locationreset
- wait 2m
- if <location[<npc.location>].distance[%npcloc%]> > 9
{
- if <location[<npc.location>].find.players.within[4].formatted> == ''
{
- spawn <npc> <npc.flag[respawnpoint]>
- flag npc locationreset:!
- queue clear
}
}
- if <npc.has_flag[locationreset]> == false queue clear
- flag npc locationreset:!
- spawn <npc> <npc.flag[respawnpoint]>
}
on death:
- define killer <context.killer>
- if <context.killer.name> == ARROW && <server.has_flag[<context.killer>]> define killer <server.flag[<context.killer>]>
- if %killer% MATCHES PLAYER
{
- playsound %killer% sound:ENTITY_BLAZE_DEATH
- define loot <util.random.int[2000].to[5000]>
- flag p@%killer% Credits:+:%loot%
- narrate "<&c>You have recovered <&b>%loot%<&c> credits!" targets:%killer%
- run KalthaxuDeath
}
- define npcloc <npc.flag[respawnpoint]>
- chunkload <location[%npcloc%].chunk> duration:16m
- wait 15m
- spawn <npc> <npc.flag[respawnpoint]>
#########################################################################################################################################
DHKalCadaver:
type: assignment
actions:
on assignment:
- trigger name:proximity toggle:true radius:30
- trigger name:damage toggle:true
- ^execute as_npc "npc select <npc.id>"
- ^execute as_npc "npc look"
- ^execute as_npc "npc health --respawndelay 11s"
- if <npc.has_trait[sentinel]> == true queue clear
- ^execute as_npc "trait sentinel"
- ^execute as_npc "npc name"
- ^execute as_npc "sentinel addtarget PLAYERS"
- ^execute as_npc "sentinel armor 0.4"
- ^execute as_npc "sentinel speed 0.8"
- ^execute as_npc "sentinel targettime 300"
- ^execute as_npc "sentinel chaserange 40"
on hit on player:
- if <util.random.int[1].to[100]> < 50 queue clear
- actionbar "<&c>You have been poisoned"
- cast poison d:5 p:1 <player>
on damaged:
- if <context.damager> MATCHES PLAYER
{
- playsound <context.damager> sound:ENTITY_BLAZE_HURT
- if <npc.can_see[<context.damager>]> == false
{
- attack target:<context.damager>
- wait 5s
- attack <npc> target:cancel
}
}
on enter proximity:
- playsound <player> sound:ENTITY_ZOMBIE_AMBIENT
on death:
- define killer <context.killer>
- if <context.killer.name> == ARROW && <server.has_flag[<context.killer>]> define killer <server.flag[<context.killer>]>
- if %killer% MATCHES PLAYER
{
- playsound %killer% sound:ENTITY_BLAZE_DEATH
- define loot <util.random.int[5].to[15]>
- flag p@%killer% Credits:+:%loot%
- narrate "<&c>You have recovered <&b>%loot%<&c> credits!" targets:%killer%
}
- flag server kalkillcount:+:1
- if <server.flag[kalkillcount]> == 4
{
- flag server kalkillcount:!
- run KalthaxuTP
}
#######################################################################################################################################################
KalthaxuTP:
type: task
script:
- define CenterTP l@716.4829909339679,52.0,209.4827083244251,90.0,-177.17944,pvpmap
- define SouthTP l@716.5141676712896,57.0,221.50450771490475,5.9999957,-179.87964,pvpmap
- define WestTP l@704.4603542754791,57.0,209.5028900425203,-0.30001023,-89.13037,pvpmap
- define NorthTP l@716.5185440571789,57.0,198.50060357067485,-2.5500035,-358.833,pvpmap
- define EastTP l@728.4855232572958,57.0,209.50389899756567,2.7,-270.93237,pvpmap
- random 5
- teleport n@695 %CenterTP%
- teleport n@695 %SouthTP%
- teleport n@695 %WestTP%
- teleport n@695 %NorthTP%
- teleport n@695 %EastTP%
- if <n@695.location.y> > 55 queue clear
- narrate "<&8>Kalthaxu:<&7> Arrise my pretties!" targets:<server.flag[KalthaxuPlayers].as_list>
- flag server kalkillcount:!
- spawn <n@696> %SouthTP%
- spawn <n@697> %NorthTP%
- spawn <n@698> %WestTP%
- spawn <n@699> %EastTP%
#######################################################################################################################################################
KalthaxuDeath:
type: task
script:
- foreach <server.flag[KalthaxuPlayers]>
{
- ^teleport <%value%> l@711.4758678835883,64.0,122.5558274442147,2.6999984,0.42937255,pvpmap
- ^cast blindness remove <%value%>
}
- flag server KalthaxuPlayers:!