Murphy613
Prince
- Joined
- Nov 18, 2012
- Messages
- 483
(Just want to warn you that this is the first of what will probably dozens of questions.)
I've worked a bit and come up with this:
Firstly, where do I add the civ requirement? (I just noticed the irony - I randomly chose Egypt as an example for a 'River of Blood' spell.
) Next, how do I trigger a lua code in Firetuner? Lastly (for now) at what words do I need to put an 'end'? I know I have to do it for each 'if'.
I've worked a bit and come up with this:
Code:
function RiverOfBlood()
local user = Game.GetActivePlayer()
for city in player:Cities() do
local city = playerCap:GetPopulation()
if cityPop >= 3 then
city:SetPopulation((playerPop - 2), true)
elseif cityPop == 2 then
city:SetPopulation((playerPop - 1), true)
end
end
for i = 0, GameDefines.MAX_MAJOR_CIVS - 1, 1 do
local pPlayer = Players[i]
if pPlayer:IsEverAlive() then
pPlayer:AddNotification(NotificationTypes.NOTIFICATION_GENERIC, "A player has cast River of Blood, increasing the population of their cities and decreasing the population of all others!", "A player has cast River of Blood!")
end
end
end
) Next, how do I trigger a lua code in Firetuner? Lastly (for now) at what words do I need to put an 'end'? I know I have to do it for each 'if'.