iGreatGeneral = gc.getInfoTypeForString("UNIT_GREAT_GENERAL")
# Loop through promotions
for iProm in range(gc.getNumPromotionInfos()):
# Does the unit have this promotion
if pUnitZ.isHasPromotion(iProm):
# Army unit must not already have this promotion
if not MyNewArmyUnit.isHasPromotion(iProm):
# Transfer promotion to the New Army Unit
MyNewArmyUnit.setHasPromotion(iProm, True)
# Get the Leader Type
pUnitZLeaderType = pUnitZ.getLeaderUnitType()
# Does the unit have a leader?
if pUnitZLeaderType != -1:
# Get the Leader Name
pUnitzName = pUnitZ.getNameNoDesc()
#CyInterface().addImmediateMessage(str(pUnitzName), "")
# Get the Leader Type for Army Unit
MyNewArmyUnitLeaderType = MyNewArmyUnit.getLeaderUnitType()
# Make sure the Army unit does not already have a leader
if MyNewArmyUnitLeaderType == -1:
MyNewArmyUnit.setLeaderUnitType(iGreatGeneral)
MyNewArmyUnit.setName(pUnitzName)