Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion ADCK Imperial Trader

Content

Warnings

  1. http://wiki.alioth.net/index.php/ADCK%20Imperial%20Trader -> 404 Not Found
  2. Low hanging fuit: Information URL exists...

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description The Imperial Trader is an adaptation of the military vessel found in the service of the Achenar Empire. While inferior to the technology of the Imperial Navy this is a notable vessel for GalCop standards. For more details, please check the wiki page. The Imperial Trader is an adaptation of the military vessel found in the service of the Achenar Empire. While inferior to the technology of the Imperial Navy this is a notable vessel for GalCop standards. For more details, please check the wiki page.
Identifier oolite.oxp.zzz.Montana05.Slartibartfast.adck_imperial_trader oolite.oxp.zzz.Montana05.Slartibartfast.adck_imperial_trader
Title ADCK Imperial Trader ADCK Imperial Trader
Category Ships Ships
Author ADCK, Slartibartfast, Montana05 ADCK, Slartibartfast, Montana05
Version 2.11 2.11
Tags Frontier ships Frontier ships
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/Imperial_Trader_(Oolite) n/a
Download URL https://wiki.alioth.net/img_auth.php/a/ae/Oolite.oxp.zzz.Montana05.Slartibartfast.adck_imperial_trader.OXZ n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1658979011

Documentation

read_me.txt

Overview
========

Designed along the same line as the Imperial Courier, in the Imperial Navy's Battle Line, the Imperial Trader 
is a troop transport/boarding vessel.

In civilian life, it does however, commonly fulfill the role it's name belies.

People venture into space for all sorts of reasons - to live the life they want to live, to make money, 
impress women, explore the galaxy etc. etc. - This ship will enable you to do all of these things.
Get one as soon as you can.

The Imperial Trader is an adaptation of the military vessel found in the service of the Achenar Empire. While 
inferior to the technology of the Imperial Navy this is a notable vessel for GalCop standards.

History
=======

For years, ships of the Achenar Empire could be spotted in GalCop space, although these encounters were rare. This changed
when ADCK Transport Ltd acquired from unknown sources various blueprints from outer-GalCop ships. Adapting this ships to
conventional technology caused nightmares to the design department, but finally the Imperial Trader was introduced 
to the public.

While the ship proved to be a great success, after years of pressure from the authorities the company was forced to
stop the production and introduce 2 specialized alternatives instead. The T-01 (transport) is a well armed trader while
the C-01 (combat) is a powerful vessel for individuals and organizations in need of a significant weaponry. Though 
officially a license is required to own a C-01 a quick check of the shipyards will show that this regulation 
is widely ignored.

Remarks
=======

This OXP features an adaptation of the military vessel found in David Braben's Frontier game.

The ship is based on the Imperial Trader OXP (2010, outdated) and the ADCK's FFE Ships OXP (2011). Most specifications
of the T-01 are from Dertien's version of the Imperial Trader (BBS Shippack OXP).

With V 2.10 the Achenar Pulse Laser Class 2 is introduced as the armament of the Empire ship. This weapon is not
available on the open market. Additionally at some variants the engines now could be shot off, resulting in the loss 
of speed and a laser mount of the target.

Credits
=======

David Braben (Frontier game)
ADCK (author, models, basic textures and basic specifications)
Dertien (basic specifications of the T-01)
Slartibartfast (various modifications and corrections)
Griff (model and basic textures of the escape pods)
another_commander (basic specular map of the escape pods)

Requirements
============

Oolite V 1.88 or higher.

Compatibility
=============

If you are currently flying the player-ship from ADCK's FFE Ships OXP you will face some changes after installing this
package:

Your energy is a bit decreased while your trust is a little up. 
The ship texture is replaced with materials using the latest standards.
The after view and the weapon positions are corrected.

Otherwise both packages don't interfere with each other.

Details
=======

For additional details, please check the wiki-page: https://wiki.alioth.net/index.php/Imperial_Trader_(Oolite)

License
=======

This work is licensed under Creative Commons Attribution Non-Commercial Share Alike 4.0 International (CC BY-NC-SA 4.0).
To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0

Version History
===============

V 2.11 (Montana05, 2022/07/28)

    fixed an issue with flashers on subentities
    correction of a viewpoint
    improvement of speed reduction calculation for lost engines


V 2.10 (Montana05, 2022/07/05)

    better adaption to the Galactic Almanac OXZ
    script for the fragile engines
    new lasers for the outer-GalCop ship (not available on the market)
    added escape pods and cargo
    some small tweaks

