bool bAllowHireJoin = FindFreeRandomOfficer()!=-1;
bool bAllowRelease = true;
bool bAllowCapture = HasSubStr(NPChar.id,"Enc_CabinCaptain") || strcut(NPChar.id,0,1) == "Cr"; // PB: Allow Coast Raiders also
if(!bAllowCapture)
{
bAllowCapture = HasSubStr(NPChar.id,"fantom")&&FindFreeCabinCaptain()!=-1;
}
if(CheckAttribute(NPChar,"cabinfight") && NPChar.cabinfight==true) { bAllowCapture = FindFreeCabinCaptain()!=-1; } /* fantoms allow anything */ //MAXIMUS 10.10.2007
if(CheckAttribute(boarding_enemy,"location.norebirth") && boarding_enemy.location.norebirth==1) { bAllowHireJoin = true; bAllowRelease = false; bAllowCapture = true; } /* special captains must die */
if(CheckAttribute(boarding_enemy,"questchar") && boarding_enemy.questchar==true) { bAllowHireJoin = false; bAllowRelease = false; bAllowCapture = true; } /* quest allows capture */ //MAXIMUS: special identifier added into tempquest- and storycharacters init
if(GetPassengersQuantity(PChar) >= PASSENGERS_MAX) { bAllowHireJoin = false; bAllowCapture = false; } // no room for them!
if(sti(GetStorylineVar(FindCurrentStoryline(), "NO_CREW_OR_OFFICERS")) == 1 || CheckAttribute(PChar, "isnotcaptain")) { bAllowHireJoin = false; }
// TIH <-- // <-- KK
bool bDeathFight, bAllowCompanion;//MAXIMUS
//MAXIMUS: [if your crew and enemy's crew will be enough for two minimum crews, you will be able to take him as companion] -->
if(GetCrewQuantity(boarding_enemy)<GetMinCrewQuantity(boarding_enemy))
{
if(sti(GetCrewQuantity(PChar)) - (sti(GetMinCrewQuantity(boarding_enemy)) - sti(GetCrewQuantity(boarding_enemy)))>GetMinCrewQuantity(PChar)) { bAllowCompanion = bAllowHireJoin; }
else { bAllowCompanion = false; }
}
else
{
if(GetCrewQuantity(PChar)<GetMinCrewQuantity(PChar))
{
if(sti(GetCrewQuantity(boarding_enemy)) - (sti(GetMinCrewQuantity(PChar)) - sti(GetCrewQuantity(PChar)))>GetMinCrewQuantity(boarding_enemy)) { bAllowCompanion = bAllowHireJoin; }
else { bAllowCompanion = false; }
}
else { bAllowCompanion = bAllowHireJoin; }
}