//
// Please outcomment some of the original code in the file "SCRIPT.SLC": Search
// Search the strings within the next section (between START OUTCOMMENT and END OUTCOMMENT). 
// After finding the strings, simply put // in front of the whole object.
//

// START OUTCOMMENT
// alertbox '79DiscoveredRemnantsOfAncientCivilisation' {
// messagebox '250UnitGainedVeteranStatus' {
// messageBox '266CityDestroyedByWar' {
// messagebox '75PlayerDefeated' {
// messagebox '76PlayerDefeatedBy' {
// messagebox '77YouLose' {
// messagebox '123CitiesCapturedVictim' {
// messagebox '126CapitalCityCapturedAttacker' {
// messagebox '127CapitalCityCapturedVictim' {
// messagebox '40CityIsCelebratingHappiness' {
// messagebox '99AdvanceFromCapturingCity' {
// alertBox '20IAFreeSlaves' {
// alertbox '28IAMaxCitiesReached' {
// messagebox '28PickNewDiscovery' {
// messagebox '115EdisonDiscovery' {
// messagebox '116InternetDiscovery' {
// messagebox '37CityQueueIsEmpty' {
// messagebox '38UnitCompletedQueueEmpty' {
// messagebox '38UnitCompleted' {
// messagebox '38BuildingBuiltQueueEmpty' {
// messagebox '38WonderBuiltQueueEmpty' {
// messagebox '38EndgameBuiltQueueEmpty' {
// messageBox '410HotseatCityAttacked' {
// messageBox '411HotseatArmyAttacked' {
// trigger 'TVictoryEnslavement' when (special.VictoryEnslavement) {
// messageBox '402VictoryEnslavement' {
// messagebox '38BuildingBuilt' {
// messagebox '38WonderBuilt' {
// messagebox '46WonderComplete' {
// messagebox '040GrossPolluter' {
// messagebox '186StealTechnologyVictim' {
// messagebox '260LeaveOurLandsBroken' {
// END OUTCOMMENT


//
// START OF POWERSLICs 2.00 CODE
//


//
// PowerSLICs start-up box
//

//trigger 'TP_PowerSLICs_Greetings' when (IsHumanPlayer(g.player) && (g.year == 0)) {
//	Message(g.player, 'TP_PowerSLICs_Greetings');
//}

//alertbox 'TP_PowerSLICs_Greetings' {
// 	Text(ID_TP_PowerSLICs_Greetings);
//	MessageType("STEAL_ADVANCE_ICON");
//	Button(ID_BUTTON_NO) {
//	ExitToDesktop();
//	Kill();
//	}
//	Button(ID_BUTTON_YES) {
//	Kill();
//	}
//}


// This will force the graphics system to synchronize with the game's internal state
// (workaround for Disappearing Unit Syndrome if it should still exist) Also it will inform a 
// human player with a given chance (10% per round, at least 12 rounds being played since last 
// ranking) about his rankings. In 60% of those cases, a small ranking will be shown (i.e. giving 
// information for only one dimension), otherwise a big ranking will be shown (i.e. overview on 
// all available rankings). Of course, you will only see rankings for trade, undersea cities and 
// space cities if you have the corresponding advances. Finally there is a check on the current 
// level of public works. If this is too high, there will be a warning (the absolutel warning-
// trigging level depends on the current buildoptions a player has).
//