V 2.01 (Montana05, 2022/04/27)

    fixed a copy & paste error in the shipdata.plist
    added a very rare NPC version, intended as eye-candy only

V 2.00 (Slartibartfast & Montana05, 2022/04/23)

    conversion of the original OXP (Slartibartfast)
    fix of the subentities (Slartibartfast)
    correction of a viewpoint (Slartibartfast)
    added shiplibrary.plist (Slartibartfast)
    improvement of the materials (Montana05)
    included 2 new versions, both NPC and player (Montana05)
    synchronized the package with ADCK's FFE Ships OXP (Montana05)
    minor adjustments of the package (Montana05)

V 1.00 (ADCK, 2011/07/03)

    ADCK's FFE Ships OXP (various ships, including this one)

V 1.00 (ADCK, 2010/06/14)

    Imperial Trader OXP (outdated)

Equipment

Name Visible Cost [deci-credits] Tech-Level
Achenar Pulse Laser Class 2 yes 60000 15+

Ships

Name
Imperial Trader
Imperial Trader C-01
BHG Imperial Trader C-01
Imperial Trader Engine
adck_imperial_trader_C01_bhg_team_01
Imperial Trader Engine
Imperial Trader C-01
Imperial Trader C-01
Imperial Trader T-01
adck_imperial_trader_T01_convoy_01
Imperial Trader Engine
Imperial Trader T-01
Imperial Trader
Emperial Cargo container
adck_imperial_trader_empire_container_luxuries
adck_imperial_trader_empire_container_quirium_crystal
adck_imperial_trader_empire_container_slaves
Imperial Trader Engine
Imperial Trader Engine
Imperial Trader Engine
Imperial Trader Engine
escape pod
escape pod
escape pod
escape pod
escape pod
escape pod
Imperial Trader
Imperial Trader

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Scripts/adck_imperial_trader.js
this.name			= "adck_imperial_trader";
this.author			= "Montana05";
this.description	= "event handler for the ADCK Imperial Trader OXP";
this.version		= "2.11";
this.copyright		= "2022 Montana05";
this.licence		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	if(ship.dataKey.search(/adck_imperial_trader/i) < 0 || ship.hasRole("cargopod") || ship.isSubEntity || ship.isPlayer)
	{
		return;
	}
	else
	{
		var shipType = ship.dataKey;
		var shipRole = ship.primaryRole;
		var cargoLoad = ship.cargoSpaceUsed;

		// setup escape pods
		if(ship.hasRole("escape-capsule"))
		{
			let crewName = expandDescription("[nom]");
			let crewDescription = "a crew member of an evacuated ship";
			let crewRole = "hunter";  // the role is not particular important anymore, all data will be added by the script
			let crewRace = expandDescription("[adck_imperial_trader_races_scientific]");  // add a race to the crew members
			let crewRank = expandDescription("[adck_imperial_trader_crew_civil_medium]");
			let bhgRank = "Hunter";  // middle rank
			let crewInsurance = this.$getRndInteger(90, 450);
			let crewBounty = 0;

			// ranks for Bounty Hunter Guild taken from Random Hits OXP, all credits to LittleBear
			const adck_imperial_trader_bhg_ranks_array = 
			["Outsider", "Recruit", "Vigilante", "Bailiff", "Deputy", "Tracker", "Hunter", "Sheriff", "Provost", "Marshal", "Enforcer", "Executioner", "Judge"];
			bhgRank = 
			adck_imperial_trader_bhg_ranks_array[Math.floor(Math.random() * adck_imperial_trader_bhg_ranks_array.length)];
			
			switch(shipType)
			{
				case "adck_imperial_trader_escape_pod_std":

					crewName = ("the " + crewRace + " " + crewRank + " " + expandDescription("[nom]"));
					crewDescription = "a ship crew member";
					crewRole = "hunter";
					crewInsurance = this.$getRndInteger(90, 450);
					break;

				case "adck_imperial_trader_escape_pod_std_passenger":

					crewName = ("the " + crewRace + " " + expandDescription("[nom]"));
					crewDescription = "a interstellar passenger";
					crewRole = "passenger";
					crewInsurance = this.$getRndInteger(90, 450);
					break;

				case "adck_imperial_trader_escape_pod_std_criminal":

					crewName = ("the " + crewRace + " " + expandDescription("[nom]"));
					crewDescription = "a " + expandDescription("[adck_imperial_trader_criminals]") +  "wanted by GalCop police";
					crewRole = "pirate";
					crewBounty = crewInsurance + (15 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;
					break;

				case "adck_imperial_trader_escape_pod_std_pirate":

					crewName = ("the " + crewRace + " " + expandDescription("[adck_imperial_trader_pirate_nicknames]") + expandDescription("[nom]"));
					crewDescription = "a " + expandDescription("[adck_imperial_trader_criminals]") +  "wanted by GalCop police";
					crewRole = "pirate";
					crewBounty = (crewInsurance * 1.25) + (25 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;
					break;
				
				case "adck_imperial_trader_escape_pod_bhg":

					crewName = ("the " + crewRace + " " + bhgRank + " " + expandDescription("[nom]"));
					crewDescription = "a member of the Bounty Hunter Guild";
					crewRole = "hunter";
					crewInsurance = (crewInsurance * 1.10);  // BHG got better insurance conditions
					break;
					
				case "adck_imperial_trader_escape_pod_bhg_criminal":

					crewName = ("the " + crewRace + " " + bhgRank + " " + expandDescription("[nom]"));
					crewDescription = "a rogue member of the Bounty Hunter Guild";
					crewRole = "pirate";
					crewBounty = (crewInsurance * 1.10) + (15 * system.government);  // stable governments pay extra bonus
					crewInsurance = 0;
					break;	
					
				default: 
	
					break;	
			};

			ship.setCrew
			(
				{
					name: crewName,
					short_description: crewDescription,
					role: crewRole,
					species: crewRace,
					insurance: crewInsurance,
					bounty: crewBounty
				}
			);
			// removes individual roles
			ship.primaryRole = "escape-capsule";
		}
		else
		{
			if(ship.hasRole("GalCop_alien"))
			{
				// adds alien classification
				ship.primaryRole = "alien_warship";
				shipRole = ship.primaryRole;
				ship.scanDescription = "Alien";  // Warning: don't use in shipdata.plist, it will crash the game

				// individual names based on Empire systems (https://www.edsm.net/en/search/systems/index/)
				const empire_name_01_array = 
				[" Fist ", " Fury ", " Force ", " Power ", " Rage ", " Fire ", " Wrath ", " Storm ", " The Inferno ", " Hell "];
				let empire_name_01 = 
				empire_name_01_array[Math.floor(Math.random() * empire_name_01_array.length)];

				const empire_name_02_array = 
				[" Sanuku ", " Cuacocha ", " Baudu ", " Tum ", " Edin ", " Shokwa ", " Djandji ", " Lauma ", " Zeus ", " Hamal "];
				let empire_name_02 = 
				empire_name_02_array[Math.floor(Math.random() * empire_name_02_array.length)];

				const empire_name_03_array = 
				["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"];
				let empire_name_03 = 
				empire_name_03_array[Math.floor(Math.random() * empire_name_03_array.length)];

				ship.displayName = ship.name + empire_name_01 + "of" + empire_name_02 + empire_name_03;
			};
			
			switch(shipRole) 
			{
				case "trader":
				case "sunskim-trader":
				case "pirate-medium-freighter":
				case "adck_imperial_trader":
				case "adck_imperial_trader_T01":
				case "adck_imperial_trader_T01_convoy_01":	
				case "adck_imperial_trader_pirate":
				case "adck_imperial_trader_C01_pirate":
				
					if(shipRole == "adck_imperial_trader" || shipRole == "adck_imperial_trader_T01" || 
					   shipRole == "adck_imperial_trader_T01_convoy_01")
					{
						ship.primaryRole = "trader";
					};

					if(shipRole == "adck_imperial_trader_pirate" || shipRole == "adck_imperial_trader_C01_pirate")
					{
						ship.primaryRole = "pirate-medium-freighter";
					};
				
					while(ship.cargoSpaceUsed <= 1)  // makes sure that there is some cargo
					{
						if(this.$getRndInteger(1, 6) < 4)
						{
							ship.setCargoType("PLENTIFUL_GOODS");
						}
						else
						{
							ship.setCargoType("SCARCE_GOODS");
						};
					};	
					break;

				case "trader-courier":
									
					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(5, 12) - 1 ; i >= 0 ; --i)
						{
							ship.adjustCargo(this.$adck_imperial_trader_rare_cargo(), 1);
						};
					};
					break;

				case "trader-smuggler":
							
					while(ship.cargoSpaceUsed <= 1)  // makes sure that there is some cargo
					{
						if(this.$getRndInteger(1, 6) < 4)
						{
							ship.setCargoType("ILLEGAL_GOODS");
						}
						else
						{
							ship.setCargoType("PIRATE_GOODS");
						};
					};	
					break;
				
				case "scavenger":
								
					ship.forwardWeapon = "EQ_WEAPON_PULSE_LASER";  // exchanges beam to pulse laser
					
					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(5, 12) - 1 ; i >= 0 ; --i)
						{
							ship.adjustCargo(this.$adck_imperial_trader_scavenger_cargo(), 1);
						};
					};
					break;

				case "escort":
				case "escort-heavy":
				case "hunter-heavy":
				case "pirate-medium-fighter":
				case "pirate-heavy-fighter":
				case "adck_imperial_trader_C01":
				case "adck_imperial_trader_C01_bhg":
				case "adck_imperial_trader_C01_bhg_team_01":	
											
					if(shipRole.search(/adck_imperial_trader/i) >= 0)
					{
						ship.primaryRole = "hunter-heavy";
						ship.switchAI("oolite-bountyHunterAI.js");
					};
				
					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(5, 10) - 1 ; i >= 0 ; --i)
						{
							ship.adjustCargo(this.$adck_imperial_trader_space_jockey_cargo(), 1);
						};
					};
					break;

				case "alien_warship":

					if(cargoLoad <= 1)
					{
						for(var i = this.$getRndInteger(5, 12) - 1 ; i >= 0 ; --i)
						{
							ship.adjustCargo(this.$adck_imperial_trader_alien_cargo(), 1);
						};
					};
					break;
	
				default: 
	
					break;
			};
		};
		// if there is an existing script in shipDied time to move it
		ship.script.$adck_imperial_trader_shipDied_old = ship.script.shipDied;
		ship.script.shipDied = this.$adck_imperial_trader_shipDied;	
	};
};	

