Untitled diff

Created Diff never expires
#textdomain wesnoth-tsg
#textdomain wesnoth-tsg
[scenario]
[scenario]
id=08b_The_Tides_of_War
id=08b_The_Tides_of_War


name= _ "The Tides of War"
name= _ "The Tides of War"
next_scenario=09b_Bandit_Epilogue
next_scenario=09b_Bandit_Epilogue


{SCENARIO_MUSIC knalgan_theme.ogg}
{SCENARIO_MUSIC knalgan_theme.ogg}
{EXTRA_SCENARIO_MUSIC battle.ogg}
{EXTRA_SCENARIO_MUSIC battle.ogg}
{EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}
{EXTRA_SCENARIO_MUSIC siege_of_laurelmor.ogg}


map_data="{campaigns/The_South_Guard/maps/08b_The_Tides_of_War.map}"
map_data="{campaigns/The_South_Guard/maps/08b_The_Tides_of_War.map}"


{DEFAULT_SCHEDULE_DAWN}
{DEFAULT_SCHEDULE_DAWN}


victory_when_enemies_defeated=yes
victory_when_enemies_defeated=yes
turns=60
turns=60


{BIGMAP_08B}
{BIGMAP_08B}


# The South Guard
# The South Guard


[side]
[side]
side=1
side=1
type=Horseman Commander
type=Horseman Commander
id=Deoran
id=Deoran
name= _ "Deoran"
name= _ "Deoran"
unrenamable=yes
unrenamable=yes


team_name=South_Guard
team_name=South_Guard
user_team_name=_"South Guard"
user_team_name=_"South Guard"
controller=human
controller=human
{CUSTOM_SG_FLAG}
{CUSTOM_SG_FLAG}


gold=200
gold=200
{INCOME 4 2 0}
{INCOME 4 2 0}


fog=no
fog=no
shroud=no
shroud=no


canrecruit=yes
canrecruit=yes
recruit=Bowman, Spearman, Cavalryman, Footpad, Thug
recruit=Bowman, Spearman, Cavalryman, Footpad, Thug
[/side]
[/side]


# The Undead Hordes
# The Undead Hordes


[side]
[side]
side=2
side=2
type=Ancient Lich
type=Ancient Lich
id="Mal M'Brin"
id="Mal M'Brin"
name= _ "Mal M’Brin"
name= _ "Mal M’Brin"


team_name=The_Undead_Hordes
team_name=The_Undead_Hordes
user_team_name=_"Undead"
user_team_name=_"Undead"
controller=ai
controller=ai


{GOLD 400 700 900}
{GOLD 400 700 900}
{INCOME 20 30 40}
{INCOME 20 30 40}


canrecruit=yes
canrecruit=yes
[ai]
[ai]
recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,archer,mixed fighter
recruitment_pattern=scout,fighter,fighter,archer,scout,fighter,archer,mixed fighter
aggression=1.0
aggression=1.0
caution=0.0
caution=0.0
[goal]
[goal]
[criteria]
[criteria]
id=Deoran
id=Deoran
[/criteria]
[/criteria]
value=6.0
value=6.0
[/goal]
[/goal]
[/ai]
[/ai]
recruit=Wraith,Shadow,Revenant,Draug,Bone Shooter,Blood Bat,Chocobone,Dark Sorcerer,Necrophage
recruit=Wraith,Shadow,Revenant,Draug,Bone Shooter,Blood Bat,Chocobone,Dark Sorcerer,Necrophage
{FLAG_VARIANT undead}
{FLAG_VARIANT undead}
[/side]
[/side]


{STARTING_VILLAGES 2 5}
{STARTING_VILLAGES 2 5}


[event]
[event]
name=prestart
name=prestart


#define ILLUMINATING_CAMPFIRE X Y
#define ILLUMINATING_CAMPFIRE X Y
[terrain]
[terrain]
x,y={X},{Y}
x,y={X},{Y}
terrain=Gd^Ecf
terrain=Gd^Ecf
[/terrain]
[/terrain]


