Is this possible?

Bad Player

Deity
Joined
Oct 31, 2005
Messages
3,534
Location
(Bris)Vegas!
Hi I was thinking about a campaign consisting of multiple scenarios for the Lanun entitled King of the Corsairs, Ruler of the Seas. But I want you to be a third Lanun leader who tries to unite the other two Lanun tribes under your banner. So what this means is that I would want to have each new scenario map (which would be a larger map than the previous, usually including more civilizations) remember your city locations and the other leaders' city locations (if they are still around).

But the question is - can I do this...?
 
Hi I was thinking about a campaign consisting of multiple scenarios for the Lanun entitled King of the Corsairs, Ruler of the Seas. But I want you to be a third Lanun leader who tries to unite the other two Lanun tribes under your banner. So what this means is that I would want to have each new scenario map (which would be a larger map than the previous, usually including more civilizations) remember your city locations and the other leaders' city locations (if they are still around).

But the question is - can I do this...?

Possible, but not too easy. It would involve saving the relevant information in an external file (probably using Python to do set up a datafile) on completion of one scenario, then load it back in once the second scenario is started.

It's just going to be a case of building it up slowly though. Saving where cities are and putting them back in the right place - not too hard. Changing their population to match and putting the buildings back, bit trickier, but not too bad.

I'd probably suggest having enough time between the "scenarios" in the history that you don't need to respawn all the units - this prevents any issues with carrying an army of doom into the next scenario and finding it ridiculously easy. Just spawn a few defensive units on any city. You could however store whether a hero has been killed or not - making them available for the later scenarios.

==

Short version: Possible - yes. Easy - no.

I feel fairly comfortable editing python in general, but this one would give me some trouble/take some time I think if it were me doing the work - so bear that in mind when choosing what you want to save between scenarios - the more you save, the harder it's going to be for you to implement.
 
Hmm OK thanks then - I'm just thinking of whether it's actually possible at this stage rather than planning on doing it - if it's too hard then I won't (plus I actually have to learn python to do this!).

One question on that - if you have a e.g. tiny map and then save city coordinates would it be possible to transfer them to the next size up map (small) by a method such as taking the Origin (tiny) at top left of tiny map and to transfer coordinates to a small map just add e.g. Origin (small) + 50 for x and + 50 for y? Basically to move the tiny map inside a small map.

The other idea I had was to set your traits after the first scenario (based on your actions in that map) - do you think that's possible?

Another one is that if you destroy a particular leader (e.g. falamar) then they wouldn't be in the next scenario - is that possible maybe?

(This project idea might well be headed to the too hard basket but I may as well ask...)
 
As this method will be rather jury rigged yes, it is quite possible. As stated it will be difficult, but, you can easily perform a co-ordinate transformation, i.e. [2*(x,y)] (if you wanted to zoom on a particular section, then enable no settlers or some such, you would need to truncate the value and either only have mountains in very specific locations or have an invalid city placement algorithm [hella difficult]) or [x+100] (if you were zooming out, by creating a map that was larger wherein the old map is the upper right hand corner of the new map. It is a wicked neat idea, do you program much at all?

If so, simply think of it as a serialization of a grid (or map as it is likely to be a sparse data array) simply query for the locations of the cities on map end*. After that you can make the map for the scenario and then use python to unwrap the city locations and associated values. For compatibility purposes I'd avoid not saving buildings, as the only safe way to do so would be to map the actual building names (whether inline [A TON OF WASTED SPACE] or as a header [complex and quite prone to errors])

For traits, it would be easier than the city locations to simply include in the file, however you would need to evaluate the players actions some how, and that would be hella impressive (judge a player as being aggressive as opposed to expansive in some non-trivial way)

As for leaders, that is also quite possible, it will simply be a matter of figuring out the specifics of the .WBS file format and finding a way to trigger a call to write one and then interpret it without an auxiliary executable.

Anyways, your idea sounds quite neat and I wish you the best of luck with it.

*tangent: maybe their population too, for decay or growth depending on plotiness, it would also be wicked cool to say destroy the three easternmost cities and replace them with ruins to represent the player coming to power after a corrupted or weak leader had driven the country to ruin, oh so cool! *giddiness*
 
S_B yeah the idea was to incorporate the previous map into the next one in the campaign so as long as it uses map coordinates just adding e.g. [x + 100], [y + 100] for city placement should work in theory. If there's a way to query for city coordinates and number of cities at map end then it should be OK. I assume there must be a way to save to a data file of some kind (I think Kael must have done this with trophies in pre-BTS Fire phase).

Programming skillz include some reasonably good stuff IMO in QBASIC years ago!...

I hadn't thought about the expansive trait (but I had some basic ideas for the others) but the expansive trait is a healthiness trait so I was thinking things like:

Aggressive - you were at war for >50% of all turns (but it's a matter of whether this can be queried at end of map)

Expansive - you had at least 4 granaries or perhaps had at least 3 cities >8 people (Civ 4 BTS cathedrals require that you have a certain number of temples so therefore BTS must be able to count how many granaries your civ has somehow)

Financial - you had at least 1000 gold at some stage (as soon as it happens write it to a data file that you satisfied this condition).

etc - ideas are easy but thinking of an implementation is hard. So I'm just trying to get a rough idea of how to do something before deciding whether to do it (rather than start and then end).
 
This actually leads me to something that have caught my attention a few times - and I've seen some questions about it in other threads. Is it possible for multi-map/multi-scenario in Civ/Fall from heaven. For example:

Scenario 1, free your land from the orkish hordes

Scenario 2, conquer the island in the east that according to history and legend belongs to your people

Scenario 3, with the recourses from all the land and cities you've taken, defeat the evil alliance of the Svartalfar and Sheaim

Scenario's where you'd either just keep some top units and technologies, or actually an expanding multimap of some kind.

Of course only wild fantasies. :mischief:
 
Does anyone know of a mod that creates cities with python so I could copy and paste that work (with permission I assume)?


Thanks to Snarko's help on #erebus there is a cyplayer function (refer http://civilization4.net/files/modding/PythonAPI/ ) to spawn a city at certain coordinates:
CyCity initCity(INT x, INT y)
initCity( plotX, plotY ) - spawns a city at x,y




Artic circle if I understand you correctly you might be thinking of what I am talking about - play a tiny map or two then copy city locations of those maps into a larger scenario map (e.g. the top left and right corners of that map but the rest is new) where you play against the Svartalfar and Sheiam.
 
Sounds awesome. Have you played a RTS called The Moon Project? It had a similar concept... you kept both research and units between missions, so you get the feel of a gradual building up where early game choices still matter in end missions. I really, really like that concept.

Here's a flaw in it, though: the problem with Moon Project is that, because there's generally no time limit on any given mission, the tendency is to research and build up as much as possible, so you'll be super powerful in the next mission. Which meant that a lot of the mid-late game missions were really easy. Keep that in mind -- allowing the player to perfect and amass a mighty horde in the first scenario means the others may be pushovers. And this isn't even easy to account for, as if the player discovers the later scenarios to be very hard, he'll overcompensate by making an even more formidable horde in the earlier missions.

So, my recommendations:
1) Put a tech cap on each scenario, so you can't start the second scenario with endgame tech.
2) Have a 2/city unit limit at the start of each scenario, so you aren't ready to wage the final war right out of the gate, even if you had a massive stack in the last one; explain it by saying that after the war ended, many of the soldiers settled down and retired, and the military shrunk to a fraction of its former size, until a new threat was unveiled.

Yeah. Cool idea, but would require a lot of work to implement. If you get it working, I'll definitely play it.
 
Sounds awesome. Have you played a RTS called The Moon Project? It had a similar concept... you kept both research and units between missions, so you get the feel of a gradual building up where early game choices still matter in end missions. I really, really like that concept.

Here's a flaw in it, though: the problem with Moon Project is that, because there's generally no time limit on any given mission, the tendency is to research and build up as much as possible, so you'll be super powerful in the next mission. Which meant that a lot of the mid-late game missions were really easy. Keep that in mind -- allowing the player to perfect and amass a mighty horde in the first scenario means the others may be pushovers. And this isn't even easy to account for, as if the player discovers the later scenarios to be very hard, he'll overcompensate by making an even more formidable horde in the earlier missions.

So, my recommendations:
1) Put a tech cap on each scenario, so you can't start the second scenario with endgame tech.
2) Have a 2/city unit limit at the start of each scenario, so you aren't ready to wage the final war right out of the gate, even if you had a massive stack in the last one; explain it by saying that after the war ended, many of the soldiers settled down and retired, and the military shrunk to a fraction of its former size, until a new threat was unveiled.

Yeah. Cool idea, but would require a lot of work to implement. If you get it working, I'll definitely play it.

Yeah I was planning on a tech cap. :) Units - was not sure what to do exactly.
 
From the IRC chat in #erebus - this...

Code:
for iPlayer in range(gc.getMAX_PLAYERS()):
	apCityList = PyPlayer(iPlayer).getCityList()
	for pCity in apCityList:
		iX = pCity.getX()
		iY = pCity.getY()
		iPop = pCity.getPopulation()
		...
		etc		
		...
		(save them however you want here)
 
I was trawling through the python files for some mods and I found this file listed for general use with mods. From Desert War scenario for Vanilla Civ4:
Spoiler :
Code:
# Get Cities From WBS
# by Wouter "Locutus" Snijders - 2005-08-05
# Extracts city names from a WBS file for use in other Python scenario scripts

# Instructions
# You can use this script to automatically generate Python code that initialises
# city variables of all cities in a WBS (WorldBuilderSave) file. This is useful
# when creating code for scenarios that deals with a lot of pre-placed cities.
#
# Warning: while this script should be perfectly safe, one can never be careful 
# enough. So back up your files (esp. your WBS file) before you use this script.
# Especially if you start messing with the code below...
#
# This script will run when and only when (1) the variable self.runScript (see
# below) is set to True, (2) this file is part of an active mod (by default it's
# part of the Desert War scenario, but you can place it in any other mod folder
# too) and (3) it's imported from any other Python file in that mod. To import
# it into an existing script file, place the following line (without the
# preceeding #) below the line 'from CvPythonExtensions import *' in that file:
#
# import GetCitiesFromWBS
#
# You can set the WBS file that the script uses to extract cities from in the
# variable self.filePath below. By default, the code that is generated is placed
# in GetCitiesFromWBS.txt in your main Civ4 folder. To use, put the code from
# that file near the top of CvMod.py (or in whatever file you're putting your
# own code): after the imports but before any class definition. Also add the
# following function below it (without the preceeding #s):
#
# def getCity(tCoords):
#	'Returns a city at coordinates tCoords.'
#	return CyGlobalContext().getMap().plot(tCoords[0], tCoords[1]).getPlotCity()
#
# When you do this, you can within CvMod.py refer to a pre-placed city as
# getCity(t<city name>) and outside CvMod.py as CvMod.getCity(t<city name>),
# where you should remove any spaces and the special characters ', `, " and -
# from the name. So New York becomes tNewYork and 's-Hertogenbosch becomes
# tsHertogenbosch. See CvDesertWar.py as an example of the result of this script
# in action.

