| Scripts/rh_mark_shipset.js | "use strict";
this.name = "rh-mark-shipset";
this.author = "spara";
this.description	= "Name RH ships with RSN";
this.shipSpawned = function ()
{
	if (worldScripts.randomshipnames) {
		if (ship.primaryRole === "pirate")
			this.ship.displayName = this.ship.name + ": " + worldScripts.randomshipnames.$randomPirateName(this.ship);
		else if (ship.primaryRole === "escort")
			this.ship.displayName = this.ship.name + ": " + worldScripts.randomshipnames.$randomHunterName(this.ship);
		else
			this.ship.displayName = this.ship.name + ": " + worldScripts.randomshipnames.$randomTraderName(this.ship);
	}
    //log("rh_shipset_mark",this.ship.displayName);
    delete this.shipSpawned;
}
 | 
                
                    | Scripts/rh_patrol_shipset.js | "use strict";
this.name = "rh-patrol-shipset";
this.author = "Spara from script by LittleBear, Eric Walch & Thargoid";
this.copyright = "2013";
this.description	= "Name RH shipset hunter ships";
this.licence     = "CC BY-NC-SA 3.0"; 
this.version = "1.7";
this.shipSpawned = function ()
{
	var level = parseInt(this.ship.scriptInfo.level);
	var name = "";
	switch(level)
	{
		case 1: name = expandDescription("[random_hits_hunterlow_name]"); break;
		case 2: name = expandDescription("[random_hits_huntermedium_name]"); break;
		case 3: name = expandDescription("[random_hits_hunterhigh_name]"); break;
		default: name = "unknown"; // means a wrong level definition in shipData.plist. 
	}
	this.ship.displayName = this.ship.name+": "+name; // Show the Hunters name on the ID Computer when targeted.
    //log("rh_shipset_patrol",this.ship.displayName);
    delete this.shipSpawned;
}
 | 
                
                    | Scripts/rh_spawn_shipset.js | "use strict";
this.name = "rh-boss-spawn-shipset";
this.author = "spara";
this.description	= "Conditional spawning of bosses";
this.allowSpawnShip = function(shipKey)
{
	//Sanity check
	if(system.isInterstellarSpace || !system.sun || system.sun.isGoingNova || system.sun.hasGoneNova)
		return false;
	//An anarchy system, that's where the bosses primarily lurk.
	if (system.government === 0)
		return true;
	//Ok, not an anarchy system, but maybe there is such a system close by.
	var adjacentSystems = system.info.systemsInRange(7);
	var dangerousHood = false;
	for (var i = 0; i < adjacentSystems.length; i++) {
		if (System.infoForSystem(adjacentSystems[i].galaxyID, adjacentSystems[i].systemID).government === 0) {
			dangerousHood = true;
			break;
		}
	}
	//This is dangerous hood, there is an anarchy system next door. Sometimes bosses visit nearby systems. Higher the government, rarer the incident.
	if (dangerousHood && Math.random() * system.government < 0.5)
		return true;
	return false;
}
 |