def reqResurrection(pCaster, sSluagh):
iUnit = gc.getInfoTypeForString(sSluagh)
iLL = gc.getInfoTypeForString('PROMOTION_LAROTH_LEGIONNAIRE')
pPlot = CyMap().plot(0,0)
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if pUnit.getUnitType() == iUnit:
if pUnit.isHasPromotion(iLL):
return False
if not pUnit.isDelayedDeath():
return true
return false
def spellResurrection(pCaster,sSluagh):
pPlotC = pCaster.plot()
pPlayer = gc.getPlayer(pCaster.getOwner())
iUnit = gc.getInfoTypeForString(sSluagh)
iLL = gc.getInfoTypeForString('PROMOTION_LAROTH_LEGIONNAIRE')
pPlot = CyMap().plot(0,0)
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if pUnit.getUnitType() == iUnit:
if not pUnit.isHasPromotion(iLL):
break
infoCiv = gc.getCivilizationInfo(pPlayer.getCivilizationType())
iUnit = infoCiv.getCivilizationUnits(gc.getUnitInfo(iUnit).getUnitCaptureClassType())
if iUnit == -1:
iUnit = gc.getInfoTypeForString('UNIT_CHAMPION')
newUnit = pPlayer.initUnit(iUnit, pPlotC.getX(), pPlotC.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
newUnit.convert(pUnit)
for iProm in range(gc.getNumPromotionInfos()):
if gc.getPromotionInfo(iProm).isEquipment():
newUnit.setHasPromotion(iProm, False)