-- ProphetReplacer
-- Author: Neirai the Forgiven (lil' changes by Leugi)
-- DateCreated: 8/24/2013 2:56:18 PM
--------------------------------------------------------------
local sUnitType = "UNIT_PROPHET"
local iProphetID = GameInfo.Units.UNIT_PROPHET.ID
local iProphetOverride = GameInfo.Units.UNIT_XUEPRIEST.ID
local iCivType = GameInfo.Civilizations["CIVILIZATION_MUISCA"].ID
print ("This is the Override Prophet Script thing.")
function ProphetOverride(iPlayer, iUnit)
print ("This script is intended to turn Prophets into other units.")
print ("Checking to see if the player is Alive...")
local pPlayer = Players[iPlayer];
if (pPlayer:IsEverAlive()) then
print (pPlayer:GetCivilizationType())
if (pPlayer:GetCivilizationType() == iCivType) then
print("Let's find out if this unit is a prophet!")
print(iUnit)
print(GameInfoTypes["UNIT_PROPHET"])
-- print(iUnit:GetID())
for pUnit in pPlayer:Units() do
print(pUnit:GetUnitType())
if (pUnit:GetUnitType() == iProphetID) then
print ("Converting")
local newUnit = pPlayer:InitUnit(iProphetOverride, pUnit:GetX(), pUnit:GetY())
newUnit:Convert(pUnit);
iUnitID:Kill(false, -1);
print ("Conversion Complete")
end
end
end
end
end
Events.SerialEventUnitCreated.Add(ProphetOverride)