---------------------------------------------------------------------------------------------------------------
-- Set each character's preference for number of building floors
--					Floors	1	2	3	4	5	6	7	8	9	10
---------------------------------------------------------------------------------------------------------------
--30, 70, 15, 8,	4,	2,	0,	0,	0,	0);

AiChars[CAR]:SetFloors(		30, 70, 15, 8,	4,	2,	0,	0,	0,	0);
AiChars[HAT]:SetFloors(		30, 15, 70, 8,	4,	2,	0,	0,	0,	0);
AiChars[GUN]:SetFloors(		30, 15, 15, 70,	4,	2,	0,	0,	0,	0);
AiChars[DOG]:SetFloors(		30, 70, 15, 8,	4,	2,	0,	0,	0,	0);
AiChars[IRON]:SetFloors(	30, 15, 15, 8,	70,	2,	0,	0,	0,	0);
AiChars[SHIP]:SetFloors(	30, 15, 15, 8,	4,	70,	0,	0,	0,	0);
AiChars[SHOE]:SetFloors(	30, 15, 70, 8,	5,	2,	0,	0,	0,	0);
AiChars[HORSE]:SetFloors(	30, 70, 15, 8,	4,	2,	0,	0,	0,	0);
AiChars[BARROW]:SetFloors(	30, 15, 8,  70,	4,	2,	0,	0,	0,	0);
AiChars[THIMBLE]:SetFloors(	30, 70, 15, 8,	4,	2,	0,	0,	0,	0);

--AiChars[CAR]:SetFloors(		3, 30, 30, 15,	8,	5,	0,	0,	0,	0);
--AiChars[HAT]:SetFloors(		70, 30, 12, 4,	2,	1,	0,	0,	0,	0);
--AiChars[GUN]:SetFloors(		40, 30, 15, 10,	6,	3,	0,	0,	0,	0);
--AiChars[DOG]:SetFloors(		70, 30, 12, 4,	2,	1,	0,	0,	0,	0);
--AiChars[IRON]:SetFloors(		70, 30, 15, 8,	4,	2,	0,	0,	0,	0);
--AiChars[SHIP]:SetFloors(		30, 30, 30, 5,	3,	2,	0,	0,	0,	0);
--AiChars[SHOE]:SetFloors(		70, 30, 12, 4,	2,	1,	0,	0,	0,	0);
--AiChars[HORSE]:SetFloors(		3, 30, 25, 20,	8,	3,	0,	0,	0,	0);
--AiChars[BARROW]:SetFloors(	70, 30, 12, 4,	2,	1,	0,	0,	0,	0);
--AiChars[THIMBLE]:SetFloors(	20, 40, 30, 10,	3,	1,	0,	0,	0,	0);


-------------------------------------------------------------------------------------------------------------------
-------------------------------	SB	MIN	MAX	PREF 
-------------------------------------------------------------------------------------------------------------------
--1
--2
--4
--6
--8