class GetCitiesFromWBS:
	def __init__(self):
		# set this to True to run the script, to False to ignore it
		self.runScript = False
		
		# path of the WBS file, from the main Civ4 folder
		self.filePath = 'PublicMaps/DesertWar.Civ4WorldBuilderSave'

		# set this to the name of the output file
		self.outputFile = 'GetCitiesFromWBS.txt'

		# set this to the format of the output
		self.formatStr = 't%s = (%s, %s)\n'

		# set this to the list of characters that should be removed from the city name
		self.unwantedCharList = ["'", '"', '-', '`', ' ']
	def run(self):
		if self.runScript:
			wbsFile = open(self.filePath, 'r')
			citiesFile = open(self.outputFile, 'w')

			# read every line from the WBS
			strLine = wbsFile.readline()
			while strLine:
				# store the last known set of coordinates
				iBeginX = strLine.find('x=')
				if iBeginX != -1:
					iEndX = strLine.find(',', iBeginX)
					if iEndX != -1:
						iBeginY = strLine.find('y=', iEndX)
						if iBeginY != -1:
							strX = strLine[iBeginX+2:iEndX]
							strY = strLine[iBeginY+2:-1]

				# look for a city name
				iBeginCity = strLine.find('CityName=')
				if iBeginCity != -1:
					strCityName = strLine[iBeginCity+9:-1]

					# remove unwanted characters
					strCityName = self.remove(strCityName, self.unwantedCharList)

					# write the city name and the last known set of coordinates to file
					citiesFile.write(self.formatStr %(strCityName, strX, strY))

				# continue with next line
				strLine = wbsFile.readline()

			wbsFile.close()
			citiesFile.close()
	
	def remove(self, strCityName, cUnwantedList):
		'Remove unwanted character char from cityStr.'
		for cUnwanted in cUnwantedList:
			if cUnwanted == ' ':
				lParts = strCityName.split()
			else:
				lParts = strCityName.split(cUnwanted)
			strCityName = ''
			for strPart in lParts:
				strCityName += strPart
			return strCityName

def runGetCitiesFromWBS():
	app = GetCitiesFromWBS()
	app.run()

runGetCitiesFromWBS()

So I looked in DesertWar.py and Greekworld.py and they have a list of cities (with a t prefix) and what looks like the x,y coordinates. However, in the Greekworld mod at any rate, the city of Rome is not founded at the beginning of the mod although the settlers start on that tile. So I'm quite confused...

Is this the magical code I have been looking for that will save all cities for use in another python file (ie for the next scenario)?

Is this functionally different to Vehem's example code? This desert war one says it is plug and play though.


Also I added a line to the Greekworld.py saying initCity(40,40) - or something like 40,40 (just a clear tile on the map) but no city was founded there. Did I need to add more info to the initcity command? Did I put it in an incorrect spot possibly?
 
As I am understanding this bit of code, it will only change the WBS file, not the current game. But it shows you how to read from a WBS file, and that is the important thing.

Using this code you could possibly force a WBS of the current game, then shift the map layout however you wanted for your secondary map, and when you wanted to return to the first map you make another WBS (if you wanted to be able to return to the second map again), then shift the map layout back to the first WBS (need more code for that) and place the cities and whatnot.

This bit of code only shows how to read the cities from the WBS, but I think you should be able to modify it to read more data. But overall the process would probably be quite slow, especially on larger maps.
 
That actually looks exactly like what you need. It means you don't have to worry about saving the right things as you're reading from the WBS with everything you need saved anyway.
 
Well after some discussion with others I decided to go pickling!

I am using the (Vanilla Civ4) scenario/mod GreekWorld as a base to get the city saving/loading running properly before I port(?) it to FFH2.

So here's how I'm trialing it.
1) Run Greek World scenario using the Greek World 1 python files. Make sure you finish the game - I just built Roma and deleted all other units and in a few turns I was destroyed by the minor civ to the north. This makes sure the save file is created.
2) Enter world builder if you want to see that testcity is created.
3) Exit Civ 4 to desktop.
4) Replace the Greek World 1 python files with the Greek World 2 python files.
5) Run Civ 4.
6) Enter world builder and look for trialcity (testcity moved x + 3 and y + 3 tiles).

Just to debug it firstly I am only using testcity to save and replace in a different location. However if you look at the commented out code you can see that I am using for loops to make it world for all world cities (it appears to be able to save all world city data OK).

Problems:
1) It requires that I manually write the pGermanic in the line pCity = pGermanic.initCity(iX,iY) . What I want is to be able to use the CityOwner variable to define whose city it is (the setCulture uses CityOwner OK but I can't work out how to do this for initCity).
2) The main bug! The program doesn't seem to remember (or load from the pickle in the first place maybe!) the variables iX, iY, iPop, iCulture (in Greekworld.py - Greek World 2 files).

Here is the code for inspection if you will please. Note that I am a noob (trying to upgrade to newb) programmer so I need slow, few syllable explanations of what I did wrong! :D Because it's run as a once-off and I'm new to this, the code needs to be easy to understand even if slow. Credit is also due to Snarko and Vehem for their help to me in making this. :)

CvGreekWorldEventManager.py - 1
Spoiler :

Code:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
## 
## CvGreekWorldEventManager
## This class is passed an argsList from CvAppInterface.onEvent
## The argsList can contain anything from mouse location to key info
## The EVENTLIST that are being notified can be found 


from CvPythonExtensions import *
import CvUtil
import CvScreensInterface
import CvDebugTools
import CvWBPopups
import PyHelpers
import Popup as PyPopup
import CvCameraControls
import CvTopCivs
import CvEventManager
import GreekWorld	# Rhye
import sys
import pickle
	
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
gw1 = GreekWorld.GreekWorld()	# Rhye

# globals
###################################################
class CvGreekWorldEventManager(CvEventManager.CvEventManager):
	def __init__(self):
		# initialize base class
		self.parent = CvEventManager.CvEventManager
		self.parent.__init__(self)

	def onGameStart(self, argsList):
		'Called at the start of the game'
		self.parent.onGameStart(self, argsList)
		gw1.setup()
	
	def onBeginGameTurn(self, argsList):
		iGameTurn = argsList[0]
		self.parent.onBeginGameTurn(self, argsList)
		gw1.checkTurn(iGameTurn)
		
	def onCityAcquired(self, argsList):
		#'City Acquired'
		owner,playerType,city,bConquest,bTrade = argsList
		#CvUtil.pyPrint('City Acquired Event: %s' %(city.getName()))
		self.parent.onCityAcquired(self, argsList)
		gw1.checkCities(city, playerType)
[color=blue]
        def onGameEnd(self,argsList):
        	#import pickle at top of the file already
                ToFirstCityMapFile = open('D:\FirstCityMapFile', 'w')
                #CityBuildingList = []
                CityInfoList = []
                #this line calls gc.getMAX_PLAYERS() which is an SDK function.  You could also use iNumPlayers since this is defined as 16.
#                for iPlayer in range(gc.getMAX_PLAYERS()):
#        		apCityList = PyPlayer(iPlayer).getCityList()
#        		for pCity in apCityList:
#                                CityOwner = pCity.getOwner()
#                                CityInfoList.append(CityOwner)
#                                # what would be the CityOwner ID for colonies/Basium/Hyborem (ie not listed initially)?
#                		iX = pCity.getX()
#                		CityInfoList.append(iX)
#                		iY = pCity.getY()
#                		CityInfoList.append(iY)
#                		iPop = pCity.getPopulation()
#                		CityInfoList.append(iPop)
#                		iCulture = pCity.getCulture()
#                		# DOES THIS NEED A PLAYER ID NUMBER???
#                		CityInfoList.append(iCulture)
#                		CityInfoList.append('endcity')
                                # getNumRealBuilding is bts only!!!
                		# getNumRealBuilding(9) returns how many of building type 9 is in the city
                                #for iBuildingID in range(gc.getNumBuildingInfos()):
                                #	CityBuildingsList.append(iBuildingID)		
                pCity = gc.getMap().plot(33,67).getPlotCity()
                CityOwner = pCity.getOwner()
                CityInfoList.append(CityOwner)
                # what would be the CityOwner ID for colonies/Basium/Hyborem (ie not listed initially)?
                iX = pCity.getX() + 3
                CityInfoList.append(iX)
                iY = pCity.getY() + 3
                CityInfoList.append(iY)
                iPop = pCity.getPopulation()
                CityInfoList.append(iPop)
                iCulture = pCity.getCulture(CityOwner)
                CityInfoList.append(iCulture)
                CityInfoList.append('endcity')

                #pickle.dump(CityBuildingList, FirstCityMapFile)
                pickle.dump(CityInfoList, ToFirstCityMapFile)

                ToFirstCityMapFile.close()

                # Consider this code for getting city coordinates and name
                #for cityName in PyPlayer(iBabylon).getCityList():
                #        if not cityName.isNone():
                #                tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
# This is all obselete code below but I'm keeping it in the file just in case...
                #RomanCityList = []
                #PersianCityList = []

                #if iPlayer = 0 then:
                #        RomanCityList.append(iX)
                #        RomanCityList.append(iY)
                #        RomanCityList.append(iPop)
                #if iPlayer = 1 then:
                #        PersianCityList.append(iX)
                #        PersianCityList.append(iY)
                #        PersianCityList.append(iPop)
                #pickle.dump(PersianCityList, FirstCityMapFile)

                return
[/color]
 
GreekWorld.py 1 (join with next post because they are too long for one post)

Spoiler :

Code:
# Greek World Scenario

from CvPythonExtensions import *
import CvUtil
import PyHelpers		# LOQ
import Popup
import pickle			# LOQ 2005-10-12

# globals
gc = CyGlobalContext()
PyPlayer = PyHelpers.PyPlayer	# LOQ

### Constants ###


# initialise player variables to player IDs from WBS
iRome = 0
iPersia = 1
iMacedonia = 2
iEgypt = 3
iIndia = 4
iCelts = 5
iBabylon = 6
iPhoenicia = 7
iIsrael = 8
iGermanic = 9
iScythia = 10
iEtruria = 11
iGreece = 12
iGreekCol = 13
iSeleucia = 14
iParthia = 15 

iNumPlayers = 16

pRome = gc.getPlayer(iRome)
pPersia = gc.getPlayer(iPersia)
pMacedonia = gc.getPlayer(iMacedonia)
pEgypt = gc.getPlayer(iEgypt)
pIndia = gc.getPlayer(iIndia)
pCelts = gc.getPlayer(iCelts)
pBabylon = gc.getPlayer(iBabylon)
pPhoenicia = gc.getPlayer(iPhoenicia)
pIsrael = gc.getPlayer(iIsrael)
pGermanic = gc.getPlayer(iGermanic)
pScythia = gc.getPlayer(iScythia)
pEtruria = gc.getPlayer(iEtruria)
pGreece = gc.getPlayer(iGreece)
pGreekCol = gc.getPlayer(iGreekCol)
pSeleucia = gc.getPlayer(iSeleucia)
pParthia = gc.getPlayer(iParthia)

# initialise unit variables to unit indices from XML
iSettler = 4
iWorker = 5
iChristianMissionary = 11
iSwordsman = 19
iAxeman = 22
iPhalanx = 26
iArcher = 38
iHorseArcher = 46
iCamelArcher = 49
iGalley = 63

# initialise religion variables to religion indices from XML
iJudaism = 0
iChristianity = 1
iZoroastrianism = 2
iHinduism = 3
iMesopotamian = 4
iGreek = 5
iEgyptian = 6

