--	Stratagus Map - Single player campaign

Load("campaigns/human/level03h_c2.sms")

Briefing(
  title,
  objectives,
  "../campaigns/human/interface/introscreen1.png",
  "campaigns/human/level03h.txt",
  {"campaigns/human/level03h-intro1.wav",
   "campaigns/human/level03h-intro2.wav"}
)

AddTrigger(
  function() return GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-human-shipyard") >= 1 and
    GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-human-oil-platform") >= 4 end,
  function() return ActionVictory() end)
AddTrigger(
  function() return GetPlayerData(GetThisPlayer(), "TotalNumUnits") == 0 end,
  function() return ActionDefeat() end)

--Units
local allowedHumanUnits = {"unit-farm",
	"unit-town-hall", "unit-peasant",
	"unit-human-barracks", "unit-footman", "unit-archer",
	"unit-elven-lumber-mill", "upgrade-arrow1", "upgrade-arrow2",
	"unit-human-shipyard", "unit-human-oil-tanker", "unit-human-destroyer",
	"unit-human-oil-platform"
}
local allowedOrcUnits = {"unit-pig-farm",
	"unit-great-hall", "unit-peon",
	"unit-orc-barracks", "unit-grunt", "unit-axethrower",
	"unit-troll-lumber-mill", "upgrade-throwing-axe1", "upgrade-throwing-axe2",
	"unit-orc-shipyard", "unit-orc-oil-tanker", "unit-orc-destroyer",
	"unit-orc-oil-platform"
}
local function DefineAllowTable(table, flags)
	for i, unitName in ipairs(table) do
		DefineAllow(unitName, flags)
	end
end

DefineAllowNormalHumanUnits("FFFFFFFFFFFFFFFF")
DefineAllowExtraHumanUnits("FFFFFFFFFFFFFFFF")
DefineAllowNormalOrcUnits("FFFFFFFFFFFFFFFF")
DefineAllowExtraOrcUnits("FFFFFFFFFFFFFFFF")
DefineAllowSpecialUnits("FFFFFFFFFFFFFFFF")
DefineAllowHumanAlways()
DefineAllowOrcAlways()
DefineAllowTable(allowedHumanUnits, "AAAAAAAAAAAAAAAA")
DefineAllowTable(allowedOrcUnits, "AAAAAAAAAAAAAAAA")



Load("campaigns/human/level03h.sms")
