:: carDealerScripts[script]
setup.items ??= {};
setup.items.carLADAKalina	= {type:'car',speed:6,label:'LADA Kalina',price:535800		,imageExterior:"pc/items/accessories/car/car6.jpg",imageInterior:"pc/items/accessories/car/salon6.jpg"};
setup.items.carLADAVestar	= {type:'car',speed:6,label:'LADA Vesta',price:645000		,imageExterior:"pc/items/accessories/car/car7.jpg",imageInterior:"pc/items/accessories/car/salon7.jpg"};
setup.items.carChevrolet		= {type:'car',speed:6,label:'Chevrolet NIVA',price:625000	,imageExterior:"pc/items/accessories/car/car8.jpg",imageInterior:"pc/items/accessories/car/salon8.jpg"};
setup.items.carUAZHunter		= {type:'car',speed:6,label:'UAZ HUNTER',price:600000		,imageExterior:"pc/items/accessories/car/car9.jpg",imageInterior:"pc/items/accessories/car/salon9.jpg"};
setup.items.carUAZPatriot	= {type:'car',speed:6,label:'UAZ Patriot',price:760000		,imageExterior:"pc/items/accessories/car/car10.jpg",imageInterior:"pc/items/accessories/car/salon10.jpg"};
setup.items.carFordFocus		= {type:'car',speed:6,label:'Ford Focus',price:884000		,imageExterior:"pc/items/accessories/car/car13.jpg",imageInterior:"pc/items/accessories/car/salon13.jpg"};
setup.items.carRenaultLOGAN	= {type:'car',speed:6,label:'Renault LOGAN',price:649990	,imageExterior:"pc/items/accessories/car/car102.jpg",imageInterior:"pc/items/accessories/car/salon102.jpg"};
setup.items.carFordMondeo	= {type:'car',speed:6,label:'Ford Mondeo',price:1329000		,imageExterior:"pc/items/accessories/car/car110.jpg",imageInterior:"pc/items/accessories/car/salon110.jpg"};
setup.items.carToyotaCamry	= {type:'car',speed:6,label:'Toyota Camry',price:1484000	,imageExterior:"pc/items/accessories/car/car104.jpg",imageInterior:"pc/items/accessories/car/salon104.jpg"};
setup.items.carMitsubishiL200= {type:'car',speed:6,label:'Mitsubishi L200',price:1749990	,imageExterior:"pc/items/accessories/car/car95.jpg",imageInterior:"pc/items/accessories/car/salon95.jpg"};
setup.items.carToyotaCorolla = {type:'car',speed:6,label:'Toyota Corolla',price:1097000	,imageExterior:"pc/items/accessories/car/car103.jpg",imageInterior:"pc/items/accessories/car/salon103.jpg"};
setup.items.carMazda6		= {type:'car',speed:6,label:'Mazda 6',price:1299700			,imageExterior:"pc/items/accessories/car/car105.jpg",imageInterior:"pc/items/accessories/car/salon105.jpg"};
setup.items.carMercedesE		= {type:'car',speed:6,label:'Mercedes-Benz E-Class',price:2950000,imageExterior:"pc/items/accessories/car/car106.jpg",imageInterior:"pc/items/accessories/car/salon106.jpg"};
setup.items.carAudiA6		= {type:'car',speed:6,label:'Audi A6',price:2914000			,imageExterior:"pc/items/accessories/car/car109.jpg",imageInterior:"pc/items/accessories/car/salon109.jpg"};
setup.items.carLexusRX350	= {type:'car',speed:6,label:'Lexus RX 350',price:3374000	,imageExterior:"pc/items/accessories/car/car97.jpg",imageInterior:"pc/items/accessories/car/salon97.jpg"};
setup.items.carBMW3			= {type:'car',speed:6,label:'BMW 3-Seria',price:2721000		,imageExterior:"pc/items/accessories/car/car101.jpg",imageInterior:"pc/items/accessories/car/salon101.jpg"};
setup.items.carBMWM5			= {type:'car',speed:6,label:'BMW M5',price:7000000			,imageExterior:"pc/items/accessories/car/car107.jpg",imageInterior:"pc/items/accessories/car/salon107.jpg"};
setup.items.carBMWX6			= {type:'car',speed:6,label:'BMW X6',price:5366000			,imageExterior:"pc/items/accessories/car/car99.jpg",imageInterior:"pc/items/accessories/car/salon99.jpg"};
setup.items.carAudiQ7		= {type:'car',speed:6,label:'Audi Q7',price:5000000			,imageExterior:"pc/items/accessories/car/car96.jpg",imageInterior:"pc/items/accessories/car/salon96.jpg"};
setup.items.carPorscheCayenne= {type:'car',speed:6,label:'Porsche Cayenne',price:5500000	,imageExterior:"pc/items/accessories/car/car98.jpg",imageInterior:"pc/items/accessories/car/salon98.jpg"};
setup.items.carJaguarXJ		= {type:'car',speed:6,label:'Jaguar XJ',price:6500000		,imageExterior:"pc/items/accessories/car/car108.jpg",imageInterior:"pc/items/accessories/car/salon108.jpg"};
setup.items.carMercedesS		= {type:'car',speed:6,label:'Mercedes-Benz S-Class',price:7600000,imageExterior:"pc/items/accessories/car/car100.jpg",imageInterior:"pc/items/accessories/car/salon100.jpg"};
setup.items.carBentleyContinental= {type:'car',speed:6,label:'Bentley Continental GT',price:13000000,imageExterior:"pc/items/accessories/car/car111.jpg",imageInterior:"pc/items/accessories/car/salon111.jpg"};
setup.items.carFerrari458	= {type:'car',speed:6,label:'Ferrari 458 Italia',price:14000000,imageExterior:"pc/items/accessories/car/car112.jpg",imageInterior:"pc/items/accessories/car/salon112.jpg"};