# initialise city coordinates
tYerushalayim = (46, 32)
tRome = (23, 45)
tArezzo = (22, 48)
tAdria = (23, 51)
tMilano = (19, 50)
tCarthage = (21, 34)
tPalemmo = (21, 39)
tNora = (18, 40)
tAlalia = (19, 44)
tGadir = (8, 39)
tTaranto = (27, 42)
tLeptis = (25, 32)
tHippo = (17, 34)
tSiracusa = (24, 39)
tTyre = (45, 35)
tMarseilles = (16, 46)
tAleppo = (48, 38)
tSaguntum = (13, 42)
tParsa = (62, 29)
tEcbatana = (58, 35)
tGabae = (62, 34)
tRagha = (62, 38)
tHasanlu = (58, 42)
tBactra = (68, 42)
tTaxila = (70, 39)
tTarsus = (45, 39)
tSardis = (42, 41)
tTrapezus = (49, 43)
tBabylon = (52, 31)
tNineveh = (55, 39)
tSusa = (57, 30)
tAshur = (54, 36)
tLarsa = (55, 27)
tByzantium = (41, 44)
tMiletos = (40, 40)
tTanis = (39, 30)
tMemphis = (37, 28)
tHeliopolis = (38, 25)
tThebes = (39, 22)
tCyrene = (33, 31)
tAthens = (36, 40)
tSparta = (33, 38)
tCorinth = (34, 40)
tDelphi = (33, 42)
tRhodes = (40, 37)
tIsmara = (37, 46)
tEpidamnos = (30, 46)
tArgos = (34, 46)
tAlesia = (17, 56)
tGergovia = (14, 51)
tPetra = (47, 29)
tTayma = (49, 22)
tMarib = (50, 13)
tGerrha = (56, 19)
tPura = (67, 31)
tPannonia = (31, 52)


# LOQ 2005-10-12: removed Fates




class GreekWorld:

        iSpawnTurn = 500

	def makeUnit(self, iUnit, iPlayer, tCoords, iNum): #by LOQ
		'Makes iNum units for player iPlayer of the type iUnit at tCoords.'
		for i in range(iNum):
			player = gc.getPlayer(iPlayer)
			player.initUnit(iUnit, tCoords[0], tCoords[1], UnitAITypes.NO_UNITAI)

	def displayWelcomePopup( self ):
		popup = Popup.PyPopup()
		popup.setHeaderString( CyTranslator().getText("TXT_KEY_GREEK_WORLD_TITLE", ()) )
		popup.setBodyString( CyTranslator().getText("TXT_KEY_GREEK_WORLD_INTRO", ()) )
		popup.launch()

# ***** LOQ 2005-10-12: begin ***** #
	def setupScriptData( self ):
		"""Initialise the global script data dictionary for usage."""
		# random variables
		scriptDict =	{	'iPunicFate': -1,
					'iJerusalemFate': -1,
					'iPersianFate': -1,
					'iAlexanderFate': -1
				}
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getPunicFate( self ):
		"""Returns PunicFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iPunicFate']

	def setPunicFate( self, iNewValue ):
		"""Sets PunicFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iPunicFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getJerusalemFate( self ):
		"""Returns JerusalemFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iJerusalemFate']

	def setJerusalemFate( self, iNewValue ):
		"""Sets JerusalemFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iJerusalemFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getPersianFate( self ):
		"""Returns PersianFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iPersianFate']

	def setPersianFate( self, iNewValue ):
		"""Sets PersianFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iPersianFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getAlexanderFate( self ):
		"""Returns AlexanderFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iAlexanderFate']

	def setAlexanderFate( self, iNewValue ):
		"""Sets AlexanderFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iAlexanderFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

# ***** LOQ 2005-10-12: end ***** #


	def setup(self):
              
                # initialise random variables	# LOQ 2005-10-12
		self.setupScriptData()
                self.setPunicFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Punic Wars'))
                self.setJerusalemFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Jerusalem'))
                self.setPersianFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Persia'))
                self.setAlexanderFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Alexander'))

[COLOR="Blue"]		
		pCity = pGermanic.initCity(33,67)
		#pCity = gc.getMap().plot(33,67).getPlotCity()
                pCity.setName('testcity', False)
                # Not sure what False does
                pCity.setPopulation(3)
                pCity.setCulture(9,500,True)
                #9=Germanic, 500=amount of culture, Not sure what True does
                pCity.setHasRealBuilding(9,1)
                #9 gives it an aqueduct in this mod; 1 adds the building (check XML)
                pCity.setHasRealBuilding(0,0)
                # 0 is the palace, 0 removes the building.  However testcity remains the capital
                pCity.setHasReligion(5,1,0,0)
                # 5 makes it Greek polytheism.  1 adds the religion.  I don't know what BOOL bAnnounce, BOOL bArrows do...
                #pCity.setCitySizeBoost(9) - no discernable effects noticed...
[/color]
                # adds additional units to the human player's civ
                if (pRome.isHuman()):
                        self.makeUnit(iSettler, iRome, tRome, 1)
                        #self.makeUnit(iWorker, iRome, tRome, 1)
                if (pPersia.isHuman()):
                        self.makeUnit(iSettler, iPersia, tParsa, 1)
                        #self.makeUnit(iWorker, iPersia, tParsa, 1)
                if (pMacedonia.isHuman()):
                        self.makeUnit(iSettler, iMacedonia, tArgos, 1)
                        #self.makeUnit(iWorker, iMacedonia, tArgos, 1)
             
		# display welcome message
		self.displayWelcomePopup()

			
        def checkTurn(self, iGameTurn):


                #popup to test if conditions are working
