Code: Select all
function FrenchArmyOfAfrica()
local france = game:GetFactionById(0)
local germany = game:GetFactionById(2)
if GetEvent("FrenchArmyOfAfrica") == 0 then
if game.date.year == 1914 and math.random(0,4) <= game.turn and game.turn <= 3 then
if player.alliance.id == 1 or game.type == Game.TYPE_SINGLE then
local hex = GetHex(54, 62)
hex.unit:Kill()
local hex = GetHex(77, 55)
hex.unit:Kill()
local hex = GetHex(89, 54)
hex.unit:Kill()
SpawnUnit(21, france, 54, 62, 0, 100)
SpawnUnit(21, france, 77, 55, 0, 100)
SpawnUnit(21, france, 89, 54, 0, 100)
SpawnUnit(1, france, 76, 55, 0, 100)
elseif player.alliance.id == 2 then
local hex = GetHex(54, 62)
hex.unit:Kill()
local hex = GetHex(77, 55)
hex.unit:Kill()
local hex = GetHex(89, 54)
hex.unit:Kill()
SpawnUnit(21, france, 54, 62, 0, 100)
SpawnUnit(21, france, 77, 55, 0, 100)
SpawnUnit(21, france, 89, 54, 0, 100)
SpawnUnit(1, france, 76, 55, 0, 100)
end
SetEvent("FrenchArmyOfAfrica", game.turn, hex)