this.$adck_imperial_trader_shipDied = function $adck_imperial_trader_shipDied(whom, why) 
{
	if(this.ship.dataKey.search(/adck_imperial_trader/i) < 0 || 
	   this.ship.hasRole("escape-capsule") || this.ship.hasRole("cargopod") || this.ship.isSubEntity || this.ship.isPlayer)
	{
		return;
	}
	else
	{
		this.name = "adck_imperial_trader";
		let dice = worldScripts.adck_imperial_trader;
		let diceRoll = dice.$getRndInteger;
				
		let shipRole = this.ship.primaryRole;
		let shipBounty = this.ship.bounty;
		let shipPos = this.ship.position;
		let MRP01 = 0;
		let bhgCrew = 0;
		let criminalCrew = 0;
		let pirateCrew = 0;

		if(worldScripts["MRP01_ressource_spawn"])  // Montanas Ressource Pack 01 OXP
		{
			MRP01 = 1;
		};

		if(this.ship.dataKey.search(/_bhg/i) >= 0)
		{
			bhgCrew = 1;
		};
		
		if(shipBounty > 7 && shipBounty < 15)
		{
			criminalCrew = 1;
		};

		if(shipBounty > 14 || this.ship.isPirate)
		{
			pirateCrew = 1;
		};

		// if Montanas Ressource Pack 01 OXP is installed the containers from there are used, otherwise let the core-game handle it
		// exception: The Empire ship is using individual cargopods and is addressed separately
		if(MRP01 == 1 && this.ship.cargoSpaceUsed > 0 && shipRole != "alien_warship")
		{
			for(let i = this.ship.cargoList.length - 1 ; i >= 0 ; --i)
			{
				let cargoType = this.ship.cargoList[i].commodity;
				let cargoPod = ("MRP01_container_" + cargoType);
				let cargoCount = this.ship.cargoList[i].quantity;
				
				system.addShips(cargoPod, cargoCount, shipPos);
			};
		};

		switch(shipRole) 
		{
			case "trader":
			case "sunskim-trader":
			case "trader-courier":
			case "trader-smuggler":
					
				if(criminalCrew == 1)
				{
					system.addShips("adck_imperial_trader_escape_pod_std_criminal", diceRoll(1, 3), shipPos);
				}
				else if(pirateCrew == 1)
				{
					system.addShips("adck_imperial_trader_escape_pod_std_pirate", diceRoll(1, 3), shipPos);
				}
				else
				{
					system.addShips("adck_imperial_trader_escape_pod_std_trader", diceRoll(1, 3), shipPos);
				};
			
				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_cash", diceRoll(1, 2), shipPos);
				};
					
				break;

			case "hunter-heavy":
				
				if(bhgCrew == 1)
				{
					if(criminalCrew == 1 || pirateCrew == 1)
					{
						system.addShips("adck_imperial_trader_escape_pod_bhg_criminal", diceRoll(1, 3), shipPos);
					}
					else
					{
						system.addShips("adck_imperial_trader_escape_pod_bhg", diceRoll(1, 3), shipPos);
					};
				}
				else
				{
					if(criminalCrew == 1)
					{
						system.addShips("adck_imperial_trader_escape_pod_std_criminal", diceRoll(1, 3), shipPos);
					}
					else if(pirateCrew == 1)
					{
						system.addShips("adck_imperial_trader_escape_pod_std_pirate", diceRoll(1, 3), shipPos);
					}
					else
					{
						system.addShips("adck_imperial_trader_escape_pod_std", diceRoll(1, 3), shipPos);
					};
				};

				if(MRP01 == 1 && diceRoll(1, 10) > 8)
				{
					system.addShips("MRP01_container_cash", diceRoll(1, 2), shipPos);
					system.addShips("MRP01_container_prisoners", diceRoll(1, 2), shipPos)
				};
				
				break;
				
			case "pirate-medium-freighter":

				system.addShips("adck_imperial_trader_escape_pod_std_pirate", diceRoll(1, 3), shipPos);
				
				if(MRP01 == 1 && diceRoll(1, 10) > 9)
				{
					system.addShips("MRP01_container_cash", diceRoll(1, 2), shipPos);
				};
				break;

			case "pirate-medium-fighter":
			case "pirate-heavy-fighter":
					
				system.addShips("adck_imperial_trader_escape_pod_std_pirate", diceRoll(1, 3), shipPos);
				break;
			
			case "alien_warship":

				if(this.ship.cargoSpaceUsed > 0)
				{
					for(let i = this.ship.cargoList.length - 1 ; i >= 0 ; --i)
					{
						let cargoType = this.ship.cargoList[i].commodity;
						let cargoPod = ("adck_imperial_trader_empire_container_" + cargoType);
						let cargoCount = this.ship.cargoList[i].quantity;
						
						system.addShips(cargoPod, cargoCount, shipPos);
					};
				};
				break;
	
			// escort, scavenger
			default:
				
				if(bhgCrew == 1)
				{
					if(criminalCrew == 1 || pirateCrew == 1)
					{
						system.addShips("adck_imperial_trader_escape_pod_bhg_criminal", diceRoll(1, 3), shipPos);
					}
					else
					{
						system.addShips("adck_imperial_trader_escape_pod_bhg", diceRoll(1, 3), shipPos);
					};
				}
				else
				{
					if(criminalCrew == 1)
					{
						system.addShips("adck_imperial_trader_escape_pod_std_criminal", diceRoll(1, 3), shipPos);
					}
					else if(pirateCrew == 1)
					{
						system.addShips("adck_imperial_trader_escape_pod_std_pirate", diceRoll(1, 3), shipPos);
					}
					else
					{
						system.addShips("adck_imperial_trader_escape_pod_std", diceRoll(1, 3), shipPos);
					};
				};
				break;	
		};
	};

	if(this.ship.script.$adck_imperial_trader_shipDied_old)
	{
		this.ship.script.$adck_imperial_trader_shipDied_old(whom, why);
	};
};