##		if (iGameTurn >= 0):
##                        popup = Popup.PyPopup()
##                        popup.setBodyString( '%d punic \n %d jeru \n %d persia \n %d alex' %(self.getPunicFate(), self.getJerusalemFate(), self.getPersianFate(), self.getAlexanderFate()))
##                        popup.launch()

		if (iGameTurn == 1) or (iGameTurn == 30) or (iGameTurn == 60) or (iGameTurn == 90) or (iGameTurn == 120) or (iGameTurn == 150):
                        self.iSpawnTurn = iGameTurn + gc.getGame().getSorenRandNum(28, 'Greek World - Spawn turn range')

		if (iGameTurn == self.iSpawnTurn) and (iGameTurn <= 149):
                        #Scythian spawn
                        tTopLeft = (41, 44)
                        tBottomRight = (63, 59)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerSpawn, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Scythia')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iHorseArcher, iScythia, result, 3)
                                self.makeUnit(iArcher, iScythia, result, 2)
                                self.makeUnit(iSettler, iScythia, result, 1)
                                self.makeUnit(iWorker, iScythia, result, 1)
        		
		if (iGameTurn == self.iSpawnTurn) and (iGameTurn >= 30):
                        #Germanic spawn
                        tTopLeft = (24, 53)
                        tBottomRight = (41, 70)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerSpawn, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Germanic tribes')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iAxeman, iGermanic, result, 4)
                                self.makeUnit(iArcher, iGermanic, result, 2)
                                self.makeUnit(iSettler, iGermanic, result, 1)
                                self.makeUnit(iWorker, iGermanic, result, 1)
        		
		if (iGameTurn == self.iSpawnTurn) and (iGameTurn <= 111):
                        #Celtic spawn
                        tTopLeft = (8, 43)
                        tBottomRight = (43, 62)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerSpawn, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Celts')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iAxeman, iCelts, result, 4)		
                                self.makeUnit(iArcher, iCelts, result, 2)
                                self.makeUnit(iSettler, iCelts, result, 1)
                                self.makeUnit(iWorker, iCelts, result, 1)


                #Parthian spawn
		if (iGameTurn == 50) or (iGameTurn == 54): 
                        tTopLeft = (53, 36)
                        tBottomRight = (64, 45)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Parthia')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iHorseArcher, iParthia, result, 4)



                #Pirates from 200BC to 0AD (turn 80 to 120)
		if (iGameTurn >= 80 and iGameTurn <= 120):
                        if (iGameTurn % 4 == 0):
                                tTopLeft = (10, 34)
                                tBottomRight = (51, 46)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerSeaSpawn, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Pirates')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iGalley, 18, result, 1)



                #Barbarian invasions from 0AD (turn 120)
		if (iGameTurn >= 120 and iGameTurn <= 175):
                        if (iGameTurn % 3 == 0):
                                tTopLeft = (10, 11)
                                tBottomRight = (51, 30)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerInvasion, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Barbarians from the South')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iCamelArcher, 18, result, 5)
                        if (iGameTurn % 3 == 1):
                                tTopLeft = (20, 41)
                                tBottomRight = (71, 61)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Barbarians from the East')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iHorseArcher, 18, result, 7)
                        if (iGameTurn % 3 == 2):
                                tTopLeft = (9, 46)
                                tBottomRight = (43, 72)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Barbarians from the North')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iSwordsman, 18, result, 4)
                                        self.makeUnit(iAxeman, 18, result, 5)


                #Saguntum
                if (iGameTurn == 30):
                        iClean = 0
                        Plot = CyMap().plot( tSaguntum[0], tSaguntum[1] )
                        for x in range(tSaguntum[0] - 1, tSaguntum[1] + 2):		# from x-1 to x+1
                                for y in range(tSaguntum[0] - 1, tSaguntum[1] + 2):	# from y-1 to y+1
                                        if (Plot.getNumUnits() != 0):
                                                unit = Plot.getUnit(0)
                                                if (unit.getOwner() != iCelts):
                                                        iClean += 1
                        if (Plot.getPlotCity().isNone()) and (iClean == 0):
                                pCelts.found( tSaguntum[0], tSaguntum[1] )
                                Plot.getPlotCity().setName("Saguntum", True)

                
		#City flips
                                
                #Generic events
                if (self.getJerusalemFate() >= 50):
                        self.flipCity(3, tYerushalayim, 1, 1, iBabylon, [iIsrael])
                self.flipCity(2, tMarseilles, 1, 1, iCelts, [iEtruria])
                if (pRome.isHuman() == 0):
                        self.flipCity(3, tMilano, 1, 1, iCelts, [iEtruria])
                        self.flipCity(5, tAleppo, 1, 1, iBabylon, [iPhoenicia, iIsrael, 18])
                self.flipCity(5, tTyre, 1, 1, iBabylon, [iPhoenicia, iIsrael])
                self.flipCity(11, tPetra, 1, 1, iBabylon, [iIsrael])
                self.flipCity(12, tAlalia, 1, 1, iPhoenicia, [iGreekCol])
                self.flipCity(59, tPannonia, 1, 1, iCelts, [18, iEtruria])
                
                #Saguntum
                if (pPhoenicia.isAlive()):
                        self.flipCity(76, tSaguntum, 1, 1, iPhoenicia, [iCelts])
                        
                #Rise of Parthia
                self.flipCity(56, tGabae, 1, 1, iParthia, [18, iBabylon, iIndia])
                self.flipCity(56, tRagha, 1, 1, iParthia, [18, iBabylon, iIndia])
                self.flipCity(56, tHasanlu, 1, 1, iParthia, [18, iBabylon, iIndia])
                if (iGameTurn == 57):
                        for cityName in PyPlayer(iParthia).getCityList():
                                if not cityName.isNone():
                                        tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                        self.makeUnit(iHorseArcher, iParthia, tCoords, 2)

                #Roman events
                if (pRome.isHuman() == 0):
                        city = gc.getMap().plot( tRome[0], tRome[1] ).getPlotCity()
                        if not city.isNone():
                                if (city.getOwner() == iRome):
                                        #Italy
                                        self.flipCity(61, tArezzo, 1, 1, iRome, [iEtruria])  
                                        self.flipCity(66, tTaranto, 1, 1, iRome, [iGreekCol])                                        
                                        #1st punic war
                                        self.flipCity(72, tPalemmo, 1, 1, iRome, [iPhoenicia])
                                        self.flipCity(72, tNora, 0, 1, iRome, [iPhoenicia])
                                        self.flipCity(72, tAlalia, 0, 1, iRome, [iPhoenicia])
                                        #2nd punic war
                                        if (self.getPunicFate() >= 30):	# LOQ 2005-10-12
                                                self.flipCity(78, tSiracusa, 1, 1, iRome, [iGreekCol, iPhoenicia])
                                                self.flipCity(79, tGadir, 1, 1, iRome, [iPhoenicia])
                                                #3rd punic war
                                                self.flipCity(91, tCarthage, 1, 1, iRome, [iPhoenicia])
                                                self.flipCity(91, tLeptis, 0, 1, iRome, [iPhoenicia])
                                                self.flipCity(91, tHippo, 0, 1, iRome, [iPhoenicia])
                                        #2nd punic war: alternative (Hannibal wins)
                                        if (self.getPunicFate() < 30) and (pPhoenicia.isAlive()):	# LOQ 2005-10-12
                                                self.flipCity(77, tRome, 1, 1, iPhoenicia, [iRome])
                                                self.flipCity(78, tArezzo, 1, 1, iPhoenicia, [iRome])
                                                self.flipCity(78, tTaranto, 1, 1, iPhoenicia, [iRome])
                                                self.flipCity(79, tPalemmo, 0, 1, iPhoenicia, [iRome])
                                                self.flipCity(79, tNora, 0, 1, iPhoenicia, [iRome])
                                                self.flipCity(79, tAlalia, 0, 1, iPhoenicia, [iRome])
                                        #Celts
                                        self.flipCity(81, tSaguntum, 1, 1, iRome, [iCelts, iPhoenicia])
                                        self.flipCity(82, tAdria, 1, 1, iRome, [iEtruria]) 
                                        self.flipCity(95, tMarseilles, 1, 1, iRome, [iGreekCol, iCelts])
                                        self.flipCity(95, tMilano, 1, 1, iRome, [iCelts, iEtruria])
                                        self.flipCity(110, tGergovia, 1, 1, iRome, [iCelts])
                                        self.flipCity(110, tAlesia, 1, 1, iRome, [iCelts])
                                        self.flipCity(118, tPannonia, 1, 1, iRome, [18, iEtruria, iCelts])
                                        #Roman conquest of Macedonia (only if player is Persia)
                                        if (pMacedonia.isHuman() == 0):
                                                self.flipCity(90, tArgos, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(90, tDelphi, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(91, tAthens, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(91, tSparta, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(91, tCorinth, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(139, tByzantium, 1, 1, iRome, [iMacedonia, iGreece])
                                        #Roman conquest of Egypt and Middle East
                                        self.flipCity(94, tMiletos, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(94, tSardis, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(94, tRhodes, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(100, tTarsus, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(105, tCyrene, 1, 1, iRome, [iEgypt, iGreekCol])
                                        self.flipCity(107, tTyre, 1, 1, iRome, [iSeleucia])
                                        self.flipCity(107, tYerushalayim, 1, 1, iRome, [iSeleucia])
                                        self.flipCity(114, tTanis, 1, 1, iRome, [iEgypt])
                                        self.flipCity(114, tMemphis, 1, 1, iRome, [iEgypt])
                                        self.flipCity(114, tHeliopolis, 1, 1, iRome, [iEgypt])
                                        #Roma conquers Persian territories only if Macedonia is the player
                                        if (pPersia.isHuman() == 0):
                                                self.flipCity(94, tMiletos, 1, 1, iRome, [iPersia])
                                                self.flipCity(94, tSardis, 1, 1, iRome, [iPersia])
                                                self.flipCity(94, tRhodes, 1, 1, iRome, [iPersia])
                                                self.flipCity(100, tTarsus, 1, 1, iRome, [iPersia])
                                                self.flipCity(105, tCyrene, 1, 1, iRome, [iPersia])
                                                self.flipCity(107, tTyre, 1, 1, iRome, [iPersia])
                                                self.flipCity(107, tYerushalayim, 1, 1, iRome, [iPersia])
                                                self.flipCity(114, tTanis, 1, 1, iRome, [iPersia])
                                                self.flipCity(114, tMemphis, 1, 1, iRome, [iPersia])
                                                self.flipCity(114, tHeliopolis, 1, 1, iRome, [iPersia])
                                                self.flipCity(139, tByzantium, 1, 1, iRome, [iPersia])
 
GreekWorld.py 1 (join with above post)
Spoiler :

Code:
                 #Persian events
                if (pPersia.isHuman() == 0):
                        city = gc.getMap().plot( tParsa[0], tParsa[1] ).getPlotCity()
                        if not city.isNone():
                                if (city.getOwner() == iPersia):
                                        #Media, Iran
                                        self.flipCity(9, tEcbatana, 1, 1, iPersia, [18, iIndia])
                                        self.flipCity(9, tGabae, 1, 1, iPersia, [18, iIndia])
                                        self.flipCity(9, tRagha, 1, 1, iPersia, [18, iIndia])
                                        self.flipCity(9, tHasanlu, 1, 1, iPersia, [18, iIndia])
                                        self.flipCity(9, tBactra, 1, 1, iPersia, [18, iIndia])
                                        #Turkey
                                        if (pMacedonia.isHuman() == 0):
                                                self.flipCity(10, tSardis, 1, 1, iPersia, [18, iIndia, iGreekCol, iGreece])
                                                self.flipCity(10, tTrapezus, 1, 1, iPersia, [iGreekCol, iIndia])
                                                self.flipCity(10, tTarsus, 1, 1, iPersia, [18, iIndia, iGreekCol, iGreece])
                                                self.flipCity(10, tMiletos, 0, 1, iPersia, [iGreece])
                                        #Babylon
                                        for cityName in PyPlayer(iBabylon).getCityList():
                                                if not cityName.isNone():
                                                        tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                                        self.flipCity(12, tCoords, 1, 1, iPersia, [iBabylon])
                                        #Syria
                                        self.flipCity(13, tAleppo, 1, 1, iPersia, [18])
                                        self.flipCity(13, tTyre, 1, 1, iPersia, [18])
                                        #Egypt
                                        if (pMacedonia.isHuman() == 0):
                                                self.flipCity(15, tTanis, 1, 1, iPersia, [iEgypt])
                                                self.flipCity(15, tMemphis, 1, 1, iPersia, [iEgypt])
                                                self.flipCity(15, tHeliopolis, 1, 1, iPersia, [iEgypt])
                                                self.flipCity(15, tThebes, 1, 1, iPersia, [iEgypt])
                                                self.flipCity(15, tCyrene, 1, 1, iPersia, [iEgypt, iGreekCol])
                                        #Darius
                                        self.flipCity(16, tPura, 1, 1, iPersia, [18, iIndia])
                                        self.flipCity(16, tTaxila, 1, 1, iPersia, [iIndia])
                                        self.flipCity(16, tIsmara, 1, 1, iPersia, [18])
                                        if (pMacedonia.isHuman() == 0):
                                                self.flipCity(16, tByzantium, 1, 1, iPersia, [iGreekCol])
                                                #Persian wars
                                                if (self.getPersianFate() >= 30):	# LOQ 2005-10-12
                                                        self.flipCity(24, tMiletos, 0, 1, iGreece, [iPersia])
                                                        #Egypt will be free later
                                                        self.flipCity(39, tTanis, 1, 1, iEgypt, [iPersia])
                                                        self.flipCity(39, tMemphis, 1, 1, iEgypt, [iPersia])
                                                        self.flipCity(39, tHeliopolis, 1, 1, iEgypt, [iPersia])
                                                        self.flipCity(39, tThebes, 1, 1, iEgypt, [iPersia])
                                                        self.flipCity(39, tCyrene, 1, 1, iEgypt, [iPersia])
                                                #Persian wars: alternative (Persia wins)
                                                if (self.getPersianFate() < 30):                       	# LOQ 2005-10-12
                                                        for cityName in PyPlayer(iGreece).getCityList():
                                                                if not cityName.isNone():
                                                                        tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                                                        self.flipCity(24, tCoords, 1, 1, iPersia, [iGreece])
                                                        self.flipCity(24, tSiracusa, 1, 1, iPhoenicia, [iGreekCol])
                                                        self.flipCity(24, tTrapezus, 1, 1, iGreekCol, [iPersia])
                                                        self.flipCity(24, tTaxila, 1, 1, iIndia, [iPersia])
                                                        self.flipCity(24, tEcbatana, 1, 1, iParthia, [iPersia])
                                        #Parthia
                                        self.flipCity(56, tGabae, 0, 1, iParthia, [iPersia])
                                        self.flipCity(56, tRagha, 0, 1, iParthia, [iPersia])
                                        self.flipCity(56, tHasanlu, 0, 1, iParthia, [iPersia])
                                        self.flipCity(56, tBactra, 0, 1, iParthia, [iPersia])
                                        
                #Macedonian events
                if (pMacedonia.isHuman() == 0):
                        city = gc.getMap().plot( tArgos[0], tArgos[1] ).getPlotCity()
                        if not city.isNone():
                                if (city.getOwner() == iMacedonia):
                                        self.flipCity(51, tIsmara, 1, 1, iMacedonia, [18, iScythia, iGreekCol])
                                        self.flipCity(52, tDelphi, 1, 1, iMacedonia, [iGreece])
                                        self.flipCity(52, tCorinth, 1, 1, iMacedonia, [iGreece])
                                        self.flipCity(52, tSparta, 1, 1, iMacedonia, [iGreece])
                                        self.flipCity(52, tAthens, 1, 1, iMacedonia, [iGreece])
                                        self.flipCity(52, tMiletos, 0, 1, iGreekCol, [iGreece])
                                        self.flipCity(52, tRhodes, 0, 1, iGreekCol, [iGreece])
                                        #Alexander 
                                        self.flipCity(53, tMiletos, 1, 1, iMacedonia, [iGreekCol, iIsrael, iScythia, iBabylon])
                                        self.flipCity(53, tRhodes, 1, 1, iMacedonia, [iGreekCol,iBabylon])
                                        self.flipCity(53, tTarsus, 1, 1, iMacedonia, [18, iGreekCol, iScythia, iIsrael, iParthia, iBabylon])
                                        self.flipCity(53, tSardis, 1, 1, iMacedonia, [18, iGreekCol, iScythia, iIsrael, iParthia, iBabylon])
                                        self.flipCity(53, tAleppo, 1, 1, iMacedonia, [18, iGreekCol, iScythia, iIsrael, iParthia, iBabylon])
                                        self.flipCity(54, tTyre, 1, 1, iMacedonia, [iEgypt, iPhoenicia, iIsrael, iBabylon])
                                        self.flipCity(54, tYerushalayim, 0, 1, iMacedonia, [iIsrael, iBabylon])
                                        self.flipCity(54, tTanis, 0, 1, iMacedonia, [iEgypt, iBabylon])
                                        self.flipCity(54, tMemphis, 0, 1, iMacedonia, [iEgypt, iBabylon])
                                        self.flipCity(54, tHeliopolis, 0, 1, iMacedonia, [iEgypt, iBabylon])
                                        self.flipCity(54, tThebes, 0, 1, iMacedonia, [iEgypt, iBabylon])
                                        self.flipCity(55, tAshur, 0, 1, iMacedonia, [iBabylon, iIsrael])
                                        self.flipCity(55, tBabylon, 0, 1, iMacedonia, [iBabylon, iIsrael])
                                        self.flipCity(55, tSusa, 0, 1, iMacedonia, [iBabylon, iIsrael])
                                        #Alexander attacks Persian territories (only if player is Rome)
                                        if (pPersia.isHuman() == 0):
                                                for cityName in PyPlayer(iPersia).getCityList():
                                                        if not cityName.isNone():
                                                                tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                                                self.flipCity(55, tCoords, 0, 1, iMacedonia, [iPersia])
                                        if (iGameTurn == 54) or (iGameTurn == 55): #Seleucia spawn
                                                tTopLeft = (45, 32)
                                                tBottomRight = (51, 39)
                                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Seleucia')
                                                result = plotList[rndNum]
                                                if (result):
                                                        self.makeUnit(iPhalanx, iSeleucia, result, 4)
                                        #Alexander dies
                                        if (self.getAlexanderFate() >= 30):	# LOQ 2005-10-12
                                                self.flipCity(56, tTrapezus, 0, 1, iGreekCol, [iMacedonia])
                                                self.flipCity(56, tMiletos, 0, 1, iGreekCol, [iMacedonia])
                                                self.flipCity(56, tRhodes, 0, 1, iGreekCol, [iMacedonia])
                                                self.flipCity(56, tSardis, 0, 1, iGreekCol, [iMacedonia])
                                                self.flipCity(56, tTarsus, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tAleppo, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tTyre, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tYerushalayim, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tEcbatana, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tBabylon, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tAshur, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tLarsa, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tNineveh, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tSusa, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(56, tParsa, 0, 1, iSeleucia, [iMacedonia])
                                                #stronger Seleucid empire
                                                if (iGameTurn == 57):
                                                        for cityName in PyPlayer(iSeleucia).getCityList():
                                                                if not cityName.isNone():
                                                                        tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                                                        self.makeUnit(iPhalanx, iSeleucia, tCoords, 2)
                                                self.flipCity(56, tGabae, 0, 1, iParthia, [iMacedonia])
                                                self.flipCity(56, tRagha, 0, 1, iParthia, [iMacedonia])
                                                self.flipCity(56, tHasanlu, 0, 1, iParthia, [iMacedonia])
                                                self.flipCity(56, tBactra, 0, 1, iIndia, [iMacedonia])
                                                self.flipCity(56, tTaxila, 0, 1, iIndia, [iMacedonia])
                                                self.flipCity(56, tTanis, 0, 1, iEgypt, [iMacedonia])
                                                self.flipCity(56, tMemphis, 0, 1, iEgypt, [iMacedonia])
                                                self.flipCity(56, tHeliopolis, 0, 1, iEgypt, [iMacedonia])
                                                self.flipCity(56, tThebes, 0, 1, iEgypt, [iMacedonia])
                                                self.flipCity(56, tCyrene, 0, 1, iEgypt, [iMacedonia])
                                        #Alexander lives
                                        if (self.getAlexanderFate() < 30):	# LOQ 2005-10-12
                                                self.flipCity(57, tPetra, 1, 1, iMacedonia, [18, iEgypt, iIsrael])
                                                self.flipCity(57, tTayma, 1, 1, iMacedonia, [18, iEgypt, iIsrael])                                            
                                                self.flipCity(57, tMarib, 1, 1, iMacedonia, [18, iEgypt, iIsrael])
                                                self.flipCity(57, tGerrha, 1, 1, iMacedonia, [18, iEgypt, iIsrael])
                                                self.flipCity(59, tGadir, 1, 1, iMacedonia, [iPhoenicia])
                                                if (pRome.isHuman() == 0):
                                                        self.flipCity(58, tSiracusa, 1, 1, iMacedonia, [iPhoenicia, iGreekCol, iRome])
                                                        self.flipCity(58, tPalemmo, 1, 1, iMacedonia, [iPhoenicia, iGreekCol, iRome])
                                                        self.flipCity(59, tGadir, 1, 1, iMacedonia, [iRome]) 
                                                self.flipCity(61, tGabae, 1, 1, iParthia, [iMacedonia])
                                                self.flipCity(61, tRagha, 1, 1, iParthia, [iMacedonia])
                                                self.flipCity(61, tHasanlu, 1, 1, iParthia, [iMacedonia])
                                                self.flipCity(61, tBactra, 1, 1, iIndia, [iMacedonia])
                                                self.flipCity(62, tTaxila, 1, 1, iIndia, [iMacedonia])
                                                self.flipCity(62, tAthens, 1, 1, iGreece, [iMacedonia])
                                                self.flipCity(62, tSparta, 1, 1, iGreece, [iMacedonia])
                                                self.flipCity(62, tDelphi, 1, 1, iGreece, [iMacedonia])
                                                self.flipCity(62, tCorinth, 1, 1, iGreece, [iMacedonia])
                                                self.flipCity(63, tTarsus, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tAleppo, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tTyre, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tYerushalayim, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tPetra, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tTayma, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tMarib, 0, 1, iSeleucia, [iMacedonia])
                                                self.flipCity(63, tGerrha, 0, 1, iSeleucia, [iMacedonia])
                                                if (iGameTurn == 64):
                                                        for cityName in PyPlayer(iSeleucia).getCityList():
                                                                if not cityName.isNone():
                                                                        tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                                                        self.makeUnit(iPhalanx, iSeleucia, tCoords, 2)
                                        #Parthian expansion
                                        self.flipCity(92, tEcbatana, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        self.flipCity(92, tBabylon, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        self.flipCity(92, tAshur, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        self.flipCity(92, tLarsa, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        self.flipCity(92, tNineveh, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        self.flipCity(92, tSusa, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        self.flipCity(92, tParsa, 1, 1, iParthia, [iSeleucia, iMacedonia])
                                        if (iGameTurn == 93):
                                                for cityName in PyPlayer(iParthia).getCityList():
                                                        if not cityName.isNone():
                                                                tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                                                self.makeUnit(iHorseArcher, iParthia, tCoords, 2)


                                

		# Christianity by LOQ
		if (iGameTurn == 123):
			city = gc.getMap().plot( tYerushalayim[0], tYerushalayim[1] ).getPlotCity()
			# if Yerushalayim razed
			if city.isNone():
				jewishCityList = []
				for iPlayer in range(iNumPlayers):
					for pyCity in PyPlayer(iPlayer).getCityList():
						if pyCity.GetCy().isHasReligion(iJudaism):
							jewishCityList.append(pyCity.GetCy())
				if jewishCityList:
					iCity = gc.getGame().getSorenRandNum(len(jewishCityList), 'Greek World - Birth of Christianity')
					city = jewishCityList[iCity]
			# if Yerushalayim exists or an alternative is found
			if not city.isNone():
				gc.getGame().setHolyCity(iChristianity, city, True)
                        #Christianity spreads
                        tCoords = (city.getX(), city.getY())
                        if (gc.getPlayer(city.getOwner()).isHuman() == 0):
                                self.makeUnit(iChristianMissionary, city.getOwner(), tCoords, 7)
                                
                #Christianity spreads
		if (iGameTurn >= 130) and (iGameTurn <= 170):
			christianCityList = []
 			for iPlayer in range(iNumPlayers):
				for pyCity in PyPlayer(iPlayer).getCityList():
					if pyCity.GetCy().isHasReligion(iChristianity):
						christianCityList.append(pyCity.GetCy())                              
			if christianCityList:
				iCity = gc.getGame().getSorenRandNum(len(christianCityList), 'Greek World - Spread of Christianity')
				city = christianCityList[iCity]
                                tCoords = (city.getX(), city.getY())
                                if (gc.getPlayer(city.getOwner()).isHuman() == 0):
                                        self.makeUnit(iChristianMissionary, city.getOwner(), tCoords, 1)
 
GreekWorld.py 1 (join with above 2 posts)
Spoiler :

Code:
        def flipCity(self, iFlipTurn, tCityPlot, bFlipType, bKillUnits, iNewOwner, iOldOwners):
                """Changes owner of city specified by tCityPlot on turn iFlipTurn.
                bFlipType specifies if it's conquered or traded.
                If bKillUnits != 0 all the units in the city will be killed and replaced by two archers.
                iOldOwners is a list. Flip happens only if the old owner is in the list. An empty list will cause the flip to always happen."""
                pNewOwner = gc.getPlayer(iNewOwner)
                if (gc.getGame().getGameTurn() == iFlipTurn):
##                            popup = Popup.PyPopup() 
##                            popup.setBodyString( 'Turn' )
##                            popup.launch()
                            city = gc.getMap().plot( tCityPlot[0], tCityPlot[1] ).getPlotCity()
                            if not city.isNone():
##                                    popup = Popup.PyPopup() 
##                                    popup.setBodyString( 'NoCity' )
##                                    popup.launch()
                                    if (city.getOwner() in iOldOwners or not iOldOwners):
##                                            popup = Popup.PyPopup() 
##                                            popup.setBodyString( 'Owners' )
##                                            popup.launch()
                                            if (bKillUnits):
                                                    killPlot = gc.getMap().plot( tCityPlot[0], tCityPlot[1] )
                                                    for i in range(killPlot.getNumUnits()):
                                                            unit = killPlot.getUnit(0)
                                                            unit.kill(False, iNewOwner)
                                            if (bFlipType): #conquest
                                                    if (city.getPopulation() == 2):
                                                            city.setPopulation(3)
                                                    if (city.getPopulation() == 1):
                                                            city.setPopulation(2)
                                                    pNewOwner.acquireCity(city, True, False)
                                            else: #trade
                                                    pNewOwner.acquireCity(city, False, True)
                                            if (bKillUnits):
                                                    self.makeUnit(iArcher, iNewOwner, tCityPlot, 2)
                                            return True
                return False
                            




	def squareSearch( self, tTopLeft, tBottomRight, function, argsList ): #by LOQ
		"""Searches all tile in the square from tTopLeft to tBottomRight and calls function for
		every tile, passing argsList. The function called must return a tuple: (1) a result, (2) if
		a plot should be painted and (3) if the search should continue."""
		tPaintedList = []
		result = None
		for x in range(tTopLeft[0], tBottomRight[0]):
			for y in range(tTopLeft[1], tBottomRight[1]):
				result, bPaintPlot, bContinueSearch = function((x, y), result, argsList)
				if bPaintPlot:			# paint plot
					tPaintedList.append((x, y))
				if not bContinueSearch:		# goal reached, so stop
					return result, tPaintedList
		return result, tPaintedList


	def innerInvasion( self, tCoords, result, argsList ):
		"""Checks validity of the plot at the current tCoords, returns plot if valid (which stops the search).
		Plot is valid if it's hill or flatlands and it isn't occupied by a unit or city"""
		bPaint = True
		bContinue = True
		pCurrent = gc.getMap().plot( tCoords[0], tCoords[1] )
		if ( pCurrent.isHills() or pCurrent.isFlatlands() ):
			if ( not pCurrent.isCity() and not pCurrent.isUnit() ):
        			# this is a good plot, so paint it and continue search
				return (None, bPaint, bContinue)
		# not a good plot, so don't paint it but continue search
		return (None, not bPaint, bContinue)

	def outerInvasion( self, tCoords, result, argsList ):
		"""Checks validity of the plot at the current tCoords, returns plot if valid (which stops the search).
		Plot is valid if it's hill or flatlands, it isn't occupied by a unit or city and if it isn't a civ's territory"""
		bPaint = True
		bContinue = True
		pCurrent = gc.getMap().plot( tCoords[0], tCoords[1] )
		if ( pCurrent.isHills() or pCurrent.isFlatlands() ):
			if ( not pCurrent.isCity() and not pCurrent.isUnit() ):
				if (pCurrent.countTotalCulture() == 0 ):
					# this is a good plot, so paint it and continue search
					return (None, bPaint, bContinue)
		# not a good plot, so don't paint it but continue search
		return (None, not bPaint, bContinue)

	def innerSeaSpawn( self, tCoords, result, argsList ):
		"""Checks validity of the plot at the current tCoords, returns plot if valid (which stops the search).
		Plot is valid if it's water and it isn't occupied by any unit. Unit check extended to adjacent plots"""
		bPaint = True
		bContinue = True
		pCurrent = gc.getMap().plot( tCoords[0], tCoords[1] )
		if ( pCurrent.isWater()):
			if ( not pCurrent.isCity() and not pCurrent.isUnit() ):
                                iClean = 0
                                for x in range(tCoords[0] - 1, tCoords[0] + 2):		# from x-1 to x+1
                                        for y in range(tCoords[1] - 1, tCoords[1] + 2):	# from y-1 to y+1
                                                if (pCurrent.getNumUnits() != 0):
                                                        iClean += 1
                                if ( iClean == 0 ):   
					# this is a good plot, so paint it and continue search
					return (None, bPaint, bContinue)
		# not a good plot, so don't paint it but continue search
		return (None, not bPaint, bContinue)

	def outerSpawn( self, tCoords, result, argsList ):
		"""Checks validity of the plot at the current tCoords, returns plot if valid (which stops the search).
		Plot is valid if it's hill or flatlands, it isn't occupied by a unit or city and if it isn't a civ's territory.
		Unit check extended to adjacent plots"""
		bPaint = True
		bContinue = True
		pCurrent = gc.getMap().plot( tCoords[0], tCoords[1] )
		if ( pCurrent.isHills() or pCurrent.isFlatlands() ):
			if ( not pCurrent.isCity() and not pCurrent.isUnit() ):
                                iClean = 0
                                for x in range(tCoords[0] - 1, tCoords[0] + 2):		# from x-1 to x+1
                                        for y in range(tCoords[1] - 1, tCoords[1] + 2):	# from y-1 to y+1
                                                if (pCurrent.getNumUnits() != 0):
                                                        iClean += 1
                                if ( iClean == 0 ):
                                        if (pCurrent.countTotalCulture() == 0 ):
                                                # this is a good plot, so paint it and continue search
                                                return (None, bPaint, bContinue)
		# not a good plot, so don't paint it but continue search
		return (None, not bPaint, bContinue)


        def checkCities(self, city, iNewOwner):
                """Renames a city depending on its owner"""
                if city.getName() == 'Taras' and iNewOwner == iRome:
                        city.setName('Tarentum', False)
                if city.getName() == 'Tarentum' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Taras', False)
                if city.getName() == 'Syrakousai' and iNewOwner == iRome:
                        city.setName('Syracusae', False)
                if city.getName() == 'Syracusae' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Syrakousai', False)
                if city.getName() == 'Athenai' and iNewOwner == iRome:
                        city.setName('Athanae', False)
                if city.getName() == 'Athanae' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Athenai', False)
                if city.getName() == 'Miletos' and iNewOwner == iRome:
                        city.setName('Miletus', False)
                if city.getName() == 'Miletus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Miletos', False)
                if city.getName() == 'Epidamnos' and iNewOwner == iRome:
                        city.setName('Dyrrachium', False)
                if city.getName() == 'Dyrrachium' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Epidamnos', False)
                if city.getName() == 'Rhodos' and iNewOwner == iRome:
                        city.setName('Rhodus', False)
                if city.getName() == 'Rhodus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Rhodos', False)
                if city.getName() == 'Byzantion' and iNewOwner == iRome:
                        city.setName('Byzantium', False)
                if city.getName() == 'Byzantium' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Byzantion', False)
                if city.getName() == 'Trapezounda' and iNewOwner == iRome:
                        city.setName('Trapezus', False)
                if city.getName() == 'Trapezus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Trapezounda', False)
                if city.getName() == 'Tarsos' and iNewOwner == iRome:
                        city.setName('Tarsus', False)
                if city.getName() == 'Tarsus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Tarsos', False)
                if city.getName() == 'Sparte' and iNewOwner == iRome:
                        city.setName('Sparta', False)
                if city.getName() == 'Sparta' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Sparte', False)
                if city.getName() == 'Korinthos' and iNewOwner == iRome:
                        city.setName('Corinthus', False)
                if city.getName() == 'Corinthus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Korinthos', False)
                if city.getName() == 'Delphoi' and iNewOwner == iRome:
                        city.setName('Delphi', False)
                if city.getName() == 'Delphi' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Delphoi', False)
                if city.getName() == 'Alexandreia' and iNewOwner == iRome:
                        city.setName('Alexandria', False)
                if city.getName() == 'Alexandria' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Alexandreia', False)
                if city.getName() == 'Alalia' and iNewOwner == iRome:
                        city.setName('Aleria', False)
                if city.getName() == 'Aleria' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Alalia', False)
                if city.getName() == 'Thasos' and iNewOwner == iRome:
                        city.setName('Thasus', False)
                if city.getName() == 'Thasus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Thasos', False)
                if city.getName() == 'Olynthos' and iNewOwner == iRome:
                        city.setName('Olynthus', False)
                if city.getName() == 'Olynthus' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Olynthos', False)
                if city.getName() == 'Thessaloniki' and iNewOwner == iRome:
                        city.setName('Thessalonica', False)
                if city.getName() == 'Thessalonica' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Thessaloniki', False)
                if city.getName() == 'Massalia' and iNewOwner == iRome:
                        city.setName('Massilia', False)
                if city.getName() == 'Massilia' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Massalia', False)

                if city.getName() == 'Roma' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Rome', False)
                if city.getName() == 'Rome' and iNewOwner == iRome:
                        city.setName('Roma', False)

                        
                if ((city.getName() == 'Sur') or (city.getName() == 'Tyros') or (city.getName() == 'Tsor') or (city.getName() == 'Zara')) and iNewOwner == iRome:
                        city.setName('Tyrus', False)
                if ((city.getName() == 'Tyrus') or (city.getName() == 'Sur') or (city.getName() == 'Tsor') or (city.getName() == 'Zara')) and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Tyros', False)
                if ((city.getName() == 'Tyrus') or (city.getName() == 'Tyros') or (city.getName() == 'Sur') or (city.getName() == 'Zara')) and iNewOwner == iIsrael:
                        city.setName('Tsor', False)
                if ((city.getName() == 'Tyrus') or (city.getName() == 'Tyros') or (city.getName() == 'Tsor') or (city.getName() == 'Sur')) and iNewOwner == iBabylon:
                        city.setName('Zara', False)
                if ((city.getName() == 'Tyrus') or (city.getName() == 'Tyros') or (city.getName() == 'Tsor') or (city.getName() == 'Zara')) and iNewOwner == iPhoenicia:
                        city.setName('Sur', False)
                if ((city.getName() == 'Qart-Hadasht') or (city.getName() == 'Karkhedon')) and iNewOwner == iRome:
                        city.setName('Carthago', False)
                if ((city.getName() == 'Qart-Hadasht') or (city.getName() == 'Carthago')) and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Karkhedon', False)
                if ((city.getName() == 'Carthago') or (city.getName() == 'Karkhedon')) and iNewOwner == iPhoenicia:
                        city.setName('Qart-Hadasht', False)
                if ((city.getName() == 'Lpqy') or (city.getName() == 'Lepcis')) and iNewOwner == iRome:
                        city.setName('Leptis Magna', False)
                if ((city.getName() == 'Lpqy') or (city.getName() == 'Leptis Magna')) and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Lepcis', False)
                if ((city.getName() == 'Leptis Magna') or (city.getName() == 'Lepcis')) and iNewOwner == iPhoenicia:
                        city.setName('Lpqy', False)
                if city.getName() == 'Hippo' and iNewOwner == iRome:
                        city.setName('Hippo Regius', False)
                if city.getName() == 'Hippo Regius' and iNewOwner == iPhoenicia:
                        city.setName('Hippo', False)
                        
                if ((city.getName() == 'Ziz') or (city.getName() == 'Panormos')) and iNewOwner == iRome:
                        city.setName('Panormus', False)
                if ((city.getName() == 'Ziz') or (city.getName() == 'Panormus')) and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Panormos', False)
                if ((city.getName() == 'Panormus') or (city.getName() == 'Panormos')) and iNewOwner == iPhoenicia:
                        city.setName('Ziz', False)
                if city.getName() == 'Gadir' and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Gades', False)
                if city.getName() == 'Gades' and iNewOwner == iPhoenicia:
                        city.setName('Gadir', False)

                if ((city.getName() == 'Yerushalayim') or (city.getName() == 'Hierousalem')) and iNewOwner == iRome:
                        city.setName('Aelia Capitolina', False)
                if ((city.getName() == 'Yerushalayim') or (city.getName() == 'Aelia Capitolina')) and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Hierousalem', False)
                if ((city.getName() == 'Aelia Capitolina') or (city.getName() == 'Hierousalem')) and iNewOwner == iIsrael:
                        city.setName('Yerushalayim', False)

                if city.getName() == 'Hangmatana' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Ecbatana', False)
                if city.getName() == 'Ecbatana' and iNewOwner == iPersia:
                        city.setName('Hangmatana', False)

                if city.getName() == 'Parsa' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Persepolis', False)
                if city.getName() == 'Persepolis' and iNewOwner == iPersia:
                        city.setName('Parsa', False)
                if city.getName() == 'Pathragada' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Pasargadae', False)
                if city.getName() == 'Pasargadae' and iNewOwner == iPersia:
                        city.setName('Pathragada', False)

                if ((city.getName() == 'Niwt-rst') or (city.getName() == 'Thebes')) and iNewOwner == iRome:
                        city.setName('Thebae', False)
                if ((city.getName() == 'Niwt-rst') or (city.getName() == 'Thebae')) and ((iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Thebes', False)
                if ((city.getName() == 'Thebes') or (city.getName() == 'Thebae')) and iNewOwner == iPhoenicia:
                        city.setName('Niwt-rst', False)
                if ((city.getName() == 'Djanet') or (city.getName() == 'Zoan')) and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Tanis', False)
                if ((city.getName() == 'Djanet') or (city.getName() == 'Tanis')) and iNewOwner == iIsrael:
                        city.setName('Zoan', False)
                if ((city.getName() == 'Tanis') or (city.getName() == 'Zoan')) and iNewOwner == iPhoenicia:
                        city.setName('Niwt-rst', False)
                if city.getName() == 'Ineb Hedj' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Memphis', False)
                if city.getName() == 'Memphis' and iNewOwner == iEgypt:
                        city.setName('Ineb Hedj', False)
                if city.getName() == 'Abdju' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Abydos', False)
                if city.getName() == 'Abydos' and iNewOwner == iEgypt:
                        city.setName('Abdju', False)
                if city.getName() == 'Iunu' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Heliopolis', False)
                if city.getName() == 'Heliopolis' and iNewOwner == iEgypt:
                        city.setName('Iunu', False)
                if city.getName() == 'Yebu' and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Elephantine', False)
                if city.getName() == 'Elephantine' and iNewOwner == iEgypt:
                        city.setName('Yebu', False)

                if ((city.getName() == 'Babili') or (city.getName() == 'Babel')) and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Babylon', False)
                if ((city.getName() == 'Babili') or (city.getName() == 'Babylon')) and iNewOwner == iIsrael:
                        city.setName('Babel', False)
                if ((city.getName() == 'Babylon') or (city.getName() == 'Babel')) and iNewOwner == iBabylon:
                        city.setName('Babili', False)
                if ((city.getName() == 'Susan') or (city.getName() == 'Shushan')) and ((iNewOwner == iRome) or (iNewOwner == iMacedonia) or (iNewOwner == iGreece) or (iNewOwner == iGreekCol)):
                        city.setName('Susa', False)
                if ((city.getName() == 'Susan') or (city.getName() == 'Susa')) and iNewOwner == iIsrael:
                        city.setName('Babel', False)
                if ((city.getName() == 'Susa') or (city.getName() == 'Shushan')) and iNewOwner == iBabylon:
                        city.setName('Susan', False)
                if city.getName() == 'Ninua' and iNewOwner == iIsrael:
                        city.setName('Nineveh', False)
                if city.getName() == 'Nineveh' and iNewOwner == iBabylon:
                        city.setName('Ninua', False)
                if city.getName() == 'Assur' and iNewOwner == iIsrael:
                        city.setName('Ashur', False)
                if city.getName() == 'Ashur' and iNewOwner == iBabylon:
                        city.setName('Assur', False)
                if city.getName() == 'Larsa' and iNewOwner == iIsrael:
                        city.setName('Ellasar', False)
                if city.getName() == 'Ellasar' and iNewOwner == iBabylon:
                        city.setName('Larsa', False)

                if city.getName() == 'Richborough' and iNewOwner == iRome:
                        city.setName('Rutupiae', False)
                if city.getName() == 'Rutupiae' and iNewOwner == iCelts:
                        city.setName('Richborough', False)
                if city.getName() == 'Lutetia' and iNewOwner == iRome:
                        city.setName('Lutetia Parisorum', False)
                if city.getName() == 'Lutetia Parisorum' and iNewOwner == iCelts:
                        city.setName('Lutetia', False)
                if city.getName() == 'Melpum' and ((iNewOwner == iRome) or (iNewOwner == iCelts)):
                        city.setName('Mediolanum', False)
 
CvGreekWorldEventManager - 2
Spoiler :

Code:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
## 
## CvGreekWorldEventManager
## This class is passed an argsList from CvAppInterface.onEvent
## The argsList can contain anything from mouse location to key info
## The EVENTLIST that are being notified can be found 


from CvPythonExtensions import *
import CvUtil
import CvScreensInterface
import CvDebugTools
import CvWBPopups
import PyHelpers
import Popup as PyPopup
import CvCameraControls
import CvTopCivs
import CvEventManager
import GreekWorld	# Rhye
import sys
import pickle
	
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
gw1 = GreekWorld.GreekWorld()	# Rhye

# globals
###################################################
class CvGreekWorldEventManager(CvEventManager.CvEventManager):
	def __init__(self):
		# initialize base class
		self.parent = CvEventManager.CvEventManager
		self.parent.__init__(self)

	def onGameStart(self, argsList):
		'Called at the start of the game'
		self.parent.onGameStart(self, argsList)
		gw1.setup()
		
	def onBeginGameTurn(self, argsList):
		iGameTurn = argsList[0]
		self.parent.onBeginGameTurn(self, argsList)
		gw1.checkTurn(iGameTurn)
		
	def onCityAcquired(self, argsList):
		#'City Acquired'
		owner,playerType,city,bConquest,bTrade = argsList
		#CvUtil.pyPrint('City Acquired Event: %s' %(city.getName()))
		self.parent.onCityAcquired(self, argsList)
		gw1.checkCities(city, playerType)
 
GreekWorld.py - 2 (put together these 3 parts of the long file)
Spoiler :

Code:
# Greek World Scenario

from CvPythonExtensions import *
import CvUtil
import PyHelpers		# LOQ
import Popup
import pickle			# LOQ 2005-10-12

# globals
gc = CyGlobalContext()
PyPlayer = PyHelpers.PyPlayer	# LOQ

### Constants ###


# initialise player variables to player IDs from WBS
iRome = 0
iPersia = 1
iMacedonia = 2
iEgypt = 3
iIndia = 4
iCelts = 5
iBabylon = 6
iPhoenicia = 7
iIsrael = 8
iGermanic = 9
iScythia = 10
iEtruria = 11
iGreece = 12
iGreekCol = 13
iSeleucia = 14
iParthia = 15 

iNumPlayers = 16

pRome = gc.getPlayer(iRome)
pPersia = gc.getPlayer(iPersia)
pMacedonia = gc.getPlayer(iMacedonia)
pEgypt = gc.getPlayer(iEgypt)
pIndia = gc.getPlayer(iIndia)
pCelts = gc.getPlayer(iCelts)
pBabylon = gc.getPlayer(iBabylon)
pPhoenicia = gc.getPlayer(iPhoenicia)
pIsrael = gc.getPlayer(iIsrael)
pGermanic = gc.getPlayer(iGermanic)
pScythia = gc.getPlayer(iScythia)
pEtruria = gc.getPlayer(iEtruria)
pGreece = gc.getPlayer(iGreece)
pGreekCol = gc.getPlayer(iGreekCol)
pSeleucia = gc.getPlayer(iSeleucia)
pParthia = gc.getPlayer(iParthia)

# initialise unit variables to unit indices from XML
iSettler = 4
iWorker = 5
iChristianMissionary = 11
iSwordsman = 19
iAxeman = 22
iPhalanx = 26
iArcher = 38
iHorseArcher = 46
iCamelArcher = 49
iGalley = 63

# initialise religion variables to religion indices from XML
iJudaism = 0
iChristianity = 1
iZoroastrianism = 2
iHinduism = 3
iMesopotamian = 4
iGreek = 5
iEgyptian = 6

# initialise city coordinates
tYerushalayim = (46, 32)
tRome = (23, 45)
tArezzo = (22, 48)
tAdria = (23, 51)
tMilano = (19, 50)
tCarthage = (21, 34)
tPalemmo = (21, 39)
tNora = (18, 40)
tAlalia = (19, 44)
tGadir = (8, 39)
tTaranto = (27, 42)
tLeptis = (25, 32)
tHippo = (17, 34)
tSiracusa = (24, 39)
tTyre = (45, 35)
tMarseilles = (16, 46)
tAleppo = (48, 38)
tSaguntum = (13, 42)
tParsa = (62, 29)
tEcbatana = (58, 35)
tGabae = (62, 34)
tRagha = (62, 38)
tHasanlu = (58, 42)
tBactra = (68, 42)
tTaxila = (70, 39)
tTarsus = (45, 39)
tSardis = (42, 41)
tTrapezus = (49, 43)
tBabylon = (52, 31)
tNineveh = (55, 39)
tSusa = (57, 30)
tAshur = (54, 36)
tLarsa = (55, 27)
tByzantium = (41, 44)
tMiletos = (40, 40)
tTanis = (39, 30)
tMemphis = (37, 28)
tHeliopolis = (38, 25)
tThebes = (39, 22)
tCyrene = (33, 31)
tAthens = (36, 40)
tSparta = (33, 38)
tCorinth = (34, 40)
tDelphi = (33, 42)
tRhodes = (40, 37)
tIsmara = (37, 46)
tEpidamnos = (30, 46)
tArgos = (34, 46)
tAlesia = (17, 56)
tGergovia = (14, 51)
tPetra = (47, 29)
tTayma = (49, 22)
tMarib = (50, 13)
tGerrha = (56, 19)
tPura = (67, 31)
tPannonia = (31, 52)


# LOQ 2005-10-12: removed Fates




class GreekWorld:

        iSpawnTurn = 500

	def makeUnit(self, iUnit, iPlayer, tCoords, iNum): #by LOQ
		'Makes iNum units for player iPlayer of the type iUnit at tCoords.'
		for i in range(iNum):
			player = gc.getPlayer(iPlayer)
			player.initUnit(iUnit, tCoords[0], tCoords[1], UnitAITypes.NO_UNITAI)

	def displayWelcomePopup( self ):
		popup = Popup.PyPopup()
		popup.setHeaderString( CyTranslator().getText("TXT_KEY_GREEK_WORLD_TITLE", ()) )
		popup.setBodyString( CyTranslator().getText("TXT_KEY_GREEK_WORLD_INTRO", ()) )
		popup.launch()

# ***** LOQ 2005-10-12: begin ***** #
	def setupScriptData( self ):
		"""Initialise the global script data dictionary for usage."""
		# random variables
		scriptDict =	{	'iPunicFate': -1,
					'iJerusalemFate': -1,
					'iPersianFate': -1,
					'iAlexanderFate': -1
				}
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getPunicFate( self ):
		"""Returns PunicFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iPunicFate']

	def setPunicFate( self, iNewValue ):
		"""Sets PunicFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iPunicFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getJerusalemFate( self ):
		"""Returns JerusalemFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iJerusalemFate']

	def setJerusalemFate( self, iNewValue ):
		"""Sets JerusalemFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iJerusalemFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getPersianFate( self ):
		"""Returns PersianFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iPersianFate']

	def setPersianFate( self, iNewValue ):
		"""Sets PersianFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iPersianFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

	def getAlexanderFate( self ):
		"""Returns AlexanderFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		return scriptDict['iAlexanderFate']

	def setAlexanderFate( self, iNewValue ):
		"""Sets AlexanderFate."""
		scriptDict = pickle.loads( gc.getPlayer(0).getScriptData() )
		scriptDict['iAlexanderFate'] = iNewValue
		gc.getPlayer(0).setScriptData( pickle.dumps(scriptDict) )

# ***** LOQ 2005-10-12: end ***** #


	def setup(self):
              
                # initialise random variables	# LOQ 2005-10-12
		self.setupScriptData()
                self.setPunicFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Punic Wars'))
                self.setJerusalemFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Jerusalem'))
                self.setPersianFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Persia'))
                self.setAlexanderFate(gc.getGame().getSorenRandNum(100, 'Greek World - fate of Alexander'))
[color=blue]
                unpickledCityFile = open('D:\FirstCityMapFile','r')
                #problem with Meier's using the ' which closes the pathway                                        
                unpickledCityFileList = pickle.load(unpickledCityFile)
                for cityValues in unpickledCityFileList:
                        CityOwner = cityValues
                        iX = cityValues
                        iY = cityValues
                        iPop = cityValues
                        iCulture = cityValues

                pCity = pGermanic.initCity(iX,iY)
                # if you change iX and iY to 33,67 a city is built but then
                # population and culture don't work.  I think unpickled list is not working
		#pCity = gc.getMap().plot(33,67).getPlotCity()
                pCity.setName('trialcity', False)
                # Not sure what False does
                pCity.setPopulation(iPop)
                pCity.setCulture(CityOwner,iCulture,True)
                #9=Germanic, 500=amount of culture, Not sure what True does
                #pCity.setHasRealBuilding(9,1)
                #9 gives it an aqueduct in this mod; 1 adds the building (check XML)
                #pCity.setHasRealBuilding(0,0)
                # 0 is the palace, 0 removes the building.  However testcity remains the capital
                #pCity.setHasReligion(5,1,0,0)
                # 5 makes it Greek polytheism.  1 adds the religion.  I don't know what BOOL bAnnounce, BOOL bArrows do...
 
                        
                        # 'end city' value is to somehow show when the/
                        # buildings' list has ended

                unpickledCityFile.close()	
#       	pCity = pGermanic.initCity(33,67)
#		#pCity = gc.getMap().plot(33,67).getPlotCity()
#                pCity.setName('testcity', False)
#                # Not sure what False does
#                pCity.setPopulation(3)
#                pCity.setCulture(9,500,True)
#                #9=Germanic, 500=amount of culture, Not sure what True does
#                pCity.setHasRealBuilding(9,1)
#                #9 gives it an aqueduct in this mod; 1 adds the building (check XML)
#                pCity.setHasRealBuilding(0,0)
#                # 0 is the palace, 0 removes the building.  However testcity remains the capital
#                pCity.setHasReligion(5,1,0,0)
#                # 5 makes it Greek polytheism.  1 adds the religion.  I don't know what BOOL bAnnounce, BOOL bArrows do...
#                #pCity.setCitySizeBoost(9) - no discernable effects noticed...
[/color]
                # adds additional units to the human player's civ
                if (pRome.isHuman()):
                        self.makeUnit(iSettler, iRome, tRome, 1)
                        #self.makeUnit(iWorker, iRome, tRome, 1)
                if (pPersia.isHuman()):
                        self.makeUnit(iSettler, iPersia, tParsa, 1)
                        #self.makeUnit(iWorker, iPersia, tParsa, 1)
                if (pMacedonia.isHuman()):
                        self.makeUnit(iSettler, iMacedonia, tArgos, 1)
                        #self.makeUnit(iWorker, iMacedonia, tArgos, 1)
             
		# display welcome message
		self.displayWelcomePopup()

			
        def checkTurn(self, iGameTurn):


                #popup to test if conditions are working
##		if (iGameTurn >= 0):
##                        popup = Popup.PyPopup()
##                        popup.setBodyString( '%d punic \n %d jeru \n %d persia \n %d alex' %(self.getPunicFate(), self.getJerusalemFate(), self.getPersianFate(), self.getAlexanderFate()))
##                        popup.launch()

		if (iGameTurn == 1) or (iGameTurn == 30) or (iGameTurn == 60) or (iGameTurn == 90) or (iGameTurn == 120) or (iGameTurn == 150):
                        self.iSpawnTurn = iGameTurn + gc.getGame().getSorenRandNum(28, 'Greek World - Spawn turn range')

		if (iGameTurn == self.iSpawnTurn) and (iGameTurn <= 149):
                        #Scythian spawn
                        tTopLeft = (41, 44)
                        tBottomRight = (63, 59)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerSpawn, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Scythia')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iHorseArcher, iScythia, result, 3)
                                self.makeUnit(iArcher, iScythia, result, 2)
                                self.makeUnit(iSettler, iScythia, result, 1)
                                self.makeUnit(iWorker, iScythia, result, 1)
        		
		if (iGameTurn == self.iSpawnTurn) and (iGameTurn >= 30):
                        #Germanic spawn
                        tTopLeft = (24, 53)
                        tBottomRight = (41, 70)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerSpawn, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Germanic tribes')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iAxeman, iGermanic, result, 4)
                                self.makeUnit(iArcher, iGermanic, result, 2)
                                self.makeUnit(iSettler, iGermanic, result, 1)
                                self.makeUnit(iWorker, iGermanic, result, 1)
        		
		if (iGameTurn == self.iSpawnTurn) and (iGameTurn <= 111):
                        #Celtic spawn
                        tTopLeft = (8, 43)
                        tBottomRight = (43, 62)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerSpawn, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Celts')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iAxeman, iCelts, result, 4)		
                                self.makeUnit(iArcher, iCelts, result, 2)
                                self.makeUnit(iSettler, iCelts, result, 1)
                                self.makeUnit(iWorker, iCelts, result, 1)


                #Parthian spawn
		if (iGameTurn == 50) or (iGameTurn == 54): 
                        tTopLeft = (53, 36)
                        tBottomRight = (64, 45)
                        dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                        rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Parthia')
                        result = plotList[rndNum]
                        if (result):
                                self.makeUnit(iHorseArcher, iParthia, result, 4)



                #Pirates from 200BC to 0AD (turn 80 to 120)
		if (iGameTurn >= 80 and iGameTurn <= 120):
                        if (iGameTurn % 4 == 0):
                                tTopLeft = (10, 34)
                                tBottomRight = (51, 46)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerSeaSpawn, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Pirates')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iGalley, 18, result, 1)



                #Barbarian invasions from 0AD (turn 120)
		if (iGameTurn >= 120 and iGameTurn <= 175):
                        if (iGameTurn % 3 == 0):
                                tTopLeft = (10, 11)
                                tBottomRight = (51, 30)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.outerInvasion, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Barbarians from the South')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iCamelArcher, 18, result, 5)
                        if (iGameTurn % 3 == 1):
                                tTopLeft = (20, 41)
                                tBottomRight = (71, 61)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Barbarians from the East')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iHorseArcher, 18, result, 7)
                        if (iGameTurn % 3 == 2):
                                tTopLeft = (9, 46)
                                tBottomRight = (43, 72)
                                dummy, plotList = self.squareSearch( tTopLeft, tBottomRight, self.innerInvasion, [] )
                                rndNum = gc.getGame().getSorenRandNum(len(plotList), 'Greek World - Barbarians from the North')
                                result = plotList[rndNum]
                                if (result):
                                        self.makeUnit(iSwordsman, 18, result, 4)
                                        self.makeUnit(iAxeman, 18, result, 5)


                #Saguntum
                if (iGameTurn == 30):
                        iClean = 0
                        Plot = CyMap().plot( tSaguntum[0], tSaguntum[1] )
                        for x in range(tSaguntum[0] - 1, tSaguntum[1] + 2):		# from x-1 to x+1
                                for y in range(tSaguntum[0] - 1, tSaguntum[1] + 2):	# from y-1 to y+1
                                        if (Plot.getNumUnits() != 0):
                                                unit = Plot.getUnit(0)
                                                if (unit.getOwner() != iCelts):
                                                        iClean += 1
                        if (Plot.getPlotCity().isNone()) and (iClean == 0):
                                pCelts.found( tSaguntum[0], tSaguntum[1] )
                                Plot.getPlotCity().setName("Saguntum", True)

                
		#City flips
                                
                #Generic events
                if (self.getJerusalemFate() >= 50):
                        self.flipCity(3, tYerushalayim, 1, 1, iBabylon, [iIsrael])
                self.flipCity(2, tMarseilles, 1, 1, iCelts, [iEtruria])
                if (pRome.isHuman() == 0):
                        self.flipCity(3, tMilano, 1, 1, iCelts, [iEtruria])
                        self.flipCity(5, tAleppo, 1, 1, iBabylon, [iPhoenicia, iIsrael, 18])
                self.flipCity(5, tTyre, 1, 1, iBabylon, [iPhoenicia, iIsrael])
                self.flipCity(11, tPetra, 1, 1, iBabylon, [iIsrael])
                self.flipCity(12, tAlalia, 1, 1, iPhoenicia, [iGreekCol])
                self.flipCity(59, tPannonia, 1, 1, iCelts, [18, iEtruria])
                
                #Saguntum
                if (pPhoenicia.isAlive()):
                        self.flipCity(76, tSaguntum, 1, 1, iPhoenicia, [iCelts])
                        
                #Rise of Parthia
                self.flipCity(56, tGabae, 1, 1, iParthia, [18, iBabylon, iIndia])
                self.flipCity(56, tRagha, 1, 1, iParthia, [18, iBabylon, iIndia])
                self.flipCity(56, tHasanlu, 1, 1, iParthia, [18, iBabylon, iIndia])
                if (iGameTurn == 57):
                        for cityName in PyPlayer(iParthia).getCityList():
                                if not cityName.isNone():
                                        tCoords = (cityName.GetCy().getX(), cityName.GetCy().getY())
                                        self.makeUnit(iHorseArcher, iParthia, tCoords, 2)

                #Roman events
                if (pRome.isHuman() == 0):
                        city = gc.getMap().plot( tRome[0], tRome[1] ).getPlotCity()
                        if not city.isNone():
                                if (city.getOwner() == iRome):
                                        #Italy
                                        self.flipCity(61, tArezzo, 1, 1, iRome, [iEtruria])  
                                        self.flipCity(66, tTaranto, 1, 1, iRome, [iGreekCol])                                        
                                        #1st punic war
                                        self.flipCity(72, tPalemmo, 1, 1, iRome, [iPhoenicia])
                                        self.flipCity(72, tNora, 0, 1, iRome, [iPhoenicia])
                                        self.flipCity(72, tAlalia, 0, 1, iRome, [iPhoenicia])
                                        #2nd punic war
                                        if (self.getPunicFate() >= 30):	# LOQ 2005-10-12
                                                self.flipCity(78, tSiracusa, 1, 1, iRome, [iGreekCol, iPhoenicia])
                                                self.flipCity(79, tGadir, 1, 1, iRome, [iPhoenicia])
                                                #3rd punic war
                                                self.flipCity(91, tCarthage, 1, 1, iRome, [iPhoenicia])
                                                self.flipCity(91, tLeptis, 0, 1, iRome, [iPhoenicia])
                                                self.flipCity(91, tHippo, 0, 1, iRome, [iPhoenicia])
                                        #2nd punic war: alternative (Hannibal wins)
                                        if (self.getPunicFate() < 30) and (pPhoenicia.isAlive()):	# LOQ 2005-10-12
                                                self.flipCity(77, tRome, 1, 1, iPhoenicia, [iRome])
                                                self.flipCity(78, tArezzo, 1, 1, iPhoenicia, [iRome])
                                                self.flipCity(78, tTaranto, 1, 1, iPhoenicia, [iRome])
                                                self.flipCity(79, tPalemmo, 0, 1, iPhoenicia, [iRome])
                                                self.flipCity(79, tNora, 0, 1, iPhoenicia, [iRome])
                                                self.flipCity(79, tAlalia, 0, 1, iPhoenicia, [iRome])
                                        #Celts
                                        self.flipCity(81, tSaguntum, 1, 1, iRome, [iCelts, iPhoenicia])
                                        self.flipCity(82, tAdria, 1, 1, iRome, [iEtruria]) 
                                        self.flipCity(95, tMarseilles, 1, 1, iRome, [iGreekCol, iCelts])
                                        self.flipCity(95, tMilano, 1, 1, iRome, [iCelts, iEtruria])
                                        self.flipCity(110, tGergovia, 1, 1, iRome, [iCelts])
                                        self.flipCity(110, tAlesia, 1, 1, iRome, [iCelts])
                                        self.flipCity(118, tPannonia, 1, 1, iRome, [18, iEtruria, iCelts])
                                        #Roman conquest of Macedonia (only if player is Persia)
                                        if (pMacedonia.isHuman() == 0):
                                                self.flipCity(90, tArgos, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(90, tDelphi, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(91, tAthens, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(91, tSparta, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(91, tCorinth, 1, 1, iRome, [iMacedonia, iGreece])
                                                self.flipCity(139, tByzantium, 1, 1, iRome, [iMacedonia, iGreece])
                                        #Roman conquest of Egypt and Middle East
                                        self.flipCity(94, tMiletos, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(94, tSardis, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(94, tRhodes, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(100, tTarsus, 1, 1, iRome, [iSeleucia, iGreekCol])
                                        self.flipCity(105, tCyrene, 1, 1, iRome, [iEgypt, iGreekCol])
                                        self.flipCity(107, tTyre, 1, 1, iRome, [iSeleucia])
                                        self.flipCity(107, tYerushalayim, 1, 1, iRome, [iSeleucia])
                                        self.flipCity(114, tTanis, 1, 1, iRome, [iEgypt])
                                        self.flipCity(114, tMemphis, 1, 1, iRome, [iEgypt])
                                        self.flipCity(114, tHeliopolis, 1, 1, iRome, [iEgypt])
                                        #Roma conquers Persian territories only if Macedonia is the player
                                        if (pPersia.isHuman() == 0):
                                                self.flipCity(94, tMiletos, 1, 1, iRome, [iPersia])
                                                self.flipCity(94, tSardis, 1, 1, iRome, [iPersia])
                                                self.flipCity(94, tRhodes, 1, 1, iRome, [iPersia])
                                                self.flipCity(100, tTarsus, 1, 1, iRome, [iPersia])
                                                self.flipCity(105, tCyrene, 1, 1, iRome, [iPersia])
                                                self.flipCity(107, tTyre, 1, 1, iRome, [iPersia])
                                                self.flipCity(107, tYerushalayim, 1, 1, iRome, [iPersia])
                                                self.flipCity(114, tTanis, 1, 1, iRome, [iPersia])
                                                self.flipCity(114, tMemphis, 1, 1, iRome, [iPersia])
                                                self.flipCity(114, tHeliopolis, 1, 1, iRome, [iPersia])
                                                self.flipCity(139, tByzantium, 1, 1, iRome, [iPersia])
 
Back
Top Bottom