void CalculateEncInfoData()
{
ref mainCh = GetMainCharacter();
mainCh.ShipEnc = "none";
mainCh.CanEscape = 1;
EncRecalcReloadToSea();
float modifier = 1.0;
if (checkAttribute(mainCh, "Perks.List.ShipSpeedUp")) {
if (sti(mainCh.Perks.List.ShipSpeedUp) != 0) modifier += 0.2;
}
if (checkAttribute(mainCh, "Perks.List.ShipTurnRateUp")) {
if (sti(mainCh.Perks.List.ShipTurnRateUp) != 0) modifier += 0.15;
}
if (checkAttribute(mainCh, "Perks.List.SailingProfessional")) {
if (sti(mainCh.Perks.List.SailingProfessional) != 0) modifier += 0.65;
}
ref MyShipType = GetShipByType(GetCharacterShipType(mainCh));
aref arship; makearef(arship, mainCh.ship);
float SpeedMod = stf(GetLocalShipAttrib(arship, MyShipType, "SpeedRate")) / 12 / stf(mainCh.EncSpeed);
float sailmod = sqrt(GetSummonSkillFromName(mainCh, SKILL_SAILING)) * 16 * modifier * SpeedMod;
if (sti(sqrt(GetSummonSkillFromName(mainCh, SKILL_SNEAK))) != 0) {
if (rand(100) / (sqrt(GetSummonSkillFromName(mainCh, SKILL_SNEAK)) * 3.2) > sailmod) mainCh.CanEscape = false;
}
}