:: carDealerNewCars[public indoors]
	<h2>Car Dealership - New Vehicles</h2>
	<<image "locations/city/industrial/cardealer/manager.jpg">>

	<div class="itemsOverview vehicles">
		<<for _vehicleId, _vehicleData range setup.items>>
			<<if _vehicleData.type != 'car'>>
				<<continue>>
			<</if>>
			<<capture _vehicleId>>
			<div class="item linkedImage">
				<<image _vehicleData.imageExterior>>
				<<link `_vehicleData.price.toLocaleString()+' ₽'`>>
					<<gt 'carDealerDetails' `_vehicleId`>>
				<</link>>
			</div>
			<</capture>>
		<</for>>
	</div>

	/*<<act 'Talk to the manager'>>
		<<gt 'autosalonF' 'manager1'>>
	<</act>>
	<<act 'Return'>>
		<<gt 'autotraidF' 'start'>>
	<</act>>*/

:: carDealerDetails[event]
	<<addtime 5>>
	<<ret>>
	<<set _vehicleId = $location_var[$here][0]>>
	<<set _vehicleData = setup.items[_vehicleId]>>
	<h2>_vehicleData.label</h2>
	<<image _vehicleData.imageExterior>>
	<<image _vehicleData.imageInterior>>
	<<act 'Buy' undefined `{cost:{both:_vehicleData.price}}`>>
		<<run $inventory.set(_vehicleId,1,'vehicles',{'minutesDriven':0,'gas':240})>>
		<<gt 'carDealerCarBought' _vehicleId>>
	<</act>>


	/*<center><b>Car Dealership</b></center>
	<<image "locations/city/industrial/cardealer/manager.jpg">>
	<p>You have karta <b>₽</b> in your bank account.</p>
	The manager smiles affably and explains routinely what is required to purchase a car: A driver''s license and the sum, in full, in your bank account.
	<p>"With how the economy is right now, we can't accept payment by installments at this time I'm afraid," he apologizes. "A few new laws have also been passed too: We cannot accept cash payment - the Duma believes that will help fight crime - and it is currently not possible to own more than one car, according to the Oblast's new anti-corruption law.</p>
	<<act 'Leave'>>
		<<gt 'city_industrial'>>
	<</act>>
	<<if getvar("$prava") == 1>>*/

:: carDealerCarBought[event]
	<<addtime 30>>
	<<set _vehicleId = $location_var[$here][0]>>
	<<set _vehicleData = setup.items[_vehicleId]>>
	<h2>_vehicleData.label</h2>
	<<image _vehicleData.imageExterior>>
	<p>
		The salesman extends his hand in congratulations and expresses his genuine excitement for your new car purchase.
		His voice is filled with enthusiasm as his says, "Congratulations! We are thrilled for you and your new car! It's a fantastic choice.".
		He hands you the keys to your new car and explains to you all you need to know about its technical details.
	</p>
	<<act 'Drive off'>>
		<<addtime 5>>
		<<useVehicle _vehicleId>>
		<<gt 'city_industrial'>>
	<</act>>
