From 0771fddf812e403d528721dfd6885dfb5f16074b Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Wed, 4 Feb 2015 19:31:31 +1100 Subject: [PATCH] NR S2: cleaned up/improved scenario code --- .../scenarios/02_Infested_Caves.cfg | 315 +++++++++++------- .../Northern_Rebirth/utils/characters.cfg | 12 + 2 files changed, 202 insertions(+), 125 deletions(-) diff --git a/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg b/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg index de0b8cef3022..c0294cadfe56 100644 --- a/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg +++ b/data/campaigns/Northern_Rebirth/scenarios/02_Infested_Caves.cfg @@ -1,14 +1,21 @@ #textdomain wesnoth-nr + [scenario] id=02_Infested_Caves name= _ "Infested Caves" + map_data="{campaigns/Northern_Rebirth/maps/02_Infested_Caves.map}" + {TURNS 55 50 45} + next_scenario=03_To_the_Mines + + {UNDERGROUND} - {INTRO_AND_SCENARIO_MUSIC "knolls.ogg" "underground.ogg"} - {EXTRA_SCENARIO_MUSIC "revelation.ogg"} - {EXTRA_SCENARIO_MUSIC "knalgan_theme.ogg"} + {SCENARIO_MUSIC underground.ogg} + {EXTRA_SCENARIO_MUSIC revelation.ogg} + {EXTRA_SCENARIO_MUSIC knalgan_theme.ogg} [story] [part] + music=knolls.ogg story= _ "Ill-armed and untrained though they were, the people of Dwarven Doors rose against the Orcs. Although their losses had been tremendous, never once did they break or falter. In the end, the orcish host was smashed and the survivors sent scurrying for their lives." [/part] [part] @@ -32,122 +39,146 @@ story= _ "Faced with certain destruction at the hands of the orcs, or a fate unknown in the caves of Knalga, Tallin chose the latter. The people quickly gathered together and collected whatever food and weapons they could and plunged into the darkness of the caves." [/part] [/story] - {NR_TRACK {REVOLT_STAGE2}} - map_data="{campaigns/Northern_Rebirth/maps/02_Infested_Caves.map}" - {TURNS 55 50 45} - # Whole scenario takes place underground thus apropriate time of day. - {UNDERGROUND} - next_scenario=03_To_the_Mines + {NR_TRACK {REVOLT_STAGE2}} # Set sides # Players side - some more recruit options this time. + # wmllint: validate-off [side] - type=Peasant - id=Tallin - name=_ "Tallin" - canrecruit=yes side=1 controller=human {GOLD 450 400 350} recruit=Peasant,Woodsman,Thug,Poacher,Footpad team_name=rebels - user_team_name=_"Rebels" - shroud=yes + user_team_name= _ "Rebels" {FLAG_VARIANT6 ragged} + + # wmllint: recognize Tallin + {CHARACTER_STATS_TALLIN} + + shroud=yes [/side] + # wmllint: validate-on # Three sides for trolls, one lead by troll warrior [side] + side=2 + controller=ai + recruit=Troll Whelp + {GOLD 100 150 200} + team_name=trolls + user_team_name= _ "Trolls" + type=Troll id=Knash name= _ "Knash" canrecruit=yes - side=2 - {GOLD 100 150 200} - recruit=Troll Whelp - team_name=trolls - user_team_name=_"Trolls" + shroud=yes [/side] [side] + side=3 + controller=ai + recruit=Troll Whelp + {GOLD 100 150 200} + team_name=trolls + user_team_name= _ "Trolls" + type=Troll id=Krog name= _ "Krog" canrecruit=yes - side=3 - {GOLD 100 150 200} - recruit=Troll Whelp - team_name=trolls - user_team_name=_"Trolls" [/side] # Dwarven side [side] + side=4 + controller=ai + recruit=Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Guardsman,Dwarvish Scout + {GOLD 130 120 100} + team_name=rebels + user_team_name= _ "Rebels" + {FLAG_VARIANT knalgan} + type=Dwarvish Lord id=Hamel name= _ "Hamel" profile=portraits/Hamel.png canrecruit=yes - side=4 - {GOLD 130 120 100} - recruit=Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Guardsman,Dwarvish Scout - team_name=rebels - user_team_name=_"Rebels" + [ai] recruitment_pattern=fighter,fighter,fighter,mixed fighter [/ai] - {FLAG_VARIANT knalgan} + + {NOTRAIT_UNIT () "Dwarvish Stalwart" 30 25} {GUARDIAN} + {NOTRAIT_UNIT () "Dwarvish Stalwart" 28 21} {GUARDIAN} + {NOTRAIT_UNIT () "Dwarvish Stalwart" 31 21} {GUARDIAN} + {NOTRAIT_UNIT () "Dwarvish Stalwart" 26 24} {GUARDIAN} [/side] - # Three undead sides [side] - type=Death Knight - canrecruit=yes side=5 + controller=ai + recruit=Skeleton,Skeleton Archer {GOLD 300 400 500} {INCOME 10 15 20} - recruit=Skeleton,Skeleton Archer team_name=undead - user_team_name=_"Undead" + user_team_name= _ "Undead" {FLAG_VARIANT undead} + + type=Death Knight + id=Mal Barath + name= _ "Mal Barath" + canrecruit=yes [/side] [side] + side=6 + controller=ai + recruit=Troll Whelp,Troll,Troll Rocklobber + {GOLD 300 400 500} + team_name=trolls + user_team_name= _ "Trolls" + type=Troll Warrior id=Thung name= _ "Thung" canrecruit=yes - side=6 - {GOLD 300 400 500} - recruit=Troll Whelp,Troll,Troll Rocklobber - team_name=trolls - user_team_name=_"Trolls" [/side] [side] - type=Death Knight - canrecruit=yes side=7 + controller=ai + recruit=Skeleton,Skeleton Archer {GOLD 250 350 450} {INCOME 4 6 8} - recruit=Skeleton,Skeleton Archer team_name=undead - user_team_name=_"Undead" + user_team_name= _ "Undead" {FLAG_VARIANT undead} - [/side] - [side] type=Death Knight + id=Delzath + name= _ "Delzath" canrecruit=yes + [/side] + + [side] side=8 + controller=ai + recruit=Skeleton,Skeleton Archer {GOLD 250 350 450} {INCOME 4 6 8} - recruit=Skeleton,Skeleton Archer + team_name=undead - user_team_name=_"Undead" + user_team_name= _ "Undead" {FLAG_VARIANT undead} + + type=Death Knight + id=Mal Tath + name= _ "Mal Tath" + canrecruit=yes [/side] # And an empty side for the bat used in flavor event @@ -155,29 +186,11 @@ no_leader=yes side=9 hidden=yes + color=black [/side] - # Prestart event - place some dwarven guards to increase the - # survivability of the allied AI and set player - # objectives. [event] name=prestart - {NOTRAIT_UNIT 4 "Dwarvish Stalwart" 30 25} - [+unit] - ai_special=guardian - [/unit] - {NOTRAIT_UNIT 4 "Dwarvish Stalwart" 28 21} - [+unit] - ai_special=guardian - [/unit] - {NOTRAIT_UNIT 4 "Dwarvish Stalwart" 31 21} - [+unit] - ai_special=guardian - [/unit] - {NOTRAIT_UNIT 4 "Dwarvish Stalwart" 26 24} - [+unit] - ai_special=guardian - [/unit] [objectives] side=1 @@ -209,36 +222,44 @@ {RECALL_SUPPORTER} [/event] - # Start event - execute the flavour bat encounter. + # Start event - execute the flavor bat encounter. [event] name=start + [message] role=Supporter message= _ "So here we are..." [/message] + [message] role=Supporter message= _ "(Trip) Oof!" # wmllint: no spellcheck [/message] + [message] role=Supporter message= _ "Great idea, Tallin, I probably couldn’t even fight a bat down here." [/message] + [move_unit_fake] type=Blood Bat side=9 x=15,14,13,12,11 y=12,12,12,12,12 [/move_unit_fake] + {NOTRAIT_UNIT 9 "Blood Bat" 11 12} + [message] type=Blood Bat message= _ "Neep Neep!" # wmmlint: no spellcheck [/message] + [message] role=Supporter message= _ "Ahhhh!" [/message] + [message] speaker=Tallin message= _ "Calm down. Come what may, we’ll handle them. Come on now, let’s find those dwarves!" @@ -250,75 +271,78 @@ name=moveto [filter] side=1 - x=2 - y=1 + x,y=2,1 [/filter] [unit] - type=Arch Mage - id=Camerin - profile=portraits/Camerin.png - name= _ "Camerin" - [modifications] - {TRAIT_LOYAL} - {TRAIT_STRONG} - [/modifications] - {IS_LOYAL} side=1 - x=1 - y=1 + x,y=1,1 + + # wmllint: recognize Camerin + {CHARACTER_STATS_CAMERIN} [/unit] + [message] speaker=Camerin message= _ "Prepare to die, you foul orc!" [/message] + [message] speaker=unit message= _ "Hold it! I am no orc, I am a human!" [/message] + [message] speaker=Camerin message= _ "A human! Amazing, I haven’t seen a human ever since the orcs attacked." [/message] + [message] speaker=unit message= _ "How have you managed to survive all this time?" [/message] + [message] speaker=Camerin message= _ "By frying every orc, troll or skeleton I come across. Duh! Those monsters desecrated my life’s work, now I shall not rest till I send every last one of them to hell! Oh, and just between me and you, it is actually good fun — more fun anyway than sitting on your backside studying all day..." [/message] + [message] speaker=unit message= _ "... Uh, sure!" [/message] + [message] speaker=Camerin message= _ "But silly me, where are my manners? Would you like to come inside for tea?" [/message] + [message] speaker=unit message= _ "Um... err... well actually we are presently busy fighting our way through hordes of trolls and skeletons trying to find the dwarves... if there are any left." [/message] + [message] speaker=Camerin message= _ "Hordes of trolls and skeletons! Where?! Let’s go burn ’em all!" [/message] + [message] speaker=unit # wmllint: local spelling Er message= _ "Er... let’s go..." [/message] + [message] speaker=unit message={WHISPER _"whisper^Is it safe to have this lunatic with us?"} [/message] - {VARIABLE found_Camerin 1} + # The following two events are absolutely useless if Camerin # was not found so we'll set them only when this happens using # event nesting. - # Flavour event on Camerins first attack + # Flavor event on Camerins first attack [event] name=attack [filter] @@ -335,7 +359,7 @@ [/message] [/event] - # And flavour event on his first kill + # And flavor event on his first kill [event] name=die [filter_second] @@ -363,13 +387,14 @@ speaker=unit message= _ "This tunnel keeps on going..." [/message] + [message] speaker=Tallin message= _ "I think we should finish searching this part of Knalga first before we go deeper into the caves." [/message] [/event] - # Flavour event on first sighting of the undead + # Flavor event on first sighting of the undead [event] name=sighted,moveto [filter] @@ -383,21 +408,24 @@ role=Supporter message= _ "Grim Gods of Darkness, what are those things!" [/message] + [message] speaker=Tallin message= _ "Skeletons!" [/message] + [message] role=Supporter message= _ "Look at the axes they bear. At one time those skeletons must have been dwarves!" [/message] + [message] speaker=Tallin message= _ "Stand firm, men. The dwarven defenders of Knalga rise again. Now it remains to be seen whether or not they recognize us as friends." [/message] [/event] - # Flavour event for the first time they attack + # Flavor event for the first time they attack [event] name=attack [filter] @@ -411,6 +439,7 @@ role=Supporter message= _ "They are attacking us!" [/message] + [message] speaker=Tallin message= _ "Destroy them!" @@ -426,7 +455,7 @@ y=4,5 [/filter] - # Check from which side do we open and use apropriate race in the dialogue. + # Check from which side do we open and use appropriate race in the dialogue. [if] [variable] name=unit.y @@ -445,29 +474,34 @@ [/message] [/else] [/if] + [message] speaker=Tallin message= _ "Well, let’s see what’s behind it." [/message] + [message] speaker=unit message= _ "All right. (Grunt... strain...) It’s not moving. It seems to be stuck." [/message] + [message] speaker=Tallin message= _ "Well, just kick it down then." [/message] + [message] speaker=unit message= _ "... Right." [/message] + [message] speaker=unit message= _ "(Smash)" [/message] + [terrain] - x=13 - y=5 + x,y=13,5 terrain=Uu [/terrain] [/event] @@ -499,29 +533,34 @@ [/message] [/else] [/if] + [message] speaker=Tallin message= _ "Well, let’s see what’s behind it." [/message] + [message] speaker=unit message= _ "All right. (Grunt... strain...) It’s not moving. It seems to be stuck." [/message] + [message] speaker=Tallin message= _ "Well, just kick it down then." [/message] + [message] speaker=unit message= _ "... Right." [/message] + [message] speaker=unit message= _ "(Smash)" [/message] + [terrain] - x=7 - y=28 + x,y=7,28 terrain=Uu [/terrain] [/event] @@ -539,6 +578,7 @@ speaker=unit message= _ "Wow, this place is interesting." [/message] + [message] speaker=Hamel message= _ "This is how we get our food, me lad. Since we are a tad close to the surface here, some sunlight shines down through the cracks in the roof. If we baby the plants, we can usually get enough. They taste unco’ foul but that’s how we ha’ survived all these long years." @@ -556,14 +596,17 @@ role=Supporter message= _ "Tallin, this situation is hopeless — there are endless monsters swarming from all directions!" [/message] + [message] speaker=Tallin message= _ "We are in a dire situation indeed — but just see — the trolls and the skeletons are also attacking each other. We must all stay together in one group; let each man support the man next to him. If our ranks are imposing enough the monsters may shy away from us in favor of easier prey." [/message] + [message] role=Supporter message= _ "But still, Tallin, we will take losses, and for each one of us, there is no replacement — whereas for every monster we kill, it seems that two more come to take its place!" [/message] + [message] speaker=Tallin message= _ "Which is why we must make haste to find the dwarves. Dwarves are hardy creatures and they know their caves backwards and forwards — so I am sure at least some must have survived! Indeed, this is our only hope for otherwise, be it on the surface or be it down here, any way we turn we face certain destruction!" @@ -584,27 +627,34 @@ speaker=unit message= _ "Stand where ye be, you... Och! A human!" [/message] + [message] speaker=Tallin message= _ "Greetings from the people of Dwarven Doors, friend." [/message] + [message] speaker=unit message= _ "Dwarven Doors? I thought ye surface humans had been enslaved or slain by the orcs years ago." [/message] + [message] speaker=Tallin message= _ "Yes, we were enslaved, but we rose against Al’Tar and defeated his warband. In order to stay free, we seek help and equipment from our old allies, the dwarves." [/message] + [message] speaker=unit message= _ "Och, the dwarves of Knalga are themselves in desperate straits — but we havena’ forgotten the old bonds. Be welcome to our keep. Aye, and have speech with our chieftain, the Lord Hamel." [/message] + [message] speaker=Tallin message= _ "Very well." [/message] - {VARIABLE found_dwarves 1} + + {VARIABLE found_dwarves yes} + [objectives] side=1 [objective] @@ -640,36 +690,41 @@ x=33,33,34,34,35,35,35,36,36,37,37,31,32,32 y=20,21,20,21,21,22,23,22,23,23,24,23,22,23 [/filter] + [message] speaker=Hamel message= _ "Well met, Tallin. My men have told me of your victory against Al’Tar." [/message] + [message] speaker=Tallin message= _ "Thank you and well-met indeed, Lord Hamel." [/message] + [message] role=Supporter message= _ "Whew, we did it!" [/message] + [message] speaker=Camerin message= _ "Awww! Are we done already?" [/message] + [endlevel] result=victory bonus=no [/endlevel] [/event] - # All enemies defeated, choose apropriate dialogue depending on wether the dwarves were found or not. + # All enemies defeated, choose appropriate dialog depending on whether the dwarves were found or not. [event] name=enemies defeated [if] [variable] name=found_dwarves - numerical_equals=1 + boolean_equals=yes [/variable] [then] [message] @@ -695,33 +750,38 @@ id=Hamel [/filter] - {INCIDENTAL_MUSIC "sad.ogg"} + {INCIDENTAL_MUSIC sad.ogg} + [role] type=Master Bowman,Royal Guard,Halberdier,Swordsman,Pikeman,Longbowman,Javelineer,Trapper,Bandit,Highwayman,Thug,Poacher,Spearman,Bowman,Peasant role=Messenger [/role] + [message] role=Messenger message= _ "Tallin, we have just received the news that the dwarvish Lord Hamel has just been slain. We are too late!" [/message] + [message] speaker=Tallin message= _ "No! Without the dwarvish weapons we have no hope!" [/message] + [endlevel] result=defeat [/endlevel] [/event] - # If we won and Camerin wasn't found add him to the players army. Clear variables. + # If we won and Camerin wasn't found add him to the players army [event] name=victory [if] - [variable] - name=found_Camerin - numerical_equals=0 - [/variable] + [not] + [have_unit] + id=Camerin + [/have_unit] + [/not] [then] [move_unit_fake] type=Arch Mage @@ -729,32 +789,30 @@ x=1,2,3,4,4,3,3,3,3,3,3,3,4,5,6 y=1,1,2,2,3,4,5,6,7,8,9,10,10,11,11 [/move_unit_fake] + [unit] - type=Arch Mage - id=Camerin - name= _ "Camerin" - profile=portraits/Camerin.png side=1 - x=6 - y=11 - [modifications] - {TRAIT_LOYAL} - {TRAIT_STRONG} - [/modifications] - {IS_LOYAL} + x,y=6,11 + + # wmllint: recognize Camerin + {CHARACTER_STATS_CAMERIN} [/unit] + [message] speaker=Camerin message= _ "Hey, what’s going on in here?" [/message] + # Try to choose as Admirer, in order: # (1) A Thug or Bandit on side 1 # (2) Otherwise, any unit other than Tallin, Camerin and Supporter on side 1 # (3) If all else fails, Tallin + [role] type=Thug,Bandit role=Admirer [/role] + [if] [not] [have_unit] @@ -778,6 +836,7 @@ [/role] [/then] [/if] + [if] [not] [have_unit] @@ -792,49 +851,55 @@ [/role] [/then] [/if] + [message] role=Admirer message= _ "We are killing lots of trolls and skeletons." [/message] + [message] speaker=Camerin message= _ "Really! Did you save any for me?" [/message] + [message] role=Admirer message= _ "Uh, not really..." [/message] + [message] speaker=Camerin message= _ "Awww!" [/message] + [message] role=Admirer message= _ "But hey, if you want to join us, I am sure we will be fighting a lot more orcs, trolls and skeletons in the near future." [/message] + [message] speaker=Camerin message= _ "Really! Oh yeah, I am in!" [/message] + [message] speaker=Tallin message= _ "... That was rather odd. Who is this guy?" [/message] - [if] - [variable] - name=found_dwarves - numerical_equals=1 - [/variable] - [then] - [message] - speaker=Hamel - message= _ "Oh, dinna’ mind him, that’d be Camerin. He used to be yer usual scholarly mage, and he moved awa’ up here to be alone and study. But then when the orcs invaded he went a little loony. My guess is that some roving orcs ransacked his place and burnt his notes or something. Whatever it was, he couldna’ take it and became fey. Ever since he has been roving these caves destroying any manner of monster that he comes across. They all give him a very wide berth by now. So just be polite, give him some room and you’ll find he is relatively harmless..." - [/message] - [/then] - [/if] + + [message] + speaker=Hamel + message= _ "Oh, dinna’ mind him, that’d be Camerin. He used to be yer usual scholarly mage, and he moved awa’ up here to be alone and study. But then when the orcs invaded he went a little loony. My guess is that some roving orcs ransacked his place and burnt his notes or something. Whatever it was, he couldna’ take it and became fey. Ever since he has been roving these caves destroying any manner of monster that he comes across. They all give him a very wide berth by now. So just be polite, give him some room and you’ll find he is relatively harmless..." + [show_if] + [variable] + name=found_dwarves + boolean_equals=yes + [/variable] + [/show_if] + [/message] [/then] [/if] - {CLEAR_VARIABLE found_Camerin} + {CLEAR_VARIABLE found_dwarves} [/event] [/scenario] diff --git a/data/campaigns/Northern_Rebirth/utils/characters.cfg b/data/campaigns/Northern_Rebirth/utils/characters.cfg index 33e2d248df81..76c7c98f886b 100644 --- a/data/campaigns/Northern_Rebirth/utils/characters.cfg +++ b/data/campaigns/Northern_Rebirth/utils/characters.cfg @@ -19,3 +19,15 @@ [/object] [/modifications] #enddef + +#define CHARACTER_STATS_CAMERIN + type=Arch Mage + id=Camerin + name= _ "Camerin" + profile=portraits/Camerin.png + {IS_LOYAL} + [modifications] + {TRAIT_LOYAL} + {TRAIT_STRONG} + [/modifications] +#enddef