mechaerik
Tuturuu!
I've been trying this for a while, but I can't seem to get it to work:
The first one is me trying to make it so if theres a certain building (palace is a placeholder), a unit will spawn with more xp.
The second is basically the same, only with civics, not buildings.
Any obvious errors?
PHP:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
pCity = pPlot.getPlotCity() ##added
## mechaerik START
if (pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_PALACE")))>0:
unit.changeExperience(2,100,False,False,False)
## mechaerik END
## mechaerik START
if (gc.getPlayer(pCity.getOwner()).isCivic(gc.getInfoTypeForString("CIVIC_SLAVERY"))):
unit.changeExperience(2,100,False,False,False)
## mechaerik END
The first one is me trying to make it so if theres a certain building (palace is a placeholder), a unit will spawn with more xp.
The second is basically the same, only with civics, not buildings.
Any obvious errors?