-
Notifications
You must be signed in to change notification settings - Fork 0
/
war02b.go
509 lines (506 loc) · 11 KB
/
war02b.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
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
package war02b
import "github.com/noxworld-dev/noxscript/ns/v3"
var (
wp4 ns.WaypointID
ivar5 int
obj6 ns.ObjectID
obj7 ns.ObjectID
obj8 ns.ObjectID
obj9 ns.ObjectID
obj10 ns.ObjectID
obj11 ns.ObjectID
obj12 ns.ObjectID
obj13 ns.ObjectID
obj14 ns.ObjectID
obj15 ns.ObjectID
wp16 ns.WaypointID
wp17 ns.WaypointID
wp18 ns.WaypointID
wp19 ns.WaypointID
wp20 ns.WaypointID
wp21 ns.WaypointID
wp22 ns.WaypointID
wp23 ns.WaypointID
wp24 ns.WaypointID
wp25 ns.WaypointID
wp26 ns.WaypointID
wp27 ns.WaypointID
wp28 ns.WaypointID
wp29 ns.WaypointID
wp30 ns.WaypointID
wp31 ns.WaypointID
wp32 ns.WaypointID
gvar33 int
gvar34 int
gvar35 int
gvar36 int
gvar37 int
obj38 ns.ObjectID
wp39 ns.WaypointID
flag40 bool
gvar41 int
obj42 ns.ObjectID
obj43 ns.ObjectID
obj44 ns.ObjectID
obj45 ns.ObjectID
gvar46 ns.ObjectGroupID
gvar47 ns.ObjectGroupID
gvar48 ns.ObjectGroupID
wp49 ns.WaypointID
wp50 ns.WaypointID
wp51 ns.WaypointID
wp52 ns.WaypointID
wp53 ns.WaypointID
flag54 bool
flag55 bool
flag56 bool
flag57 bool
flag58 bool
obj59 ns.ObjectID
obj60 ns.ObjectID
obj61 ns.ObjectID
obj62 ns.ObjectID
obj63 ns.ObjectID
obj64 ns.ObjectID
obj65 ns.ObjectID
obj66 ns.ObjectID
obj67 ns.ObjectID
obj68 ns.ObjectID
obj69 ns.ObjectID
obj70 ns.ObjectID
obj71 ns.ObjectID
obj72 ns.ObjectID
obj73 ns.ObjectID
wp74 ns.WaypointID
wp75 ns.WaypointID
wp76 ns.WaypointID
wp77 ns.WaypointID
wp78 ns.WaypointID
wp79 ns.WaypointID
wp80 ns.WaypointID
wp81 ns.WaypointID
wp82 ns.WaypointID
wp83 ns.WaypointID
wp84 ns.WaypointID
wp85 ns.WaypointID
wp86 ns.WaypointID
wp87 ns.WaypointID
wp88 ns.WaypointID
wp89 ns.WaypointID
wp90 ns.WaypointID
wp91 ns.WaypointID
)
func init() {
ivar5 = 60
gvar33 = 0
gvar34 = 1
gvar35 = 2
gvar36 = 3
gvar37 = 4
flag40 = false
gvar41 = gvar33
flag54 = false
flag55 = false
flag56 = false
flag57 = false
flag58 = false
}
func PlayerDeath() {
ns.DeathScreen(2)
}
func MapShutdown() {
ns.SetQuestStatus(2, "War02A:EnteredGauntlet")
}
func BlockSecret() {
ns.MoveWaypoint(wp4, ns.GetObjectX(ns.GetHost()), ns.GetObjectY(ns.GetHost()))
ns.AudioEvent(ns.SecretFound, wp4)
ns.PrintToAll("GeneralPrint:SecretFound")
ns.GiveXp(ns.GetHost(), 100)
}
func OpenBlockSecretExit() {
ns.NoWallSound(false)
ns.WallOpen(ns.Wall(77, 157))
}
func ResetSquishTrapSEG1() {
ns.Move(obj8, wp25)
ns.Move(obj9, wp26)
ns.Move(obj10, wp27)
ns.Move(obj11, wp28)
ns.Move(obj12, wp29)
ns.Move(obj13, wp30)
ns.Move(obj14, wp31)
ns.Move(obj15, wp32)
ns.AudioEvent(ns.BoulderMove, wp16)
ns.FrameTimer(20, ResetSquishTrapSEG2)
}
func ResetSquishTrapSEG2() {
ns.ObjectOn(obj6)
ns.ObjectOn(obj7)
}
func InitializeSquishBlocks() {
obj6 = ns.Object("SquishTrigger")
obj7 = ns.Object("BoomTrigger")
obj8 = ns.Object("SquishBlock01")
obj9 = ns.Object("SquishBlock02")
obj10 = ns.Object("SquishBlock03")
obj11 = ns.Object("SquishBlock04")
obj12 = ns.Object("SquishBlock05")
obj13 = ns.Object("SquishBlock06")
obj14 = ns.Object("SquishBlock07")
obj15 = ns.Object("SquishBlock08")
wp16 = ns.Waypoint("SquishAudioOrigin")
wp17 = ns.Waypoint("SquishWP01")
wp18 = ns.Waypoint("SquishWP02")
wp19 = ns.Waypoint("SquishWP03")
wp20 = ns.Waypoint("SquishWP04")
wp21 = ns.Waypoint("SquishWP05")
wp22 = ns.Waypoint("SquishWP06")
wp23 = ns.Waypoint("SquishWP07")
wp24 = ns.Waypoint("SquishWP08")
wp25 = ns.Waypoint("SquishWPHome01")
wp26 = ns.Waypoint("SquishWPHome02")
wp27 = ns.Waypoint("SquishWPHome03")
wp28 = ns.Waypoint("SquishWPHome04")
wp29 = ns.Waypoint("SquishWPHome05")
wp30 = ns.Waypoint("SquishWPHome06")
wp31 = ns.Waypoint("SquishWPHome07")
wp32 = ns.Waypoint("SquishWPHome08")
}
func Squish() {
ns.ObjectOff(obj6)
ns.Move(obj8, wp17)
ns.Move(obj9, wp18)
ns.Move(obj10, wp19)
ns.Move(obj11, wp20)
ns.Move(obj12, wp21)
ns.Move(obj13, wp22)
ns.Move(obj14, wp23)
ns.Move(obj15, wp24)
ns.AudioEvent(ns.BoulderMove, wp16)
ns.FrameTimer(ivar5, ResetSquishTrapSEG1)
}
func SquishBoom() {
if ns.IsCaller(obj10) {
goto LABEL1
}
return
LABEL1:
ns.ObjectOff(obj7)
ns.AudioEvent(ns.HammerMissing, wp16)
ns.Effect(ns.JIGGLE, ns.GetObjectX(ns.GetHost()), ns.GetObjectY(ns.GetHost()), 10, 0)
}
func GearhartDialogStart() {
var v0 int
ns.LookAtObject(obj38, ns.GetHost())
ns.ObjectGroupOff(gvar48)
switch v0 = gvar41; v0 {
case gvar33:
goto LABEL1
case gvar34:
goto LABEL2
case gvar35:
goto LABEL3
case gvar36:
goto LABEL4
case gvar37:
goto LABEL5
default:
goto LABEL6
}
LABEL1:
ns.DestroyEveryChat()
ns.TellStory(ns.SwordsmanHurt, "War02a:GearhartTalk02")
goto LABEL6
LABEL2:
ns.DestroyEveryChat()
ns.TellStory(ns.SwordsmanHurt, "War02a:GearhartTalk03")
goto LABEL6
LABEL3:
ns.DestroyEveryChat()
ns.TellStory(ns.SwordsmanHurt, "War02a:GearhartTalk04")
goto LABEL6
LABEL4:
ns.DestroyEveryChat()
ns.TellStory(ns.SwordsmanHurt, "War02a:GearhartTalk05")
goto LABEL6
LABEL5:
ns.DestroyEveryChat()
ns.TellStory(ns.SwordsmanHurt, "War02a:GearhartTalk06")
goto LABEL6
LABEL6:
return
}
func GearhartDialogEnd() {
var v0 int
ns.ObjectGroupOn(gvar48)
switch v0 = gvar41; v0 {
case gvar33:
goto LABEL1
case gvar34:
goto LABEL2
case gvar35:
goto LABEL3
case gvar36:
goto LABEL4
case gvar37:
goto LABEL5
default:
goto LABEL6
}
LABEL1:
ns.CancelDialog(obj38)
ns.CreatureGuard(obj38, ns.GetWaypointX(wp50), ns.GetWaypointY(wp50), ns.GetWaypointX(wp52), ns.GetWaypointY(wp52), 0)
ns.Pickup(ns.GetHost(), ns.Object("SilverKey01"))
ns.PrintToAll("GeneralPrint:GainedKey")
ns.AudioEvent(ns.KeyDrop, wp39)
gvar41 = gvar34
goto LABEL6
LABEL2:
flag55 = true
ns.CreatureGuard(obj38, ns.GetWaypointX(wp53), ns.GetWaypointY(wp53), ns.GetWaypointX(wp52), ns.GetWaypointY(wp52), 0)
gvar41 = gvar35
goto LABEL6
LABEL3:
goto LABEL6
LABEL4:
goto LABEL6
LABEL5:
flag56 = true
ns.CreatureFollow(obj38, ns.GetHost())
ns.CancelDialog(obj38)
ns.ObjectOn(obj45)
goto LABEL6
LABEL6:
return
}
func GearRoomMusic() {
ns.Music(26, 100)
}
func InitializeSwitchPuzzle() {
obj42 = ns.Object("ExitElevator")
obj43 = ns.Object("PlayerSwitch")
obj44 = ns.Object("GearhartSwitch")
obj45 = ns.Object("ExitTrigger")
gvar46 = ns.ObjectGroup("ElevatorSwitches")
gvar47 = ns.ObjectGroup("ElevatorGears")
wp49 = ns.Waypoint("FenceWP")
wp50 = ns.Waypoint("GateWP")
wp51 = ns.Waypoint("GearRoomEntranceWP")
wp52 = ns.Waypoint("PlayerSwitchWP")
wp53 = ns.Waypoint("GearhartSwitchWP")
wp39 = ns.Waypoint("SilverKeyWay")
}
func SetGearhartDialog() {
if !ns.IsCaller(obj38) {
goto LABEL1
}
ns.StoryPic(obj38, "GearhartPic")
ns.SetDialog(obj38, "FALSE", GearhartDialogStart, GearhartDialogEnd)
ns.ObjectOff(ns.GetTrigger())
LABEL1:
return
}
func GearhartCallForHelp() {
if !flag54 {
goto LABEL1
}
return
LABEL1:
flag54 = true
ns.Chat(obj38, "War02a:GearhartTalk01")
ns.Move(obj38, wp49)
ns.StoryPic(obj38, "GearhartPic")
ns.SetDialog(obj38, "FALSE", GearhartDialogStart, GearhartDialogEnd)
}
func CheckForBothButtons() {
if flag55 {
goto LABEL1
}
return
LABEL1:
if !(flag58 && flag57) {
goto LABEL2
}
ns.Music(16, 100)
ns.ObjectOn(obj42)
ns.ObjectGroupOn(gvar47)
ns.ObjectGroupOff(gvar46)
gvar41 = gvar37
ns.StartDialog(obj38, ns.GetHost())
LABEL2:
return
}
func PlayerSwitchActivate() {
flag58 = true
CheckForBothButtons()
}
func PlayerSwitchDeactivate() {
flag58 = false
}
func GearhartSwitchActivate() {
if !ns.IsCaller(obj38) {
goto LABEL1
}
ns.Chat(obj38, "War02a:GearhartTalk05")
LABEL1:
flag57 = true
CheckForBothButtons()
}
func GearhartSwitchDeactivate() {
flag57 = false
}
func LeaveGearRoom() {
if !ns.IsCaller(obj38) {
goto LABEL1
}
ns.CreatureGuard(obj38, ns.GetWaypointX(wp51), ns.GetWaypointY(wp51), 0, 0, 0)
LABEL1:
return
}
func EnterGearRoom() {
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
if !flag56 {
goto LABEL1
}
ns.CreatureFollow(obj38, ns.GetHost())
LABEL1:
return
}
func gotoExit() {
if flag40 {
goto LABEL1
}
ns.MoveObject(ns.GetHost(), 494, 610)
LABEL1:
return
}
func ExitSewers() {
ns.Frozen(ns.GetHost(), true)
ns.Blind()
ns.FrameTimer(60, gotoExit)
}
func Exit() {
flag40 = true
ns.Frozen(ns.GetHost(), false)
}
func sweepsOn123() {
if ns.IsObjectOn(obj59) {
goto LABEL1
}
ns.ObjectOn(obj59)
LABEL1:
ns.MoveWaypoint(wp4, ns.GetObjectX(ns.GetHost()), ns.GetObjectY(ns.GetHost()))
ns.AudioEvent(ns.BoulderMove, wp4)
ns.ObjectOn(obj60)
ns.ObjectOn(obj61)
ns.ObjectOn(obj62)
ns.Move(obj60, wp75)
ns.Move(obj61, wp77)
ns.Move(obj62, wp79)
}
func sweepsOn456() {
ns.MoveWaypoint(wp4, ns.GetObjectX(ns.GetHost()), ns.GetObjectY(ns.GetHost()))
ns.AudioEvent(ns.BoulderMove, wp4)
ns.ObjectOn(obj63)
ns.ObjectOn(obj64)
ns.ObjectOn(obj65)
ns.Move(obj63, wp80)
ns.Move(obj64, wp82)
ns.Move(obj65, wp84)
}
func sweepsOn789() {
ns.MoveWaypoint(wp4, ns.GetObjectX(ns.GetHost()), ns.GetObjectY(ns.GetHost()))
ns.AudioEvent(ns.BoulderMove, wp4)
ns.ObjectOn(obj66)
ns.ObjectOn(obj67)
ns.ObjectOn(obj68)
ns.Move(obj66, wp87)
ns.Move(obj67, wp89)
ns.Move(obj68, wp91)
}
func sweepsOn10thru14() {
ns.ObjectOn(obj69)
ns.ObjectOn(obj70)
ns.ObjectOn(obj71)
ns.ObjectOn(obj72)
ns.ObjectOn(obj73)
}
func sweepsOff123() {
ns.Move(obj60, wp74)
ns.Move(obj61, wp76)
ns.Move(obj62, wp78)
}
func sweepsOff456() {
ns.Move(obj63, wp81)
ns.Move(obj64, wp83)
ns.Move(obj65, wp85)
}
func sweepsOff789() {
ns.Move(obj66, wp86)
ns.Move(obj67, wp88)
ns.Move(obj68, wp90)
}
func sweepsOff10thru14() {
ns.ObjectOff(obj69)
ns.ObjectOff(obj70)
ns.ObjectOff(obj71)
ns.ObjectOff(obj72)
ns.ObjectOff(obj73)
}
func MapInitialize() {
obj38 = ns.Object("F2Gearhart")
obj60 = ns.Object("SweeperMover1")
obj61 = ns.Object("SweeperMover2")
obj62 = ns.Object("SweeperMover3")
obj63 = ns.Object("SweeperMover4")
obj64 = ns.Object("SweeperMover5")
obj65 = ns.Object("SweeperMover6")
obj66 = ns.Object("SweeperMover7")
obj67 = ns.Object("SweeperMover8")
obj68 = ns.Object("SweeperMover9")
obj69 = ns.Object("SweeperMover10")
obj70 = ns.Object("SweeperMover11")
obj71 = ns.Object("SweeperMover12")
obj72 = ns.Object("SweeperMover13")
obj73 = ns.Object("SweeperMover14")
gvar48 = ns.ObjectGroup("EveryMonsterOnMap")
wp4 = ns.Waypoint("AudioOrigin")
wp74 = ns.Waypoint("SweeperWay1a")
wp75 = ns.Waypoint("SweeperWay1b")
wp76 = ns.Waypoint("SweeperWay2a")
wp77 = ns.Waypoint("SweeperWay2b")
wp78 = ns.Waypoint("SweeperWay3a")
wp79 = ns.Waypoint("SweeperWay3b")
wp80 = ns.Waypoint("SweeperWay4")
wp81 = ns.Waypoint("SweeperWay4a")
wp82 = ns.Waypoint("SweeperWay5")
wp83 = ns.Waypoint("SweeperWay5a")
wp84 = ns.Waypoint("SweeperWay6")
wp85 = ns.Waypoint("SweeperWay6a")
wp86 = ns.Waypoint("SweeperWay7")
wp87 = ns.Waypoint("SweeperWay7a")
wp88 = ns.Waypoint("SweeperWay8")
wp89 = ns.Waypoint("SweeperWay8a")
wp90 = ns.Waypoint("SweeperWay9")
wp91 = ns.Waypoint("SweeperWay9a")
obj59 = ns.Object("Spider01")
InitializeSwitchPuzzle()
InitializeSquishBlocks()
}
func MapEntry() {
ns.UnBlind()
}
func OnEvent(typ string) {
switch typ {
case "PlayerDeath":
PlayerDeath()
case "MapShutdown":
MapShutdown()
case "MapInitialize":
MapInitialize()
case "MapEntry":
MapEntry()
}
}