-- ProphetReplacer
-- Author: Neirai the Forgiven
-- DateCreated: 8/24/2013 2:56:18 PM
--------------------------------------------------------------
local sUnitType = "UNIT_PROPHET"
local iProphetID = GameInfo.Units.UNIT_PROPHET.ID
local iGodslayer = GameInfo.Units.UNIT_GODSLAYERPRIME.ID
print ("Hurrah. Your lousy script actually loaded.")
function ProphetsToGodslayers(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 ("Player is alive, mon")
print (pPlayer:GetCivilizationType())
print (GameInfo.Civilizations["CIVILIZATION_EVILZANDALARI"].ID)
if (pPlayer:GetCivilizationType() == GameInfo.Civilizations["CIVILIZATION_EVILZANDALARI"].ID) then
print("This player is Zandalari!")
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
--if (iUnit:GetID() == GameInfoTypes["UNIT_PROPHET"]) then
print("This unit is a prophet. DIE PROPHET DIE")
local iProphetx = pUnit:GetX();
local iProphety = pUnit:GetY();
pUnit:Kill(false, -1);
pPlayer:InitUnit(iGodslayer, iProphetx, iProphety, UNITAI_ATTACK, DirectionTypes.DIRECTION_WEST)
else print ("This unit is not a prophet, and has been spared the wrath of this script.")
end
end
else print ("This player is scum.")
end
end
end
Events.SerialEventUnitCreated.Add(ProphetsToGodslayers)