Date: 2014/07/17 09:05:17 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
Sentry:
type: assignment
interact scripts:
- 100 TheSentry
actions:
on assignment:
- trigger name:click toggle:true
TheSentry:
type: interact
steps:
1:
click trigger:
script:
- if <npc.owner> = <player> {
- chat "Welcome to sentry tell me 'wallguard' to go to wallguard script or 'bodyguard' for me to guard you"
} else {
- chat "I'm in the service of lord <npc.owner> it's quite a honor"
}
chat trigger:
'wallguard':
trigger: "I want you to be a /wallguard/"
script:
- zap step:wallguard
'bodyguard':
trigger: "I want you to be a /bodyguard/"
script:
- zap 'step:bodyguard'
wallguard:
click trigger:
script:
- if <npc.owner> = <player> {
- chat "Welcome to the wallguard menu tell me Names of people you want me to ignore then say 'point1, point2, point3, and point4' for the 4 points on point four the sentry will start guarding "
- execute as_server "sentry <npc.id> guard <player.name>"
}
else {
- chat "Good day to you sir."
}
chat trigger:
'faction':
trigger: "I want you to ignore /Regex:.+/"
script:
- flag npc player2ignore:<player.chat_history>
- execute as_server "sentry <npc.id> ignore add player:<npc.flag[player2ignore]>"
- chat "The name has been registered"
'point1':
trigger: "this is your /point1/"
script:
- narrate "point one registered."
- ^flag <npc> pos1:<player.location>
'point2':
trigger: "this is your /point2/"
script:
- narrate "point two registered."
- ^flag <npc> pos2:<player.location>
'point3':
trigger: "this is your /point3/"
script:
- narrate "point three registered."
- ^flag <npc> pos3:<player.location>
'point4':
trigger: "this is your /point4/"
script:
- narrate "point four is registered and the sentry begins to patrol."
- execute as_server "sentry <npc.id> guard"
- ^flag <npc> pos4:<player.location>
- execute as_server "sentry <npc.id> target add entity:PLAYER"
- run execute
- zap step:ChooseTask
2:
click trigger:
script:
- if <npc.owner> = <player> {
- chat "Hello my lord which task would you like me to do?"
- chat "Would you like me to continue or be your bodyguard"
- zap 'step:ChooseTask'
}
else {
- chat "Hello mate how are you?"
- zap step:1
}
'ChooseTask':
chat trigger:
'continue':
trigger: "I want you to /continue/."
script:
- run execute
'bodyguard':
trigger: "I want you to be a /bodyguard/."
script:
- flag <npc> STOP
- zap 'step:bodyguard'
'return':
trigger: "I want you to /return/."
script:
- zap 'step:bodyguard'
'continue':
click trigger:
script:
- chat "Hello sir just making my rounds."
'bodyguard':
click trigger:
script:
- chat "Welcome to the bodyguard menu say hold to make me stop then follow for me to continue to guard you. or return to get back the wall sentry."
- execute as_server "sentry <npc.id> guard <player.name>"
- zap 'step:stop'
'stop':
chat trigger:
'Stop':
trigger: "/Stop/ here!."
script:
- execute as_server "sentry <npc.id> guard"
- zap 'step:stop'
'follow':
trigger: "/Follow/ me!."
script:
- execute as_server "sentry <npc.id> guard <player.name>"
- zap 'step:stop'
'return':
trigger: "/return/ to the beggining!."
script:
- execute as_server "sentry <npc.id> guard <player.name>"
- flag npc STOP:!
- zap step:1
execute:
type: task
script:
- if <npc.flag[STOP]> queue clear
else {
- ~walk <npc> <npc.flag[pos1]>
- ~walk <npc> <npc.flag[pos2]>
- ~walk <npc> <npc.flag[pos3]>
- ~walk <npc> <npc.flag[pos4]>
- run execute
}