"use strict";
this.name = "coyoteLobo5";
this.author = "Okti";
this.copyright = "(C) Okti";
this.licence = "Creative Commons Attribution - Non-Commercial - Share Alike 3.0";
this.description = "Ship script for coyoteLebo4.";

this.shipSpawned = function () {
	//this.ship.reportAIMessages = true;
}

this.locatePlayer = function () {
	this.playerArray = system.shipsWithPrimaryRole("player");
	if (this.playerArray.length == 0) {
		//this.ship.remove(); 
	} else {
		if (this.ship.position.distanceTo(player.ship.position) < 12000) {
			this.ship.reactToAIMessage("PLAYER_NEAR");
		} else {}
	}
}

this.questionPlayer = function () {
	this.ship.commsMessage(expandDescription("[COYOTE_S220_01]"), player.ship);
	player.consoleMessage(expandDescription("[COYOTE_S220_03]"), 6);
}

this.replyPlayer = function () {
	this.ship.commsMessage(expandDescription("[COYOTE_S220_02]"), player.ship);
	this.playerArray = system.shipsWithPrimaryRole("coyotezorra5");
	if (this.playerArray.length == 0) {
		//this.ship.remove(); 
	} else {
		this.playerArray[0].setAI("route1traderAI.plist");
	}
}