-
Notifications
You must be signed in to change notification settings - Fork 0
/
wiz03a.go
476 lines (472 loc) · 9.16 KB
/
wiz03a.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
package wiz03a
import (
"strconv"
"github.com/noxworld-dev/noxscript/ns/v3"
)
var (
obj4 ns.ObjectID
wp5 ns.WaypointID
wp6 [70]ns.WaypointID
obj7 ns.ObjectID
obj8 ns.ObjectID
gvar9 ns.ObjectGroupID
obj10 ns.ObjectID
obj11 ns.ObjectID
obj12 ns.ObjectID
obj13 ns.ObjectID
wp14 ns.WaypointID
obj15 ns.ObjectID
obj16 ns.ObjectID
gvar17 ns.WallGroupID
gvar18 int
gvar19 int
gvar20 int
gvar21 int
gvar22 int
wp23 ns.WaypointID
wp24 ns.WaypointID
obj25 ns.ObjectID
wp26 ns.WaypointID
wp27 ns.WaypointID
wp28 ns.WaypointID
wp29 ns.WaypointID
obj30 ns.ObjectID
gvar31 ns.ObjectID
gvar32 ns.ObjectID
gvar33 ns.ObjectGroupID
obj34 ns.ObjectID
obj35 ns.ObjectID
gvar36 ns.ObjectGroupID
gvar37 ns.ObjectGroupID
gvar38 ns.WallGroupID
wp39 ns.WaypointID
gvar40 int
gvar41 int
gvar42 int
obj43 ns.ObjectID
gvar44 ns.ObjectGroupID
obj45 ns.ObjectID
gvar46 ns.ObjectGroupID
gvar47 int
gvar48 [6]int
gvar49 int
gvar50 int
)
func init() {
gvar18 = 0
gvar19 = 1
gvar20 = 2
gvar21 = 3
gvar22 = gvar18
gvar40 = 0
gvar41 = 1
gvar42 = gvar40
}
func ArcherIdle() {
ns.AggressionLevel(obj4, 1)
ns.CreatureIdle(obj4)
}
func MissileAttackBarrel() {
var (
v0 float32
v1 float32
)
v0 = ns.GetWaypointX(wp5)
v1 = ns.GetWaypointY(wp5)
ns.HitFarLocation(obj4, v0, v1)
}
func AttackBarrel() {
ns.FrameTimer(3, MissileAttackBarrel)
}
func FlamesCreate() {
var (
v0 int
v1 int
)
v0 = 0
for {
if !(v0 < 70) {
goto LABEL1
}
switch v1 = v0 % 3; v1 {
case 0:
goto LABEL2
case 1:
goto LABEL3
case 2:
goto LABEL4
default:
goto LABEL5
}
LABEL2:
ns.CreateObject("MediumFlame", wp6[v0])
goto LABEL5
LABEL3:
ns.CreateObject("Flame", wp6[v0])
goto LABEL5
LABEL4:
ns.CreateObject("SmallFlame", wp6[v0])
goto LABEL5
LABEL5:
v0 += 1
}
LABEL1:
return
}
func PlayerDeath() {
ns.DeathScreen(3)
}
func HorvathTalkStart() {
var v0 int
if !ns.HasItem(ns.GetHost(), ns.Object("Wiz03b:AmuletofTeleportation")) {
goto LABEL1
}
gvar22 = gvar21
LABEL1:
switch v0 = gvar22; v0 {
case gvar18:
goto LABEL2
case gvar19:
goto LABEL3
case gvar20:
goto LABEL4
case gvar21:
goto LABEL5
default:
goto LABEL6
}
LABEL2:
ns.TellStory(ns.SwordsmanHurt, "Wiz03a:HorvathIntro")
goto LABEL6
LABEL3:
ns.TellStory(ns.SwordsmanHurt, "Wiz03a:HorvathPre")
goto LABEL6
LABEL4:
ns.TellStory(ns.SwordsmanHurt, "Wiz03a:HorvathPre2")
goto LABEL6
LABEL5:
ns.TellStory(ns.SwordsmanHurt, "Wiz03a:HorvathFinish")
goto LABEL6
ns.Blind()
ns.FrameTimer(60, PlayerExit)
goto LABEL6
LABEL6:
return
}
func HorvathTalkEnd() {
var v0 int
switch v0 = gvar22; v0 {
case gvar18:
goto LABEL1
case gvar19:
goto LABEL2
case gvar21:
goto LABEL3
default:
goto LABEL4
}
LABEL1:
ns.ObjectOn(obj16)
ns.JournalEntry(ns.GetHost(), "Wiz03aGetAmulet", 2)
ns.Print("Con01a:NewJournalEntry")
gvar22 = gvar19
goto LABEL4
LABEL2:
gvar22 = gvar20
goto LABEL4
LABEL3:
ns.Frozen(ns.GetHost(), true)
ns.JournalEdit(ns.GetHost(), "Journal:Wiz03aGetAmulet", 4)
gvar31 = ns.GetLastItem(ns.GetHost())
for {
if gvar31 == 0 {
goto LABEL5
}
gvar32 = ns.GetPreviousItem(gvar31)
if gvar31 != ns.Object("Wiz03b:AmuletofTeleportation") {
goto LABEL6
}
ns.Delete(gvar31)
LABEL6:
gvar31 = gvar32
}
LABEL5:
ns.CancelDialog(obj10)
ns.Blind()
ns.FrameTimer(60, PlayerExit)
goto LABEL4
LABEL4:
return
}
func AirshipCaptainAppear() {
var (
v0 float32
v1 float32
v2 float32
v3 float32
)
v0 = ns.GetWaypointX(wp26)
v1 = ns.GetWaypointY(wp26)
v2 = ns.GetWaypointX(wp27)
v3 = ns.GetWaypointY(wp27)
ns.MoveObject(obj25, v0, v1)
ns.CreatureGuard(obj25, v0, v1, v2, v3, 500)
}
func PlayerExit() {
var (
v0 float32
v1 float32
)
v0 = ns.GetWaypointX(wp28)
v1 = ns.GetWaypointY(wp28)
ns.MoveObject(ns.GetHost(), v0, v1)
ns.Frozen(ns.GetHost(), false)
}
func MissionStart() {
ns.ObjectOff(obj8)
}
func BrennethSpeaks() {
var (
v0 float32
v1 float32
v2 float32
v3 float32
)
v0 = ns.GetObjectX(obj35)
v1 = ns.GetObjectY(obj35)
v2 = ns.GetObjectX(ns.GetHost())
v3 = ns.GetObjectY(ns.GetHost())
if !(ns.Distance(v0, v1, v2, v3) < 230) {
goto LABEL1
}
ns.LookAtObject(obj35, ns.GetHost())
ns.StartDialog(obj35, ns.GetHost())
ns.TellStory(ns.SwordsmanHurt, "Wiz03a:BrennethExplains")
goto LABEL2
LABEL1:
ns.FrameTimer(30, BrennethSpeaks)
LABEL2:
return
}
func BrennethTalkStart() {
var v0 int
switch v0 = gvar42; v0 {
case gvar41:
goto LABEL1
default:
goto LABEL2
}
LABEL1:
ns.LookAtObject(obj35, ns.GetHost())
ns.TellStory(ns.SwordsmanHurt, "Wiz03a:BrennethEnd")
goto LABEL2
LABEL2:
return
}
func BrennethTalkEnd() {
var v0 int
switch v0 = gvar42; v0 {
case gvar40:
goto LABEL1
case gvar41:
goto LABEL2
default:
goto LABEL3
}
LABEL1:
ns.Move(obj35, wp39)
ns.CreatureGuard(obj35, 4938, 1032, 4923, 1078, 500)
gvar42 = gvar41
goto LABEL3
LABEL2:
goto LABEL3
LABEL3:
return
}
func MapInitialize() {
var v0 int
obj8 = ns.Object("MissionTrig")
obj10 = ns.Object("Horvath")
gvar9 = ns.ObjectGroup("HorvathTrigGroup")
ns.StoryPic(obj10, "HorvathPic")
ns.SetDialog(obj10, ns.NORMAL, HorvathTalkStart, HorvathTalkEnd)
obj11 = ns.Object("HorvathDoor1")
obj12 = ns.Object("HorvathDoor2")
ns.SetOwner(ns.GetHost(), obj10)
obj13 = ns.Object("HorvathBookcaseMover1")
obj15 = ns.Object("HorvathBookcaseMover2")
obj16 = ns.Object("HorvathBookcaseTrigger")
ns.LockDoor(obj11)
ns.LockDoor(obj12)
wp23 = ns.Waypoint("JournalSoundWP")
wp14 = ns.Waypoint("HorvathBookcase1WP")
obj25 = ns.Object("Airship_Captain")
wp26 = ns.Waypoint("AirshipCaptainWP")
wp27 = ns.Waypoint("AirshipCaptainLook")
ns.SetOwner(ns.GetHost(), obj25)
gvar38 = ns.WallGroup("InvisibleWallGroup")
gvar33 = ns.ObjectGroup("ElevatorTrigGroup")
obj34 = ns.Object("CellarElevator")
obj35 = ns.Object("Brenneth")
gvar36 = ns.ObjectGroup("BrennethGroup")
ns.GroupSetOwner(ns.GetHost(), gvar36)
ns.StoryPic(obj35, "MalePic8")
ns.SetDialog(obj35, ns.NORMAL, BrennethTalkStart, BrennethTalkEnd)
wp39 = ns.Waypoint("BrennethWP")
gvar37 = ns.ObjectGroup("GearGroup")
obj43 = ns.Object("Bandit01")
ns.Damage(obj43, 0, 100, 5)
gvar46 = ns.ObjectGroup("MonsterGroup1")
ns.ObjectGroupOff(gvar46)
gvar44 = ns.ObjectGroup("MissionExitGroup")
obj45 = ns.Object("Wiz03b:AmuletofTeleportation")
gvar17 = ns.WallGroup("HorvathWallGroup")
wp28 = ns.Waypoint("ExitWP")
wp29 = ns.Waypoint("Wiz03bExitWP")
obj30 = ns.Object("ExitTrig")
obj4 = ns.Object("Archer01")
wp5 = ns.Waypoint("Barrel1WP")
obj7 = ns.Object("Barrel01")
wp24 = ns.Waypoint("Secret01WP")
ns.StartupScreen(3)
v0 = 0
for {
if !(v0 < 70) {
goto LABEL1
}
wp6[v0] = ns.Waypoint(strconv.Itoa(v0+1) + "WP")
v0 += 1
}
LABEL1:
return
}
func MapEntry() {
ns.UnBlind()
ns.ObjectOn(obj30)
}
func HorvathPickup() {
ns.Pickup(obj10, ns.Object("Wiz03b:AmuletofTeleportation"))
}
func OpenHorvathWalls() {
ns.ObjectOff(ns.GetTrigger())
ns.ObjectOn(obj13)
ns.ObjectOn(obj15)
ns.WallGroupOpen(gvar17)
}
func QuestSwitch() {
if !ns.HasItem(ns.GetHost(), ns.Object("Wiz03b:AmuletofTeleportation")) {
goto LABEL1
}
ns.MoveObject(obj35, 5457, 1685)
ns.ObjectGroupOn(gvar37)
ns.ObjectOn(obj34)
AirshipCaptainAppear()
LABEL1:
return
}
func QuestXP() {
if !ns.HasItem(ns.GetHost(), ns.Object("Wiz03b:AmuletofTeleportation")) {
goto LABEL1
}
ns.ObjectOff(ns.GetTrigger())
ns.GiveXp(ns.GetHost(), 1000)
ns.AudioEvent(ns.FlagDrop, wp23)
ns.Music(0, 100)
LABEL1:
return
}
func DisableElevator() {
ns.NoWallSound(true)
ns.WallGroupOpen(gvar38)
ns.NoWallSound(false)
ns.ObjectOff(obj34)
ns.ObjectGroupOff(gvar37)
ns.ObjectGroupOff(gvar33)
ns.CreatureFollow(obj35, ns.GetHost())
ns.AudioEvent(ns.WoodenArmorBreak, wp39)
ns.AudioEvent(ns.MetalArmorBreak, wp39)
ns.AudioEvent(ns.WallDestroyed, wp39)
ns.AudioEvent(ns.LightningWand, wp39)
ns.Effect(ns.SMOKE_BLAST, 4953, 1047, 4953, 1047)
ns.Effect(ns.BLUE_SPARKS, 4953, 1047, 4953, 1047)
BrennethSpeaks()
}
func MonsterGoHome() {
if !ns.IsAttackedBy(ns.GetCaller(), ns.GetHost()) {
goto LABEL1
}
ns.GoBackHome(ns.GetCaller())
LABEL1:
return
}
func MonsterGroup1Enable() {
ns.ObjectGroupOn(gvar46)
}
func PlayerWiz03bExit() {
var (
v0 float32
v1 float32
)
v0 = ns.GetWaypointX(wp29)
v1 = ns.GetWaypointY(wp29)
ns.MoveObject(ns.GetHost(), v0, v1)
}
func FreezePlayer() {
ns.Frozen(ns.GetHost(), true)
}
func GotoWiz03b() {
ns.ObjectOff(obj30)
ns.Blind()
ns.FrameTimer(30, FreezePlayer)
ns.FrameTimer(60, PlayerWiz03bExit)
}
func QuestCheck() {
if !ns.HasItem(ns.GetHost(), ns.Object("Wiz03b:AmuletofTeleportation")) {
goto LABEL1
}
ns.Chat(ns.GetHost(), "I got it!")
LABEL1:
return
}
func Secret50XP() {
ns.GiveXp(ns.GetHost(), 50)
ns.PrintToAll("GeneralPrint:SecretFound")
ns.AudioEvent(ns.SecretFound, wp24)
}
func Award100XP() {
ns.GiveXp(ns.GetHost(), 100)
}
func PlaySubMusic() {
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
ns.Music(19, 100)
LABEL1:
return
}
func PlayNoMusic() {
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
ns.Music(0, 100)
LABEL1:
return
}
func PlayWanderMusic() {
if !ns.IsCaller(ns.GetHost()) {
goto LABEL1
}
ns.Music(22, 100)
LABEL1:
return
}
func OnEvent(typ string) {
switch typ {
case "PlayerDeath":
PlayerDeath()
case "MapInitialize":
MapInitialize()
case "MapEntry":
MapEntry()
}
}