-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
02_Hostile_Mountains.cfg
661 lines (600 loc) · 16.6 KB
/
02_Hostile_Mountains.cfg
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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
#textdomain wesnoth-low
[scenario]
id=02_Hostile_Mountains
next_scenario=03_Kalian_under_Attack
random_start_time=no
allow_new_game=no
force_lock_settings=yes
experience_modifier=100
name= _ "Hostile Mountains"
{LOW_MAP 02_Hostile_Mountains.map}
{TURNS 36 32 28}
{INTRO_AND_SCENARIO_MUSIC sad.ogg northern_mountains.ogg}
{EXTRA_SCENARIO_MUSIC knolls.ogg}
{EXTRA_SCENARIO_MUSIC traveling_minstrels.ogg}
{EXTRA_SCENARIO_MUSIC legends_of_the_north.ogg}
{EXTRA_SCENARIO_MUSIC knalgan_theme.ogg}
{DEFAULT_SCHEDULE_AFTERNOON}
{STARTING_VILLAGES_ALL 4}
{STARTING_VILLAGES_DWARF 3}
[story]
[part]
story= _ "Kalenz and his band broke out of the orcish encirclement, only to discover that the country on the direct route to the Ka’lian was already swarming with orcs. The raid on Kalenz’s home, it seemed, had been but one small part of a great migration south. There was no choice but to make a detour through territory the elves would rather have avoided..."
delay=8000
[/part]
[/story]
{LOW_TRACK {FLIGHT_STAGE2} }
### Kalenz's code ###
#define PLAYER_GOLD
#ifdef MULTIPLAYER
{GOLD 100 90 50}
#else
{GOLD 200 180 100}
#endif
income=-2
village_gold=1
#enddef
# wmllint: validate-off
[side]
side=1
{PLAYABLE}
{KALENZ_YOUNG}
{PLAYER_GOLD}
disallow_shuffle=yes
#ifndef MULTIPLAYER
[unit]
{LANDAR_YOUNG}
x=20
y=4
[/unit]
#endif
[/side]
# wmllint: validate-on
[event]
name=prestart
[recall]
id=Anduilas
x=20
y=6
[/recall]
[recall]
id=Arkildur
x=19
y=5
[/recall]
[/event]
### /Kalenz's code ###
# wmllint: skip-side
{MP_SIDE 2 (
x=20
y=4
save_id=Landar
disallow_shuffle=yes
{LANDAR_YOUNG}
{PLAYABLE}
{PLAYER_GOLD}
)}
### Olurf's Code ###
#define OLURFS_LAND
x=20-24,19-30,17-30,16-30,14-30,12-30,11-30,10-30,7-30,8-30,10-30,13-30,15-30,18-30,19-30,20-30,22-30,23-30,24-30,23-30,22-30
y=10,11,12,13-15,16-17,18-19,20,21,22,23,24,25,26,27,28-29,30,31-32 ,33-36,37,38-39,40
#enddef
# wmllint: validate-off
[side]
# wmllint: who OLURF is Olurf
{OLURF}
side=3
allow_player=no
controller=ai
{GOLD 150 120 120}
persistent=yes
save_id=Olurf
#ifdef EASY
team_name=player
user_team_name= _ "Player"
#else
team_name=player,trolls
user_team_name= _ "Neutrals"
#endif
[ai]
{AI_SIMPLE_ALWAYS_ASPECT caution 0}
{AI_SIMPLE_ALWAYS_ASPECT village_value 0}
{AI_SIMPLE_ALWAYS_ASPECT leader_value 0}
[/ai]
[/side]
# wmllint: validate-on
# Trolls have stepped on Olurf's land.
[event]
name=enter_hex
first_time_only=yes
[filter]
side=4
{OLURFS_LAND}
[/filter]
[message]
id=Olurf
message= _ "Those stinking trolls ha’ stepped on <i>our</i> land!"
[/message]
[cancel_action]
[/cancel_action]
[if]
[variable]
name=offended_by_elves
boolean_equals=yes
[/variable]
# the elves have stepped onto already
[then]
[modify_side]
side=3
team_name=dwarves
user_team_name= _ "Enemies"
[/modify_side]
#ifdef EASY
[fire_event]
name=dwarves_defend_their_territory
[/fire_event]
#endif
#ifdef NORMAL
[fire_event]
name=dwarves_defend_their_territory
[/fire_event]
#endif
#ifdef HARD
[fire_event]
name=dwarves_kill_elves_and_trolls
[/fire_event]
#endif
[/then]
[else]
[modify_side]
side=3
team_name=player
user_team_name= _ "Player"
[/modify_side]
#ifdef EASY
[fire_event]
name=dwarves_kill_trolls
[/fire_event]
#endif
#ifdef NORMAL
[fire_event]
name=dwarves_kill_trolls
[/fire_event]
#endif
#ifdef HARD
[fire_event]
name=dwarves_kill_trolls
[/fire_event]
#endif
[/else]
[/if]
[/event]
# Elves have stepped on Olurf's land.
[event]
name=enter_hex
first_time_only=yes
[filter]
side=1,2
{OLURFS_LAND}
[/filter]
[message]
id=Olurf
message= _ "Those lying elves have stepped on <i>our</i> land!"
[/message]
[message]
id=Kalenz
message= _ "Fight to subdue, and do not kill unless you must. We have foes enough as it is without making blood enemies of these dwarves."
[/message]
[cancel_action]
[/cancel_action]
[store_side]
side=3
variable=olurf_side
[/store_side]
[if]
[variable]
name=olurf_side.team_name
equals=player
[/variable]
[then]
[modify_side]
side=3
team_name=dwarves
user_team_name= _ "Enemies"
[/modify_side]
#ifdef EASY
[fire_event]
name=dwarves_defend_their_territory
[/fire_event]
#endif
#ifdef NORMAL
[fire_event]
#TODO think about making it like HARD
name=dwarves_defend_their_territory
[/fire_event]
#endif
#ifdef HARD
[fire_event]
name=dwarves_kill_elves_and_trolls
[/fire_event]
#endif
[/then]
[else]
[modify_side]
side=3
team_name=trolls
user_team_name= _ "Enemies"
[/modify_side]
#ifdef EASY
[fire_event]
name=dwarves_defend_their_territory
[/fire_event]
#endif
#ifdef NORMAL
[fire_event]
name=dwarves_kill_elves
[/fire_event]
#endif
#ifdef HARD
[fire_event]
name=dwarves_kill_elves
[/fire_event]
#endif
[/else]
[/if]
{CLEAR_VARIABLE olurf_side}
{VARIABLE offended_by_elves yes}
[/event]
# start dwarven ai code
#define CLEAN_AI SIDE
{MODIFY_AI_DELETE_GOAL {SIDE} *}
{MODIFY_AI_TRY_DELETE_STAGE {SIDE} retreat_to_olurfs_land}
{MODIFY_AI_TRY_DELETE_ASPECT {SIDE} avoid stay_in_own_land}
{MODIFY_AI_TRY_DELETE_ASPECT {SIDE} recruitment_instructions always}
#enddef
#define ADD_AVOID_STAY_AT_OLURFS_LAND
{MODIFY_AI_ADD_ASPECT 3 avoid (
[facet]
id="stay_in_own_land"
[value]
[not]
{OLURFS_LAND}
[/not]
[/value]
[/facet]
)}
#enddef
#define ADD_GOAL_KILL_ELVES SIDE
{MODIFY_AI_ADD_GOAL {SIDE} (
[goal]
id=kill_elves
[criteria]
side=1,2
[/criteria]
value=1.5
[/goal]
)}
#enddef
#define ADD_GOAL_KILL_TROLLS SIDE
{MODIFY_AI_ADD_GOAL {SIDE} (
[goal]
id=kill_trolls
[criteria]
side=4
[/criteria]
value=1.5
[/goal]
)}
#enddef
#define ADD_GOAL_KILL_TRESPASSERS SIDE
{MODIFY_AI_ADD_GOAL {SIDE} (
[goal]
id=kill_trespassers
[criteria]
[not]
side={SIDE}
[/not]
#limiting is handled by 'avoid' aspect
[/criteria]
value=1.5
[/goal]
)}
#enddef
#define ADD_STAGE_RETREAT_TO_OLURFS_LAND SIDE
[modify_ai]
side={SIDE}
action=add
path=stage[0]
[stage]
id=retreat_to_olurfs_land
name=ai_default_rca::candidate_action_evaluation_loop
#TODO: add [candidate_action]s to make the retreat work
[/stage]
[/modify_ai]
#enddef
[event]
name=dwarves_watch_the_show
first_time_only=no
{CLEAN_AI 3}
{MODIFY_AI_ADD_ASPECT 3 recruitment_instructions {AI_NO_RECRUITMENT} }
{ADD_AVOID_STAY_AT_OLURFS_LAND}
[message]
id=Olurf
message= _ "It should be rare sport to watch this... Just be sure not to trespass on our land."
[/message]
[/event]
[event]
name=dwarves_kill_elves
first_time_only=no
{CLEAN_AI 3}
{ADD_GOAL_KILL_ELVES 3}
[message]
id=Olurf
message= _ "Up axes, and death to elves!"
[/message]
[/event]
[event]
name=dwarves_kill_trolls
first_time_only=no
{CLEAN_AI 3}
{ADD_GOAL_KILL_TROLLS 3}
[message]
id=Olurf
message= _ "Up axes, and death to trolls!"
[/message]
[/event]
[event]
name=dwarves_kill_elves_and_trolls
first_time_only=no
{CLEAN_AI 3}
{ADD_GOAL_KILL_ELVES 3}
{ADD_GOAL_KILL_TROLLS 3}
[message]
id=Olurf
message= _ "Up axes, and kill all the interlopers!"
[/message]
[/event]
[event]
name=dwarves_defend_their_territory
first_time_only=no
{CLEAN_AI 3}
{ADD_AVOID_STAY_AT_OLURFS_LAND}
{ADD_GOAL_KILL_TRESPASSERS 3}
{ADD_STAGE_RETREAT_TO_OLURFS_LAND 3}
[message]
id=Olurf
message= _ "Defend our bounds! Slay all who trespass them!"
[/message]
[/event]
#undef CLEAN_AI
#undef ADD_AVOID_STAY_AT_OLURFS_LAND
#undef ADD_STAGE_RETREAT_TO_OLURFS_LAND
#undef ADD_GOAL_KILL_ELVES
#undef ADD_GOAL_KILL_TROLLS
#undef ADD_GOAL_KILL_TRESPASSERS
# end dwarven ai code
[event]
name=scenario_end
{CLEAR_VARIABLE offended_by_elves}
[/event]
### /Olurf's Code ###
### Enemy Side ###
[side]
side=4
allow_player=no
controller=ai
#ifdef EASY
type=Troll Hero
#else
type=Great Troll
#endif
id=Grugl
name=_ "Grugl"
team_name=trolls
user_team_name= _ "Enemies"
{TROLL_SETUP}
canrecruit=yes
#ifdef EASY
recruit=Troll Whelp
#endif
#ifdef NORMAL
recruit=Troll Whelp, Troll, Troll Rocklobber
#endif
#ifdef HARD
recruit=Troll Whelp, Troll, Troll Rocklobber, Troll Warrior
#endif
{GOLD 170 240 270}
[ai]
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter, mixed fighter"}
[goal]
[criteria]
race=elf
[/criteria]
value=1.5
[/goal]
{AI_SIMPLE_ALWAYS_ASPECT aggression 0.75}
{AI_SIMPLE_NIGHT_ASPECT caution 0}
{AI_SIMPLE_NIGHT_ASPECT grouping no}
[/ai]
{INCOME 4 8 12}
[/side]
#undef OLURFS_LAND
#ifdef HARD
{LIMIT_CONTEMPORANEOUS_RECRUITS 4 "Troll Warrior" 2}
#endif
### /Enemy Side ###
#### Objectives and corresponding events ####
[event]
name=start
[message]
id=Kalenz
message= _ "I had hoped to avoid these paths... The eastern way is through dwarvish territory and is shorter. I pray the dwarves will grant us safe passage, since the other path is through troll territory..."
[/message]
[message]
id=Olurf
message= _ "Not even in yer dreams, elf. These are dwarvish lands, and troubles we want no part of nip at yer heels. Get out and stay out!"
[/message]
[message]
id=Landar
message= _ "Our troubles will be yours, too, whether either of us wills it or not. The orcs have come down from the north like a flood; if we squabble among ourselves they will feast on our discord."
[/message]
[message]
id=Olurf
message= _ "Bah. More smooth words and trickery, by my beard. We know yer kind... and who needs yer help anyway, weaklings? Leave now, or feel my axe! That same kiss of steel will greet all intruders. Anyone who sets foot on the eastern bank o’ this river will rue the day he was born!"
[/message]
[message]
id=Landar
message= _ "I cannot see how trolls could be any less friendly."
[/message]
[message]
id=Kalenz
message= _ "Hmm... Perhaps the dwarves’ intransigence can serve our purpose. Onwards, and no matter what you do, do <i>not</i> step on the eastern bank of the river!"
[/message]
{HIGHLIGHT_IMAGE 18 37 scenery/signpost.png ()}
[fire_event]
name=dwarves_watch_the_show
[/fire_event]
[/event]
[event]
name=prestart
[objectives]
side=0
[objective]
description= _ "Kalenz or Landar must reach the signpost"
condition=win
[/objective]
[objective]
{ALTERNATIVE_OBJECTIVE_CAPTION}
description= _ "Defeat Grugl"
condition=win
[/objective]
[objective]
description= _ "Death of Kalenz"
condition=lose
[/objective]
[objective]
description= _ "Death of Landar"
condition=lose
[/objective]
[objective]
description= _ "Death of Olurf"
condition=lose
[/objective]
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=80
[/gold_carryover]
[/objectives]
[/event]
#define ENDSPEECH SPEAKER_NAME
[message]
speaker={SPEAKER_NAME}
message= _ "We made it. Onwards to Wesmere!"
[/message]
[if]
[variable]
name=killed_by_elves
greater_than=3
[/variable]
[then]
[message]
id=Olurf
message= _ "Crazy elves! But at least they felled a few trolls before they left."
[/message]
[/then]
[else]
[message]
id=Olurf
message= _ "Crazy elves!"
[/message]
[/else]
[/if]
#enddef
[event]
name=prestart
{VARIABLE killed_by_elves 0}
[/event]
[event]
name=die
first_time_only="no"
[filter]
race=troll
[/filter]
[filter_second]
race=elf
[/filter_second]
#TODO does this need the variable to exist?
[set_variable]
name=killed_by_elves
add=1
[/set_variable]
[/event]
[event]
name=scenario_end
{CLEAR_VARIABLE killed_by_elves}
[/event]
[event]
name=moveto
[filter]
x=18
y=37
[and]
id=Kalenz
[or]
id=Landar
[/or]
[/and]
[/filter]
{ENDSPEECH unit}
[endlevel]
result=victory
#ifdef MULTIPLAYER
bonus=0.5
#else
bonus=yes
#endif
[/endlevel]
[/event]
[event]
name=last breath
[filter]
id=Grugl
[/filter]
[filter_second]
race=dwarf
[/filter_second]
[message]
id=Grugl
# wmllint: local spelling Urgh
message= _ "Urgh! Grugl tried to eat dwarves, but choked on their sharp nasty axes."
[/message]
{ENDSPEECH "Kalenz"}
[/event]
[event]
name=last breath
[filter]
id=Grugl
[/filter]
[filter_second]
race=elf
[/filter_second]
[message]
id=Grugl
message= _ "Urgh! Grugl wanted tasty elf-meat, but choked on their nasty pointy spears!"
[/message]
{ENDSPEECH second_unit}
#undef ENDSPEECH
[endlevel]
result=victory
#ifdef MULTIPLAYER
bonus=0.5
#else
bonus=yes
#endif
[/endlevel]
[/event]
{campaigns/Legend_of_Wesmere/utils/deaths.cfg}
[/scenario]
#undef PLAYER_GOLD
#undef MULTIPLAYER_GOLD