1#textdomain wesnoth-utbs
2
3# wmllint: directory spelling Griknagh
4
5[scenario]
6    id=05_A_Subterranean_Struggle
7    name= _ "A Subterranean Struggle"
8    next_scenario=06a_In_the_Tunnels_of_the_Trolls
9
10    {UTBS_MAP 05_A_Subterranean_Struggle.map}
11    victory_when_enemies_defeated=no
12
13    {UNDERGROUND}
14    {TURNS 45 43 41}
15
16    #TODO add extra music
17    {SCENARIO_MUSIC "underground.ogg"}
18    {EXTRA_SCENARIO_MUSIC "legends_of_the_north.ogg"}
19    {EXTRA_SCENARIO_MUSIC "the_dangerous_symphony.ogg"}
20
21    {STORY_A_SUBTERRANEAN_STRUGGLE}
22
23    [side]
24        side=1
25        id=Kaleh
26        type=Quenoth Youth
27        canrecruit=yes
28        gold=200
29        {INCOME 7 5 3}
30        controller=human
31        shroud=yes
32        fog=no
33        {FLAG_VARIANT long}
34        user_team_name= _ "team_name^Quenoth Elves"
35    [/side]
36
37    #Side=2 troll 1 (blue)
38    [side]
39        no_leader=yes
40        side=2
41        gold=0
42        income=0
43        controller=ai
44        shroud=no
45        fog=no
46        hidden=yes
47        team_name=trolls
48        user_team_name= _ "team_name^Trolls"
49
50        recruit=Troll Whelp, Troll, Troll Rocklobber
51        [ai]
52            recruitment_pattern=fighter,fighter,mixed fighter
53            aggression=0.8
54            caution=0.05
55            grouping=offensive
56
57            [goal]
58                name=target
59                [criteria]
60                    side=1
61                [/criteria]
62                value=10
63            [/goal]
64            [goal]
65                name=target
66                [criteria]
67                    side=4
68                [/criteria]
69                value=9
70            [/goal]
71            [goal]
72                name=target
73                [criteria]
74                    side=5
75                [/criteria]
76                value=9
77            [/goal]
78        [/ai]
79    [/side]
80
81    #Side=3 troll 2 (green)
82    [side]
83        side=3
84        no_leader=yes
85        gold=0
86        income=0
87        controller=ai
88        shroud=no
89        fog=no
90        hidden=yes
91        team_name=trolls
92        user_team_name= _ "team_name^Trolls"
93
94        recruit=Troll Whelp, Troll, Troll Rocklobber
95
96        [ai]
97            recruitment_pattern=fighter,fighter,mixed fighter
98
99            aggression=0.8
100            caution=0.05
101            grouping=offensive
102
103            [goal]
104                name=target
105                [criteria]
106                    side=1
107                [/criteria]
108                value=10
109            [/goal]
110            [goal]
111                name=target
112                [criteria]
113                    side=4
114                [/criteria]
115                value=9
116            [/goal]
117            [goal]
118                name=target
119                [criteria]
120                    side=5
121                [/criteria]
122                value=9
123            [/goal]
124        [/ai]
125    [/side]
126
127    #Side=4 dwarf 1 (yellow)
128    [side]
129        side=4
130        no_leader=yes
131        gold=0
132        income=0
133        controller=ai
134        shroud=no
135        fog=no
136        hidden=yes
137        team_name=dwarves
138        user_team_name= _ "team_name^Dwarves"
139
140        recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, Dwarvish Guardsman
141
142        [ai]
143            aggression=0.8
144            caution=0.05
145            grouping=offensive
146
147            [goal]
148                name=target
149                [criteria]
150                    side=1
151                [/criteria]
152                value=10
153            [/goal]
154            [goal]
155                name=target
156                [criteria]
157                    side=2
158                [/criteria]
159                value=9
160            [/goal]
161            [goal]
162                name=target
163                [criteria]
164                    side=3
165                [/criteria]
166                value=9
167            [/goal]
168        [/ai]
169        {FLAG_VARIANT knalgan}
170    [/side]
171
172    #Side=5 dwarf 2 (purple)
173    [side]
174        side=5
175        no_leader=yes
176        gold=0
177        income=0
178        controller=ai
179        shroud=no
180        fog=no
181        hidden=yes
182        team_name=dwarves
183        user_team_name= _ "team_name^Dwarves"
184
185        recruit=Dwarvish Fighter, Dwarvish Steelclad, Dwarvish Thunderer, Dwarvish Guardsman
186
187        [ai]
188            aggression=0.8
189            caution=0.05
190            grouping=offensive
191
192            [goal]
193                name=target
194                [criteria]
195                    side=1
196                [/criteria]
197                value=10
198            [/goal]
199            [goal]
200                name=target
201                [criteria]
202                    side=2
203                [/criteria]
204                value=9
205            [/goal]
206            [goal]
207                name=target
208                [criteria]
209                    side=3
210                [/criteria]
211                value=9
212            [/goal]
213        [/ai]
214        {FLAG_VARIANT knalgan}
215    [/side]
216
217    #Side=6 Ants
218    [side]
219        side=6
220        no_leader=yes
221        gold=0
222        income=0
223        controller=ai
224        shroud=no
225        fog=no
226        hidden=yes
227        color=white
228
229        [ai]
230            aggression=0.8
231            caution=0.1
232
233            village_value=0
234
235            recruitment_pattern=fighter,fighter,fighter,fighter
236
237            #causes ants to target cave spider
238            [goal]
239                name=target
240                [criteria]
241                    type=Cave Spider
242                [/criteria]
243                value=150
244            [/goal]
245
246            [goal]
247                name=target
248                [criteria]
249                    side=1
250                [/criteria]
251                value=100
252            [/goal]
253
254            passive_leader=yes
255        [/ai]
256    [/side]
257
258    #Side=7 Assassin & Cave Spider
259    [side]
260        side=7
261        no_leader=yes
262        gold=0
263        income=0
264        controller=ai
265        shroud=yes
266        fog=no
267        hidden=yes
268        color=teal
269
270        [ai]
271            aggression=0.90
272            caution=0.10
273        [/ai]
274    [/side]
275
276    # Prestart functions:
277    # set starting scenario objectives
278    # increase cost of recruiting units
279    # place item images on map
280    # recall main heroes
281    # initialize starting variable
282    # create elf units
283    # create AI=guardian starting units
284
285    #fires lighting central cavern
286    {ANIMATED_CAMPFIRE 31 32}
287    {ANIMATED_CAMPFIRE 33 21}
288
289    [event]
290        name=prestart
291
292        #set starting scenario objectives
293
294        [objectives]
295            summary= _ "Starting Objectives:"
296            [objective]
297                description= _ "Explore underground"
298                condition=win
299            [/objective]
300            [objective]
301                description= _ "Defeat enemy leaders"
302                condition=win
303            [/objective]
304            [objective]
305                description= _ "Death of Kaleh"
306                condition=lose
307            [/objective]
308            [objective]
309                description= _ "Death of Nym"
310                condition=lose
311            [/objective]
312            [objective]
313                description= _ "Death of Zhul"
314                condition=lose
315            [/objective]
316
317            {TURNS_RUN_OUT}
318
319            [gold_carryover]
320                bonus=yes
321                carryover_percentage=40
322            [/gold_carryover]
323        [/objectives]
324
325        {INCREASE_RECRUIT_COSTS 1}
326
327        #central cavern furnishings
328
329        {PLACE_IMAGE items/rock-cairn3.png 42 21}  # this image is in a different folder because it is not in core, just campaign
330        {PLACE_IMAGE scenery/rock-cairn.png 38 20}
331        {PLACE_IMAGE scenery/rock-cairn2.png 30 20}
332
333        {PLACE_IMAGE items/burial.png 27 33}
334        {PLACE_IMAGE items/burial2.png 35 34}
335        {PLACE_IMAGE items/burial.png 43 33}
336
337        #recall heroes
338        [recall]
339            id=Nym
340        [/recall]
341
342        [recall]
343            id=Zhul
344        [/recall]
345
346        [recall]
347            id=Elyssa
348        [/recall]
349
350        #create starting elves
351
352        [unit]
353            type=Quenoth Fighter
354            name= _ "Nantheos"
355            x=4
356            y=23
357            side=1
358            [modifications]
359                {TRAIT_QUICK}
360                {TRAIT_STRONG}
361            [/modifications]
362        [/unit]
363
364        [unit]
365            type=Quenoth Fighter
366            name= _ "Sylestria"
367            x=5
368            y=25
369            side=1
370            [modifications]
371                {TRAIT_INTELLIGENT}
372                {TRAIT_RESILIENT}
373            [/modifications]
374        [/unit]
375
376        # If Elyssa the Mage isn't there, boost starting group a bit
377
378        [if]
379            [not]
380                [have_unit]
381                    id=Elyssa
382                [/have_unit]
383            [/not]
384            [then]
385                [unit]
386                    type=Quenoth Flanker
387                    name= _ "Rygar"
388                    x=6
389                    y=24
390                    side=1
391                    [modifications]
392                        {TRAIT_LOYAL}
393                        {TRAIT_RESILIENT}
394                    [/modifications]
395                    {IS_LOYAL}
396                [/unit]
397            [/then]
398        [/if]
399    [/event]
400
401    # starting events
402
403    [event]
404        name=start
405
406        # starting dialogue
407
408        [if]
409            [have_unit]
410                id=Elyssa
411            [/have_unit]
412
413            [then]
414                [message]
415                    speaker=Kaleh
416                    message= _ "You mentioned that dwarves and trolls often lived underground, Elyssa. I’ve only heard myths, have you ever met a dwarf or a troll?"
417                [/message]
418
419                [message]
420                    speaker=Elyssa
421                    message= _ "No I haven’t, I don’t often explore underground unless I have to. There are lots of nasty things that lurk far away from the light of the suns. But I’ve read a bit about them, and have even met a few people who had dealings with dwarves."
422                [/message]
423
424                [message]
425                    speaker=Nym
426                    message= _ "What are dwarves like?"
427                [/message]
428
429                [message]
430                    speaker=Elyssa
431                    message= _ "They’re a proud people, and some would say greedy. They love their gold and fine metals, and forge many beautiful things. I should warn you, they have little liking for elves. There was some betrayal many years ago, though I don’t know what happened."
432                [/message]
433
434                [message]
435                    speaker=Kaleh
436                    message= _ "And what about trolls? I’m not sure I’d want to meet one face to face."
437                [/message]
438
439                [message]
440                    speaker=Elyssa
441                    message= _ "Trolls and dwarves are natural enemies, living so close together. And many would say trolls are little more than brutes and savages. Trolls are huge and very strong, with skin as hard as stone, and can be fearsome foes. But I knew one man long ago who traded with a group of trolls and said they were quite honorable, as long as you didn’t try to cheat them."
442                [/message]
443
444                [message]
445                    speaker=Zhul
446                    message= _ "Well, with Eloh’s guidance, I hope we find these tunnels deserted. I’ll be happy if our biggest problem is not getting lost. I have little wish to meet either dwarves or trolls. But Eloh will watch over us."
447                [/message]
448
449                [message]
450                    speaker=Kaleh
451                    message= _ "Will she? I got the impression she was powerless underground."
452                [/message]
453
454                [message]
455                    speaker=Zhul
456                    message= _ "Where did you get that idea? Certainly Eloh is strongest during the day, when the suns are shining down on us. But it is said that even in the darkest of nights she will protect her faithful. And back during the Golden Age holy elven warriors led great crusades against orcs and other foul things that hid underground, killing them with Eloh’s aid. Faith is our shield, Kaleh. I think you should keep your doubts to yourself; it would not do to unduly worry our people. Eloh will always protect us, if we follow her path."
457                [/message]
458
459                [message]
460                    speaker=Kaleh
461                    message= _ "Then let us hope the rest of our journey may be as uneventful as it has been this far."
462                [/message]
463            [/then]
464
465            [else]
466                [message]
467                    speaker=Kaleh
468                    message= _ "I’ve heard of dwarves, but do you have any idea, Zhul, what kinds of creatures we might encounter underground?"
469                [/message]
470
471                [message]
472                    speaker=Zhul
473                    message= _ "These tunnels are foreign to me; I know little more than you do. All I know about dwarves is from the few tales from the Golden Age."
474                [/message]
475
476                [message]
477                    speaker=Nym
478                    message= _ "What are they like?"
479                [/message]
480
481                [message]
482                    speaker=Zhul
483                    message= _ "They lived deep under the earth, mining gold and fine metals and forging many beautiful things. We were once allies during the Golden Age, but in the strife and chaos of the fall we lost all contact. I don’t know if any survived. But in the golden age they were very helpful in our wars against the orcs and trolls."
484                [/message]
485
486                [message]
487                    speaker=Kaleh
488                    message= _ "What are trolls?"
489                [/message]
490
491                [message]
492                    speaker=Zhul
493                    message= _ "Trolls were huge gray creatures as big as giants and very strong. They were reclusive creatures, hiding underground. We never had much contact with them, though some fought with the orcs in the great wars. They were mighty warriors. I’m sure they have all died off; I certainly would never want to meet one face to face."
494                [/message]
495
496                [message]
497                    speaker=Zhul
498                    message= _ "But with Eloh’s guidance, I hope we find these tunnels deserted. I’d be happy if our biggest problem is not getting lost. Still, even underground Eloh will watch over us."
499                [/message]
500
501                [message]
502                    speaker=Kaleh
503                    message= _ "Will she? I got the impression she was powerless underground."
504                [/message]
505
506                [message]
507                    speaker=Zhul
508                    message= _ "Where did you get that idea? Certainly Eloh is strongest during the day, when the suns are shining down on us. But it is said that even in the darkest of nights she will protect her faithful. And back during the Golden Age holy elven warriors led great crusades against orcs and other foul things that hid underground, killing them with Eloh’s aid. Faith is our shield, Kaleh. I think you should keep your doubts to yourself; it would not do to unduly worry our people. Eloh will always protect us, if we follow her path."
509                [/message]
510
511                [message]
512                    speaker=Kaleh
513                    message= _ "Then let us hope the rest of our journey may be as uneventful as it has been this far."
514                [/message]
515            [/else]
516        [/if]
517    [/event]
518
519    # Event 1: Spider and Ants
520
521    [event]
522        name=moveto
523
524        [filter]
525            x=12-18
526            y=20-29
527            side=1
528        [/filter]
529
530        [message]
531            speaker=Nym
532            message= _ "All I’m saying is that these tunnels aren’t as bad as I expected."
533        [/message]
534
535        [message]
536            speaker=Kaleh
537            # wmllint: local spelling Shhh
538            message= _ "Shhh! Did you hear something?"
539        [/message]
540
541        [remove_shroud]
542            side=1
543            x=11-19
544            y=24-27
545        [/remove_shroud]
546
547        #make ants easy: 3 medium: 4 hard: 5
548
549        {NOTRAIT_UNIT 6 (Giant Ant) 17 26}
550        {NOTRAIT_UNIT 6 (Giant Ant) 17 27}
551        {NOTRAIT_UNIT 6 (Giant Ant) 18 26}
552
553#ifndef EASY
554        {NOTRAIT_UNIT 6 (Giant Ant) 18 27}
555#endif
556
557#ifdef HARD
558        {NOTRAIT_UNIT 6 (Giant Ant) 19 27}
559#endif
560
561        #make spider
562        {NOTRAIT_UNIT 7 (Cave Spider) 4 25}
563
564        [redraw]
565        [/redraw]
566
567        [scroll_to_unit]
568            type=Giant Ant
569        [/scroll_to_unit]
570
571        [delay]
572            time=400
573        [/delay]
574
575        [message]
576            speaker=Zhul
577            message= _ "Ants. Very big ants. Maybe they won’t be hostile."
578        [/message]
579
580        [scroll_to_unit]
581            type=Cave Spider
582        [/scroll_to_unit]
583
584        [delay]
585            time=400
586        [/delay]
587
588        [message]
589            speaker=Kaleh
590            message= _ "On the other hand, that spider probably is."
591        [/message]
592
593        [message]
594            speaker=Nym
595            message= _ "Caught between a spider and its prey. Not a good place to be."
596        [/message]
597    [/event]
598
599    # If player escapes cave spider, then reward player by killing it
600
601    [event]
602        name=moveto
603
604        [filter]
605            x=18-24
606            y=26-29
607            side=1
608        [/filter]
609
610        [if]
611            [have_unit]
612                type=Cave Spider
613            [/have_unit]
614
615            [then]
616                [kill]
617                    type=Cave Spider
618                    animate=yes
619                [/kill]
620
621                [message]
622                    speaker=Nym
623                    message= _ "Whoa! Did you see that? That huge stalactite just fell and crushed the spider. Aren’t we lucky!"
624                [/message]
625
626                [message]
627                    speaker=Zhul
628                    message= _ "Eloh must indeed be watching over us."
629                [/message]
630            [/then]
631        [/if]
632    [/event]
633
634    # When player approaches large cavern, a dying dwarf runs out and yells a warning.
635
636    [event]
637        name=moveto
638
639        [filter]
640            x=18-24
641            y=26-28
642            side=1
643        [/filter]
644
645        [message]
646            speaker=Nym
647            message= _ "You know, if all we discover down here are insects, I’ll be very disappointed."
648        [/message]
649
650        [if]
651            [have_unit]
652                id=Elyssa
653            [/have_unit]
654
655            [then]
656                [message]
657                    speaker=Elyssa
658                    message= _ "Spiders aren’t insects."
659                [/message]
660
661                [message]
662                    speaker=Nym
663                    message= _ "Thanks for the clarification."
664                [/message]
665            [/then]
666        [/if]
667        [unit]
668            type=Dwarvish Fighter
669            side=4
670            hitpoints=12
671            id=Wounded Dwarf
672            x=25
673            y=28
674        [/unit]
675        [move_unit]
676            id=Wounded Dwarf
677            to_x=25,24,23,22,21
678            to_y=28,28,29,28,29
679        [/move_unit]
680
681        [message]
682            speaker=Wounded Dwarf
683            message= _ "Help! They’re everywhere!"
684        [/message]
685
686        [kill]
687            id=Wounded Dwarf
688            animate=yes
689        [/kill]
690
691        [message]
692            speaker=Kaleh
693            message= _ "Nym, your timing is impeccable."
694        [/message]
695
696        [if]
697            [have_unit]
698                id=Elyssa
699            [/have_unit]
700
701            [then]
702                [message]
703                    speaker=Elyssa
704                    message= _ "That’s a dwarf, but it looks like he’s been beaten to a pulp."
705                [/message]
706            [/then]
707
708            [else]
709                [message]
710                    speaker=Zhul
711                    message= _ "Short and hairy, he must be a dwarf. But he’s been beaten to a pulp."
712                [/message]
713            [/else]
714        [/if]
715
716        [message]
717            speaker=Kaleh
718            message= _ "I don’t know what ‘they’ are, but we can’t go back. Prepare yourselves for anything, everyone."
719        [/message]
720    [/event]
721
722    # EVENT 5 IS LISTED OUT OF ORDER BECAUSE FOR SOME REASON IT WASN'T
723    # FIRING WHEN PLACED AFTER EVENT 4.5. CURRENTLY THIS EVENT WORKS
724    # FINE WHEN IT IS HERE AND EVENT 6 FIRES FINE AFTER 4.5. SO EVEN
725    # THOUGH THE EVENTS ARE OUT OF ORDER, I'M LEAVING THEM THIS WAY
726    # BECAUSE IT SEEMS TO MAKE EVERYTHING WORK FINE.
727
728    # Event 5: Sighted dwarf/troll leader events
729
730#define DWARF_ALLY_APPROACH_MESSAGES
731    {VARIABLE Fundin_approach_message (_ "What are you doing back here? The trolls hide in the southern tunnels, not this way.")}
732    {VARIABLE Nori_approach_message (_ "What are you doing back here? The trolls hide in the southern tunnels, not this way.")}
733    # wmllint: local spelling stinkin'
734    {VARIABLE Thungar_approach_message (_ "Nasty dwarves and stinkin’ elves, we will smash you all!")}
735    {VARIABLE Gnarl_approach_message (_ "Kill the elves! We must stop them here. This is our land, crush the intruders!")}
736#enddef
737
738#define TROLL_ALLY_APPROACH_MESSAGES
739    {VARIABLE Fundin_approach_message (_ "Treacherous elves, how can you fight with such horrid creatures as trolls? I will cleave all in two with my axe!")}
740    {VARIABLE Nori_approach_message (_ "If you think you can take these caves from us, then you are fools. We are masters of fighting underground and we will die to defend our home. Fight on, my brothers!")}
741    {VARIABLE Thungar_approach_message (_ "What you doing back here? Nasty dwarves are to the north, no dwarves this way. Go back and fight bravely.")}
742    {VARIABLE Gnarl_approach_message (_ "What you doing back here? Nasty dwarves are to the north, no dwarves this way. Go back and fight bravely.")}
743#enddef
744
745#define APPROACH_LEADER LEADER_ID ENTER_X_SPAN ENTER_Y_SPAN REMOVE_X_SPAN REMOVE_Y_SPAN
746    [event]
747        name=moveto
748
749        [filter]
750            x={ENTER_X_SPAN}
751            y={ENTER_Y_SPAN}
752            side=1
753        [/filter]
754
755        [remove_shroud]
756            x={REMOVE_X_SPAN}
757            y={REMOVE_Y_SPAN}
758            side=1
759        [/remove_shroud]
760
761        [message]
762            speaker={LEADER_ID}
763            message=${LEADER_ID}_approach_message
764        [/message]
765    [/event]
766#enddef
767
768    # NW dwarf
769    {APPROACH_LEADER Fundin 23-31 8-17 22-31 7-17}
770
771    # NE dwarf
772    {APPROACH_LEADER Nori 41-51 10-16 40-52 9-17}
773
774    # SW troll
775    {APPROACH_LEADER Thungar 23-31 37-44 21-32 37-44}
776
777    # SE troll
778    {APPROACH_LEADER Gnarl 42-51 37-45 42-51 37-46}
779#undef APPROACH_LEADER
780
781    # victory events for trolls and dwarves here to make the ally event easier to follow
782#define CLOAK_KILL_OBJECTIVES
783    [objectives]
784        summary= _ "New Objectives:"
785        silent=no
786        [objective]
787            description= _ "Defeat the Cloaked Figure"
788            condition=win
789        [/objective]
790        [objective]
791            description= _ "Death of Kaleh"
792            condition=lose
793        [/objective]
794        [objective]
795            description= _ "Death of Nym"
796            condition=lose
797        [/objective]
798        [objective]
799            description= _ "Death of Zhul"
800            condition=lose
801        [/objective]
802
803        {TURNS_RUN_OUT}
804
805        [gold_carryover]
806            bonus=yes
807            carryover_percentage=40
808        [/gold_carryover]
809    [/objectives]
810#enddef
811
812#define TROLL_ALLY_VICTORY
813    [event]
814        name=troll_victory_test
815
816        [filter_condition]
817            [have_unit]
818                race=dwarf
819                canrecruit=yes
820                count=0
821            [/have_unit]
822        [/filter_condition]
823
824        [terrain]
825            x=22,21,20,19,19,18,17
826            y=14,14,14,15,16,16,17
827            terrain=Uu
828        [/terrain]
829
830        {NAMED_NOTRAIT_UNIT 2 (Troll Shaman) 20 14 (Zurg) ( _ "Zurg")}
831
832        [remove_shroud]
833            x=19-23
834            y=12-16
835            side=1
836        [/remove_shroud]
837
838        [redraw]
839            side=1
840        [/redraw]
841
842        [delay]
843            time=200
844        [/delay]
845
846        # wmllint: recognize Cloaked Figure
847        [message]
848            speaker=Zurg
849            message= _ "Congratulations! Some of trolls didn’t think you strong enough to beat Dwarves."
850        [/message]
851
852        [message]
853            speaker=Kaleh
854            message= _ "Where did you come from?"
855        [/message]
856
857        [message]
858            speaker=Zurg
859            message= _ "There many secret tunnels that you sun dwellers not know of. Only troll know. We smarter than you think. Zurg would have killed dwarves himself, but he was just sent back from where real fighting is."
860        [/message]
861
862        [message]
863            speaker=Zhul
864            message= _ "The real fighting? I thought that was what we were waist-deep in?"
865        [/message]
866
867        [message]
868            speaker=Zurg
869            # wmllint: local spelling tricksy
870            message= _ "While you fighting, another clan of dwarves sneak around and flank us. They tricksy like that. We must leave you and run back to defend women and little trolls. Dwarves never give up, many trolls die today, very hard fighting. But dwarves make mistake, you stronger than dwarf or troll thought. You trolls’ secret weapon."
871        [/message]
872
873        [message]
874            speaker=Nym
875            message= _ "How do you mean?"
876        [/message]
877
878        [message]
879            speaker=Zurg
880            message= _ "Right before battle, we find secret passage just to the north leading straight to big dwarf stronghold. Hiding in stronghold is big important dwarf, directing the battle. Dwarves always think they best fighters around so they leave only a few dwarves guarding their stronghold. If you elves can break through dwarf defenses and kill dwarf chieftain, then it will do much damage to dwarves, make them afraid and confused, easy prey for trolls. You do this and we can drive them back. Then troll leader can help show you how to return to surface. You come with Zurg, he show you way to secret passage."
881        [/message]
882
883        [message]
884            speaker=Elyssa
885            message= _ "Their knowledge of these tunnels is uncanny. I could have sworn a minute ago that that wall was solid rock."
886        [/message]
887
888        [if]
889            [have_unit]
890                id=Cloaked Figure
891            [/have_unit]
892
893            [then]
894                [message]
895                    speaker=Kaleh
896                    message= _ "Wait a moment, Zurg, we must deal with this mysterious cloaked figure before we can follow you."
897                [/message]
898
899                #set new scenario objectives
900
901                {CLOAK_KILL_OBJECTIVES}
902            [/then]
903
904            [else]
905                [message]
906                    speaker=Kaleh
907                    message= _ "It sounds like our work is not yet done. Very well, gather yourselves together, we must follow Zurg."
908                [/message]
909
910                [endlevel]
911                    result=victory
912                    next_scenario=06b_In_the_Domain_of_the_Dwarves
913                    bonus=yes
914                    {NEW_GOLD_CARRYOVER 40}
915                [/endlevel]
916            [/else]
917        [/if]
918    [/event]
919#enddef
920
921#define DWARF_ALLY_VICTORY
922    [event]
923        name=dwarf_victory_test
924
925        [filter_condition]
926            [have_unit]
927                race=troll
928                canrecruit=yes
929                count=0
930            [/have_unit]
931        [/filter_condition]
932
933        [terrain]
934            x=24,23,22,21,20,19,18
935            y=44,45,45,46,46,46,45
936            terrain=Uu
937        [/terrain]
938
939        [delay]
940            time=200
941        [/delay]
942
943        {NAMED_NOTRAIT_UNIT 5 (Dwarvish Pathfinder) 21 46 (Grimnir) ( _ "Grimnir")}
944
945        [remove_shroud]
946            x=20-26
947            y=43-46
948            side=1
949        [/remove_shroud]
950
951        [redraw]
952            side=1
953        [/redraw]
954
955        [message]
956            speaker=Grimnir
957            message= _ "Congratulations, some of me boys didn’t think you could beat the trolls."
958        [/message]
959
960        [message]
961            speaker=Kaleh
962            message= _ "Where did you come from?"
963        [/message]
964
965        [message]
966            speaker=Grimnir
967            message= _ "Don’t think you know all the tunnels and passages that twist through these caves, elf. I would have killed him myself, but I was just sent back from the main front of the battle."
968        [/message]
969
970        [message]
971            speaker=Zhul
972            message= _ "The front? I thought this was the front."
973        [/message]
974
975        [message]
976            speaker=Grimnir
977            message= _ "While you were fighting, a separate clan of trolls sneaked around our sentries and flanked us, attacking our supply depots. There are more of those stinking buggers than we had originally thought. To tell you the truth, we are hard pressed. We’re going to have to pull back all our forces in these caves to reinforce the back lines. But your victory here has produced a unexpected opportunity."
978        [/message]
979
980        [message]
981            speaker=Nym
982            message= _ "It has?"
983        [/message]
984
985        [message]
986            speaker=Grimnir
987            message= _ "Right before the trolls overran this area of the mines, our scouts had found an old tunnel south of here that leads almost straight to the main lair of this tribe of trolls. We believe that protected in the lair is one of their main leaders who is directing the battle. We were going to try to sneak in and lead a surprise attack, but frankly we didn’t have enough dwarves to spare. If by using this passage you can sneak past their front lines and kill him, then it will throw the trolls into disarray and relieve the pressure on our front lines. If you do this our King has promised to help you return your people to the sunlit lands. When you’re ready I’ll show you the way. It’s not far."
988        [/message]
989
990        [message]
991            speaker=Elyssa
992            message= _ "Their knowledge of these tunnels is uncanny. I could have sworn a minute ago that that wall was solid rock."
993        [/message]
994
995        [if]
996            [have_unit]
997                id=Cloaked Figure
998            [/have_unit]
999
1000            [then]
1001                [message]
1002                    speaker=Kaleh
1003                    message= _ "Wait a moment, Grimnir, we must deal with this mysterious cloaked figure before we can follow you."
1004                [/message]
1005
1006                {CLOAK_KILL_OBJECTIVES}
1007            [/then]
1008
1009            [else]
1010                [message]
1011                    speaker=Kaleh
1012                    message= _ "It sounds like our work is not yet done. Very well, gather yourselves together, we must follow Grimnir."
1013                [/message]
1014
1015                [endlevel]
1016                    result=victory
1017                    next_scenario=06a_In_the_Tunnels_of_the_Trolls
1018                    bonus=yes
1019                    {NEW_GOLD_CARRYOVER 40}
1020                [/endlevel]
1021            [/else]
1022        [/if]
1023    [/event]
1024#enddef
1025
1026    # Event 2: Entering the large cavern
1027
1028    #player chooses one side (trolls or dwarves) then:
1029
1030    #assign allies
1031    #create troll and dwarf leaders
1032    #create dwarf and troll defenders, make one side attackers
1033    #change ally and enemy gold/income
1034    #capture all villages, destroy ally's tunnel villages
1035    #seal off exits from allies caves
1036
1037    [event]
1038        name=moveto
1039
1040        [filter]
1041            x=24-74
1042            y=20-34
1043            side=1
1044        [/filter]
1045
1046        #create 14 dwarves and 12 trolls
1047
1048        #dwarves:
1049        # 2 dwarvish steelclads, 3 dwarvish fighters, 1 dwarvish thunderguard, 2 dwarvish thunderers, 2 dwarvish guardsmen, 1 dwarvish ulfserker, 1 dwarvish steelclad (captain), and 1 dwarvish pathfinder and 1 dwarvish scout
1050
1051        #trolls:
1052        # 6 troll whelps, 2 trolls, 2 troll rocklobbers, 1 shaman, 1 shaman leader
1053
1054        # on EASY and NORMAL, reduce number of trolls and dwarves
1055        # if EASY:
1056        # Dwarves:  remove 1 fighter (39,21), and 1 thunderer (35,20)
1057        # Trolls:   remove 2 troll whelps (37,32) (34,34)
1058        #       turn troll rocklobber into a whelp (33,32)
1059
1060        # if NORMAL:
1061        # Dwarves:  remove 1 fighter (39,21)
1062        # Trolls:   remove 2 troll whelps (37,32) (34,34)
1063
1064        #Western side
1065        #battling over the castle
1066        #1 dwarvish fighter, 1 dwarvish thunderer, 1 dwarvish guardsman
1067
1068#define DEFENDER SIDE TYPE X Y ROLE_STRING NAME_STRING
1069    [unit]
1070        side={SIDE}
1071        type={TYPE}
1072        name={NAME_STRING}
1073        x={X}
1074        y={Y}
1075        random_traits=yes
1076        role={ROLE_STRING}
1077    [/unit]
1078#enddef
1079
1080        {NAMED_UNIT 4 (Dwarvish Fighter) 30 27 first_dwarf ( _ "Dwarf Defender") (role=Dwarf Defender)}
1081        {NAMED_UNIT 4 (Dwarvish Thunderer) 30 25 second_dwarf ( _ "Dwarf Defender") (role=Dwarf Defender)}
1082        {DEFENDER 4 (Dwarvish Guardsman) 29 30 (Dwarf Defender) ( _ "Dwarf Defender")}
1083
1084        #2 troll whelps
1085        {DEFENDER 3 (Troll Whelp) 31 30 (Troll Defender) ( _ "Troll Defender")}
1086        {DEFENDER 2 (Troll Whelp) 29 28 (Troll Defender) ( _ "Troll Defender")}
1087
1088        #western reinforcements
1089
1090        #1 dwarvish berserker, 1 dwarvish steelclad (captain), 1 dwarvish fighter, (added: 1 dwarvish scout)
1091
1092        {DEFENDER 4 (Dwarvish Ulfserker) 30 21 (Dwarf Defender) ( _ "Dwarf Defender")}
1093        {NAMED_GENERIC_UNIT 4 (Dwarvish Steelclad) 32 20 (Dwarf Leader) ( _ "Dwarf Leader")}
1094        {DEFENDER 5 (Dwarvish Fighter) 34 22 (Dwarf Defender) ( _ "Dwarf Defender")}
1095
1096        {DEFENDER 4 (Dwarvish Scout) 34 26 (Dwarf Defender) ( _ "Dwarf Defender")}
1097
1098        #2 troll whelps, 1 troll rocklobber, 1 shaman (captain)
1099
1100        {DEFENDER 2 (Troll Whelp) 29 31 (Troll Defender) ( _ "Troll Defender")}
1101
1102        #unit was originally a troll
1103#ifdef HARD
1104        {DEFENDER 2 (Troll Whelp) 34 31 (Troll Defender) ( _ "Troll Defender")}
1105#endif
1106
1107#ifdef EASY
1108        {DEFENDER 2 (Troll Whelp) 33 32 (Troll Defender) ( _ "Troll Defender")}
1109#else
1110        {DEFENDER 2 (Troll Rocklobber) 33 32 (Troll Defender) ( _ "Troll Defender")}
1111#endif
1112
1113        {NAMED_GENERIC_UNIT 2 (Troll Shaman) 28 33 (Troll Leader) ( _ "Troll Leader")}
1114
1115        #Center
1116        #1 dwarvish thunderer (N village)
1117
1118#ifndef EASY
1119        {DEFENDER 5 (Dwarvish Thunderer) 35 20 (Dwarf Defender) ( _ "Dwarf Defender")}
1120#endif
1121
1122        #Eastern side
1123        #battling over the center
1124
1125        #1 dwarvish steelclad, 1 dwarvish guardsman, 1 dwarvish thunderer
1126        #1 dwarvish pathfinder
1127        {DEFENDER 5 (Dwarvish Steelclad) 40 26 (Dwarf Defender) ( _ "Dwarf Defender")}
1128        {DEFENDER 5 (Dwarvish Guardsman) 39 24 (Dwarf Defender) ( _ "Dwarf Defender")}
1129        {DEFENDER 5 (Dwarvish Thunderer) 42 23 (Dwarf Defender) ( _ "Dwarf Defender")}
1130        {DEFENDER 5 (Dwarvish Pathfinder) 44 26 (Dwarf Defender) ( _ "Dwarf Defender")}
1131
1132        #1 troll whelp, 1 troll, 1 troll rocklobber
1133        {DEFENDER 2 (Troll Whelp) 41 27 (Troll Defender) ( _ "Troll Defender")}
1134        {DEFENDER 3 (Troll) 42 29 (Troll Defender) ( _ "Troll Defender")}
1135        {DEFENDER 3 (Troll Rocklobber) 39 29 (Troll Defender) ( _ "Troll Defender")}
1136
1137        #eastern reinforcements
1138
1139        #1 dwarvish steelclad, 1 dwarvish fighter
1140
1141        {DEFENDER 5 (Dwarvish Steelclad) 42 21 (Dwarf Defender) ( _ "Dwarf Defender")}
1142
1143#ifdef HARD
1144        {DEFENDER 5 (Dwarvish Fighter) 39 21 (Dwarf Defender) ( _ "Dwarf Defender")}
1145#endif
1146
1147        #2 troll whelps, 1 shaman
1148
1149#ifdef HARD
1150        {DEFENDER 3 (Troll Whelp) 37 32 (Troll Defender) ( _ "Troll Defender")}
1151#endif
1152        {DEFENDER 3 (Troll Whelp) 42 32 (Troll Defender) ( _ "Troll Defender")}
1153        {DEFENDER 3 (Troll Shaman) 44 31 (Troll Defender) ( _ "Troll Defender")}
1154
1155#undef DEFENDER
1156
1157        # wmllint: recognize Dwarf Defender
1158        # wmllint: recognize Troll Defender
1159
1160        [redraw]
1161        [/redraw]
1162
1163        #reveal large cave x: 25-47 y: 19-35
1164        [remove_shroud]
1165            side=1
1166            x=25-47
1167            y=19-35
1168        [/remove_shroud]
1169
1170        #dwarf/troll/elf dialogue
1171
1172        {CHECK_EXPLORER}
1173        [message]
1174            speaker=$explorer.id
1175            message= _ "Whoa."
1176        [/message]
1177
1178        # Unhide the dwarves' and trolls' sides
1179        [modify_side]
1180            side=2,3,4,5
1181            hidden=no
1182        [/modify_side]
1183
1184        [scroll_to_unit]
1185            x,y=34,22
1186        [/scroll_to_unit]
1187
1188        [delay]
1189            time=400
1190        [/delay]
1191
1192        [scroll_to_unit]
1193            x,y=42,23
1194        [/scroll_to_unit]
1195
1196        [delay]
1197            time=400
1198        [/delay]
1199
1200        [scroll_to_unit]
1201            x,y=42,29
1202        [/scroll_to_unit]
1203
1204        [delay]
1205            time=400
1206        [/delay]
1207
1208        [scroll_to_unit]
1209            x,y=33,32
1210        [/scroll_to_unit]
1211
1212        [delay]
1213            time=400
1214        [/delay]
1215
1216        [scroll_to_unit]
1217            x,y=29,27
1218        [/scroll_to_unit]
1219
1220        [delay]
1221            time=400
1222        [/delay]
1223
1224        [message]
1225            speaker=Nym
1226            message= _ "I think I preferred the spider and the ants..."
1227        [/message]
1228
1229        [message]
1230            speaker=Dwarf Leader
1231            message= _ "Stand firm, boys, here they come!"
1232        [/message]
1233
1234        [message]
1235            speaker=Troll Leader
1236            message= _ "You invade our tunnels, you slaughter our people, by Griknagh we will make you pay!"
1237        [/message]
1238
1239        [message]
1240            speaker=Dwarf Leader
1241            message= _ "Tenacious savages, aren’t they? But these tunnels are rich in ore, and we won’t let a couple of trolls keep them from us."
1242        [/message]
1243
1244        [message]
1245            speaker=Troll Leader
1246            message= _ "Wait... What... Who are you?"
1247        [/message]
1248
1249        [message]
1250            speaker=Kaleh
1251            message= _ "Uh..."
1252        [/message]
1253
1254        [message]
1255            speaker=Dwarf Leader
1256            message= _ "What by the names of my forefathers are they?"
1257        [/message]
1258
1259        [message]
1260            speaker=first_dwarf
1261            message= _ "Wait a minute... Vacuous eyes, pointy ears — they must be elves."
1262        [/message]
1263
1264        [message]
1265            speaker=second_dwarf
1266            message= _ "Elves?! What in the nine hells are elves doing down here?"
1267        [/message]
1268
1269        [message]
1270            speaker=Dwarf Leader
1271            message= _ "Never mind that, who are you?"
1272        [/message]
1273
1274        [message]
1275            speaker=Kaleh
1276            message= _ "I am Kaleh, and we are the Quenoth elves. What in Eloh’s name is going on here?"
1277        [/message]
1278
1279        [message]
1280            speaker=Troll Leader
1281            message= _ "They invade our land and kill our young. Dwarves always want more, always greedy for glittery rocks."
1282        [/message]
1283
1284        [message]
1285            speaker=Dwarf Leader
1286            message= _ "Those monsters killed me boys. Kaleh, if you be of stout heart, help us drive these lummoxes from our tunnels."
1287        [/message]
1288
1289        [message]
1290            speaker=Troll Leader
1291            message= _ "No, this is our home. Help us, little ones, and we will help you."
1292        [/message]
1293
1294        [message]
1295            speaker=Zhul
1296            message= _ "There’s too many of them for us to try to take them both on, and besides with all these branching tunnels we’ll have no idea which way to go. I think we should take them up on their offer; ally ourselves with one of the factions so we can get their help in finding a way back to the surface."
1297        [/message]
1298
1299        [message]
1300            speaker=Nym
1301            message= _ "But even if we do, what about all of our people? How can we safely escort them through this war zone?"
1302            image=portraits/nym_moody.png
1303        [/message]
1304
1305        [message]
1306            speaker=Kaleh
1307            message= _ "We won’t. If we keep the majority of our people hidden back up the passage we should be able to protect them, at least for a little while. In the meantime, we’ll go ahead and try to sort out this mess. I think you’re right Zhul, if we’re lucky we may just be able to negotiate a safe passage out of here."
1308        [/message]
1309
1310        #choose side to ally with
1311
1312        #set ally variable (1=dwarf 2=troll) and change elvish allegiance
1313
1314        [message]
1315            speaker=$explorer.id
1316            message= _ "But they both look evenly matched. Who should we ally with?"
1317
1318            [option]
1319                label= _ "Let’s aid the dwarves."
1320
1321                [command]
1322                    [set_variable]
1323                        name=ally_race
1324                        value="dwarf"
1325                    [/set_variable]
1326
1327                    [modify_side]
1328                        side=1
1329                        team_name=dwarves
1330                        user_team_name= _ "team_name^Dwarves"
1331                    [/modify_side]
1332
1333                    [message]
1334                        speaker=Troll Leader
1335                        message= _ "Bah! Your kind all the same. Everyone turns on trolls. But you’ll see, Griknagh will smash you all."
1336                    [/message]
1337
1338                    {DWARF_ALLY_APPROACH_MESSAGES}
1339                    {DWARF_ALLY_VICTORY}
1340                    [event]
1341                        name=troll_victory_test
1342                        [endlevel]
1343                            result=defeat
1344                        [/endlevel]
1345                    [/event]
1346
1347                    #set new scenario objectives
1348
1349                    [objectives]
1350                        summary= _ "New Objectives:"
1351                        silent=no
1352                        [objective]
1353                            description= _ "Defeat troll leaders"
1354                            condition=win
1355                        [/objective]
1356                        [objective]
1357                            description= _ "Death of Kaleh"
1358                            condition=lose
1359                        [/objective]
1360                        [objective]
1361                            description= _ "Death of Nym"
1362                            condition=lose
1363                        [/objective]
1364                        [objective]
1365                            description= _ "Death of Zhul"
1366                            condition=lose
1367                        [/objective]
1368                        [objective]
1369                            description= _ "Death of Fundin"
1370                            condition=lose
1371                        [/objective]
1372                        [objective]
1373                            description= _ "Death of Nori"
1374                            condition=lose
1375                        [/objective]
1376
1377                        {TURNS_RUN_OUT}
1378
1379                        [gold_carryover]
1380                            bonus=yes
1381                            carryover_percentage=40
1382                        [/gold_carryover]
1383                    [/objectives]
1384                [/command]
1385            [/option]
1386
1387            [option]
1388                label= _ "Let’s aid the trolls."
1389
1390                [command]
1391                    [set_variable]
1392                        name=ally_race
1393                        value="troll"
1394                    [/set_variable]
1395
1396                    [modify_side]
1397                        side=1
1398                        team_name=trolls
1399                        user_team_name= _ "team_name^Trolls"
1400                    [/modify_side]
1401
1402                    [message]
1403                        speaker=Dwarf Leader
1404                        message= _ "I knew elves couldn’t be trusted. Foolish boy, you will regret your betrayal. Taste dwarven steel!"
1405                    [/message]
1406
1407                    {TROLL_ALLY_APPROACH_MESSAGES}
1408                    {TROLL_ALLY_VICTORY}
1409                    [event]
1410                        name=dwarf_victory_test
1411                        [endlevel]
1412                            result=defeat
1413                        [/endlevel]
1414                    [/event]
1415
1416                    #set new scenario objectives
1417                    [objectives]
1418                        summary= _ "New Objectives:"
1419                        silent=no
1420                        [objective]
1421                            description= _ "Defeat dwarf leaders"
1422                            condition=win
1423                        [/objective]
1424                        [objective]
1425                            description= _ "Death of Kaleh"
1426                            condition=lose
1427                        [/objective]
1428                        [objective]
1429                            description= _ "Death of Nym"
1430                            condition=lose
1431                        [/objective]
1432                        [objective]
1433                            description= _ "Death of Zhul"
1434                            condition=lose
1435                        [/objective]
1436                        [objective]
1437                            description= _ "Death of Thungar"
1438                            condition=lose
1439                        [/objective]
1440                        [objective]
1441                            description= _ "Death of Gnarl"
1442                            condition=lose
1443                        [/objective]
1444
1445                        {TURNS_RUN_OUT}
1446
1447                        [gold_carryover]
1448                            bonus=yes
1449                            carryover_percentage=40
1450                        [/gold_carryover]
1451                    [/objectives]
1452                [/command]
1453            [/option]
1454        [/message]
1455
1456        # change music playing
1457
1458        [music]
1459            name=battle.ogg
1460            immediate=yes
1461        [/music]
1462
1463        [message]
1464            speaker=$explorer.id
1465            message= _ "There seems to be an abandoned dwarvish fortress right in front of us. If we can fight our way to the keep, we should be able to start rallying our warriors to help in the battle."
1466        [/message]
1467        {CLEAR_VARIABLE explorer}
1468
1469        #add enemy units in tunnels who will arrive in main cavern at turn 2
1470
1471        [if]
1472            [variable]
1473                name=ally_race
1474                equals="dwarf"
1475            [/variable]
1476
1477            [then]
1478                # EASY: add 3 troll whelps, MED: add 3 trolls HARD: add 4 trolls
1479                # (on easier difficulties, remove trolls closest to elves)
1480
1481#ifdef HARD
1482                {NAMED_GENERIC_UNIT 2 (Troll Whelp) 25 36 () ( _ "Troll Skirmisher")}
1483#endif
1484                {NAMED_GENERIC_UNIT 3 (Troll Whelp) 33 38 () ( _ "Troll Skirmisher")}
1485                {NAMED_GENERIC_UNIT 3 (Troll Whelp) 42 35 () ( _ "Troll Skirmisher")}
1486
1487                {NAMED_GENERIC_UNIT 3 (Troll Whelp) 46 35 () ( _ "Troll Skirmisher")}
1488            [/then]
1489
1490            [else]
1491                # add 3-4 dwarf enemies
1492                # if EASY difficulty, then remove Dwarvish Thunderer
1493
1494                # (was a dwarvish steelclad)
1495                {NAMED_GENERIC_UNIT 4 (Dwarvish Fighter) 26 18 () ( _ "Dwarf Skirmisher")}
1496
1497                {NAMED_GENERIC_UNIT 4 (Dwarvish Pathfinder) 28 18 () ( _ "Dwarf Skirmisher")}
1498
1499                {NAMED_GENERIC_UNIT 5 (Dwarvish Berserker) 38 18 () ( _ "Dwarf Skirmisher")}
1500
1501#ifndef EASY
1502                {NAMED_GENERIC_UNIT 5 (Dwarvish Thunderguard) 44 19 (Dwarf Thunderer) ( _ "Dwarf Thunderer")}
1503#endif
1504
1505                {NAMED_GENERIC_UNIT 5 (Dwarvish Scout) 43 18 () ( _ "Dwarf Skirmisher")}
1506            [/else]
1507        [/if]
1508
1509        #increase recruitment options for enemies
1510        #set gold/income for allies and enemies
1511
1512        # I think the trolls are slightly more powerful than the dwarves
1513        # So I'm giving trolls 2 less income than dwarves
1514
1515        [if]
1516            [variable]
1517                name=ally_race
1518                equals=dwarf
1519            [/variable]
1520
1521            [then]
1522                #ally with dwarves
1523
1524                [allow_recruit]
1525                    type=Troll Shaman
1526                    side=2,3
1527                [/allow_recruit]
1528
1529                #allies
1530                [modify_side]
1531                    [filter_side]
1532                        side=4,5
1533                    [/filter_side]
1534                    {INCOME -2 -3 -4}
1535                    {GOLD 50 50 25}
1536                [/modify_side]
1537
1538                #enemies
1539                [modify_side]
1540                    [filter_side]
1541                        side=2,3
1542                    [/filter_side]
1543                    {INCOME 3 5 7}
1544                    {GOLD 100 125 150}
1545                [/modify_side]
1546
1547                [modify_unit]
1548                    [filter]
1549                        role=Troll Defender
1550                    [/filter]
1551                    name= _ "Troll Skirmisher"
1552                [/modify_unit]
1553
1554                # destroy dwarvish villages in tunnels and add troll villages
1555                [terrain]
1556                    x=28,35
1557                    y=19,14
1558                    terrain=Uu
1559                [/terrain]
1560
1561                [terrain]
1562                    x=36,43
1563                    y=17,18
1564                    terrain=Xu
1565                [/terrain]
1566
1567                [terrain]
1568                    x=25,34,47,37
1569                    y=36,37,36,47
1570                    terrain=Uu^Vu
1571                [/terrain]
1572            [/then]
1573
1574            [else]
1575                #ally with trolls
1576
1577                #ulfserkers are too deadly, especially for elves with no defense
1578
1579                [allow_recruit]
1580                    type=Dwarvish Pathfinder
1581                    side=4,5
1582                [/allow_recruit]
1583
1584                #allies
1585                [modify_side]
1586                    [filter_side]
1587                        side=2,3
1588                    [/filter_side]
1589                    {INCOME -2 -3 -4}
1590                    {GOLD 50 50 25}
1591                [/modify_side]
1592
1593                #enemies
1594                [modify_side]
1595                    [filter_side]
1596                        side=4,5
1597                    [/filter_side]
1598                    {INCOME 4 6 8}
1599                    {GOLD 125 150 150}
1600                [/modify_side]
1601
1602                [modify_unit]
1603                    [filter]
1604                        role=Dwarf Defender
1605                    [/filter]
1606                    name= _ "Dwarf Skirmisher"
1607                [/modify_unit]
1608            [/else]
1609        [/if]
1610
1611        #create 2 dwarf leaders (26,12) (45,13)
1612        [unit]
1613            type=Dwarvish Explorer
1614            id=Fundin
1615            name= _ "Fundin"
1616            canrecruit=yes
1617            x=26
1618            y=12
1619            side=4
1620            [modifications]
1621                {TRAIT_RESILIENT}
1622            [/modifications]
1623        [/unit]
1624
1625        [unit]
1626            type=Dwarvish Explorer
1627            id=Nori
1628            name= _ "Nori"
1629            canrecruit=yes
1630            x=45
1631            y=13
1632            side=5
1633            [modifications]
1634                {TRAIT_STRONG}
1635                {TRAIT_QUICK}
1636            [/modifications]
1637        [/unit]
1638
1639        #create 2 troll leaders (26,40) (46,42)
1640        [unit]
1641            type=Troll Warrior
1642            id=Thungar
1643            name= _ "Thungar"
1644            canrecruit=yes
1645            x=26
1646            y=40
1647            side=2
1648            [modifications]
1649                {TRAIT_RESILIENT}
1650            [/modifications]
1651        [/unit]
1652
1653        [unit]
1654            type=Troll Warrior
1655            id=Gnarl
1656            name= _ "Gnarl"
1657            canrecruit=yes
1658            x=46
1659            y=42
1660            side=3
1661            [modifications]
1662                {TRAIT_STRONG}
1663                {TRAIT_QUICK}
1664            [/modifications]
1665        [/unit]
1666
1667        # capture villages for each troll/dwarf leader
1668
1669        # troll 1 (side2)
1670
1671        # in troll cave and western tunnels
1672        [capture_village]
1673            x,y=22-35,36-43
1674            side=2
1675        [/capture_village]
1676
1677        # in main cavern
1678        [capture_village]
1679            x,y=36,32
1680            side=2
1681        [/capture_village]
1682
1683        # troll 2 (side3)
1684
1685        # in troll cave and eastern tunnels
1686        [capture_village]
1687            x,y=37-50,36-47
1688            side=3
1689        [/capture_village]
1690
1691        # in main cavern
1692        [capture_village]
1693            x,y=31,30
1694            side=3
1695        [/capture_village]
1696
1697        [capture_village]
1698            x,y=26,28
1699            side=3
1700        [/capture_village]
1701
1702        # dwarf 1 (side4)
1703
1704        # in dwarf cave and western tunnels
1705        [capture_village]
1706            x,y=24-35,8-19
1707            side=4
1708        [/capture_village]
1709
1710        # in main cavern
1711        [capture_village]
1712            x,y=28,24
1713            side=4
1714        [/capture_village]
1715
1716        [capture_village]
1717            x,y=35,27
1718            side=4
1719        [/capture_village]
1720
1721        # dwarf 2 (side5)
1722
1723        # in dwarf cave and eastern tunnels
1724        [capture_village]
1725            x,y=36-51,10-18
1726            side=5
1727        [/capture_village]
1728
1729        # in main cavern
1730        [capture_village]
1731            x,y=40,26
1732            side=5
1733        [/capture_village]
1734
1735        [fire_event]
1736            name=queue_battle_events
1737        [/fire_event]
1738    [/event]
1739
1740    # Event 3: Enemy counter-attack (Battle Turn 3)
1741
1742    # if fighting dwarves: (3,4,5)
1743    # run 2 dwarvish thunderguards down to western threatre,
1744    # and 1 down to eastern bottleneck
1745
1746    # if fighting trolls: (3,4,5)
1747    # run 2 troll shamans up to western threatre, and 1 up to eastern
1748    # bottleneck (reduced to 1 on each side)
1749
1750    [event]
1751        name=enemy_attack
1752
1753        [if]
1754            [variable]
1755                name=ally_race
1756                equals=dwarf
1757            [/variable]
1758
1759            [then]
1760                #if allied with dwarves
1761
1762                #west side
1763
1764                [move_unit_fake]
1765                    type=Troll Shaman
1766                    side=2
1767                    x=27,27,28
1768                    y=39,33,32
1769                [/move_unit_fake]
1770
1771                {NAMED_GENERIC_UNIT 2 (Troll Shaman) 28 32 (Troll Flamecaster) ( _ "Troll Flamecaster")}
1772
1773#ifdef HARD
1774
1775                [move_unit_fake]
1776                    type=Troll Shaman
1777                    side=2
1778                    x=33,33,32
1779                    y=39,33,32
1780                [/move_unit_fake]
1781
1782                {NAMED_GENERIC_UNIT 2 (Troll Shaman) 32 32 () ( _ "Troll Flamecaster")}
1783#endif
1784
1785                #east side
1786
1787                [move_unit_fake]
1788                    type=Troll Shaman
1789                    side=3
1790                    x=38,42,42,41
1791                    y=37,35,29,29
1792                [/move_unit_fake]
1793
1794                {NAMED_GENERIC_UNIT 3 (Troll Shaman) 41 29 () ( _ "Troll Flamecaster")}
1795
1796#ifndef EASY
1797
1798                [move_unit_fake]
1799                    type=Troll Shaman
1800                    side=3
1801                    x=45,45
1802                    y=40,30
1803                [/move_unit_fake]
1804
1805                {NAMED_GENERIC_UNIT 3 (Troll Shaman) 45 30 () ( _ "Troll Flamecaster")}
1806#endif
1807
1808                [message]
1809                    speaker=Troll Flamecaster
1810                    message= _ "Burn, burn and die!"
1811                [/message]
1812
1813                [color_adjust]
1814                    red,green,blue=255,0,0
1815                [/color_adjust]
1816
1817                [redraw]
1818                [/redraw]
1819
1820                [sound]
1821                    name=fire.wav
1822                [/sound]
1823
1824                [delay]
1825                    time=100
1826                [/delay]
1827
1828                [color_adjust]
1829                    red,green,blue=0,0,0
1830                [/color_adjust]
1831
1832                [redraw]
1833                [/redraw]
1834
1835                [message]
1836                    speaker=Dwarf Leader
1837                    message= _ "Dive for cover!"
1838                [/message]
1839
1840                [message]
1841                    speaker=Kaleh
1842                    message= _ "Those new troll shamans are decimating the dwarves with blasts of fire! This doesn’t look good."
1843                [/message]
1844
1845                [store_unit]
1846                    [filter]
1847                        role="Dwarf Defender"
1848                        x=24-46
1849                        y=19-35
1850                    [/filter]
1851                    variable=victims
1852                    kill=no
1853                [/store_unit]
1854
1855                #if easy kill 50%
1856                #if medium kill 60%
1857                #if hard kill 80%
1858
1859                {VARIABLE deaths $victims.length}
1860                {VARIABLE_OP deaths multiply {ON_DIFFICULTY 0.6 0.7 0.8}}
1861                {VARIABLE_OP deaths round 0}
1862
1863                #{DEBUG_MSG "Killing $deaths defenders out of $victims.length"}
1864
1865                {VARIABLE i 1}
1866                {REPEAT $deaths (
1867                    {RANDOM "1..$victims.length"}
1868                    {VARIABLE_OP random sub 1}
1869
1870                    {VARIABLE casualty $victims[$random].id}
1871
1872                    #have some dwarves scream as they die
1873                    [switch]
1874                        variable=i
1875
1876                        [case]
1877                            value=1
1878
1879                            [message]
1880                                id=$casualty
1881                                message= _ "Aauughh!"
1882                            [/message]
1883                        [/case]
1884
1885                        [case]
1886                            value=2
1887
1888                            [message]
1889                                id=$casualty
1890                                message= _ "No...!"
1891                            [/message]
1892                        [/case]
1893
1894                        [case]
1895                            value=3
1896
1897                            [message]
1898                                id=$casualty
1899                                message= _ "Help me!!"
1900                            [/message]
1901                        [/case]
1902                    [/switch]
1903
1904                    [kill]
1905                        id=$casualty
1906                        animate=yes
1907                        fire_event=no
1908                    [/kill]
1909
1910                    {VARIABLE_OP i add 1}
1911
1912                    # Update the victims array
1913                    [store_unit]
1914                        [filter]
1915                            find_in=victims
1916                            [not]
1917                                id=$casualty
1918                            [/not]
1919                        [/filter]
1920
1921                        variable=victims
1922                        kill=no
1923                    [/store_unit]
1924                )}
1925
1926                [message]
1927                    speaker=Dwarf Leader
1928                    message= _ "More accursed troll magic. Fall back!"
1929                [/message]
1930
1931                [message]
1932                    speaker=Dwarf Leader
1933                    # wmllint: local spelling hurtin'
1934                    message= _ "I need to go back and rally more reinforcements. We’re hurtin’, Kaleh, I’ll need your men to cover for us. Do your best, boy, and may your ancestors watch over you."
1935                [/message]
1936
1937                [kill]
1938                    id=Dwarf Leader
1939                    animate=no
1940                [/kill]
1941            [/then]
1942
1943            [else]
1944                #if allied with trolls
1945
1946                #west side
1947                [move_unit_fake]
1948                    type=Dwarvish Thunderguard
1949                    side=4
1950                    x=26,27,28,29,30,30,30,30
1951                    y=18,19,19,19,19,20,21,22
1952                [/move_unit_fake]
1953
1954                {NAMED_GENERIC_UNIT 4 (Dwarvish Thunderguard) 30 22 (Dwarf Grenadier) ( _ "Dwarf Grenadier")}
1955
1956                [move_unit_fake]
1957                    type=Dwarvish Thunderguard
1958                    side=4
1959                    x=26,27,28,29,30,30,31,32,32
1960                    y=18,19,19,19,19,20,21,21,22
1961                [/move_unit_fake]
1962
1963                {NAMED_GENERIC_UNIT 4 (Dwarvish Thunderguard) 32 22 () ( _ "Dwarf Grenadier")}
1964
1965#ifdef HARD
1966
1967                [move_unit_fake]
1968                    type=Dwarvish Thunderguard
1969                    side=4
1970                    x=26,27,28,29,30,30,31,32,33,34
1971                    y=18,19,19,19,19,20,21,21,22,22
1972                [/move_unit_fake]
1973
1974                {NAMED_GENERIC_UNIT 4 (Dwarvish Thunderguard) 34 22 () ( _ "Dwarf Grenadier")}
1975#endif
1976
1977                #east side
1978
1979                [move_unit_fake]
1980                    type=Dwarvish Thunderguard
1981                    side=5
1982                    x=45,44,44,43,42,41,41,40
1983                    y=18,18,19,20,20,21,22,22
1984                [/move_unit_fake]
1985
1986                {NAMED_GENERIC_UNIT 5 (Dwarvish Thunderguard) 40 22 () ( _ "Dwarf Grenadier")}
1987
1988#ifndef EASY
1989
1990                [move_unit_fake]
1991                    type=Dwarvish Thunderguard
1992                    side=5
1993                    x=45,44,44,43,43,42,42
1994                    y=18,18,19,20,21,21,22
1995                [/move_unit_fake]
1996
1997                {NAMED_GENERIC_UNIT 5 (Dwarvish Thunderguard) 42 22 () ( _ "Dwarf Grenadier")}
1998#endif
1999
2000                [message]
2001                    speaker=Dwarf Grenadier
2002                    message= _ "Let’s blast those monsters back to the pits they spawned from! Fire in the hole!"
2003                [/message]
2004
2005                [color_adjust]
2006                    red,green,blue=255,0,0
2007                [/color_adjust]
2008
2009                [redraw]
2010                [/redraw]
2011
2012                [sound]
2013                    name=thunderstick.ogg
2014                [/sound]
2015
2016                [delay]
2017                    time=100
2018                [/delay]
2019
2020                [color_adjust]
2021                    red,green,blue=0,0,0
2022                [/color_adjust]
2023
2024                [redraw]
2025                [/redraw]
2026
2027                [message]
2028                    speaker=Troll Leader
2029                    message= _ "More dwarven trickery! Fall back!"
2030                [/message]
2031
2032                [message]
2033                    speaker=Kaleh
2034                    message= _ "Those new dwarves are lobbing explosives at the trolls with devastating effect! I don’t think the trolls can take this much longer."
2035                [/message]
2036
2037                [store_unit]
2038                    [filter]
2039                        role="Troll Defender"
2040                        x=24-46
2041                        y=19-35
2042                    [/filter]
2043                    variable=victims
2044                    kill=no
2045                [/store_unit]
2046
2047                #if easy kill 50%
2048                #if medium kill 60%
2049                #if hard kill 75%
2050
2051                {VARIABLE deaths $victims.length}
2052                {VARIABLE_OP deaths multiply {ON_DIFFICULTY 0.5 0.6 0.75}}
2053                {VARIABLE_OP deaths round 0}
2054
2055                #{DEBUG_MSG "Killing $deaths defenders out of $victims.length"}
2056
2057                {VARIABLE i 1}
2058                {REPEAT $deaths (
2059                    {RANDOM "1..$victims.length"}
2060                    {VARIABLE_OP random sub 1}
2061
2062                    {VARIABLE casualty $victims[$random].id}
2063
2064                    #have some trolls scream as they die
2065                    [switch]
2066                        variable=i
2067
2068                        [case]
2069                            value=1
2070
2071                            [message]
2072                                id=$casualty
2073                                message= _ "Aaughh!"
2074                            [/message]
2075                        [/case]
2076
2077                        [case]
2078                            value=2
2079
2080                            [message]
2081                                id=$casualty
2082                                message= _ "No...!"
2083                            [/message]
2084                        [/case]
2085
2086                        [case]
2087                            value=3
2088
2089                            [message]
2090                                id=$casualty
2091                                message= _ "Gaaghh!"  # wmllint: no spellcheck
2092                            [/message]
2093                        [/case]
2094                    [/switch]
2095
2096                    [kill]
2097                        id=$casualty
2098                        animate=yes
2099                        fire_event=no
2100                    [/kill]
2101
2102                    {VARIABLE_OP i add 1}
2103
2104                    # Update the victims array
2105                    [store_unit]
2106                        [filter]
2107                            find_in=victims
2108                            [not]
2109                                id=$casualty
2110                            [/not]
2111                        [/filter]
2112
2113                        variable=victims
2114                        kill=no
2115                    [/store_unit]
2116                )}
2117
2118                [message]
2119                    speaker=Troll Leader
2120                    message= _ "I must go back and find more trolls to fight. You must hold them back, Kaleh. Be strong like rock. Griknagh will be with you."
2121                [/message]
2122
2123                [kill]
2124                    id=Troll Leader
2125                    animate=no
2126                [/kill]
2127            [/else]
2128        [/if]
2129
2130        {CLEAR_VARIABLE casualty,deaths,victims,i}
2131    [/event]
2132
2133    # Event 4: Ally reinforcements
2134    #   message: ally leader sent us to help you
2135
2136#define ALLY_REINFORCEMENTS
2137
2138    [if]
2139        [variable]
2140            name=ally_race
2141            equals="troll"
2142        [/variable]
2143
2144        [then]
2145            # Troll
2146            # Easy: 3 whelps 1 troll shaman, 1 rock lobber
2147            # Medium: 3 whelps 1 troll shaman, 1 rock lobber
2148            # Hard: 2 whelps 1 troll shaman, 1 rock lobber
2149
2150            [unit]
2151                type=Troll Shaman
2152                id="Thu'lok"
2153                name= _ "Thu’lok"
2154                x=34
2155                y=32
2156                side=1
2157                unrenamable=yes
2158                [modifications]
2159                    {TRAIT_LOYAL}
2160                    {TRAIT_RESILIENT}
2161                [/modifications]
2162                {IS_LOYAL}
2163                role=ally
2164            [/unit]
2165
2166            [unit]
2167                type=Troll Whelp
2168                id=Harpo
2169                name= _ "Harpo"
2170                x=33
2171                y=33
2172                side=1
2173                unrenamable=yes
2174                [modifications]
2175                    {TRAIT_LOYAL}
2176                    {TRAIT_STRONG}
2177                [/modifications]
2178                {IS_LOYAL}
2179                role=ally
2180            [/unit]
2181
2182            [unit]
2183                type=Troll Whelp
2184                id=Groucho
2185                name= _ "Groucho"
2186                x=34
2187                y=33
2188                side=1
2189                unrenamable=yes
2190                [modifications]
2191                    {TRAIT_LOYAL}
2192                    {TRAIT_INTELLIGENT}
2193                [/modifications]
2194                {IS_LOYAL}
2195                role=ally
2196            [/unit]
2197
2198#ifndef HARD
2199            [unit]
2200                type=Troll Whelp
2201                name= _ "Chico"
2202                id=Chico
2203                x=35
2204                y=33
2205                side=1
2206                unrenamable=yes
2207                [modifications]
2208                    {TRAIT_LOYAL}
2209                    {TRAIT_RESILIENT}
2210                [/modifications]
2211                {IS_LOYAL}
2212                role=ally
2213            [/unit]
2214#endif
2215
2216            [unit]
2217                type=Troll Rocklobber
2218                name= _ "Groo"
2219                id=Groo
2220                x=33
2221                y=34
2222                side=1
2223                unrenamable=yes
2224                [modifications]
2225                    {TRAIT_LOYAL}
2226                    {TRAIT_QUICK}
2227                [/modifications]
2228                {IS_LOYAL}
2229                role=ally
2230            [/unit]
2231
2232            [message]
2233                speaker="Thu'lok"
2234                message= _ "Our leader sent us to help you. We fight for you until all the dwarves are dead. We will avenge the deaths of our people!"
2235            [/message]
2236
2237            #dwarf cairns
2238            [event]
2239                name=moveto
2240                [filter]
2241                    x=30,38,42
2242                    y=20,20,21
2243                    side=1
2244                [/filter]
2245
2246                [message]
2247                    role=ally
2248                    message= _ "The dwarves use stone cairns to mark their territory. What a waste of good throwing stones."
2249                [/message]
2250
2251                [allow_undo]
2252                [/allow_undo]
2253            [/event]
2254        [/then]
2255
2256        [else]
2257            # Dwarves
2258            # Easy: 2 dwarvish fighters, 1 thunderer, 1 berserker,
2259            # 1 dwarvish scout
2260            # Medium: 2 dwarvish fighters, 1 thunderer, 1 berserker,
2261            # 1 dwarvish scout
2262            # Hard: 1 dwarvish fighter, 1 thunderer, 1 berserker,
2263            # 1 dwarvish scout
2264
2265            [unit]
2266                type=Dwarvish Fighter
2267                id=Dwalim
2268                name= _ "Dwalim"
2269                x=36
2270                y=21
2271                side=1
2272                unrenamable=yes
2273                [modifications]
2274                    {TRAIT_LOYAL}
2275                    {TRAIT_STRONG}
2276                [/modifications]
2277                {IS_LOYAL}
2278                role=ally
2279                placement=map
2280                passable=yes
2281            [/unit]
2282
2283            [unit]
2284                type=Dwarvish Pathfinder
2285                id=Moin
2286                name= _ "Moin"
2287                x=35
2288                y=21
2289                side=1
2290                unrenamable=yes
2291                [modifications]
2292                    {TRAIT_LOYAL}
2293                    {TRAIT_QUICK}
2294                [/modifications]
2295                {IS_LOYAL}
2296                role=ally
2297                placement=map
2298                passable=yes
2299            [/unit]
2300
2301            [unit]
2302                type=Dwarvish Thunderer
2303                id=Nordi
2304                name= _ "Nordi"
2305                x=37
2306                y=21
2307                side=1
2308                unrenamable=yes
2309                [modifications]
2310                    {TRAIT_LOYAL}
2311                    {TRAIT_INTELLIGENT}
2312                [/modifications]
2313                {IS_LOYAL}
2314                role=ally
2315                placement=map
2316                passable=yes
2317            [/unit]
2318
2319            [unit]
2320                type=Dwarvish Berserker
2321                id=Byorn
2322                name= _ "Byorn"
2323                x=38
2324                y=20
2325                side=1
2326                unrenamable=yes
2327                [modifications]
2328                    {TRAIT_LOYAL}
2329                    {TRAIT_RESILIENT}
2330                [/modifications]
2331                {IS_LOYAL}
2332                role=ally
2333                placement=map
2334                passable=yes
2335            [/unit]
2336
2337#ifndef HARD
2338
2339            [unit]
2340                type=Dwarvish Fighter
2341                id=Runin
2342                name= _ "Runin"
2343                x=35
2344                y=20
2345                side=1
2346                unrenamable=yes
2347                [modifications]
2348                    {TRAIT_LOYAL}
2349                    {TRAIT_QUICK}
2350                [/modifications]
2351                {IS_LOYAL}
2352                role=ally
2353                placement=map
2354                passable=yes
2355            [/unit]
2356#endif
2357
2358            [message]
2359                speaker=Dwalim
2360                message= _ "Looks like we came just in time. Our chief told us we’re to fight with you until all the trolls are dead. Tell us where to go — I want to kill me some troll!"
2361            [/message]
2362
2363            #troll totems
2364            [event]
2365                name=moveto
2366
2367                [filter]
2368                    x=27,35,43
2369                    y=33,34,33
2370                    side=1
2371                [/filter]
2372
2373                [message]
2374                    role=ally
2375                    message= _ "The trolls display the skulls of their enemies as a way of marking their territory. How barbaric."
2376                [/message]
2377
2378                [allow_undo]
2379                [/allow_undo]
2380            [/event]
2381        [/else]
2382    [/if]
2383
2384#enddef
2385
2386    # Event 29: Return of the Assassin/Cloaked Figure (same guy, two names)
2387
2388    # Find the location of Kaleh and then find an adjacent
2389    # hex the cloaked figure can pop up in. (any hex that is not impassable)
2390
2391    [event]
2392        name=call_assassin
2393
2394        [store_locations]
2395            [filter]
2396                id=Kaleh
2397            [/filter]
2398
2399            variable=dark_assassin_location
2400        [/store_locations]
2401
2402        [unit]
2403            type=Dark Assassin2
2404            id=Cloaked Figure
2405            name= _ "Cloaked Figure"
2406            side=7
2407            x,y=$dark_assassin_location.x,$dark_assassin_location.y
2408            placement=map
2409            passable=yes
2410            [modifications]
2411                {TRAIT_INTELLIGENT}
2412                {TRAIT_RESILIENT}
2413            [/modifications]
2414        [/unit]
2415
2416        [micro_ai]
2417            side=7
2418            ai_type=assassin
2419            action=add
2420
2421            [filter]
2422                id=Cloaked Figure
2423            [/filter]
2424            [filter_second]
2425                id=Kaleh
2426            [/filter_second]
2427        [/micro_ai]
2428
2429        [message]
2430            speaker=Cloaked Figure
2431            image=portraits/cloaked.png
2432            message= _ "Did you think you had escaped me, Kaleh? I am your shadow, I will always be there until you pay for what you have done."
2433        [/message]
2434
2435        [message]
2436            speaker=Cloaked Figure
2437            image=portraits/cloaked.png
2438            message= _ "You want to flee, don’t you? But you cannot. They couldn’t escape her either. Even death could not save them. She will devour us all. But first I shall have my revenge. Do the dance of death for me, Kaleh! Dance! Dance!"
2439        [/message]
2440        {CLEAR_VARIABLE dark_assassin_location}
2441    [/event]
2442
2443    [event]
2444        name=queue_battle_events
2445
2446        [event]
2447            name="turn $($turn_number+3)"
2448            delayed_variable_substitution=no
2449
2450            [fire_event]
2451                name=enemy_attack
2452            [/fire_event]
2453        [/event]
2454
2455        [event]
2456            name="turn $($turn_number+6)"
2457            delayed_variable_substitution=no
2458            {ALLY_REINFORCEMENTS}
2459        [/event]
2460
2461        [set_variable]
2462            name=assassin_turn
2463            rand=13..18
2464        [/set_variable]
2465        [event]
2466            name="turn $($turn_number|+$assassin_turn|)"
2467            delayed_variable_substitution=no
2468            [fire_event]
2469                name=call_assassin
2470            [/fire_event]
2471        [/event]
2472        {CLEAR_VARIABLE assassin_turn}
2473    [/event]
2474
2475    # Event 6: death events for each leader
2476
2477    #for each death check to see if other leader is dead, if so
2478    #also send in dwarf/troll messenger with victory congratulations
2479
2480    [event]
2481        name=last breath
2482
2483        [filter]
2484            id=Fundin
2485        [/filter]
2486
2487        [message]
2488            speaker=Fundin
2489            message= _ "The rest is silence..."
2490        [/message]
2491
2492        [kill]
2493            id=Fundin
2494            animate=yes
2495        [/kill]
2496
2497        [fire_event]
2498            name=troll_victory_test
2499        [/fire_event]
2500    [/event]
2501
2502    [event]
2503        name=last breath
2504
2505        [filter]
2506            id=Nori
2507        [/filter]
2508
2509        [message]
2510            speaker=Nori
2511            message= _ "I go to my ancestors..."
2512        [/message]
2513
2514        [kill]
2515            id=Nori
2516            animate=yes
2517        [/kill]
2518
2519        [fire_event]
2520            name=troll_victory_test
2521        [/fire_event]
2522    [/event]
2523
2524    [event]
2525        name=last breath
2526
2527        [filter]
2528            id=Thungar
2529        [/filter]
2530
2531        [message]
2532            speaker=Thungar
2533            message= _ "Arrghh!!"
2534        [/message]
2535
2536        [fire_event]
2537            name=dwarf_victory_test
2538        [/fire_event]
2539    [/event]
2540
2541    [event]
2542        name=last breath
2543
2544        [filter]
2545            id=Gnarl
2546        [/filter]
2547
2548        [message]
2549            speaker=Gnarl
2550            message= _ "I will be avenged..."
2551        [/message]
2552
2553        [kill]
2554            id=Gnarl
2555            animate=yes
2556        [/kill]
2557
2558        [fire_event]
2559            name=dwarf_victory_test
2560        [/fire_event]
2561    [/event]
2562
2563    # When cloaked figure dies and if player has already killed both enemy
2564    # leaders, then go to victory
2565
2566    [event]
2567        name=die
2568
2569        [filter]
2570            id=Cloaked Figure
2571        [/filter]
2572
2573        [kill]
2574            id=Cloaked Figure
2575            animate=no
2576            fire_event=no
2577        [/kill]
2578
2579        [micro_ai]
2580            side=7
2581            ai_type=assassin
2582            action=delete
2583        [/micro_ai]
2584
2585        [message]
2586            speaker=Kaleh
2587            message= _ "Where did he go? How does he disappear like that? And what in Uria’s name was he ranting about? Whoever that is is starting to make me get edgy."
2588        [/message]
2589
2590        # if cloaked figure was delaying victory event from firing
2591
2592        [if]
2593            [have_unit]
2594                race=dwarf
2595                canrecruit=yes
2596                count=0
2597            [/have_unit]
2598
2599            [then]
2600                [message]
2601                    speaker=Kaleh
2602                    message= _ "The cloaked figure is gone. Still, our work is not yet done. Gather yourselves together; we must follow Zurg."
2603                [/message]
2604
2605                [endlevel]
2606                    result=victory
2607                    next_scenario=06b_In_the_Domain_of_the_Dwarves
2608                    bonus=yes
2609                    {NEW_GOLD_CARRYOVER 40}
2610                [/endlevel]
2611            [/then]
2612        [/if]
2613
2614        [if]
2615            [have_unit]
2616                race=troll
2617                canrecruit=yes
2618                count=0
2619            [/have_unit]
2620
2621            [then]
2622                [message]
2623                    speaker=Kaleh
2624                    message= _ "The cloaked figure is gone. Still, our work is not yet done. Gather yourselves together; we must follow Grimnir."
2625                [/message]
2626
2627                [endlevel]
2628                    result=victory
2629                    next_scenario=06a_In_the_Tunnels_of_the_Trolls
2630                    bonus=yes
2631                    {NEW_GOLD_CARRYOVER 40}
2632                [/endlevel]
2633            [/then]
2634        [/if]
2635    [/event]
2636
2637    #at victory, clear variables:
2638    [event]
2639        name=victory
2640        {CLEAR_VARIABLE Fundin_approach_message}
2641        {CLEAR_VARIABLE Nori_approach_message}
2642        {CLEAR_VARIABLE Thungar_approach_message}
2643        {CLEAR_VARIABLE Gnarl_approach_message}
2644    [/event]
2645
2646    # if player runs out of time, display time over message
2647    [event]
2648        name=time over
2649
2650        [message]
2651            speaker=Kaleh
2652            message= _ "Oh no, we took too long and enemy reinforcements have arrived. We’ll surely be overwhelmed now!"
2653        [/message]
2654    [/event]
2655
2656    {UTBS_INCLUDE utils/deaths.cfg}
2657[/scenario]
2658