------------------------------------------------------------------------------------------------------------------								
AiChars[HAT]:SetFootprint(		0,	1,	4,	2 );	
AiChars[HAT]:SetFootprint(		1,	2,	8,	4 );
AiChars[HAT]:SetFootprint(		2,	4,	9,	4 );
AiChars[HAT]:SetFootprint(		3,	6,	16,	8 );
AiChars[HAT]:SetFootprint(		4,	8,	24,	12);
------------------------------------------------------------------------------------------------------------------	
AiChars[GUN]:SetFootprint(		0,	1,	4,	1 );	
AiChars[GUN]:SetFootprint(		1,	2,	8,	2 );
AiChars[GUN]:SetFootprint(		2,	4,	9,	4 );
AiChars[GUN]:SetFootprint(		3,	6,	16,	6 );
AiChars[GUN]:SetFootprint(		4,	8,	24,	8 );
------------------------------------------------------------------------------------------------------------------	
AiChars[SHIP]:SetFootprint(		0,	1,	4,	2 );	
AiChars[SHIP]:SetFootprint(		1,	2,	8,	4 );
AiChars[SHIP]:SetFootprint(		2,	4,	9,	4 );
AiChars[SHIP]:SetFootprint(		3,	6,	16,	8 );
AiChars[SHIP]:SetFootprint(		4,	8,	24,	12);
------------------------------------------------------------------------------------------------------------------	
AiChars[DOG]:SetFootprint(		0,	1,	4,	1 );	
AiChars[DOG]:SetFootprint(		1,	2,	8,	2 );
AiChars[DOG]:SetFootprint(		2,	4,	9,	4 );
AiChars[DOG]:SetFootprint(		3,	6,	16,	6 );
AiChars[DOG]:SetFootprint(		4,	8,	24,	8 );
------------------------------------------------------------------------------------------------------------------	
AiChars[IRON]:SetFootprint(		0,	1,	4,	1);	
AiChars[IRON]:SetFootprint(		1,	2,	8,	2);
AiChars[IRON]:SetFootprint(		2,	4,	9,	4);
AiChars[IRON]:SetFootprint(		3,	6,	16,	6);
AiChars[IRON]:SetFootprint(		4,	8,	24,	8);
------------------------------------------------------------------------------------------------------------------	
AiChars[CAR]:SetFootprint(		0,	1,	4,	2 );	
AiChars[CAR]:SetFootprint(		1,	2,	8,	4 );
AiChars[CAR]:SetFootprint(		2,	4,	9,	4 );
AiChars[CAR]:SetFootprint(		3,	6,	16,	8 );
AiChars[CAR]:SetFootprint(		4,	8,	24,	12);
------------------------------------------------------------------------------------------------------------------	
AiChars[THIMBLE]:SetFootprint(	0,	1,	4,	1);	
AiChars[THIMBLE]:SetFootprint(	1,	2,	8,	2);
AiChars[THIMBLE]:SetFootprint(	2,	4,	9,	4);
AiChars[THIMBLE]:SetFootprint(	3,	6,	16,	6);
AiChars[THIMBLE]:SetFootprint(	4,	8,	24,	8);
------------------------------------------------------------------------------------------------------------------	
AiChars[HORSE]:SetFootprint(	0,	1,	4,	1);	
AiChars[HORSE]:SetFootprint(	1,	2,	8,	2);
AiChars[HORSE]:SetFootprint(	2,	4,	9,	4);
AiChars[HORSE]:SetFootprint(	3,	6,	16,	6);
AiChars[HORSE]:SetFootprint(	4,	8,	24,	8);
------------------------------------------------------------------------------------------------------------------	
AiChars[SHOE]:SetFootprint(		0,	1,	4,	1);	
AiChars[SHOE]:SetFootprint(		1,	2,	8,	2);
AiChars[SHOE]:SetFootprint(		2,	4,	9,	4);
AiChars[SHOE]:SetFootprint(		3,	6,	16,	6);
AiChars[SHOE]:SetFootprint(		4,	8,	24,	8);
------------------------------------------------------------------------------------------------------------------	
AiChars[BARROW]:SetFootprint(	0,	1,	4,	2 );	
AiChars[BARROW]:SetFootprint(	1,	2,	8,	4 );
AiChars[BARROW]:SetFootprint(	2,	4,	9,	4 );
AiChars[BARROW]:SetFootprint(	3,	6,	16,	8 );
AiChars[BARROW]:SetFootprint(	4,	8,	24,	12);


--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

AiChars[HAT]:SetPrestigeBias(PP_HIGH);
AiChars[DOG]:SetPrestigeBias(PP_HIGH);
AiChars[GUN]:SetPrestigeBias(PP_MED);
AiChars[CAR]:SetPrestigeBias(PP_ANY);
AiChars[IRON]:SetPrestigeBias(PP_ANY);
AiChars[SHOE]:SetPrestigeBias(PP_ANY);
AiChars[SHIP]:SetPrestigeBias(PP_MED);
AiChars[HORSE]:SetPrestigeBias(PP_MED);
AiChars[BARROW]:SetPrestigeBias(PP_ANY);
AiChars[THIMBLE]:SetPrestigeBias(PP_ANY);

--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////							
--											Bld.Bef.Buy		Buy To Bld.		Buy Opp.Blk		Buy Own Blk.
AiChars[HAT]:SetStrategySelectionBias(		60,				20,				10,				10 );
AiChars[DOG]:SetStrategySelectionBias(		60,				10,				25,				5  );					
AiChars[GUN]:SetStrategySelectionBias(		50,				20,				10,				20 );					
AiChars[CAR]:SetStrategySelectionBias(		80,				5,				5,				10 );
AiChars[IRON]:SetStrategySelectionBias(		50,				35,				5,				10 );					
AiChars[SHOE]:SetStrategySelectionBias(		70,				10,				10,				10 );						
AiChars[SHIP]:SetStrategySelectionBias(		70,				20,				5,				5  );					
AiChars[HORSE]:SetStrategySelectionBias(	70,				5,				10,				15 );						
AiChars[BARROW]:SetStrategySelectionBias(	80,				5,				5,				10 );						
AiChars[THIMBLE]:SetStrategySelectionBias(	70,				10,				5,				5  );

--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

--	1:	First day start-time		
--	2:	Building start-time	
--	3:	Day time building end-time
--	4:	Night time building end-time
--	5:	Construction rate (real seconds)
--	diff: (difficulty 0=easy; 1=medium; 2=hard)