[item]
[item]
x,y={X},{Y}
x,y={X},{Y}
halo=halo/fire-aura.png
halo=halo/fire-aura.png
[/item]
[/item]


[store_locations]
[store_locations]
x,y={X},{Y}
x,y={X},{Y}
radius=2
radius=2


variable=illuminated_locations
variable=illuminated_locations
[/store_locations]
[/store_locations]


[time_area]
[time_area]
find_in=illuminated_locations
find_in=illuminated_locations


{MORNING}
{MORNING}
{MORNING}
{MORNING}
{AFTERNOON}
{AFTERNOON}
{AFTERNOON}
{AFTERNOON}
{DUSK}
{DUSK}
{DAWN}
{DAWN}
[/time_area]
[/time_area]
#enddef
#enddef


[set_variables]
[set_variables]
name=pebbles_defense_benefits
name=pebbles_defense_benefits


[value]
[value]
turn=6
turn=6
{MODIFY_TERRAIN Ce 30 17}
{MODIFY_TERRAIN Ce 30 17}
{VARIABLE defenses some}
{VARIABLE defenses some}
[/value]
[/value]
[value]
[value]
turn=7
turn=7
{NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 30 17 () (_"Provincial Guard")} {GUARDIAN}
{NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 30 17 () (_"Provincial Guard")} {GUARDIAN}
{VARIABLE provincial_guard some}
{VARIABLE provincial_guard some}
[/value]
[/value]
[value]
[value]
turn=8
turn=8
{MODIFY_TERRAIN Ce 27 17}
{MODIFY_TERRAIN Ce 27 17}
[/value]
[/value]
[value]
[value]
turn=9
turn=9
{NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 27 17 () (_"Provincial Guard")} {GUARDIAN}
{NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 27 17 () (_"Provincial Guard")} {GUARDIAN}
[/value]
[/value]
[value]
[value]
turn=10
turn=10
{MODIFY_TERRAIN Re^Vct 16 9}
{MODIFY_TERRAIN Re^Vct 16 9}
{MODIFY_TERRAIN Re^Vct 16 11}
{MODIFY_TERRAIN Re^Vct 16 11}
[/value]
[/value]
[value]
[value]
turn=11
turn=11
{MODIFY_TERRAIN Re^Vct 17 14}
{MODIFY_TERRAIN Re^Vct 17 14}
{MODIFY_TERRAIN Re^Vct 19 15}
{MODIFY_TERRAIN Re^Vct 19 15}
[/value]
[/value]
[value]
[value]
turn=12
turn=12
{MODIFY_TERRAIN Ch 20 11}
{MODIFY_TERRAIN Ch 20 11}
{MODIFY_TERRAIN Ch 22 10}
{MODIFY_TERRAIN Ch 22 10}
[/value]
[/value]
[value]
[value]
turn=13
turn=13
{MODIFY_TERRAIN Ce 25 17}
{MODIFY_TERRAIN Ce 25 17}
{MODIFY_TERRAIN Gd 26 16}
{MODIFY_TERRAIN Gd 26 16}
{NAMED_GENERIC_UNIT 1 (Lieutenant) 25 17 (Lt. Nilaf) (_"Lt. Nilaf")} {GUARDIAN}
{NAMED_GENERIC_UNIT 1 (Lieutenant) 25 17 (Lt. Nilaf) (_"Lt. Nilaf")} {GUARDIAN}
[/value]
[/value]
[value]
[value]
turn=14
turn=14
{MODIFY_TERRAIN Ce 23 17}
{MODIFY_TERRAIN Ce 23 17}
{MODIFY_TERRAIN Gd 24 16}
{MODIFY_TERRAIN Gd 24 16}
{NAMED_GENERIC_UNIT 1 (Spearman) 23 17 () (_"Provincial Guard")} {GUARDIAN}
{NAMED_GENERIC_UNIT 1 (Spearman) 23 17 () (_"Provincial Guard")} {GUARDIAN}
[/value]
[/value]
[value]
[value]
turn=15
turn=15
{MODIFY_TERRAIN Ce 14 17}
{MODIFY_TERRAIN Ce 14 17}
{NAMED_GENERIC_UNIT 1 (Bowman) 14 17 () (_"Provincial Guard")} {GUARDIAN}
{NAMED_GENERIC_UNIT 1 (Bowman) 14 17 () (_"Provincial Guard")} {GUARDIAN}
[/value]
[/value]
[value]
[value]
turn=16
turn=16
{MODIFY_TERRAIN Ce 34 17}
{MODIFY_TERRAIN Ce 34 17}
{NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 34 17 () (_"Provincial Guard")} {GUARDIAN}
{NAMED_GENERIC_UNIT 1 (Heavy Infantryman) 34 17 () (_"Provincial Guard")} {GUARDIAN}
{VARIABLE provincial_guard full}
{VARIABLE provincial_guard full}
[/value]
[/value]
[value]
[value]
turn=17
turn=17
{ILLUMINATING_CAMPFIRE 20 16}
{ILLUMINATING_CAMPFIRE 20 16}
[/value]
[/value]
[value]
[value]
turn=18
turn=18
{ILLUMINATING_CAMPFIRE 11 14}
{ILLUMINATING_CAMPFIRE 11 14}
[/value]
[/value]
[value]
[value]
turn=19
turn=19
{ILLUMINATING_CAMPFIRE 26 16}
{ILLUMINATING_CAMPFIRE 26 16}
[/value]
[/value]
[value]
[value]
turn=20
turn=20
{ILLUMINATING_CAMPFIRE 35 17}
{ILLUMINATING_CAMPFIRE 35 17}
[/value]
[/value]
[value]
[value]
turn=21
turn=21
{MODIFY_TERRAIN Ce 23 21}
{MODIFY_TERRAIN Ce 23 21}
[/value]
[/value]
[value]
[value]
turn=22
turn=22
{MODIFY_TERRAIN Ce 26 21}
{MODIFY_TERRAIN Ce 26 21}
{VARIABLE defenses full}
{VARIABLE defenses full}
[/value]
[/value]
[/set_variables]
[/set_variables]


