int iBootyQuality = 0;
int iBooty;
switch(iGetEncType){
case 0: // Merchant 0: single merchant
iBootyQuality = GOODS_QUANTITY; //include down to the least valuable
iStart += 6;// omit the 6 most valuable
break;
case 1: // Merchant 1: merchants with a light escort
iBootyQuality = GOODS_QUANTITY - rand((8 - iShipClass) + 1); // remove a random amount of the least valuable
iStart += 2;// omit gold and silver
break;
case 2: // Merchant 2: a single merchant with heavy escort
iBootyQuality = GOODS_QUANTITY - 5 - rand((8 - iShipClass) + (iGetNumWarShips*2));// remove at least 5 of the less valuable and a further random amount
break;
case 3: // Patrol: a small patrol
break;
case 4: // Fleet: warships
break;
case 5: // Corsar: -->PIRATE ONLY<--, warships
break;
case 6: // Pirate: -->PIRATE ONLY<--, small craft
break;
case 7: // Punitive Squadron: a rag-tag bunch
break;
case 8: // L - Merchant 0: Shallow Waters Merchant Fleet, a group of merchants
iBootyQuality = GOODS_QUANTITY - rand((8 - iShipClass) + (roundup(iGetNumMerchantShips/2))); // cut out shipclass
iStart += 4; // omit 4 most valuble
break;
case 9: // L - Merchant 1: Coastal Waters Merchant Fleet, an escorted group of merchants
iBootyQuality = GOODS_QUANTITY - round(GOODS_QUANTITY/4) - rand((8 - iShipClass) + iGetNumMerchantShips + iGetNumWarShips); // omit the bottom quarter of cheap goods and another couple depending on chance and how large the fleet
iStart += 2; // omit gold, enough protection for maybe silver? omitted too for now. treasure fleets are supposed to be the big haul after all
break;
case 10: // L - Merchant 2: -->SPAIN ONLY<--, Trans-Atlantic Treasure Fleet, a convoy
iBootyQuality = GOODS_QUANTITY - round(GOODS_QUANTITY/3) - rand((8 - iShipClass) + iGetNumMerchantShips + (iGetNumWarShips*2)); // cut out bottom 3rd cheap goods, another few based on chance, number of merchant ships and TWICE the number of war ships. might be too good even. jackpot!
//iBootyQuality = iClamp(iStart,roundup(GOODS_QUANTITY/2),iBootyQuality);
break;
case 11: // L - Patrol: Regional Patrol, a large patrol
break;
case 12: // L - Fleet: Regional Patrol, a small fleet
break;
case 13: // L - Corsar: ARMADA, a battle fleet
break;
case 14: // L - Pirate, -->PIRATE ONLY<--, a rag-tag bunch
break;
case 15: // L - Punitive Squadron, a scratch patrol
break;
}
//iBootyQuality = iClamp(iStart,GOODS_QUANTITY,iBootyQuality);
// TIH --> we generate random different types now, instead of always 7 different types
int randGoods = 1 + rand(6);
for (int r=0;r<randGoods;r++)
{
iBooty = iStart + rand(iBootyQuality - iStart - 1) // PW not sure about the -1 I think this excludes the lowest value cargo
iBooty = iClamp(iStart,GOODS_QUANTITY,iBooty);
Fantom_SetCharacterGoods(rFantom, iBooty, makeint(iMultiply * rand(iRandMultiply * 3)) );
}
// TIH <--
// TIH --> better method, prevents overloaded ships due to innept mathmatics Sep3'06
if(rFantom.FantomType == "trade")
{
iBooty = iStart + rand(iBootyQuality - iStart - 1) // PW not sure about the -1 I think this excludes the lowest value cargo
iBooty = iClamp(iStart,GOODS_QUANTITY,iBooty)
int fillQuantity = GetCargoGoods(rFantom,iBooty) + GetCharacterFreeSpace(rFantom,iBooty);// fill up the hold
Fantom_SetCharacterGoods(rFantom, iBooty, fillQuantity);
}