-- 	Stratagus Map - Single player campaign

Load("campaigns/orc/level02o_c2.sms")

Briefing(
  title,
  objectives,
  "../campaigns/orc/interface/introscreen1.png",
  "campaigns/orc/level02o.txt",
  {"campaigns/orc/level02o-intro1.wav"}
)

Triggers = [[
HaveUnitSharpAxe = nil

AddTrigger( 
  function() return GetPlayerData(2, "UnitTypesCount", "unit-sharp-axe") == 0 and
    IfRescuedNearUnit("this", "==", 1, "unit-sharp-axe", "unit-circle-of-power") end,
  function() return ActionVictory() end)
  
AddTrigger( 
  function() return GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-sharp-axe") == 1 end,
  function() HaveUnitSharpAxe=true; return false end)
  
AddTrigger(
  function() return GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-sharp-axe") == 0 and
    HaveUnitSharpAxe ~= nil end,
  function() return ActionDefeat() end)
	
AddTrigger(
  function() return GetPlayerData(GetThisPlayer(), "TotalNumUnits") == 0 end,
  function() return ActionDefeat() end)
]]

assert(loadstring(Triggers))()

-- Units

-- Townhall - Produces
DefineAllow("unit-peasant", "AAAAAAAAAAAAAAAA")

DefineAllow("unit-peon", "AAAAAAAAAAAAAAAA")

-- Barracks - Produces
DefineAllow("unit-footman", "AAAAAAAAAAAAAAAA")
DefineAllow("unit-archer", "AAAAAAAAAAAAAAAA")
  DefineAllow("unit-ranger", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-knight", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-paladin", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-ballista", "FFFFFFFFFFFFFFFF")

DefineAllow("unit-grunt", "AAAAAAAAAAAAAAAA")
DefineAllow("unit-axethrower", "AAAAAAAAAAAAAAAA")
  DefineAllow("unit-berserker", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-ogre", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-ogre-mage", "FFFFFFFFFFFFFFFF")
    DefineAllow("unit-eye-of-vision", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-catapult", "FFFFFFFFFFFFFFFF")

-- Shipyard - Produces
DefineAllow("unit-human-oil-tanker", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-destroyer", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-transport", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-battleship", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-submarine", "FFFFFFFFFFFFFFFF")

DefineAllow("unit-orc-oil-tanker", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-transport", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-destroyer", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-ogre-juggernaught", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-submarine", "FFFFFFFFFFFFFFFF")

-- Other Buildings
DefineAllow("unit-balloon", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-gryphon-rider", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-mage", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-dwarves", "FFFFFFFFFFFFFFFF")

DefineAllow("unit-zeppelin", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-dragon", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-death-knight", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-goblin-sappers", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-skeleton", "FFFFFFFFFFFFFFFF")

-- Human Specials
DefineAllow("unit-female-hero", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-flying-angel", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-white-mage", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-knight-rider", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-arthor-literios", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-wise-man", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-man-of-light", "FFFFFFFFFFFFFFFF")

-- Building Human
DefineAllow("unit-town-hall", "AAAAAAAAAAAAAAAA")
  DefineAllow("unit-keep", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-castle", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-barracks", "AAAAAAAAAAAAAAAA")
DefineAllow("unit-farm", "AAAAAAAAAAAAAAAA")
DefineAllow("unit-human-blacksmith", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-sword1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-sword2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-human-shield1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-human-shield2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-ballista1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-ballista2", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-watch-tower", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-human-guard-tower", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-human-cannon-tower", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-elven-lumber-mill", "AAAAAAAAAAAAAAAA")
  DefineAllow("upgrade-arrow1", "AAAAAAAAAAAAAAAA")
  DefineAllow("upgrade-arrow2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-ranger", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-longbow", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-ranger-scouting", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-ranger-marksmanship", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-church", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-paladin", "FFFFFFFFFFFFFFFF")
-- DefineAllow("upgrade-holy-vision", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-healing", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-exorcism", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-stables", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-inventor", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-gryphon-aviary", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-shipyard", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-refinery", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-oil-platform", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-foundry", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-human-ship-cannon1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-human-ship-cannon2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-human-ship-armor1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-human-ship-armor2", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-mage-tower", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-flame-shield", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-fireball", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-slow", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-invisibility", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-polymorph", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-blizzard", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-wall", "FFFFFFFFFFFFFFFF")

-- Orc Specials
DefineAllow("unit-evil-knight", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-fad-man", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-beast-cry", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-fire-breeze", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-quick-blade", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-double-head", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-ice-bringer", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-sharp-axe", "FFFFFFFFFFFFFFFF")


DefineAllow("unit-great-hall", "AAAAAAAAAAAAAAAA")
  DefineAllow("unit-stronghold", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-fortress", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-barracks", "AAAAAAAAAAAAAAAA")
DefineAllow("unit-pig-farm", "AAAAAAAAAAAAAAAA")
DefineAllow("unit-orc-blacksmith", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-battle-axe1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-battle-axe2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-orc-shield1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-orc-shield2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-catapult1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-catapult2", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-watch-tower", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-orc-guard-tower", "FFFFFFFFFFFFFFFF")
  DefineAllow("unit-orc-cannon-tower", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-troll-lumber-mill", "AAAAAAAAAAAAAAAA")
  DefineAllow("upgrade-throwing-axe1", "AAAAAAAAAAAAAAAA")
  DefineAllow("upgrade-throwing-axe2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-berserker", "FFFFFFFFFFFFFFFF")
    DefineAllow("upgrade-light-axes", "FFFFFFFFFFFFFFFF")
    DefineAllow("upgrade-berserker-scouting", "FFFFFFFFFFFFFFFF")
    DefineAllow("upgrade-berserker-regeneration", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-altar-of-storms", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-ogre-mound", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-ogre-mage", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-eye-of-kilrogg", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-bloodlust", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-runes", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-alchemist", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-dragon-roost", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-shipyard", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-foundry", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-orc-ship-cannon1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-orc-ship-cannon2", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-orc-ship-armor1", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-orc-ship-armor2", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-temple-of-the-damned", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-death-coil", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-whirlwind", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-haste", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-unholy-armor", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-death-and-decay", "FFFFFFFFFFFFFFFF")
  DefineAllow("upgrade-raise-dead", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-refinery", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-oil-platform", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-wall", "FFFFFFFFFFFFFFFF")

-- Specials
DefineAllow("unit-daemon", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-critter", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-gold-mine", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-oil-patch", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-circle-of-power", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-dark-portal", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-runestone", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-human-dead-body",			"FFFFFFFFFFFFFFFF")
DefineAllow("unit-orc-dead-body",			"FFFFFFFFFFFFFFFF")
DefineAllow("unit-dead-sea-body",			"FFFFFFFFFFFFFFFF")
DefineAllow("unit-destroyed-1x1-place", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-destroyed-2x2-place", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-destroyed-3x3-place", "FFFFFFFFFFFFFFFF")
DefineAllow("unit-destroyed-4x4-place", "FFFFFFFFFFFFFFFF")

Load("campaigns/orc/level02o.sms")