trigger 'TP_T_Catch_Up' when (IsHumanPlayer(g.player)) {
CatchUp();
lastrank = lastrank + 1;
getrank=Random(99);
if (getrank <= 9 && lastrank >= 12) {
lastrank = 0;
getrank = Random(99);
if (getrank <= 59) {
Message(g.player, 'TP_M_Small_Ranking');
}
else {
Message(g.player, 'TP_M_Big_Ranking');
}
}
pwlmax = 1000;
if (HasAdvance(player, ID_ADVANCE_STONE_WORKING)) {pwlmax = 1500;} 
if (HasAdvance(player, ID_ADVANCE_OCEAN_FARING)) {pwlmax = 3000;} 
if (HasAdvance(player, ID_ADVANCE_ELECTRICITY)) {pwlmax = 7500;} 
if (HasAdvance(player, ID_ADVANCE_INTELLIGENT_MATERIALS)) {pwlmax = 15000;} 
if (HasAdvance(player, ID_ADVANCE_SUPERCONDUCTOR)) {pwlmax = 15000;} 
if (HasAdvance(player, ID_ADVANCE_ROBOTICS)) {pwlmax = 15000;} 
if (HasAdvance(player, ID_ADVANCE_SEA_COLONIES)) {pwlmax = 15000;} 
if (player.publicworkslevel >= pwlmax) {
pwl = player.publicworkslevel;
pwt = player.publicworkstax;
Message(g.player, 'TP_M_Warning_Public_Works');
}
}