function EVENT_LoadBuildTimes(a)
--										diff	1 hr/min	2 hr/min	3 hr/min	4 hr/min	5 rate(in real seconds!)	
--										------------------------------------------------------------------------------------------																				
	if a == CAR then																				
		AiChars[CAR]:SetBuildTimes(		0,		10, 00,		02, 07,		15, 07,		22, 07,		48	);
		AiChars[CAR]:SetBuildTimes(		1,		09, 45,		03, 07,		14, 07,		21, 07,		36	);
		AiChars[CAR]:SetBuildTimes(		2,		09, 30,		04, 07,		13, 07,		20, 07,		24	);
												
	elseif a == GUN then																									
		AiChars[GUN]:SetBuildTimes(		0,		10, 30,		04, 00,		16, 00,		21, 30,		56	);
		AiChars[GUN]:SetBuildTimes(		1,		10, 00,		05, 30,		15, 45,		20, 30,		42	);
		AiChars[GUN]:SetBuildTimes(		2,		09, 30,		06, 05,		15, 30,		19, 45,		28	);																										
												
	elseif a == SHIP then																									
		AiChars[SHIP]:SetBuildTimes(	0,		11, 00,		07, 45,		16, 00,		21, 00,		60	);
		AiChars[SHIP]:SetBuildTimes(	1,		10, 30,		07, 15,		14, 30,		19, 30,		50	);
		AiChars[SHIP]:SetBuildTimes(	2,		10, 00,		06, 45,		12, 00,		18, 00,		40	);
												
	elseif a == DOG then																											
		AiChars[DOG]:SetBuildTimes(		0,		11, 00,		08, 13,		14, 30,		19, 30,		70	);
		AiChars[DOG]:SetBuildTimes(		1,		10, 30,		07, 13,		14, 15,		19, 15,		56	);
		AiChars[DOG]:SetBuildTimes(		2,		10, 00,		06, 13,		14, 00,		19, 00,		44	);
												
	elseif a == IRON then																									
		AiChars[IRON]:SetBuildTimes(	0,		12, 00,		08, 00,		14, 00,		19, 00,		80	);
		AiChars[IRON]:SetBuildTimes(	1,		11, 00,		07, 00,		14, 00,		19, 00,		60	);
		AiChars[IRON]:SetBuildTimes(	2,		10, 00,		06, 03,		14, 00,		19, 00,		40	);
																						
	elseif a == SHOE then																										
		AiChars[SHOE]:SetBuildTimes(	0,		10, 45,		06, 35,		14, 30,		19, 30,		56	);
		AiChars[SHOE]:SetBuildTimes(	1,		10, 15,		06, 20,		14, 15,		19, 15,		46	);
		AiChars[SHOE]:SetBuildTimes(	2,		09, 45,		06, 05,		14, 00,		19, 00,		36	);
																				
	elseif a == THIMBLE then																										
		AiChars[THIMBLE]:SetBuildTimes( 0,		11, 40,		09, 15,		16, 00,		18, 00,		62	);
		AiChars[THIMBLE]:SetBuildTimes( 1,		11, 20,		08, 30,		14, 30,		18, 00,		52	);
		AiChars[THIMBLE]:SetBuildTimes( 2,		11, 05,		08, 00,		12, 00,		18, 00,		36	);
												
	elseif a == HAT then																											
		AiChars[HAT]:SetBuildTimes(		0,		10, 20,		04, 33,		17, 17,		21, 17,		52	);
		AiChars[HAT]:SetBuildTimes(		1,		09, 55,		05, 33,		16, 17,		20, 17,		40	);
		AiChars[HAT]:SetBuildTimes(		2,		09, 45,		06, 33,		15, 17,		19, 17,		36	);
												
	elseif a == BARROW then																										
		AiChars[BARROW]:SetBuildTimes(	0,		10, 37,		05, 36,		14, 30,		19, 30,		54	);
		AiChars[BARROW]:SetBuildTimes(	1,		10, 04,		06, 05,		14, 15,		19, 15,		40	);
		AiChars[BARROW]:SetBuildTimes(	2,		09, 36,		06, 05,		14, 00,		19, 00,		26	);
												
	elseif a == HORSE then																											
		AiChars[HORSE]:SetBuildTimes(	0,		10, 45,		04, 55,		16, 55,		21, 05,		52	);
		AiChars[HORSE]:SetBuildTimes(	1,		10, 15,		05, 15,		15, 55,		20, 05,		44	);
		AiChars[HORSE]:SetBuildTimes(	2,		09, 45,		06, 05,		14, 55,		19, 05,		36	);
	end;																
end;


--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
--	6:  selloffdelay;
--	7:  recoverytarget;
--	8:  pcentcommuters;
--	9:  minrentincrease;
--	10: pcentconsolidation;	
--	11: consolidationmaxcap;
--	12: pcentdemandaccuracy;
--	13: rejectblockhrsvariance;
--	14: maxbidthresholdvariance;
--	15: criticaldaysbeforerefurb;
--	16: auctioncountdownthreshold;
--	17: criticaldaysbeforedemolish;
--	18: minpcentbidthresholdforvoting;
--	19: minpcentbidthresholdnonvoting;
--	20: unfinishedblockscorethreshold;
--	diff: (difficulty 0=easy; 1=medium; 2=hard)