this.$adck_imperial_trader_scavenger_cargo = function()
{
	const scavenger_cargo_array = ["alloys", "gold", "platinum", "computers", "machinery", "slaves"];

	// Montanas Ressource Pack 01 OXP
	if(worldScripts["MRP01_ressource_spawn"] && scavenger_cargo_array.indexOf("quirium_crystal") < 0)
	{
		scavenger_cargo_array.push("quirium_crystal");
	};
	
	let scavenger_cargo = 
	scavenger_cargo_array[Math.floor(Math.random() * scavenger_cargo_array.length)];
		
	return (scavenger_cargo);
};

// commodities in g and kg
this.$adck_imperial_trader_rare_cargo = function()
{
	const rare_cargo_array = ["gold", "platinum", "gem_stones"];

	// medicine is part of several OXP's therefore a check of the market is required
	let goods = system.mainStation.market;
	for(let i in goods) 
	{
		if(goods[i].key == ["medicine"] && rare_cargo_array.indexOf("medicine") < 0)
		{
			rare_cargo_array.push("medicine");
		};
	}; 
	
	// Montanas Ressource Pack 01 OXP
	if(worldScripts["MRP01_ressource_spawn"] && rare_cargo_array.indexOf("quirium_crystal") < 0)
	{
		rare_cargo_array.push("quirium_crystal");
	};

	// Dictators OXP 2.0
	if(worldScripts["dictators_clergy_artifacts"] && rare_cargo_array.indexOf("quirium_crystal") < 0)
	{
		rare_cargo_array.push("holy_artifacts");
	};
	
	let rare_cargo = 
	rare_cargo_array[Math.floor(Math.random() * rare_cargo_array.length)];
		
	return (rare_cargo);
};

