#define ENCOUNTER_GROUP "egroup__" int FindFreeMapEncounterSlot() { for (int i=0;i= 0) { ref rQEncounter = Encounter_GetQuestMapEncounter(iQEncounter); if (rand(99) < sti(rQEncounter.Rand)) { string sGroupID = rQEncounter.ID; if (!sti(rQEncounter.Permanent)) { Encounter_DeleteQuestMapEncounter(sGroupID); } ref rGCommander = Group_GetGroupCommander(sGroupID); rEncounter.Nation = sti(rGCommander.Nation); rEncounter.bUse = true; rEncounter.qID = sGroupID; rEncounter.GroupName = sGroupID; rEncounter.GeraldSails = true; iEncounter = iEncounterSlot; return true; } } } // try to make punitive squadron ref rMainCharacter = GetMainCharacter(); int iReputation = sti(rMainCharacter.reputation); if (iReputation < 40 && iCharacterIndexAsEnemy != -1) // FIX-ME { if (rand(100) < 40 * ((41 - iReputation) / 40)) { iEncounterType = ENCOUNTER_TYPE_PUNITIVE_SQUADRON; } } // find real encounter if not punitive if (iEncounterType == -1) { iEncounterType = FindWarEncounter(); if (iEncounterType == -1) return false; } rEncounter.RealEncounterType = iEncounterType; GenerateMapEncounter_WriteNumShips(rEncounter, iEncounterType, 4); // nation find int iNationsCanBe[MAX_NATIONS]; int iNumNationsCanBe = 0; for (int i=0; i