{FOREACH pebbles_defense_benefits i}
{FOREACH pebbles_defense_benefits i}
[if]
[if]
[variable]
[variable]
name=pebbles_defense_length
name=pebbles_defense_length
greater_than_equal_to=$pebbles_defense_benefits[$i].turn
greater_than_equal_to=$pebbles_defense_benefits[$i].turn
[/variable]
[/variable]


[then]
[then]
[insert_tag]
[insert_tag]
name=command
name=command
variable=pebbles_defense_benefits[$i]
variable=pebbles_defense_benefits[$i]
[/insert_tag]
[/insert_tag]
[/then]
[/then]
[/if]
[/if]
{NEXT i}
{NEXT i}


# the player gets 20 extra starting gold for each turn past 22
# the player gets 20 extra starting gold for each turn past 22
[if]
[if]
[variable]
[variable]
name=pebbles_defense_length
name=pebbles_defense_length
greater_than=22
greater_than=22
[/variable]
[/variable]


[then]
[then]
{VARIABLE turns_past_22 $pebbles_defense_length}
{VARIABLE turns_past_22 $pebbles_defense_length}
{VARIABLE_OP turns_past_22 sub 22}
{VARIABLE_OP turns_past_22 sub 22}


{VARIABLE extra_starting_gold 20}
{VARIABLE extra_starting_gold 20}
{VARIABLE_OP extra_starting_gold multiply $turns_past_22}
{VARIABLE_OP extra_starting_gold multiply $turns_past_22}