// food, medicine, booze and guns, what else you need for your trip ? :P
this.$adck_imperial_trader_space_jockey_cargo = function()
{
	const space_jockey_cargo_array = ["firearms", "food", "liquor_wines"];

	 // Darkside Moonshine Distillery OXP
	if(worldScripts["witchfire-populator"] && space_jockey_cargo_array.indexOf("witchfire_whiskey") < 0)
	{
		space_jockey_cargo_array.push("witchfire_whiskey");
	};
	
	// medicine is part of several OXP's therefore a check of the market is required
	if(system.mainStation)
	{
		let goods = system.mainStation.market;
		for(let i in goods) 
		{
			if(goods[i].key == ["medicine"] && space_jockey_cargo_array.indexOf("medicine") < 0)
			{
				space_jockey_cargo_array.push("medicine");
			};
		};
	}; 

	let space_jockey_cargo = 
	space_jockey_cargo_array[Math.floor(Math.random() * space_jockey_cargo_array.length)];

	return (space_jockey_cargo);
};

this.$adck_imperial_trader_alien_cargo = function()
{
	const alien_cargo_array = ["luxuries", "slaves", "alien_items"];

	// Montanas Ressource Pack 01 OXP
	if(worldScripts["MRP01_ressource_spawn"] && alien_cargo_array.indexOf("quirium_crystal") < 0)
	{
		alien_cargo_array.push("quirium_crystal");
	};
	
	let alien_cargo = 
	alien_cargo_array[Math.floor(Math.random() * alien_cargo_array.length)];
		
	return (alien_cargo);
};

