print("300 Notification is working!");
local is300Ready = false;
function Is300Ready(iPlayer)
local pPlayer = Players[iPlayer];
if PlayerCanTrain (pPlayer, GameInfoTypes["UNIT_300"]) == true then
is300Ready = true;
GameEvents.PlayerDoTurn.Remove(Is300Ready);
end
end
GameEvents.PlayerDoTurn.Add(Is300Ready);
function Is300Built(iPlayer)
local pPlayer = Players[iPlayer]
if (PlayerCanTrain(pPlayer, GameInfoTypes["UNIT_300"]) == false) and (is300Ready == true) then
local portraitIndex = GameInfo.Units["UNIT_300"].PortraitIndex;
IconHookup( portraitIndex, 80, GameInfo.Units["UNIT_300"].IconAtlas, instance.WonderConstructedAlphaAnim );
GameEvents.PlayerDoTurn(iPlayer).Remove(Is300Built);
end
if iExtraGameData ~= -1 then
CivIconHookup (iExtraGameData, 45, instance.CivIcon, instance.CivIconBH, instance.CivIconShadow, false, true );
instance.WonderSmallCivFrame:SetHide(false);
GameEvents.PlayerDoTurn.Remove(Is300Built);
end
end
GameEvents.PlayerDoTurn.Add(Is300Built);