AW Arcaeca
Deus Vult
Either way, I feel bad semi-derailing AW's thread, so I'll not investigate further, haha.
No, no! It's all very interesting and there's always the possibility that I might need to use it in the future.
You two have been very helpful, and I've basically been able to draft these two codes:
This one deals with #2...
Spoiler :
Code:
GameEvents.CityCaptureComplete.Add(
function(iPlayer, _, iX, iY, mPlayer, bConquest)
local pPlayer = Players[iPlayer]
local pCity = Map.GetPlot(iX, iY):GetPlotCity()
if (pPlayer ~= Players[mPlayer]) and (bConquest) then
if (pCity:IsHasBuilding(GameInfoTypes.BUILDING_MARKER_BUILDING_1)) then
Players[mPlayer]:Disband(pCity)
else
return
end
end
end)

Spoiler :
Code:
GameEvents.CityCanTrain.Add(
function(_, iCity, iUnitType)
local pPlot = Map.GetPlot(iCity:GetX(), iCity:GetY())
if (iCity:IsHasBuilding(GameInfoTypes.BUILDING_MARKER_BUILDING_2)) then
for direction = 0, DirectionTypes.NUM_DIRECTION_TYPES - 1, 1 do
local pAdjacentPlot = Map.PlotDirection(pPlot:GetX(), pPlot:GetY(), direction)
if pAdjacentPlot and pAdjacentPlot:IsLake() then
for row in GameInfo.Units() do
if (row.Type == iUnitType) and (row.Domain == GameInfoTypes.DOMAIN_SEA) then
return true
else
return
end
end
else
return
end
end
else
return
end
end)
