Date: 2014/06/29 03:48: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
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
"PeaceKeeper":
type: assignment
default constants:
# Name of the Town used for NPC text option.
town: Fryllnas
# List of all weapon ID numbers used in the script for guard recognition
weapons: 267|268|272|276|283|271|275|258|279|286|261
interact scripts:
- 10 Peace Keeper
actions:
on assignment:
# These are the basic triggers used in most NPC's.
- trigger name:chat toggle:true
- trigger name:click toggle:true
- trigger name:proximity state:true range:7
# Make the NPC warn the player who push him.
on push:
- run "script:warningPush"
"Peace Keeper":
type: interact
steps:
# This step is a Jumping off point for ways the NPC interacts with you. By placing different types of triggers
# inside of the steps it can be a way to make One character more varried.
'1':
proximity trigger:
entry:
script:
# When a player enters the Proximity Range it will fire a script located lower down.
- run "script:welcomeCheck"
click trigger:
script:
- random 4
- chat "Bonjour <player.name>."
- chat "Hello."
- chat "Est-ce que tout va bien ?"
- chat "<player.name> puis-je vous aider ?"
#
#
# This is the start of the task script section for the weapons check.
#
#
"welcomeCheck":
type: task
script:
# In this section the NPC uses the constant list of weapons to identify if a player is armed and then runs another set of scripts containing a warning.
- if <cons:weapons> contains <player.item_in_hand.id> run "script:warning"
else run "script:welcome"
#
# Here is the welcome that you would recieve if you do not have a weapon when approaching the NPC.
#
"welcome":
type: task
script:
- random 5
- chat "Bienvenue a <cons:town> <player.name>."
- chat "<cons:town> vous souhaite la bienvenue <player.name>."
- chat "<cons:town> est un endroit paisible, gardez le ainsi s'il vous plait."
- chat "<player.name> appreciez vous <cons:town> ?"
- chat "Bienvenue <player.name>."
#
# This is the alternate welcome you recieve if you put away a weapon that was held when approached
#
"thank":
type: task
script:
- random 3
- chat "Merci et bienvenue a <cons:town>."
- chat "<cons:town> Vous remercie pour votre respect."
- chat "J'apprecie votre honneur <player.name>."
#
# This script is the start of the warning you get for having a weapon.
#
"warning":
type: task
script:
- chat "Soyez averti<player.name>, <cons:town> n'autorise pas le port d'arme dans les rues."
- wait 1
- chat "Vous avez cinq secondes pour la ranger."
- run "script:5"
"5":
type: task
script:
- wait 1
- if <cons:weapons> contains <player.item_in_hand.id> run "script:4"
else run "script:thank"
"4":
type: task
script:
- wait 1
- if <cons:weapons> contains <player.item_in_hand.id> run "script:3"
else run "script:thank"
"3":
type: task
script:
- wait 1
- if <cons:weapons> contains <player.item_in_hand.id> run "script:2"
else run "script:thank"
"2":
type: task
script:
- wait 1
- if <cons:weapons> contains <player.item_in_hand.id> run "script:1"
else run "script:thank"
"1":
type: task
script:
- wait 1
- if <cons:weapons> contains <player.item_in_hand.id> run "script:0"
else run "script:thank"
"0":
type: task
script:
- run "Player_Raise_Debt" "def:20"
- random 3
- chat "Tu es redevable de <proc:Player_Get_Debt> envers <cons:town>."
- chat "Ta dette pour cette ville augmente de 20 or !"
- chat "20 or en plus pour les caisses de la ville."
"Player_Raise_Debt":
type: task
script:
- define "max" 200
- define "min" 0
- run "Add_Limited_Player" "def:Debt_<cons:town>|%1%|%min%|%max%"
"Player_Set_Debt":
type: task
script:
- flag player "Debt_<cons:town>:%1%"
"Player_Get_Debt":
type: procedure
script:
- ^if <player.flag[Debt_<cons:town>]> == null flag player "Debt_<cons:town>:0"
- determine <player.flag[Debt_<cons:town>]>
"Add_Limited_Player":
type: task
context: value
script:
- ^if <player.flag[%1%]> == null flag player "%1%:%2%"
else flag player "%1%:+:%2%"
# clip value
- ^if <player.flag[%1%]> > %4% flag player "%1%:%4%"
else if <player.flag[%1%]> < %3% flag player "%1%:%3%"