[gold]
[gold]
side=1
side=1
amount=$extra_starting_gold
amount=$extra_starting_gold
[/gold]
[/gold]
[/then]
[/then]
[/if]
[/if]


{CLEAR_VARIABLE pebbles_defense_benefits,illuminated_locations}
{CLEAR_VARIABLE pebbles_defense_benefits,illuminated_locations}
[/event]
[/event]


[event]
[event]
name=prestart
name=prestart


{VARIABLE village_radius $pebbles_defense_length}
{VARIABLE village_radius $pebbles_defense_length}
{VARIABLE_OP village_radius sub 5}
{VARIABLE_OP village_radius sub 5}


[if]
[if]
[variable]
[variable]
name=village_radius
name=village_radius
less_than=2
less_than=2
[/variable]
[/variable]


[then]
[then]
{VARIABLE village_radius 2}
{VARIABLE village_radius 2}
[/then]
[/then]
[/if]
[/if]


[if]
[if]
[variable]
[variable]
name=village_radius
name=village_radius
greater_than=20
greater_than=20
[/variable]
[/variable]


[then]
[then]
{VARIABLE village_radius 20}
{VARIABLE village_radius 20}
[/then]
[/then]
[/if]
[/if]
[/event]
[/event]


{STARTING_VILLAGES 1 $village_radius}
{STARTING_VILLAGES 1 $village_radius}

#start
[event]
[event]
name=start
name=start
[fire_event]
name=mefel_arrived
[/fire_event]
[/event]
# Phase one: Arrival of Mefel
[event]
name=mefel_arrived
[recall]
[recall]
id=Minister Hylas
id=Minister Hylas
x,y=21,11
x,y=21,11
[/recall]
[/recall]
# The proper fix to Hylas’ overlay is to add `overlays="misc/loyal-icon.png"` to his [unit] tag in 02_Proven_by_the_Sword.cfg. As of now, to make this file working:
[unit_overlay]
id=Minister Hylas
image=misc/loyal-icon.png
[/unit_overlay]
{UNMAKE_HERO "Minister Hylas"}
[recall]
[recall]
id=Jarek
id=Jarek
x,y=21,12
x,y=21,12
[/recall]
[/recall]
[recall]
[recall]
id=Moreth
id=Moreth
x,y=22,12
x,y=22,12
[/recall]
[/recall]


[message]
[message]
speaker=Deoran
speaker=Deoran
message= _ "Look! The undead army has broken through Sir Gerrick’s lines! Alas, he is lost!"
message= _ "Look! The undead army has broken through Sir Gerrick’s lines! Alas, he is lost!"
[/message]
[/message]


[message]
[message]
speaker=Moreth
speaker=Moreth
message= _ "Since I was a boy, Gerrick was my leader, and there was no one braver. Today we shall defend our homes, and avenge him!"
message= _ "Since I was a boy, Gerrick was my leader, and there was no one braver. Today we shall defend our homes, and avenge him!"
[/message]
[/message]