function EVENT_LoadDifficultyVariables(a)							
--											diff:	6		7		8		9		10		11		12		13		14		15		16		17		18		19		20		
--										------------------------------------------------------------------------------------------------------------------------------------
	if a == CAR then
		AiChars[CAR]:SetDifficultyVars(		0,		8,		100,	10,		1,		0.4,	2500,	1,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[CAR]:SetDifficultyVars(		1,		8,		100,	10,		1,		0.4,	2500,	5,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[CAR]:SetDifficultyVars(		2,		8,		100,	10,		1,		0.4,	2500,	10,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == GUN then																															
		AiChars[GUN]:SetDifficultyVars(		0,		8,		100,	10,		1,		0.4,	2500,	30,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[GUN]:SetDifficultyVars(		1,		8,		100,	10,		1,		0.4,	2500,	40,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[GUN]:SetDifficultyVars(		2,		8,		100,	10,		1,		0.4,	2500,	50,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == SHIP then																															
		AiChars[SHIP]:SetDifficultyVars(	0,		8,		100,	10,		1,		0.4,	2500,	50,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[SHIP]:SetDifficultyVars(	1,		8,		100,	10,		1,		0.4,	2500,	60,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[SHIP]:SetDifficultyVars(	2,		8,		100,	10,		1,		0.4,	2500,	70,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == DOG then																															
		AiChars[DOG]:SetDifficultyVars(		0,		8,		100,	10,		1,		0.4,	2500,	60,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[DOG]:SetDifficultyVars(		1,		8,		100,	10,		1,		0.4,	2500,	70,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[DOG]:SetDifficultyVars(		2,		8,		100,	10,		1,		0.4,	2500,	80,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == IRON then																															
		AiChars[IRON]:SetDifficultyVars(	0,		8,		100,	10,		1,		0.4,	2500,	70,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);	
		AiChars[IRON]:SetDifficultyVars(	1,		8,		100,	10,		1,		0.4,	2500,	80,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[IRON]:SetDifficultyVars(	2,		8,		100,	10,		1,		0.4,	2500,	90,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == SHOE then																															
		AiChars[SHOE]:SetDifficultyVars(	0,		8,		100,	10,		1,		0.4,	2500,	60,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);	
		AiChars[SHOE]:SetDifficultyVars(	1,		8,		100,	10,		1,		0.4,	2500,	80,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[SHOE]:SetDifficultyVars(	2,		8,		100,	10,		1,		0.4,	2500,	100,	8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == THIMBLE then																														
		AiChars[THIMBLE]:SetDifficultyVars(	0,		8,		100,	10,		1,		0.4,	2500,	5,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[THIMBLE]:SetDifficultyVars(	1,		8,		100,	10,		1,		0.4,	2500,	10,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[THIMBLE]:SetDifficultyVars(	2,		8,		100,	10,		1,		0.4,	2500,	20,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == HAT then																															
		AiChars[HAT]:SetDifficultyVars(		0,		8,		100,	10,		1,		0.4,	2500,	10,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[HAT]:SetDifficultyVars(		1,		8,		100,	10,		1,		0.4,	2500,	20,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
		AiChars[HAT]:SetDifficultyVars(		2,		8,		100,	10,		1,		0.4,	2500,	30,		8,		200,	1,		10,		2,		0.2,	0.4,	30	);
																																					
	elseif a == BARROW then																															
		AiChars[BARROW]:SetDifficultyVars(	0,		8,		100,	10,		1,		0.4,	2500,	40,		8,		200,	1,		10,		3,		0.2,	0.4,	30	);
		AiChars[BARROW]:SetDifficultyVars(	1,		8,		100,	10,		1,		0.4,	2500,	50,		8,		200,	1,		10,		3,		0.2,	0.4,	30	);
		AiChars[BARROW]:SetDifficultyVars(	2,		8,		100,	10,		1,		0.4,	2500,	60,		8,		200,	1,		10,		3,		0.2,	0.4,	30	);
																																					
	elseif a == HORSE then																															
		AiChars[HORSE]:SetDifficultyVars(	0,		8,		100,	10,		1,		0.4,	2500,	20,		8,		200,	1,		10,		3,		0.2,	0.4,	30	);
		AiChars[HORSE]:SetDifficultyVars(	1,		8,		100,	10,		1,		0.4,	2500,	30,		8,		200,	1,		10,		3,		0.2,	0.4,	30	);
		AiChars[HORSE]:SetDifficultyVars(	2,		8,		100,	10,		1,		0.4,	2500,	40,		8,		200,	1,		10,		3,		0.2,	0.4,	30	);
	end;
end;


--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function EVENT_LoadScoreData()

	AiChars[HAT]:SetBaseValMultiplier(10);
	AiChars[DOG]:SetBaseValMultiplier(10);
	AiChars[GUN]:SetBaseValMultiplier(10);
	AiChars[CAR]:SetBaseValMultiplier(10);
	AiChars[IRON]:SetBaseValMultiplier(10);
	AiChars[SHOE]:SetBaseValMultiplier(10);
	AiChars[SHIP]:SetBaseValMultiplier(10);
	AiChars[HORSE]:SetBaseValMultiplier(10);
	AiChars[BARROW]:SetBaseValMultiplier(10);
	AiChars[THIMBLE]:SetBaseValMultiplier(10);

	AiScores.blk2_Monopoly				= 75;		
	AiScores.blk2_1left_city_owned		= 25;	
	AiScores.blk2_opponent_monopoly		= 60;

	AiScores.blk2_Max_LandRent_Income	= 40;
	
	AiScores.blk3_Monopoly				= 75;
	AiScores.blk3_1left_city_owned		= 50;
	AiScores.blk3_2left_city_owned		= 10;
	AiScores.blk3_1left_player_owned	= 25;
	AiScores.blk3_opponent_monopoly		= 60;
	AiScores.blk3_opponent_2blocks		= 20;
	AiScores.blk3_Max_Monopoly			= 75;
	AiScores.blk3_Max_LandRent_Income	= 40;

	AiScores.RRUtil_Monopoly			= 35;
	AiScores.RRUtil_1left_city_owned	= 22;
	AiScores.RRUtil_2left_city_owned	= 10;
	AiScores.RRUtil_3left_city_owned    = 3;
	AiScores.RRUtil_3left_Bonus			= 20;
	AiScores.RRUtil_opponent_monopoly	= 25;
	AiScores.RRUtil_Max_LandRent_Income	= 100;

	AiScores.MaxScoreCap				= 110;
	
	AiScores.MaxDevelopment				= 30
	AiScores.MaxObjective				= 0;
	AiScores.MaxHindrance				= 0;
	AiScores.BasicBidVariance			= 10;
	AiScores.MaxTTscoreThreshold		= 75;

end;




--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
------------------------------------------------------------
-- Available actions.....			TType,	Hr, Min, Event
------------------------------------------------------------
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_POLL );
--	AiChars[BARROW]:LoadTimeTable(	HSE,	00, 00, TT_DEMOLISH );
--  AiChars[BARROW]:LoadTimeTable(	HSE,	00, 00, TT_SPOILAGE );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_BUY_BLOCK );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_SELL_BLOCK );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_CREATE_BUS );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_TAKEOVER_BUS );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_REFURBISH_BUS );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 30, TT_EOD_STOCK_AND_PRICE );
--	AiChars[BARROW]:LoadTimeTable(	TAC,	00, 00, TT_BUSINESS_STATES );
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


--///////////////////////////////////////////////////////////////////////////////////////////////////////
--								H O U S E K E E P I N G		T I M E T A B L E
--///////////////////////////////////////////////////////////////////////////////////////////////////////
--** NB *** NOTE THE FOLLOWING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--** "TT_BUSINESS_STATES" must be called before "TT_EOD_STOCK_AND_PRICE"
--** "TT_REFURBISH_BUS"   must be called after  "TT_BUSINESS_STATES"
--** "TT_EOD_STOCK_AND_PRICE" must be called before 6AM!!!!

function EVENT_LoadHseKeepingTimetable(a)

	AiChars[a]:ResetTimeTable(HSE);

	if a == IRON then			
		AiChars[IRON]:LoadTimeTable( HSE,00,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,01,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[IRON]:LoadTimeTable( HSE,02,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,03,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,04,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,05,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,06,    30, TT_BUSINESS_STATES );
		AiChars[IRON]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[IRON]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,09,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,11,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,12,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,13,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,14,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[IRON]:LoadTimeTable( HSE,15,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,16,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,17,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,18,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,19,	30,	TT_RENT );		
		AiChars[IRON]:LoadTimeTable( HSE,20,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[IRON]:LoadTimeTable( HSE,21,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[IRON]:LoadTimeTable( HSE,22,	30,	TT_RENT );
		AiChars[IRON]:LoadTimeTable( HSE,23,	30,	TT_RENT );
	
	elseif a == HAT then		
		AiChars[HAT]:LoadTimeTable(	HSE,00,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,01,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[HAT]:LoadTimeTable(	HSE,02,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,03,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,04,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,05,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,06, 30, TT_BUSINESS_STATES );
		AiChars[HAT]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[HAT]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[HAT]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,09,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,10,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,11,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,12,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,13,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,14,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[HAT]:LoadTimeTable(	HSE,15,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,16,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,17,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,18,	30,	TT_RENT );	
		AiChars[HAT]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,19,	30,	TT_RENT );		
		AiChars[HAT]:LoadTimeTable(	HSE,20,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[HAT]:LoadTimeTable(	HSE,21,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[HAT]:LoadTimeTable(	HSE,22,	30,	TT_RENT );
		AiChars[HAT]:LoadTimeTable(	HSE,23,	30,	TT_RENT );		

	elseif a == BARROW then			
		AiChars[BARROW]:LoadTimeTable( HSE,00,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,01,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 	
		AiChars[BARROW]:LoadTimeTable( HSE,02,	30,	TT_RENT );
		AiChars[BARROW]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );	
		AiChars[BARROW]:LoadTimeTable( HSE,03,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,04,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,05,	30,	TT_RENT );
		AiChars[BARROW]:LoadTimeTable( HSE,06,  30, TT_BUSINESS_STATES );	
		AiChars[BARROW]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[BARROW]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,09,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,10,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,11,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,12,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,13,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,14,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,15,	00,	TT_SPOILAGE ); 	
		AiChars[BARROW]:LoadTimeTable( HSE,15,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,16,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,17,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,18,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,19,	30,	TT_RENT );			
		AiChars[BARROW]:LoadTimeTable( HSE,20,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,21,	00,	TT_SPOILAGE ); 	
		AiChars[BARROW]:LoadTimeTable( HSE,21,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[BARROW]:LoadTimeTable( HSE,22,	30,	TT_RENT );	
		AiChars[BARROW]:LoadTimeTable( HSE,23,	30,	TT_RENT );				

	elseif a == DOG then	
		AiChars[DOG]:LoadTimeTable(	HSE,00,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,01,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[DOG]:LoadTimeTable(	HSE,02,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,03,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,04,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,05,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,06, 30, TT_BUSINESS_STATES );
		AiChars[DOG]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[DOG]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[DOG]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,09,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,10,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,11,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,12,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,13,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,14,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[DOG]:LoadTimeTable(	HSE,15,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,16,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,17,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,18,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,19,	30,	TT_RENT );		
		AiChars[DOG]:LoadTimeTable(	HSE,20,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[DOG]:LoadTimeTable(	HSE,21,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[DOG]:LoadTimeTable(	HSE,22,	30,	TT_RENT );
		AiChars[DOG]:LoadTimeTable(	HSE,23,	30,	TT_RENT );

	elseif a == THIMBLE then			
		AiChars[THIMBLE]:LoadTimeTable(	HSE,00,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,01,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[THIMBLE]:LoadTimeTable(	HSE,02,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,03,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,04,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,05,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,06, 30, TT_BUSINESS_STATES );
		AiChars[THIMBLE]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[THIMBLE]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[THIMBLE]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,09,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,10,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,11,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,12,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,13,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,14,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,14,	00,	TT_SPOILAGE ); 
		AiChars[THIMBLE]:LoadTimeTable(	HSE,15,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,16,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,17,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,18,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,19,	30,	TT_RENT );		
		AiChars[THIMBLE]:LoadTimeTable(	HSE,20,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[THIMBLE]:LoadTimeTable(	HSE,21,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,22,	30,	TT_RENT );
		AiChars[THIMBLE]:LoadTimeTable(	HSE,23,	30,	TT_RENT );		 

	elseif a == HORSE then			
		AiChars[HORSE]:LoadTimeTable( HSE,00,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,01,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 	
		AiChars[HORSE]:LoadTimeTable( HSE,02,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[HORSE]:LoadTimeTable( HSE,03,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,04,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,05,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,06,	30, TT_BUSINESS_STATES );
		AiChars[HORSE]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[HORSE]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[HORSE]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[HORSE]:LoadTimeTable( HSE,09,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,10,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,11,	30,	TT_RENT );
		AiChars[HORSE]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );	
		AiChars[HORSE]:LoadTimeTable( HSE,12,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,13,	30,	TT_RENT );
		AiChars[HORSE]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );	
		AiChars[HORSE]:LoadTimeTable( HSE,14,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,15,	00,	TT_SPOILAGE ); 	
		AiChars[HORSE]:LoadTimeTable( HSE,15,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[HORSE]:LoadTimeTable( HSE,16,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,17,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,18,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[HORSE]:LoadTimeTable( HSE,19,	30,	TT_RENT );			
		AiChars[HORSE]:LoadTimeTable( HSE,20,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,21,	00,	TT_SPOILAGE ); 	
		AiChars[HORSE]:LoadTimeTable( HSE,21,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[HORSE]:LoadTimeTable( HSE,22,	30,	TT_RENT );	
		AiChars[HORSE]:LoadTimeTable( HSE,23,	30,	TT_RENT );		

	elseif a == SHIP then			
		AiChars[SHIP]:LoadTimeTable( HSE,00,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,01,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[SHIP]:LoadTimeTable( HSE,02,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,03,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,04,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,05,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,06,    30, TT_BUSINESS_STATES );
		AiChars[SHIP]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[SHIP]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,09,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,10,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,11,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,12,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,13,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,14,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[SHIP]:LoadTimeTable( HSE,15,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,16,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,17,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,18,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,19,	30,	TT_RENT );		
		AiChars[SHIP]:LoadTimeTable( HSE,20,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[SHIP]:LoadTimeTable( HSE,21,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[SHIP]:LoadTimeTable( HSE,22,	30,	TT_RENT );
		AiChars[SHIP]:LoadTimeTable( HSE,23,	30,	TT_RENT );		

	elseif a == GUN then			
		AiChars[GUN]:LoadTimeTable(	HSE,00,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,01,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[GUN]:LoadTimeTable(	HSE,02,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,03,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,04,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,05,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,06, 30, TT_BUSINESS_STATES );
		AiChars[GUN]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[GUN]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[GUN]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,09,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,10,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,11,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,12,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,13,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,14,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[GUN]:LoadTimeTable(	HSE,15,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,16,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,17,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,18,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,19,	30,	TT_RENT );		
		AiChars[GUN]:LoadTimeTable(	HSE,20,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[GUN]:LoadTimeTable(	HSE,21,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[GUN]:LoadTimeTable(	HSE,22,	30,	TT_RENT );
		AiChars[GUN]:LoadTimeTable(	HSE,23,	30,	TT_RENT );	

	elseif a == SHOE then			
		AiChars[SHOE]:LoadTimeTable( HSE,00,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,01,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[SHOE]:LoadTimeTable( HSE,02,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,03,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,04,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,05,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,06,    30, TT_BUSINESS_STATES );
		AiChars[SHOE]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[SHOE]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,09,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,10,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,11,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,12,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,13,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );		
		AiChars[SHOE]:LoadTimeTable( HSE,14,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[SHOE]:LoadTimeTable( HSE,15,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,16,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,17,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,18,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,19,	30,	TT_RENT );		
		AiChars[SHOE]:LoadTimeTable( HSE,20,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[SHOE]:LoadTimeTable( HSE,21,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[SHOE]:LoadTimeTable( HSE,22,	30,	TT_RENT );
		AiChars[SHOE]:LoadTimeTable( HSE,23,	30,	TT_RENT );	

	elseif a == CAR then			
		AiChars[CAR]:LoadTimeTable(	HSE,00,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,01,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,02,	30,	TT_EOD_STOCK_AND_PRICE ); 
		AiChars[CAR]:LoadTimeTable(	HSE,02,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable( HSE,02,	40,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,03,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,04,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,05,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,06, 30, TT_BUSINESS_STATES );
		AiChars[CAR]:LoadTimeTable( HSE,07,	00,	TT_DEMOLISH );
		AiChars[CAR]:LoadTimeTable( HSE,07,	30,	TT_REFURBISH_BUS );
		AiChars[CAR]:LoadTimeTable( HSE,07,	30,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,09,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,10,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,11,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable( HSE,11,	45,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,12,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,13,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable( HSE,13,	45,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,14,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,15,	00,	TT_SPOILAGE ); 
		AiChars[CAR]:LoadTimeTable(	HSE,15,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable( HSE,15,	45,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,16,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,17,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,18,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable( HSE,18,	45,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,19,	30,	TT_RENT );		
		AiChars[CAR]:LoadTimeTable(	HSE,20,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,21,	00,	TT_SPOILAGE ); 
		AiChars[CAR]:LoadTimeTable(	HSE,21,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable( HSE,21,	45,	TT_TAKEOVER_BUS );
		AiChars[CAR]:LoadTimeTable(	HSE,22,	30,	TT_RENT );
		AiChars[CAR]:LoadTimeTable(	HSE,23,	30,	TT_RENT );	
	end;
end;


--///////////////////////////////////////////////////////////////////////////////////////////////////////
--									B U Y   B L O C K   T I M E T A B L E 
--///////////////////////////////////////////////////////////////////////////////////////////////////////
function EVENT_LoadBuyBlockTimetable(a)

	AiChars[a]:ResetTimeTable(BLK);

	if a == IRON then	
		AiChars[IRON]:LoadTimeTable(	BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[IRON]:LoadTimeTable(	BLK, 13, 00, TT_BUY_BLOCK );		
		AiChars[IRON]:LoadTimeTable(	BLK, 16, 00, TT_BUY_BLOCK );

	elseif a == HAT	then	
		AiChars[HAT]:LoadTimeTable(		BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[HAT]:LoadTimeTable(		BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[HAT]:LoadTimeTable(		BLK, 18, 00, TT_BUY_BLOCK );		
		
	elseif a == BARROW then	
		AiChars[BARROW]:LoadTimeTable(	BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[BARROW]:LoadTimeTable(	BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[BARROW]:LoadTimeTable(	BLK, 18, 00, TT_BUY_BLOCK );
		
	elseif a == DOG then	
		AiChars[DOG]:LoadTimeTable(		BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[DOG]:LoadTimeTable(		BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[DOG]:LoadTimeTable(		BLK, 18, 00, TT_BUY_BLOCK );		
		
	elseif a == THIMBLE then	
		AiChars[THIMBLE]:LoadTimeTable(	BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[THIMBLE]:LoadTimeTable(	BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[THIMBLE]:LoadTimeTable(	BLK, 18, 00, TT_BUY_BLOCK );		
		
	elseif a == HORSE then	
		AiChars[HORSE]:LoadTimeTable(	BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[HORSE]:LoadTimeTable(	BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[HORSE]:LoadTimeTable(	BLK, 18, 00, TT_BUY_BLOCK );
		
	elseif a == SHIP then	
		AiChars[SHIP]:LoadTimeTable(	BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[SHIP]:LoadTimeTable(	BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[SHIP]:LoadTimeTable(	BLK, 18, 00, TT_BUY_BLOCK );
		
	elseif a == GUN then	
		AiChars[GUN]:LoadTimeTable(		BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[GUN]:LoadTimeTable(		BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[GUN]:LoadTimeTable(		BLK, 18, 00, TT_BUY_BLOCK );
		
	elseif a == SHOE then			
		AiChars[SHOE]:LoadTimeTable(	BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[SHOE]:LoadTimeTable(	BLK, 13, 00, TT_BUY_BLOCK );
		AiChars[SHOE]:LoadTimeTable(	BLK, 18, 00, TT_BUY_BLOCK );
		
	elseif a == CAR then			
		AiChars[CAR]:LoadTimeTable(		BLK, 08, 00, TT_BUY_BLOCK );
		AiChars[CAR]:LoadTimeTable(		BLK, 13, 00, TT_BUY_BLOCK );		
		AiChars[CAR]:LoadTimeTable(		BLK, 18, 00, TT_BUY_BLOCK );		
	end;
end;


--///////////////////////////////////////////////////////////////////////////////////////////////////////
function EVENT_Wait4CashTT(a)
	AiChars[a]:ResetTimeTable(TAC);
		
end;

--///////////////////////////////////////////////////////////////////////////////////////////////////////
function EVENT_LoadLandscapeBlockTT(a)
	AiChars[a]:ResetTimeTable(TAC);

	AiChars[a]:LoadTimeTable( TAC, 00, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 00, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 01, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 01, 30, TT_CREATE_BUS );		
	AiChars[a]:LoadTimeTable( TAC, 02, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 02, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 03, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 03, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 04, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 04, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 05, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 05, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 06, 00, TT_CREATE_BUS );		
	AiChars[a]:LoadTimeTable( TAC, 06, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 07, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 07, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 08, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 08, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 09, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 09, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 10, 00, TT_CREATE_BUS );		
	AiChars[a]:LoadTimeTable( TAC, 10, 30, TT_CREATE_BUS );		
	AiChars[a]:LoadTimeTable( TAC, 11, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 11, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 12, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 12, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 13, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 13, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 14, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 14, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 15, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 15, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 16, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 16, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 17, 00, TT_CREATE_BUS );		
	AiChars[a]:LoadTimeTable( TAC, 17, 30, TT_CREATE_BUS );		
	AiChars[a]:LoadTimeTable( TAC, 18, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 18, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 19, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 19, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 20, 00, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 20, 30, TT_CREATE_BUS );	
	AiChars[a]:LoadTimeTable( TAC, 21, 00, TT_CREATE_BUS );				
	AiChars[a]:LoadTimeTable( TAC, 21, 30, TT_CREATE_BUS );				
	AiChars[a]:LoadTimeTable( TAC, 22, 00, TT_CREATE_BUS );				
	AiChars[a]:LoadTimeTable( TAC, 22, 30, TT_CREATE_BUS );				
end;

--///////////////////////////////////////////////////////////////////////////////////////////////////////
function EVENT_Kill_TAC_Timetable(a)
	AiChars[a]:ResetTimeTable(TAC);
end;


--///////////////////////////////////////////////////////////////////////////////////////////////////////
--//////////////////////////////////////// MISC. FUNCTIONS //////////////////////////////////////////////

function EVENT_SetPlayerMoney(a, b)
	AiChars[a]:SetMoney(b);
end;

function EVENT_IncreasePlayerMoney(a)
	AiChars[a]:IncreaseMoney(100);
end;

function EVENT_DecreasePlayerMoney(a)
	AiChars[a]:DecreaseMoney(-100);
end;

function EVENT_Twiddle_Thumbs(a)
	AiChars[a]:SetTwiddleThumbs();
end;

--///////////////////////////////////////////////////////////////////////////////////////////////////////
--////////////////////////////////////////DEBUG FLAGS ///////////////////////////////////////////////////

function EVENT_LoadDebugFlags(a)
--	AiChars[a]:SetDebugFlags(FORCE_AUCTION);
--	AiChars[a]:SetDebugFlags(STOP_STRAT_BLOCKS);
--	AiChars[a]:SetDebugFlags(SHOW_SPELL_CARDS);
end;

--AiChars[IRON]:SetTwiddleThumbs();



--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--AiChars[CAR]:SetPlayerDifficulty(0);	
--AiChars[GUN]:SetPlayerDifficulty(0);	
--AiChars[SHIP]:SetPlayerDifficulty(0);	
--AiChars[DOG]:SetPlayerDifficulty(0);	
--AiChars[IRON]:SetPlayerDifficulty(0);	
--AiChars[SHOE]:SetPlayerDifficulty(0);	
--AiChars[THIMBLE]:SetPlayerDifficulty(0);	
--AiChars[HAT]:SetPlayerDifficulty(0);	
--AiChars[BARROW]:SetPlayerDifficulty(0);	
--AiChars[HORSE]:SetPlayerDifficulty(0);	

