Code: Select all
if GetEvent("DOWspain") == game.turn then
SetWarEffort(15, 60)
end
Moderators: Slitherine Core, The Lordz
Code: Select all
if GetEvent("DOWspain") == game.turn then
SetWarEffort(15, 60)
end
Code: Select all
if GetEvent("DOWspain") == game.turn then
SetWarEffort(15, 60)
end
local spain = game:GetFactionById(15)
LogUi("SPANISH WAR EFFORT IS SET TO: " .. spain.luaData.warEffort
Code: Select all
if GetEvent("DOWspain") == game.turn then
SetWarEffort(15, 60)
end
local spain = game:GetFactionById(15)
LogUi("SPANISH WAR EFFORT IS SET TO: " .. spain.luaData.warEffort)
Code: Select all
GetEvent("EXAMPLE") == game.turn
Code: Select all
if GetEvent("DOWitaly") == game.turn then
SetEvent("SpainJoinsWar", game.turn)
end
if GetEvent("SpainJoinsWar") >0
and GetEvent("SpainJoinsWar") +2 == game.turn then
if italy.alliance.id == 2 then
local luck = math.random(1,6)
if luck <= 3 then
SetFactionAlignment(15, math.random(95,100))
SetEvent("SpainJoinsWar1", game.turn)
SetWarEffort(15, 60)
elseif luck > 3 and luck <= 5 then
SetEvent("SpainJoinsWar2", game.turn)
SetWarEffort(15, 60)
elseif luck == 6 then
SetFactionAlignment(15, math.random(0,5))
SetEvent("SpainJoinsWar3", game.turn)
SetWarEffort(15, 60)
end
end
end
Code: Select all
if GetEvent("SpainJoinsWar") >0
and GetEvent("SpainJoinsWar") +2 == game.turn then
SetWarEffort(15, 60)
end
Code: Select all
if GetEvent("SpainJoinsWar") +2 == game.turn then
SetWarEffort(15, 60)
end
Code: Select all
GetEvent("SpainJoinsWar") >0
Code: Select all
if GetEvent("DOWitaly") == game.turn then
SetEvent("SpainJoinsWar", game.turn)
end
if GetEvent("SpainJoinsWar") >0
and GetEvent("SpainJoinsWar") +2 == game.turn then
if italy.alliance.id == 2 then
local luck = math.random(1,6)
if luck <= 3 then
SetFactionAlignment(15, math.random(95,100))
SetEvent("SpainJoinsWar1", game.turn)
SetEvent("SpainJoinsWar", -1)
elseif luck <= 5 then
SetEvent("SpainNeutral", game.turn)
SetEvent("SpainJoinsWar", -1)
elseif luck == 6 then
SetFactionAlignment(15, math.random(0,5))
SetEvent("SpainJoinsWar2", game.turn)
SetEvent("SpainJoinsWar", -1)
end
end
end
if GetEvent("DOWspain") == game.turn then
SetWarEffort(15, 60)
end
Code: Select all
function SpainWarEffort()
if GetEvent("DOWspain") > 0
and spain.luaData.warEffort < 100 then
local luck = math.random(1,12)
if luck <= 12 then
if spain.alliance.id == 1 then
spain.luaData.warEffort = spain.luaData.warEffort + 10
france.ConsumeProductionPoints(5)
britain.ConsumeProductionPoints(10)
elseif spain.alliance.id == 2 then
spain.luaData.warEffort = spain.luaData.warEffort + 10
germany.ConsumeProductionPoints(15)
end
end
end
end
Code: Select all
[19:22:37][11348]game/game_events.lua:14646(global SpainWarEffort) game/game_events.lua:14646: attempt to index global 'spain' (a nil value)
Code: Select all
[19:22:37][11348]game/game_events.lua:14646(global SpainWarEffort) game/game_events.lua:14646: attempt to index global 'spain' (a nil value)
Code: Select all
attempt to index global 'spain' (a nil value)
Code: Select all
and spain.luaData.warEffort < 100 then
Code: Select all
local spain = game:GetFactionById(15)
Code: Select all
local luck = math.random(1,12)
if luck <= 12 then
(...)
end
Code: Select all
function SpainWarEffort()
local spain = game:GetFactionById(15)
local germany = game:GetFactionById(2)
if spain.alliance.id ~= 0
and spain.luaData.warEffort < 100 then
local luck = math.random(1,12)
if luck == 12 then
if spain.alliance.id == 1 then
spain.luaData.warEffort = spain.luaData.warEffort + 10
france:ConsumeProductionPoints(5)
britain:ConsumeProductionPoints(10)
SetEvent("SpainWarEffort", game.turn)
elseif spain.alliance.id == 2 then
spain.luaData.warEffort = spain.luaData.warEffort + 10
germany:ConsumeProductionPoints(15)
SetEvent("SpainWarEffort", game.turn)
end
end
end
end