Code: Select all
local germany = game:GetFactionById(2)
local austria = game:GetFactionById(3)
local berlin = GetHex(101, 22)
local budapest = GetHex(108, 33)
if GetEvent("FortressGarrisons") == 0 then
if berlin.alliance.id == 0
and germany.alliance.id == 0
and berlin.unit == nil then
SpawnUnit(0, germany, 101, 22, 0, 100)
germany:ConsumeManpower(10)
end
if austria.alliance.id == 2
and budapest.alliance.id == 2 then
local hexes = game.map:GetHexesInRange(budapest, 4)
for _, hex in pairs(hexes) do
if hex.unit ~= nil
and hex.unit.faction.alliance.id == 1
and hex.unit.type == Unit.LAND then
SpawnUnit(0, austria, 108, 33, 0, 100)
austria:ConsumeManpower(10)
end
end
end