[if]
[if]
[variable]
[variable]
name=provincial_guard
name=provincial_guard
equals=some
equals=some
[/variable]
[/variable]
[variable]
[variable]
name=defenses
name=defenses
equals=some
equals=some
[/variable]
[/variable]
[then]
[then]
[message]
[message]
speaker=Deoran
speaker=Deoran
message= _ "But in the narrow window his valiant stand gave us, we have roused some of the provincial guard and reinforced our defenses!"
message= _ "But in the narrow window his valiant stand gave us, we have roused some of the provincial guard and reinforced our defenses!"
[/message]
[/message]
[/then]
[/then]
[else]
[else]
[if]
[if]
[variable]
[variable]
name=provincial_guard
name=provincial_guard
equals=full
equals=full
[/variable]
[/variable]
[variable]
[variable]
name=defenses
name=defenses
equals=some
equals=some
[/variable]
[/variable]
[then]
[then]
[message]
[message]
speaker=Deoran
speaker=Deoran
message= _ "But in the narrow window his valiant stand gave us, we have roused the whole provincial guard and reinforced our defenses!"
message= _ "But in the narrow window his valiant stand gave us, we have roused the whole provincial guard and reinforced our defenses!"
[/message]
[/message]
[/then]
[/then]
[else]
[else]
[if]
[if]
[variable]
[variable]
name=provincial_guard
name=provincial_guard
equals=full
equals=full
[/variable]
[/variable]
[variable]
[variable]
name=defenses
name=defenses
equals=full
equals=full
[/variable]
[/variable]
[then]
[then]
[message]
[message]
speaker=Deoran
speaker=Deoran
message= _ "But in the narrow window his valiant stand gave us, we have roused the whole provincial guard and fully embattled the city!"
message= _ "But in the narrow window his valiant stand gave us, we have roused the whole provincial guard and fully embattled the city!"
[/message]
[/message]
[/then]
[/then]
[/if]
[/if]
[/else]
[/else]
[/if]
[/if]
[/else]
[/else]
[/if]
[/if]


[message]
[message]
speaker=Lt. Nilaf
speaker=Lt. Nilaf
message= _ "Indeed, Lord, we are ready to defend our homes!"
message= _ "Indeed, Lord, we are ready to defend our homes!"
[/message]
[/message]


[if]
[if]
[variable]
[variable]
name=pebbles_defense_length
name=pebbles_defense_length
less_than=24
less_than=24
[/variable]
[/variable]
[then]
[then]
[message]
[message]
speaker=Minister Hylas
speaker=Minister Hylas
message= _ "I have summoned the great Council of Westin!"
message= _ "I have summoned the great Council of Westin!"
[/message]
[/message]
# wmllint: local spelling Mefel
# wmllint: local spelling Mefel
{NAMED_LOYAL_UNIT 1 (Silver Mage) 11 1 (Minister Mefel) (_"Minister Mefel")}
{NAMED_LOYAL_UNIT 1 (Silver Mage) 11 1 (Minister Mefel) (_"Minister Mefel")}
[message]
[message]
speaker=Minister Mefel
speaker=Minister Mefel
message= _ "Hylas, I have made all possible haste, but my Council brethren are not as swift as I. It will take more time for them to arrive."
message= _ "Hylas, I have made all possible haste, but my Council brethren are not as swift as I. It will take more time for them to arrive."
[/message]
[/message]
{VARIABLE council_arrive_turn 25}
{VARIABLE_OP council_arrive_turn sub $pebbles_defense_length}
{VARIABLE council_arrived false}
[fire_event]
name=waiting_for_council
[/fire_event]
[/then]
[/then]