messagebox 'TP_M_Small_Ranking' {
nump = Preference("NumPlayers") - 1;
whichrank = Random(8);
if (whichrank == 0) {
Title(ID_TP_TITLE_Ranking_city);
if (CitiesRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (CitiesRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (CitiesRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (CitiesRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (CitiesRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (CitiesRank(player) >= 6 && CitiesRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (CitiesRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if (whichrank == 1) {
Title(ID_TP_TITLE_Ranking_geographic);
if (GeographicRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (GeographicRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (GeographicRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (GeographicRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (GeographicRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (GeographicRank(player) >= 6 && GeographicRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (GeographicRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if (whichrank == 2) {
Title(ID_TP_TITLE_Ranking_gold);
if (GoldRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (GoldRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (GoldRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (GoldRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (GoldRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (GoldRank(player) >= 6 && GoldRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (GoldRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if (whichrank == 3) {
Title(ID_TP_TITLE_Ranking_science);
if (KnowledgeRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (KnowledgeRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (KnowledgeRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (KnowledgeRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (KnowledgeRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (KnowledgeRank(player) >= 6 && KnowledgeRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (KnowledgeRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if (whichrank == 4) {
Title(ID_TP_TITLE_Ranking_military);
if (MilitaryRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (MilitaryRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (MilitaryRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (MilitaryRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (MilitaryRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (MilitaryRank(player) >= 6 && MilitaryRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (MilitaryRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if (whichrank == 5) {
Title(ID_TP_TITLE_Ranking_population);
if (PopulationRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (PopulationRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (PopulationRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (PopulationRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (PopulationRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (PopulationRank(player) >= 6 && PopulationRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (PopulationRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if ((whichrank == 6) && (HasAdvance(player, ID_ADVANCE_SPACE_COLONIES))) {
Title(ID_TP_TITLE_Ranking_space);
if (SpaceRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (SpaceRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (SpaceRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (SpaceRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (SpaceRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (SpaceRank(player) >= 6 && SpaceRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (SpaceRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if ((whichrank == 6) && !(HasAdvance(player, ID_ADVANCE_SPACE_COLONIES))) {
Title(ID_TP_TITLE_Ranking_city);
if (CitiesRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (CitiesRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (CitiesRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (CitiesRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (CitiesRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (CitiesRank(player) >= 6 && CitiesRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (CitiesRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if ((whichrank == 7) && (HasAdvance(player, ID_ADVANCE_TRADE))) {
Title(ID_TP_TITLE_Ranking_Trade);
if (TradeRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (TradeRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (TradeRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (TradeRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (TradeRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (TradeRank(player) >= 6 && TradeRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (TradeRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if ((whichrank == 7) && !(HasAdvance(player, ID_ADVANCE_TRADE))) {
Title(ID_TP_TITLE_Ranking_gold);
if (GoldRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (GoldRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (GoldRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (GoldRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (GoldRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (GoldRank(player) >= 6 && GoldRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (GoldRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if ((whichrank == 8) && (HasAdvance(player, ID_ADVANCE_SEA_COLONIES))) {
Title(ID_TP_TITLE_Ranking_Undersea);
if (UnderseaRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (UnderseaRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (UnderseaRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (UnderseaRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (UnderseaRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (UnderseaRank(player) >= 6 && UnderseaRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (UnderseaRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
if ((whichrank == 8) && !(HasAdvance(player, ID_ADVANCE_SEA_COLONIES))) {
Title(ID_TP_TITLE_Ranking_geographic);
if (GeographicRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
if (GeographicRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
if (GeographicRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
if (GeographicRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
if (GeographicRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
if (GeographicRank(player) >= 6 && GeographicRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
if (GeographicRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
}
MessageType("TP_SMALL_RANKING");
Duration(1);
}

alertbox 'TP_M_Big_Ranking' {
MessageType("TP_SMALL_RANKING");
citr = CitiesRank(player);
geor = GeographicRank(player);
golr = GoldRank(player);
knor = KnowledgeRank(player);
milr = MilitaryRank(player);
popr = PopulationRank(player);
spar = SpaceRank(player);
trar = TradeRank(player);
undr = UnderseaRank(player);
nump = Preference("NumPlayers") - 1;
if (HasAdvance(player, ID_ADVANCE_TRADE) && HasAdvance(player, ID_ADVANCE_SEA_COLONIES) && HasAdvance(player, ID_ADVANCE_SPACE_COLONIES)) {Text(ID_TP_TEXT_Big_Ranking_All);}
elseif (HasAdvance(player, ID_ADVANCE_TRADE) && !HasAdvance(player, ID_ADVANCE_SEA_COLONIES) && !HasAdvance(player, ID_ADVANCE_SPACE_COLONIES)) {Text(ID_TP_TEXT_Big_Ranking_onlytrade);}
elseif (HasAdvance(player, ID_ADVANCE_TRADE) && HasAdvance(player, ID_ADVANCE_SEA_COLONIES) && !HasAdvance(player, ID_ADVANCE_SPACE_COLONIES)) {Text(ID_TP_TEXT_Big_Ranking_trade_sea_nospace);}
elseif (HasAdvance(player, ID_ADVANCE_TRADE) && !HasAdvance(player, ID_ADVANCE_SEA_COLONIES) && HasAdvance(player, ID_ADVANCE_SPACE_COLONIES)) {Text(ID_TP_TEXT_Big_Ranking_trade_nosea_space);}
else {Text(ID_TP_TEXT_Big_Ranking_notrade_nosea_nospace);}
Button(ID_BUTTON_CLOSE) {
Kill();
}
}

messagebox 'TP_M_Warning_Public_Works' {
MessageType("WASTING_WORK");
Title(ID_TP_TITLE_Warning_Public_Works);
Text(ID_TP_TEXT_Warning_Public_Works);
Duration(1);
}


//
// As soon as a city is clicked, open the City screen and the LaborTab
// This feature is not a standard feature in PowerSLICs as some computers may be too slow
// for this. Outcomment this if you like the idea and your computer is on the fast side.
// 

// trigger 'ClickedCity' when (IsHumanPlayer(g.player) && (clicked.city)) {
// 	OpenLaborTab();
// 	OpenCity();
// }
//


//
// Warning in case human player got bombarded
//

TypeLocation position;
trigger 'TP_T_Warning_Bombarding2' when (special.bombarded && IsBombardingUnit(unit)) {
position = unit.2.location;
Message(unit.2.owner, 'TP_M_Warning_Bombarding2');
}

messagebox 'TP_M_Warning_Bombarding2' {
duration(2);
MessageClass(504);
MessageType("TP_WARNING_BOMBARDING2");
Title(ID_TP_TITLE_Warning_Bombarding2);
Text(ID_TP_TEXT_Warning_Bombarding2);
UseDirector();
Button(ID_Close_bombarding_messages) {
KillClass(g.player, 504);
}
Button(ID_SHOW_ME) {
	AddCenter(position);
	AddEffect(position, "SPECEFFECT_EXPLOSION_LAND_1", "SOUND_ID_NONE");
	Kill();
}
}


//
// Message "Your City XXX increased by one"
// 

//trigger 'TP_T_City_Growth' when (IsHumanPlayer(g.player) && (city.population) && (city.owner == g.player)) {
//if (city.population > 1) { Message(g.player, 'TP_M_CityGrowth');}
//}

//messagebox 'TP_M_CityGrowth' {
//MessageClass(501);
//city_happiness = city.happiness;
//MessageType("TP_CITY_GROWTH");
//Title(ID_TP_TITLE_CityGrowth);
//Text(ID_TP_TEXT_CityGrowth);
//EyePoint(city.1);
//Duration(1);
//UseDirector();
//Button(ID_Close_growth_messages) {
//KillClass(g.player, 501);
//}
//}


//
// Show short menu as soon as an enemy unit is clicked
//

TypeLocation position2;
Trigger 'TP_Click_Enemy' when (IsHumanPlayer(g.player) && clicked.unit && unit.owner != g.player) {
Message(g.player, 'TP_M_Click_Enemy');
}

messagebox 'TP_M_Click_Enemy' {
Duration(1);
position2 = unit.location;
Show();
MessageType("TP_ATTACK");
Title(ID_TP_TITLE_Click_Enemy);
Text(ID_TP_TEXT_Click_Enemy);
AddCenter(position2);
Button(ID_BUTTON_CANCEL) {
Kill();
}
Button(ID_BUTTON_LIBRARY) {
LibraryUnit(unit);
Kill();
}
Button(ID_BUTTON_DIPLOMATIC_MENU) {
OpenDiplomacy();
Kill();
}
Button(ID_BUTTON_TRADE_MENU) {
OpenTrade();
Kill();
}
}


//
// Option to add a settler to a city of size 2-6 (Alanus, thanks for finding the bug in there!)
// Changed to autowar - Smirnov 5.11.2011
//

TypeLocation position3;
trigger 'TP_T_Add_To_City_Menu' when ((IsHumanPlayer(g.player)) && (unit.moved) && (unit.type == UnitType("UNIT_AUTOWAR"))) {
position3 = unit.location;
incity = 0;
i = 0;
while ((i < player.cities) && (incity == 0)) {
SetCitybyIndex(1, player, i);
if (position3 == city.location) {
incity = 1;
if ((city.population <= 6) && (city.population >=2)) {
Message(g.player, 'TP_M_Add_To_City_Menu');
}
}
i = i + 1;
}
}

alertbox 'TP_M_Add_To_City_Menu' {
Text(ID_TP_M_Add_To_City_Menu);
Button(ID_BUTTON_NO) {
Kill();
}
Button(ID_BUTTON_YES) {
AddPops(city, 1);
SetOrder(1, 56); 
AddOrder(unit, position3);
Kill();
}
}


//
// Capitol Altertboxes by Alanus (Thanks a lot)
//

alertbox 'ALM_M_Capitol_BUILT'{
Text(ID_ALM_Capitol_BUILT);
Button(ID_BUTTON_CLOSE) {
kill();
}
Button(ID_BUTTON_LIBRARY) {
LibraryBuilding(building.built);
kill();
}
Duration(1);
UseDirector();
}

alertbox 'ALM_M_Capitol_BUILT_QUEUE_EMPTY'{
Text(ID_ALM_Capitol_BUILT_QUEUE_EMPTY);
Button(ID_BUTTON_CLOSE) {
kill();
}
Button(ID_BUTTON_LIBRARY) {
LibraryBuilding(building.built);
kill();
}
Duration(1);
UseDirector();
}


//
// Here a slightly revised messagebox offering a link to the GL as soon as a new advance
// has been found when entering a goody hut
// PLEASE ELIMINATE THE ORIGINAL
//

alertbox '79DiscoveredRemnantsOfAncientCivilisation' {
	Text(ID_DISCOVERED_REMNANTS_OF_ANCIENT_CIV) ;
	Button(ID_BUTTON_CLOSE) {
		Kill();
	}
	Button(ID_BUTTON_LIBRARY) {
		Kill();
		LibraryAdvance(discovery.type);
	}
	UseDirector();
}


//
// Show "Unit XX got a veteran" at the end of a battle not before a battle starts!
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '250UnitGainedVeteranStatus' {
	Duration(1);
	Text(ID_UNIT_VETERAN);
	EyePoint(unit.1.location);
	MessageType("MILITARY");
	UseDirector();
}



//
// Show "City XX got destroyed in war" at the end of a battle not before a battle starts!
// PLEASE ELIMINATE THE ORIGINAL
//

messageBox '266CityDestroyedByWar' {
	Text(ID_CITY_DESTROYED_BY_WAR);
	MessageType("STARVE");
	UseDirector();
}


//
// Show winning/loosing civ messages due to war at end of battle not before a battle starts !
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '75PlayerDefeated' {
	Text(ID_PLAYER_DEFEATED) ;
	MessageType("CIVILIZATION");
	UseDirector();
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '76PlayerDefeatedBy' {
	Text(ID_PLAYER_DEFEATED_BY) ;
	MessageType("CIVILIZATION");
	UseDirector();
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '77YouLose' {
	Text(ID_YOU_LOSE) ;
 	MessageType("CIVILIZATION");
	UseDirector();
}



//
// Show winning/loosing city messages due to war at end of battle not before a battle starts !
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '123CitiesCapturedVictim' {
	UseDirector();
	Text(ID_CITIES_CAPTURED_VICTIM) ;
	MessageType("MILITARY");
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '126CapitalCityCapturedAttacker' {
	UseDirector();
	Text(ID_CAPITAL_CITY_CAPTURED_ATTACKER) ;
	MessageType("MILITARY");
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '127CapitalCityCapturedVictim' {
	UseDirector();
	Text(ID_CAPITAL_CITY_CAPTURED_VICTIM) ;
	MessageType("MILITARY");
}



//
// Updated "City is happy" messagebox with new icon
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '40CityIsCelebratingHappiness' {
	MessageClass(505);
	Text(ID_CITY_IS_CELEBRATING_HAPPINESS);
	MessageType("TP_CITY_HAPPY");
	EyePoint(city);
	Duration(1);
	Button(ID_Close_happiness_messages) {
	KillClass(g.player, 505);
	}
}



//
// Updated "Got advance due to capturig city" messagebox after a battle has finished 
// PLEASE ELIMINATE THE ORIGINAL
//

alertbox '99AdvanceFromCapturingCity' {
	Text(ID_ADVANCE_FROM_CAPTURING_CITY);
	Button(ID_BUTTON_CLOSE) {
		Kill();
	}
	Button(ID_BUTTON_LIBRARY) {
		Kill();
		LibraryAdvance(discovery.type);
	}
	UseDirector();
}


//
// Updated "Do you want to free slaves?" messagebox after a battle has finished
// PLEASE ELIMINATE THE ORIGINAL
//

alertBox '20IAFreeSlaves' {
UseDirector();
MessageClass(420);
	Text(ID_IA_FREE_SLAVES);
 	Button(ID_BUTTON_NO) {
 		Kill();
 	}
 	Button(ID_BUTTON_YES) {
 		DoFreeSlaves();
 		Kill();
 	}
}


//
// Updated "You have reached the City max" messagebox
// PLEASE ELIMINATE THE ORIGINAL
//

alertbox '28IAMaxCitiesReached' {
UseDirector();
MessageClass(420);
	Text(ID_IA_MAX_CITIES_REACHED) ;
	Button(ID_BUTTON_CLOSE) {
		Kill();
	}
}


//
// Updated "Pick new discovery" messagebox
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '28PickNewDiscovery' {
	UseDirector();
	Text(ID_PICK_NEW_DISCOVERY);
	EyeDropdown(2, discovery);
	Button(ID_BUTTON_RESEARCH) {
		Research();
		Kill();
	}
	Button(ID_BUTTON_LIBRARY) {
		OpenLibrary();
	}

	Button(ID_BUTTON_GOAL) {
		OpenResearchGoalWindow();
	}
	MessageType("KNOWLEDGE");
}


//
// Updated Discovery messageboxes due to Edison's Lab and Internet.
// PLEASE ELIMINATE THE ORIGINAL
//

alertbox '115EdisonDiscovery' {
 	Text(ID_EDISON_DISCOVERY) ;
	Button(ID_BUTTON_CLOSE) {
		Kill();
	}
	Button(ID_BUTTON_LIBRARY) {
		Kill();
		LibraryAdvance(discovery.type);
	}
	UseDirector();
}


// PLEASE ELIMINATE THE ORIGINAL

alertbox '116InternetDiscovery' {
	Text(ID_INTERNET_DISCOVERY) ;
	Button(ID_BUTTON_CLOSE) {
		Kill();
	}
	Button(ID_BUTTON_LIBRARY) {
		Kill();
		LibraryAdvance(discovery.type);
	}
	UseDirector();
}

 

// 
// Updated CityQueueEmpty messages with new messageicons
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '38BuildingBuilt' {
	Duration(1);
	if (building.built == BuildingType("IMPROVE_CAPITOL")) {
		Message(g.player, 'ALM_M_Capitol_BUILT');
		Abort();
	} else {
		Text(ID_BUILDING_BUILT);
		MessageType("NEW_BUILDING");
		Button(ID_BUTTON_LIBRARY) {
		LibraryBuilding(building.built);
		}
		EyePoint(city.1, city.owner, 'OpenProductionCallback');
	}
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '37CityQueueIsEmpty' {
	MessageClass(502);
	Text(ID_CITY_BUILD_QUEUE_IS_EMPTY);
	Title(ID_TITLE_CITY_BUILD_QUEUE_IS_EMPTY);
	Button(ID_Close_queueempty_messages) {
	KillClass(g.player, 502);
	}
	EyePoint(city.1, city.owner, 'OpenProductionCallback');
	Duration(1);
	MessageType("TP_QUEUE_EMPTY"); 
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '38UnitCompletedQueueEmpty' {
	MessageClass(502);
	Text(ID_UNIT_COMPLETED_QUEUE_EMPTY);
	Duration(1);
	MessageType("TP_QUEUE_EMPTY_AFTER_UNIT"); 
	EyePoint(city.1, city.owner, 'OpenProductionCallback');
	Button(ID_Close_queueempty_messages) {
	KillClass(g.player, 502);
	}
	Button(ID_BUTTON_LIBRARY) {
	LibraryUnit(unit);
	}
}


// PLEASE ELIMINATE THE ORIGINAL

//messagebox '38UnitCompleted' {
//	if (city.queue >= 2) {
//		Text(ID_NEW_UNIT_COMPLETED);
//		Duration(1);
//		MessageType("NEXT_UNIT_ICON");
//		EyePoint(city.1, city.owner, 'OpenProductionCallback');
//		Button(ID_BUTTON_LIBRARY) {
//		LibraryUnit(unit);
//		}
//	}
//	else {
//		MessageClass(502);
//		ClearBuildQueue(city.1);
//		Text(ID_UNIT_COMPLETED_QUEUE_EMPTY);
//		Duration(1);
//		MessageType("TP_QUEUE_EMPTY_AFTER_UNIT");
//		EyePoint(city.1, city.owner, 'OpenProductionCallback');
//		Button(ID_Close_queueempty_messages) {
//		KillClass(g.player, 502);
//		}
//		Button(ID_BUTTON_LIBRARY) {
//		LibraryUnit(unit);
//		}	
//	}
//}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '38BuildingBuiltQueueEmpty' {
	if (building.built == BuildingType("IMPROVE_CAPITOL")) {
		Message(g.player, 'ALM_M_Capitol_BUILT_QUEUE_EMPTY');
		Abort();
	} else {
	MessageClass(502);
	Text(ID_BUILDING_BUILT_QUEUE_EMPTY);
	Duration(1);
	MessageType("TP_QUEUE_EMPTY_AFTER_BUILDING"); 
	EyePoint(city.1, city.owner, 'OpenProductionCallback');
	Button(ID_Close_queueempty_messages) {
	KillClass(g.player, 502);
	}
	Button(ID_BUTTON_LIBRARY) {
	LibraryBuilding(building);
	}
	}
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '38WonderBuilt' {
	MessageClass(502);
	Text(ID_WONDER_BUILT);
	Duration(1);
	MessageType("IWONDER");
	EyePoint(city.1, city.owner, 'OpenProductionCallback');
	Button(ID_BUTTON_LIBRARY) {
	LibraryWonder(wonder);
	}
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '38WonderBuiltQueueEmpty' {
	MessageClass(502);
	Text(ID_WONDER_BUILT_QUEUE_EMPTY);
	Duration(1);
	MessageType("TP_QUEUE_EMPTY_AFTER_WONDER"); 
	EyePoint(city.1, city.owner, 'OpenProductionCallback');
	Button(ID_Close_queueempty_messages) {
	KillClass(g.player, 502);
	}
	Button(ID_BUTTON_LIBRARY) {
	LibraryWonder(wonder);
	}
}


// PLEASE ELIMINATE THE ORIGINAL

messagebox '38EndgameBuiltQueueEmpty' {
	MessageClass(502);
	Text(ID_ENDGAME_BUILT_QUEUE_EMPTY);
	Duration(1);
	MessageType("TP_QUEUE_EMPTY"); 
	EyePoint(city.1, city.owner, 'OpenProductionCallback');
	Button(ID_Close_queueempty_messages) {
	KillClass(g.player, 502);
	}
}


//
// Updated replay of city/unit attacks 
// PLEASE ELIMINATE THE ORIGINAL
//

//messageBox '410HotseatCityAttacked' {
//	MessageClass(503);
//	MessageType("TP_ATTACK");
//	Text(ID_HOTSEAT_CITY_ATTACKED);
//	Button(ID_Close_attack_messages) {
//	KillClass(g.player, 503);
//	}
//	Button(ID_SHOW_ME) {
//		AddCenter(location.1);
//		AddEffect(location.1, "SPECEFFECT_EXPLOSION_LAND_1", "SOUND_ID_NONE");
//		Kill();
//	}
//}


// PLEASE ELIMINATE THE ORIGINAL

//messageBox '411HotseatArmyAttacked' {
//	MessageClass(503);
//	MessageType("TP_ATTACK");
//	Text(ID_HOTSEAT_ARMY_ATTACKED);
//	Button(ID_Close_attack_messages) {
//	KillClass(g.player, 503);
//	}
//	Button(ID_SHOW_ME) {
//		AddCenter(location.1);
//		AddEffect(location.1, "SPECEFFECT_EXPLOSION_LAND_1", "SOUND_ID_NONE");
//		Kill();
//	}
//}


//
// Updated "You enslavered an unit in combat" message
// PLEASE ELIMINATE THE ORIGINAL (trigger PLUS messagebox)
//

trigger 'TVictoryEnslavement' when (special.VictoryEnslavement) {
	Message(player.1, '402VictoryEnslavement');
}

messageBox '402VictoryEnslavement' {
	Duration(1);
	UseDirector();
	Text(ID_VICTORY_ENSLAVEMENT_CITY);
	MessageType("DEMANDS");
}


//
// Updated "You are destroying the environment with pollution"
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '040GrossPolluter' {
	Text(ID_GROSS_POLLUTER) ;
	MessageType("POLLUTION");
	EyePoint(city);
}


//
// Updated "You just got victim of a steal technology attack"
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '186StealTechnologyVictim' {
 	Text(ID_STEAL_TECHNOLOGY_VICTIM) ;
 	MessageType("STEAL_ADVANCE_ICON");
	EyePoint(city);
}


//
// Updated "Broken leave our lands"
// PLEASE ELIMINATE THE ORIGINAL
//

messagebox '260LeaveOurLandsBroken' {
	Text(ID_LEAVE_OUR_LANDS_BROKEN);
	MessageType("ANTIDIPLOMATIC");
	Button(ID_BUTTON_DIPLOMATIC_MENU) {
	OpenDiplomacy();
	Kill();
	}
}