this.$getRndInteger = function(min, max)
{
	return (Math.floor(Math.random() * (max - min + 1) ) + min);
};
Scripts/adck_imperial_trader_achenar_pulse_laser_conditions.js
this.name			= "adck_imperial_trader_achenar_pulse_laser_conditions";
this.author			= "Montana05";
this.description	= "conditions for the handling of the Achenar Pulse Laser Class 2";
this.version		= "2.11";
this.copyright		= "2022 Montana05";
this.licence   		= "CC BY-NC-SA 4.0";
"use strict";

this.allowAwardEquipment = function(equipment, ship, context)
{
	// remainder from oolite-conditions.js:

	// OXP hook to allow stations to forbid specific equipment
	if(context == "purchase" && player.ship.dockedStation && player.ship.dockedStation.scriptInfo["oolite-barred-equipment"])
	{
		if (player.ship.dockedStation.scriptInfo["oolite-barred-equipment"].indexOf(equipment) != -1)
		{
			return false;
		};
	};

	// OXP hook to allow ships to forbid specific "available to all" equipment
	if(ship.scriptInfo && ship.scriptInfo["oolite-barred-equipment"] && ship.scriptInfo["oolite-barred-equipment"].indexOf(equipment) != -1)
	{
		return false;
	};
	
	// for compatibility with Laser Mount Switching System (LMSS)
	var lmss = worldScripts.LMSS_Core;

	if(lmss && lmss._switching == true) 
	{
		return true;
	};
	
	// otherwise permitted
	return true;
};	


Scripts/adck_imperial_trader_subent.js
this.name			= "adck_imperial_trader_subent";
this.author			= "Montana05";
this.description	= "handling of subentities for the Imperial Trader";
this.version		= "2.11";
this.copyright		= "2022 Montana05";
this.licence        = "CC BY-NC-SA 4.0";
"use strict";

this.shipDied = function () 
{ 
    this.ship.owner.commsMessage("The shields are failing, we lost an engine !");
    this.ship.owner.maxSpeed = (this.ship.owner.maxSpeed - 111);  // 30% speed reduction
    if(this.ship.owner.maxSpeed < 0)
    {
        this.ship.owner.maxSpeed = 0;
    };
};