[else]
[else]
[message]
[message]
speaker=Minister Hylas
speaker=Minister Hylas
message= _ "And I have summoned the great Council of Westin! They will battle with all their might!"
message= _ "And I have summoned the great Council of Westin! They will battle with all their might!"
[/message]
[/message]
{NAMED_LOYAL_UNIT 1 (Silver Mage) 11 1 (Minister Mefel) (_"Minister Mefel")}
{NAMED_LOYAL_UNIT 1 (Silver Mage) 11 1 (Minister Mefel) (_"Minister Mefel")}
{NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
{NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
{NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
{NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
{GENERIC_UNIT 1 (White Mage) 9 1}
{NAMED_LOYAL_UNIT 1 (White Mage) 9 1 (Apprentice Mera) (_"Apprentice Mera")}
{GENERIC_UNIT 1 (White Mage) 13 1}
[+unit]
gender=female
[/unit]
{NAMED_LOYAL_UNIT 1 (White Mage) 13 1 (Apprentice Lirylla) (_"Apprentice Lirylla")}
[+unit]
gender=female
[/unit]
[message]
[message]
speaker=Minister Mefel
speaker=Minister Mefel
message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
[/message]
[/message]
[message]
[message]
speaker=Deoran
speaker=Deoran
message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
[/message]
[/message]
[/else]
[/if]
{VARIABLE council_arrived true}

[message]
speaker=Deoran
message= _ "We have rallied all the forces that we will be able to! Let us not make Sir Gerrick’s sacrifice a vain one. For Wesnoth!"
[/message]

[if]
[variable]
name=pebbles_defense_length
less_than=24
[/variable]
[then]
[objectives]
side=1
[objective]
description= _ "Defeat Mal M’Brin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]

{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}

note= _ "The Council of Westin will arrive on turn $council_arrive_turn|."
[/objectives]
[/then]
[else]
[objectives]
[objectives]
side=1
side=1
[objective]
[objective]
description= _ "Defeat Mal M’Brin"
description= _ "Defeat Mal M’Brin"
condition=win
condition=win
[/objective]
[/objective]
[objective]
[objective]
description= _ "Death of Deoran"
description= _ "Death of Deoran"
condition=lose
condition=lose
[/objective]
[/objective]


{TURNS_RUN_OUT}
{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
{IS_LAST_SCENARIO}
[/objectives]
[/objectives]
[/else]
[/else]
[/if]
[/if]
[/event]


[event]
[message]
name=new turn
speaker=Deoran
first_time_only=no
message= _ "We have rallied all the forces that we will be able to! Let us not make Sir Gerrick’s sacrifice a vain one. For Wesnoth!"

[/message]
[if]
[variable]
[fire_event]
name=council_arrive_turn
name=place_barriers
equals=$turn_number
[/fire_event]
[/variable]
[variable]
name=council_arrive_turn
not_equals=$empty
[/variable]
[then]
{NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
{NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
{GENERIC_UNIT 1 (White Mage) 9 1}
{GENERIC_UNIT 1 (White Mage) 13 1}
[message]
speaker=Minister Romand
message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
[/message]
[message]
speaker=Deoran
message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome."
[/message]

[objectives]
side=1
silent=yes
[objective]
description= _ "Defeat Mal M’Brin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]


{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
[/objectives]
[/then]
[/if]
[/event]
[/event]
# Phase 2: Barriers placed
[event]
name=place_barriers
# Since it is now more realistic to actually achieve those bonuses from Pebbles, we now should put some handicaps to this scenario to even things up
[event]
name=side 1 turn 1 end
{PLACE_BARRIER 26 36 "Mal M'Brin" recruiting 300 17 29 "border_size=1
usage=map


_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f
_f,_f,_f,_f,_f,_f,Xv,Xv,Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f
_f,_f,_f,_f,Xv,Xv,_f,_f,_f,Xv,Xv,_f,_f,_f,_f,_f,_f,_f
_f,_f,Xv,Xv,_f,_f,_f,_f,_f,_f,_f,Xv,Xv,_f,_f,_f,_f,_f
Xv,Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,Xv,_f,_f,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,Xv,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
_f,Xv,Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,_f
_f,_f,_f,Xv,Xv,_f,_f,_f,_f,_f,_f,_f,_f,_f,Xv,Xv,_f,_f
"}
[message]
speaker=Deoran
message=_"Will there never be an end to this heinous magic? Minister Hylas, can you tell what sort of horibleness has he surrounded his encampment with?"
[/message]
[message]
speaker=Minister Hylas
message=_"I fear I sadly can, my Lord. This most likely is the barrier Urza Afalas told us about. No man, barring these abominations, can pass it."
[/message]
[if]
[variable]
name=council_arrived
equals=true
[/variable]
[then]
[message]
speaker=Deoran
message=_"This is dire news indeed. Though Wesnoth can pride itself with magnificent wizards as well. Council of Westin, can you attempt to take this barrier down?"
[/message]
# Deoran is probably a Mounted General now
[message]
speaker=Minister Romand
message=_"We will try as soon as we can get close enough, though this will be challenging endeavor indeed. While none of us can combat this lich alone, united we might stand a chance. Hold the undead, General, and who knows, perhaps you will see us succeed!"
[/message]
[fire_event]
name=council_working
[/fire_event]
[/then]
[else]
[message]
speaker=Deoran
message=_"This is dire news indeed. How can we stand against a foe we cannot even touch?"
[/message]
[message]
speaker=Minister Mefel
message=_"Perhaps not all is yet lost. While none of us can combat this lich alone, united we might stand a chance. As soon as the rest of the Council arrives, we should manage to take this barrier down!"
[/message]
[/else]
[/if]
[event]
name=die
id=loose_if_a_mage_dies
[filter]
type= Red Mage, Arch Mage, Great Mage, Silver Mage, White Mage, Mage of Light
[/filter]
[if]
[variable]
name=unit.id
equals=Minister Hylas
[/variable]
[then]
[if]
[have_unit]
id=Minister Romand
[/have_unit]
[then]
[message]
speaker=Minister Romand
message= _ "All is lost! Without the aid of " + $unit.name + " we cannot undo the evil magic of this lich!"
[/message]
[/then]
[else]
[message]
speaker=Minister Mefel
message=_ "All is lost! Without the aid of " + $unit.name + " we cannot undo the evil magic of this lich!"
[/message]
[/else]
[/if]
[/then]
[else]
[message]
speaker=Minister Hylas
message= _ "All is lost! Without the aid of " + $unit.name + " we cannot undo the evil magic of this lich!"
[/message]
[/else]
[/if]
[endlevel]
result=defeat
[/endlevel]
[/event]
{MAKE_HERO "Minister Hylas"}
{MAKE_HERO "Minister Mefel"}
{MAKE_HERO "Minister Romand"}
{MAKE_HERO "Minister Alanafel"}
{MAKE_HERO "Apprentice Mera"}
{MAKE_HERO "Apprentice Lirylla"}
[event]
name=recruit
first_time_only=no
[filter]
side=2
[/filter]
{CAN_PASS_BARRIER $x1 $y1}
[/event]
# For an extra handicap, disallow luring Mal M’brin outta the castle. Siege him, actually!
{MODIFY_UNIT id="Mal M'Brin" max_moves 0}
[/event]
[/event]
# Phase 2.5: Council on its way
[event]
[event]
name=die
name=waiting_for_council
[objectives]
side=1
[objective]
description= _ "Defeat Mal M’Brin"
condition=win
[/objective]
[objective]
description= _ "Death of Deoran"
condition=lose
[/objective]
[objective]
description= _ "Death of any Council of Westin member"
condition=lose
[/objective]


[filter]
{TURNS_RUN_OUT}
id="Mal M'Brin"
{IS_LAST_SCENARIO}
[/filter]


[endlevel]
note= _ "The Council of Westin will arrive on turn $(24 - $pebbles_defense_length + 1)."
result=victory
[/objectives]
carryover_report=no
save=no
[event]
linger_mode=no
name= "turn $(24 - $pebbles_defense_length + 1)"
[/endlevel]
{NAMED_LOYAL_UNIT 1 (Arch Mage) 10 1 (Minister Romand) (_"Minister Romand")}
{NAMED_LOYAL_UNIT 1 (Red Mage) 12 1 (Minister Alanafel) (_"Minister Alanafel")}
{NAMED_LOYAL_UNIT 1 (White Mage) 9 1 (Apprentice Mera) (_"Apprentice Mera")}
[+unit]
gender=female
[/unit]
{NAMED_LOYAL_UNIT 1 (White Mage) 13 1 (Apprentice Lirylla) (_"Apprentice Lirylla")}
[+unit]
gender=female
[/unit]
[message]
speaker=Minister Romand
message= _ "We have heard your summons, and we shall send these dark foes back to the abyss that spawned them!"
[/message]
[message]
speaker=Deoran
message= _ "Council of Westin, we are cheered by your presence. Your aid will be most welcome, and most needed at this hour of trial. As you can see, the lich has surrounded himself with an enchanted barrier that makes it impossible for us to put an end to his evil ways. Can you raze his magic?"
[/message]
[message]
speaker=Minister Romand
message=_"We can try as soon as we can get close enough. Hold the undead, General, and who knows, perhaps you will see us succeed!"
[/message]
{VARIABLE council_arrived true}
[fire_event]
name=council_working
[/fire_event]
[/event]
[/event]
[/event]


# in order to allow Hylas to die, the death events aren't included from the
# Phase 3: Council arrived and working
# standard location here
[event]
[event]
name=last breath
name=council_working
[filter]
id=Deoran
[objectives]
[/filter]
side=1
[message]
[objective]
speaker=unit
description= _ "Defeat Mal M’Brin"
image=portraits/deoran-sad.png
condition=win
message= _ "I have failed my kingdom and duty..."
[/objective]
[/message]
[objective]
[endlevel]
description= _ "Death of Deoran"
result=defeat
condition=lose
[/endlevel]
[/objective]
[objective]
description= _ "Death of any Council of Westin member"
condition=lose
[/objective]
note= _ "Note: The mages will take the barrier down as soon as all are placed adjacent to it."

{TURNS_RUN_OUT}
{IS_LAST_SCENARIO}
[/objectives]
[event]
name=moveto
id=check_if_all_mages_hug_barrier_each_move
# There is no mage who is not positioned adjacent to the barrier
[filter_condition]
[not]
[have_unit]
type= Red Mage, Arch Mage, Great Mage, Silver Mage, White Mage, Mage of Light
[filter_location]
[not]
x=16,15,15,15,15,15,15,15,15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,33,33,33,33,33,33
y=40,40,39,38,37,36,35,34,33,32,31,31,30,30,29,29,28,28,28,29,29,30,30,31,31,32,32,33,34,35,36,37,38,39,40
[/not]
[/filter_location]
[/have_unit]
[/not]
[/filter_condition]
[fire_event]
name=barriers_down
[/fire_event]
[/event]
[/event]
[/event]
# Phase 4: Barriers down
[event]
[event]
name=last breath
name=barriers_down
[filter]
id=Minister Hylas
[/filter]
[message]
[message]
speaker=unit
speaker=Minister Romand
image=portraits/hylas.png
message= _ "Everyone focus…"
message= _ "Now I will never see Westin free again..."
[/message]
[/message]
[/event]
{UNMAKE_HERO "Minister Hylas"}
{UNMAKE_HERO "Minister Mefel"}
{UNMAKE_HERO "Minister Romand"}
{UNMAKE_HERO "Minister Alanafel"}
{UNMAKE_HERO "Apprentice Mera"}
{UNMAKE_HERO "Apprentice Lirylla"}
{PLACE_BARRIER 26 36 "Mal M'Brin" recruiting 300 17 29 "border_size=1
usage=map


[event]
_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f
name=last breath
_f, _f, _f, _f, _f, _f, Re, Gd^Fmw, Hhd, _f, _f, _f, _f, _f, _f, _f, _f, _f
[filter]
_f, _f, _f, _f, Gd^Fmw, Gd^Fmw, _f, _f, _f, Gs^Fmw, Hhd, _f, _f, _f, _f, _f, _f, _f
id=Jarek
_f, _f, Gd, Gd, _f, _f, _f, _f, _f, _f, _f, Hhd, Hhd, _f, _f, _f, _f, _f
[/filter]
Gs^Fp, Gd, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, Mm, Mm, _f, _f, _f
[message]
Gd, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, Mm, Mm, _f
speaker=unit
Gd, _f, _f, _f, _f, _f, _f,
message= _ "Far from home I fall — but not in vain! Guard our people, Deoran!"
[/message]
[/event]
[/scenario]