Date: 2014/07/27 17:17:19 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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
BodyguardStartScript:
type: world
debug: true
events:
on player joins:
- if <player.flag[BodyGuardSpawned]> == null {
- flag <player> BodyGuardSpawned:true
- run s@BodyguardSpawn
- run s@BodyGuardConversationScript
}
- if <player.flag[BodyGuardConversation]> == true {
- run s@Bodyguardconversation101
}
Bodyguardflagfalse:
type: world
debug: true
events:
on bodyguard command:
- if <player.in_group[Leader]> {
- flag BodyGuardSpawned:null
- narrate "Bodyguard Flagg set to Null"
}
- determine FULFILLED
on BCON command:
- if <player.flag[BodyGuardConversation]> == null {
- flag BodyGuardConversation:true
- narrate " "
- narrate "<red>Bodyguard Conversations<&co> <green><bold> OFF"
- narrate " "
}
else if <player.flag[BodyGuardConversation]> == true {
- flag BodyGuardConversation:null
- narrate " "
- narrate "<red>Bodyguard Conversations<&co> <green><bold> ON"
- narrate " "
}
- determine FULFILLED
# speed: 0
# - ^execute as_server "npc create BodyGuard --at '<player.location.add[<1,0,0>]>.formatted.citizens>'"
BodyguardSpawn:
type: task
debug: true
script:
- create player BodyGuard <player.location.add[1,0,0]> save:BodyGuard
- flag player Bodyguard:<entry[BodyGuard].created_npc>
- ^engage
- ^execute as_server "npc select <player.flag[BodyGuard].replace[n@]>"
- ^execute as_server "trait sentry"
- ^execute as_server "sentry strength 5"
- ^execute as_server "sentry armor 5"
- ^execute as_server "sentry equip DIAMOND_SWORD"
- ^execute as_server "sentry equip IRON_HELMET"
- ^execute as_server "sentry equip IRON_CHESTPLATE"
- ^execute as_server "sentry equip IRON_LEGGINGS"
- ^execute as_server "sentry equip IRON_BOOTS"
- ^execute as_server "sentry ignore add entity:player"
- ^execute as_server "sentry healrate 10"
- ^execute as_server "sentry killdrops false"
- ^execute as_server "sentry health 20"
- ^execute as_server "sentry invincible false"
- ^execute as_server "sentry respawn 60"
- ^execute as_server "sentry speed 1.2"
- ^execute as_server "sentry follow 5"
- ^execute as_server "npc owner <player.name>"
- ^execute as_server "npc skin knight8"
- ^execute as_server 'npc assign --set "BodyGuardSpawnAssignment"'
- ^execute as_server "sentry guard <player.name>"
- ^disengage
# - ^flag npc <npc.id> Bodyguard
# - flag global "<npc> Bodyguard:<npc.id>"
# - flag global <npc.id> Bodyguard
# - remove "<npc>" "target:<npc.flag[<npc.id> Bodyguard]>"
# - trigger name:click state:true
#-------------------------------------------------------------------------------Removal NPC-------------------------------------------------------------------------
BodyGuardQuitAssignment:
type: world
debug: true
events:
on player quits:
- run s@EraseBodyGuard
on server start:
- run s@EraseBodyGuard
EraseBodyGuard:
type: task
debug: true
script:
- wait 2
- remove <player.flag[BodyGuard]>
- flag <player> BodyGuardSpawned:null
# /ex narrate "<player.flag[BodyGuard]>"
# - remove "<npc>" "target:<npc.flag[<npc.id> Bodyguard]>"
#- ^narrate "Congratulations, You have defeated one horde of dragons! But be warned, soon and the event's will start from the beginning." "target:<global.flag[<context.entity> DragonAttacker]>"
#------------------------------------------------------------------------------------------------------------------------------------------------------------------
Bodyguardattackplayerscript:
type: task
debug: true
script:
- ^execute as_server "npc select <player.flag[BodyGuard].replace[n@]>"
- ^execute as_server "sentry target add player:<player.name>"
- wait 3
- ^execute as_server "sentry target remove player:<player.name>"
BodyGuardSpawnAssignment:
type: assignment
debug: true
actions:
on damaged:
- if <context.damager.is_player> {
- if <context.damager.flag[AttacksBodyGuard]> == true {
- run s@Bodyguardattackplayerscript as:<context.damager>
}
}
else if <context.damager.is_player> {
- narrate "Hey! stop that or I<&sq>ll attack you!" "target:<context.damager>"
- flag <context.damager> AttacksBodyGuard:true duration:10
}
on assignment:
- execute as_npc "sentry follow 5"
- run s@BodyGuardConversationScript as:<npc.owner>
- trigger name:proximity state:true radius:10
on click:
- execute as_npc "sentry follow 5"
- if <npc.owner> != <player> {
- random {
- chat "<yellow>I<&sq>m sorry <yellow><player.name><green> but I<&sq>m already guading <yellow><npc.owner.name>."
- chat "<yellow>O, hey! <yellow><player.name><green> I<&sq>m with <yellow><npc.owner.name> on a journey so I<&sq>m afraid I cant help you."
- chat "<yellow>Greetings <yellow><player.name><green> Do you know <yellow><npc.owner.name>? He<&sq>s a verry nice person."
}
}
else if "<npc.flag[Guarding]>" == "true" {
- random {
- ^chat "<yellow>Oh all right <player.name>, I'll wait back here for you."
- ^chat "<yellow>Don't worry about me, I'll stay back here. Please don't forget about me."
- ^chat "<yellow>I'll wait around for you..but please don't forget about me."
- ^chat "<yellow>You want me to hang back? Ok, no problem."
- ^chat "<yellow>Ok, I'll guard this spot."
- ^chat "<yellow>I'll stand here and wait until you come get me again."
}
- ^execute as_npc "npc sel <npc.id>"
- ^execute as_npc "sentry guard"
- ^flag npc "Guarding:false"
}
else {
- random {
- ^chat "<yellow>Ok, I'm following you."
- ^chat "<yellow>Great <white><player.name><yellow>, I'm right behind you."
- ^chat "<yellow>You lead the way boss."
- ^chat "<yellow>Watching your back. Let's go."
- ^chat "<yellow>Great, let's go for a walk."
- ^chat "<yellow>Hope we're going to crush some zombie skulls. Let's move."
}
- ^execute as_npc "npc sel <npc.id>"
- ^execute as_npc "sentry guard <player.name>"
- ^flag npc "Guarding:true"
}
interact scripts:
- 10 BodyGuardSpawnAssignment1
BodyGuardSpawnAssignment1:
type: interact
debug: true
steps:
1:
proximity trigger:
entry:
script:
- if <player> == <npc.owner> {
- execute as_server "npc sel <player.flag[BodyGuard].replace[n@]>"
- execute as_server "sentry follow 5"
}
BodyGuardConversationScript:
type: task
debug: true
script:
- wait 250
- if <player.flag[BodyGuardConversation]> == null {
- if <player.is_online> {
- chat "Right click me to toggle between guarding/following"
- random {
- chat "Hey, lets go to moria and claim the 50.000 reward!"
- chat "Hmm I wonder what the /cmd command does, dont you?"
- chat "If you'll lose me simply reconnect and I'll be back!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I absolutely love those enderchest on the /spawn, they make life easier!"
- chat "Herobrine gives me the creeps, lets hope he wont come after us!"
- chat "Lets search for Diamond Mountains using /tc biome"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I heard Diamond mountains can be found in Custom survival"
- chat "I heard Diamond mountains apear like 15000 blocks away from x<&co>0 z<&co>0 in Custom Survival"
- chat "I heard that falling in void takes you to another realm!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Let<&sq>s not build in regular survival since the world often gets destroyed!"
- chat "Did you heard? People riding dragons! The world gone mad!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Hey, lets go to moria and claim the 50.000 reward!"
- chat "Hmm I wonder what the /cmd command does, dont you?"
- chat "If you'll lose me simply reconnect and I'll be back!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I absolutely love those enderchest on the /spawn, they make life easier!"
- chat "Herobrine gives me the creeps, lets hope he wont come after us!"
- chat "Lets search for Diamond Mountains using /tc biome"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I heard Diamond mountains can be found in Custom survival"
- chat "I heard Diamond mountains apear like 15000 blocks away from x<&co>0 z<&co>0 in Custom Survival"
- chat "I heard that falling in void takes you to another realm!" targets:<player.name>
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Let<&sq>s not build in regular survival since the world often gets destroyed!"
- chat "Did you heard? People riding dragons! The world gone mad!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Hey, lets go to moria and claim the 50.000 reward!"
- chat "Hmm I wonder what the /cmd command does, dont you?"
- chat "If you'll lose me simply reconnect and I'll be back!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I absolutely love those enderchest on the /spawn, they make life easier!"
- chat "Herobrine gives me the creeps, lets hope he wont come after us!"
- chat "Lets search for Diamond Mountains using /tc biome"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I heard Diamond mountains can be found in Custom survival"
- chat "I heard Diamond mountains apear like 15000 blocks away from x<&co>0 z<&co>0 in Custom Survival"
- chat "I heard that falling in void takes you to another realm!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Let<&sq>s not build in regular survival since the world often gets destroyed!"
- chat "Did you heard? People riding dragons! The world gone mad!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Hey, lets go to moria and claim the 50.000 reward!"
- chat "Hmm I wonder what the /cmd command does, dont you?"
- chat "If you'll lose me simply reconnect and I'll be back!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I absolutely love those enderchest on the /spawn, they make life easier!"
- chat "Herobrine gives me the creeps, lets hope he wont come after us!"
- chat "Lets search for Diamond Mountains using /tc biome"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "I heard Diamond mountains can be found in Custom survival"
- chat "I heard Diamond mountains apear like 15000 blocks away from x<&co>0 z<&co>0 in Custom Survival"
- chat "I heard that falling in void takes you to another realm!"
}
}
- wait 500
- if <player.is_online> && <player.flag[BodyGuardConversation]> == null {
- random {
- chat "Let<&sq>s not build in regular survival since the world often gets destroyed!"
- chat "Did you heard? People riding dragons! The world gone mad!"
}
}
}