#textdomain wesnoth-did [scenario] id=09_A_Small_Favor3 next_scenario=10_Alone_at_Last name=_ "A Small Favor — Part 3" map_data="{campaigns/Descent_Into_Darkness/maps/09_A_Small_Favor3.map}" {TURNS 30 27 25} victory_when_enemies_defeated=no {UNDERGROUND} {SCENARIO_MUSIC underground.ogg} {EXTRA_SCENARIO_MUSIC loyalists.ogg} {EXTRA_SCENARIO_MUSIC suspense.ogg} # no story -- this occurs immediately after the previous scenario [side] side=1 controller=human team_name=intruders user_team_name=_"Intruders" type=Apprentice Mage id=Malin Keshar name=_ "Malin Keshar" profile=portraits/malin_old.png unrenamable=yes canrecruit=yes recruit= gold=0 income=-2 shroud=yes fog=no share_maps=yes share_view=yes {FLAG_VARIANT undead} [/side] [side] # Mages side=2 controller=ai team_name=defenders user_team_name=_"Defenders" no_leader=yes [ai] village_value=0 aggression=0.8 [/ai] [/side] [side] side=3 controller=ai team_name=intruders user_team_name=_"Intruders" no_leader=yes [ai] village_value=0 aggression=0.8 [goal] name=protect_unit [criteria] side=3 canrecruit=yes [/criteria] value=5 [/goal] [goal] name=protect_unit [criteria] id=Darken Volk [/criteria] protect_radius=6 value=20 [/goal] [/ai] shroud=yes fog=no share_maps=no share_view=no [/side] # This macro places the doors and adds the door-opening event {MANOR_DOORS 1,3} [event] name=prestart [objectives] side=1 [objective] condition=win description=_ "Find the book" [/objective] [objective] condition=lose description=_ "Death of Malin Keshar" [/objective] [objective] condition=lose description=_ "Death of Darken Volk" [/objective] {TURNS_RUN_OUT} [/objectives] #TODO: Create some scenery (fire, torches, ...) {PLACE_IMAGE items/book5.png 11 7} # Place mages in great hall {NAMED_NOTRAIT_UNIT 2 (Silver Mage) 13 8 ("") (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 (Red Mage) 14 9 ("") (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 (White Mage) 16 8 ("") (_"Guardian")} {GUARDIAN} # Place manor guards {SCATTER_UNITS 6 Pikeman,Duelist,Pikeman,Spearman,Pikeman,Swordsman 3 ( terrain=Rr [not] x,y=25,18 radius=4 [/not] [not] x,y=31,15 radius=2 [/not] [not] x,y=11,7 [/not] [not] [filter] [/filter] [/not] ) ( side=2 name= _ "Guard" random_traits=yes )} # Place mages in rooms {NAMED_NOTRAIT_UNIT 2 Mage 16 15 () (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 Mage 18 15 () (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 Mage 22 13 () (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 Mage 24 12 () (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 Mage 27 10 () (_"Guardian")} {GUARDIAN} {NAMED_NOTRAIT_UNIT 2 Mage 29 10 () (_"Guardian")} {GUARDIAN} # Who has the book? {VARIABLE hasBook none} [/event] [event] name=start [store_unit] [filter] [filter_wml] [variables] got_inside_manor=yes [/variables] [/filter_wml] [/filter] kill=yes variable=units_inside_manor [/store_unit] {FOREACH units_inside_manor i} {VARIABLE units_inside_manor[$i].upkeep loyal} [unstore_unit] variable=units_inside_manor[$i] find_vacant=no [/unstore_unit] [recall] id=$units_inside_manor[$i].id [/recall] {NEXT i} {CLEAR_VARIABLE units_inside_manor} [recall] id=Darken Volk x,y=26,16 [/recall] [redraw] side=1 [/redraw] [store_unit] [filter] id=Darken Volk [/filter] kill=yes variable=stored_Darken [/store_unit] {VARIABLE stored_Darken.side 3} {VARIABLE stored_Darken.canrecruit yes} {CLEAR_VARIABLE stored_Darken.ellipse} [unstore_unit] variable=stored_Darken [/unstore_unit] {CLEAR_VARIABLE stored_Darken} # Create DV's units {GENERIC_UNIT 3 (Revenant) 26 16} {GENERIC_UNIT 3 (Spectre) 26 16} {GENERIC_UNIT 3 (Deathblade) 26 16} {GENERIC_UNIT 3 (Necrophage) 26 16} {GENERIC_UNIT 3 (Banebow) 26 16} {GENERIC_UNIT 3 (Nightgaunt) 26 16} [message] speaker=Malin Keshar message=_ "I feel the book is very close, somewhere to the northwest." [/message] [/event] [event] name=turn refresh first_time_only=no [filter_condition] [variable] name=side_number equals=3 [/variable] [/filter_condition] [store_unit] [filter] id=Darken Volk [/filter] variable=stored_Darken [/store_unit] [if] [variable] name=hasBook equals=none [/variable] [then] [if] [variable] name=turn_number greater_than=3 [/variable] [then] {VARIABLE dest.x 11} {VARIABLE dest.y 7} [/then] [else] {VARIABLE dest.x 16} {VARIABLE dest.y 14} [/else] [/if] [/then] [else] {VARIABLE dest.x 31} {VARIABLE dest.y 1} [/else] [/if] [find_path] [traveler] id=Darken Volk [/traveler] [destination] x=$dest.x y=$dest.y [/destination] variable=darken_goto allow_multiple_turns=yes [/find_path] [if] [variable] name=darken_goto.step.length greater_than=0 [/variable] [then] {VARIABLE index "$(min($stored_Darken.max_moves,$darken_goto.step.length-1))"} {VARIABLE stored_Darken.goto_x $darken_goto.step[$index].x} {VARIABLE stored_Darken.goto_y $darken_goto.step[$index].y} [/then] [else] {VARIABLE stored_Darken.goto_x $dest.x} {VARIABLE stored_Darken.goto_y $dest.y} [/else] [/if] [unstore_unit] variable=stored_Darken [/unstore_unit] {CLEAR_VARIABLE stored_Darken,dest,darken_goto,index} [/event] [event] # Malin gets the book name=moveto [filter] id=Malin Keshar x,y=11,7 [/filter] [if] [variable] name=hasBook equals=none [/variable] [then] {VARIABLE hasBook Malin} [message] speaker=Malin Keshar message=_ "We’ve got the book, but now how do we get out of here?" [/message] [message] speaker=Darken Volk message=_ "There’s a small tunnel in the cellar to the northeast. It will lead us far enough out of the city that we can escape pursuit." [/message] [remove_item] x,y=11,7 [/remove_item] [objectives] side=1 [objective] condition=win description=_ "Escape via the tunnel in the northeast cellar" [/objective] [objective] condition=lose description=_ "Death of Malin Keshar" [/objective] [objective] condition=lose description=_ "Death of Darken Volk" [/objective] {TURNS_RUN_OUT} [/objectives] [event] name=moveto [filter] id=Malin Keshar x,y=30-31,1 [/filter] [message] speaker=Malin Keshar message=_ "Phew! Let’s get out of here." [/message] [endlevel] result=victory bonus=no {NEW_GOLD_CARRYOVER 100} carryover_report=no [/endlevel] [/event] [/then] [/if] [/event] [event] # DV gets the book name=moveto [filter] id=Darken Volk x,y=11,7 [/filter] [if] [variable] name=hasBook equals=none [/variable] [then] {VARIABLE hasBook Darken} [remove_item] x,y=11,7 [/remove_item] [objectives] side=1 [objective] condition=win description=_ "Escape the manor" [/objective] [objective] condition=lose description=_ "Death of Malin Keshar" [/objective] [objective] condition=lose description=_ "Death of Darken Volk" [/objective] {TURNS_RUN_OUT} [/objectives] [event] name=moveto [filter] id=Darken Volk side=3 [/filter] [message] speaker=Malin Keshar message=_ "We’ve got the book, but now how do we get out of here?" [/message] [scroll_to_unit] id=Darken Volk [/scroll_to_unit] [message] speaker=Malin Keshar message=_ "Wait, you aren’t leaving me behind, are you?" [/message] [/event] [event] name=moveto [filter] id=Darken Volk x,y=30-31,1 [/filter] [message] speaker=Darken Volk message=_ "You have served me well, my apprentice." [/message] [message] speaker=narrator message=_ "As he heads into the tunnel Darken Volk collapses its entrance, leaving Malin to be captured and executed by the city guards." image=wesnoth-icon.png [/message] [endlevel] result=defeat [/endlevel] [/event] [event] name=moveto [filter] id=Malin Keshar x,y=30-31,1 [/filter] [message] speaker=Malin Keshar message=_ "Phew! Let’s get out of here." [/message] [endlevel] result=victory bonus=no {NEW_GOLD_CARRYOVER 100} carryover_report=no [/endlevel] [/event] [/then] [/if] [/event] # Defeat Conditions {MALIN_DEATH} {VOLK_DEATH2} [event] name=time over [message] speaker=narrator message=_ "As dawn breaks, the city guards force their way into the manor and capture the two necromancers." image=wesnoth-icon.png [/message] [endlevel] result=defeat [/endlevel] [/event] [event] name=victory {MODIFY_UNIT (id=Darken Volk) side 1} [/event] [/scenario]