-
Notifications
You must be signed in to change notification settings - Fork 0
/
wiz08b.go
257 lines (254 loc) · 5.03 KB
/
wiz08b.go
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
package wiz08b
import "github.com/noxworld-dev/noxscript/ns/v3"
var (
obj4 ns.ObjectID
obj5 ns.ObjectID
obj6 ns.ObjectID
obj7 ns.ObjectID
wp8 ns.WaypointID
wp9 ns.WaypointID
gvar10 ns.ObjectGroupID
wp11 ns.WaypointID
wp12 ns.WaypointID
wp13 ns.WaypointID
wp14 ns.WaypointID
gvar15 int
gvar16 int
gvar17 int
gvar18 int
gvar19 int
flag20 bool
flag21 bool
)
func init() {
gvar15 = 0
gvar16 = 1
gvar17 = 2
gvar18 = 3
gvar19 = gvar15
flag20 = false
flag21 = false
}
func PlayerDeath() {
ns.DeathScreen(8)
}
func GoToIxSEG2() {
ns.Frozen(ns.GetHost(), false)
ns.Frozen(obj4, false)
ns.Frozen(obj5, false)
ns.Frozen(obj6, false)
ns.MoveObject(ns.GetHost(), ns.GetWaypointX(wp8), ns.GetWaypointY(wp8))
}
func GoToIx() {
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
ns.Frozen(ns.GetHost(), true)
ns.Frozen(obj4, true)
ns.Frozen(obj5, true)
ns.Frozen(obj6, true)
ns.Blind()
ns.FrameTimer(60, GoToIxSEG2)
LABEL1:
return
}
func GoToTempleSEG2() {
ns.Frozen(ns.GetHost(), false)
ns.MoveObject(ns.GetHost(), ns.GetWaypointX(wp9), ns.GetWaypointY(wp9))
}
func GoToTemple() {
ns.Frozen(ns.GetHost(), true)
ns.CancelDialog(obj7)
ns.Blind()
ns.FrameTimer(60, GoToTempleSEG2)
}
func OwnObjects() {
ns.SetOwner(ns.GetHost(), obj7)
}
func MapInitialize() {
obj4 = ns.Object("Bear01")
obj5 = ns.Object("Bear02")
obj6 = ns.Object("Bear03")
obj7 = ns.Object("IxPriest")
gvar10 = ns.ObjectGroup("Fish")
wp8 = ns.Waypoint("IxExitWP")
wp11 = ns.Waypoint("TempleExtWP")
wp12 = ns.Waypoint("TempleIntWP")
wp9 = ns.Waypoint("TempleExitWP")
wp13 = ns.Waypoint("PriestWP")
wp14 = ns.Waypoint("PriestLookWP")
ns.GroupWander(gvar10)
ns.FrameTimer(1, OwnObjects)
}
func MapEntry() {
ns.Music(22, 100)
ns.UnBlind()
}
func EnterTempleSEG2() {
ns.Frozen(ns.GetHost(), false)
ns.Frozen(obj4, false)
ns.Frozen(obj5, false)
ns.Frozen(obj6, false)
ns.MoveObject(ns.GetHost(), ns.GetWaypointX(wp12), ns.GetWaypointY(wp12))
ns.UnBlind()
}
func EnterTemple() {
ns.Frozen(ns.GetHost(), true)
ns.Frozen(obj4, true)
ns.Frozen(obj5, true)
ns.Frozen(obj6, true)
ns.Blind()
ns.FrameTimer(60, EnterTempleSEG2)
}
func LeaveTempleSEG2() {
ns.Frozen(ns.GetHost(), false)
ns.MoveObject(ns.GetHost(), ns.GetWaypointX(wp11), ns.GetWaypointY(wp11))
ns.UnBlind()
}
func LeaveTemple() {
ns.Frozen(ns.GetHost(), true)
ns.Blind()
ns.FrameTimer(60, LeaveTempleSEG2)
}
func StayAway() {
if !ns.IsAttackedBy(ns.GetCaller(), ns.GetHost()) {
goto LABEL1
}
ns.GoBackHome(ns.GetCaller())
LABEL1:
return
}
func NoMonsters() {
if !ns.IsAttackedBy(ns.GetCaller(), ns.GetHost()) {
goto LABEL1
}
ns.GoBackHome(ns.GetCaller())
LABEL1:
return
}
func BearAttack() {
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
ns.CreatureFollow(obj5, obj4)
ns.CreatureFollow(obj6, obj4)
LABEL1:
return
}
func BearIdle() {
ns.GoBackHome(ns.GetTrigger())
}
func PriestSetPieceSEG2() {
ns.CreatureFollow(obj7, ns.GetHost())
ns.FrameTimer(75, PriestSetPieceSEG3)
}
func PriestSetPieceSEG3() {
ns.StoryPic(obj7, "IxPriestPic")
ns.SetDialog(obj7, ns.NEXT, PriestDialogStart, PriestDialogEnd)
ns.StartDialog(obj7, ns.GetHost())
ns.LookAtObject(ns.GetHost(), obj7)
}
func PriestDialogStart() {
var v0 int
switch v0 = gvar19; v0 {
case gvar15:
goto LABEL1
case gvar16:
goto LABEL2
case gvar17:
goto LABEL3
case gvar18:
goto LABEL4
default:
goto LABEL5
}
LABEL1:
ns.TellStory(ns.SwordsmanHurt, "Con08a:PriestGreet")
goto LABEL5
LABEL2:
ns.TellStory(ns.SwordsmanHurt, "Con08a:PriestProd")
goto LABEL5
LABEL3:
ns.TellStory(ns.SwordsmanHurt, "Con08a:PriestProd2")
goto LABEL5
LABEL4:
ns.TellStory(ns.SwordsmanHurt, "Con08a:PriestProd3")
goto LABEL5
LABEL5:
return
}
func PriestDialogEnd() {
var v0 int
switch v0 = gvar19; v0 {
case gvar15:
goto LABEL1
case gvar16:
goto LABEL2
case gvar17:
goto LABEL3
case gvar18:
goto LABEL4
default:
goto LABEL5
}
LABEL1:
gvar19 = gvar16
PriestDialogStart()
goto LABEL5
LABEL2:
gvar19 = gvar17
PriestDialogStart()
goto LABEL5
LABEL3:
gvar19 = gvar18
ns.SetDialog(obj7, ns.NORMAL, PriestDialogStart, PriestDialogEnd)
PriestDialogStart()
goto LABEL5
LABEL4:
if flag21 {
goto LABEL6
}
flag21 = true
ns.JournalEdit(ns.GetHost(), "Chapter8IxPriest", 4)
ns.PrintToAll("Con02a:ObjectiveComplete")
ns.JournalEntry(ns.GetHost(), "Chapter8Wierdling", 2)
ns.PrintToAll("Con01a:NewJournalEntry")
ns.WideScreen(false)
ns.CreatureGuard(obj7, ns.GetWaypointX(wp13), ns.GetWaypointY(wp13), ns.GetWaypointX(wp14), ns.GetWaypointY(wp14), 0)
ReleasePlayer()
LABEL6:
goto LABEL5
LABEL5:
return
}
func ReleasePlayer() {
ns.MusicPopEvent()
ns.Frozen(ns.GetHost(), false)
}
func StartPriestSetPiece() {
if flag20 {
goto LABEL1
}
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
ns.MusicPushEvent()
ns.Music(10, 100)
flag20 = true
ns.AudioEvent(ns.BigGong, wp12)
ns.Frozen(ns.GetHost(), true)
ns.WideScreen(true)
ns.FrameTimer(60, PriestSetPieceSEG2)
LABEL1:
return
}
func OnEvent(typ string) {
switch typ {
case "PlayerDeath":
PlayerDeath()
case "MapInitialize":
MapInitialize()
case "MapEntry":
MapEntry()
}
}