//-----------------------------------------------------------------------------------
// Adjust the skill gained by character level, skill level and uneven gain in skills
//-----------------------------------------------------------------------------------
// Experience in each skill is worth more at low skill levels
skillExp = skillExp * (11 - sti(_refCharacter.skill.(expName))); // this produces 10,9,8,7,6,5,4,3,2,1
// Adjust for uneven gain in skills
int expMult = 1;
if (_exp < 1000)
{
switch (expName)
{
// case "Leadership": expMult = 3; break; // LDH 30Apr09
case "Fencing": expMult = 3; break;
case "Sailing": expMult = 1; break; // included for completeness
case "Accuracy": expMult = 1; break; // included for completeness
case "Cannons": expMult = 1; break; // included for completeness
case "Repair":
expMult = 50; // repair is a lot of small skill gains, minimum of 20 sent by repair functions
if (sti(_refCharacter.rank) < 3) // keeps player from getting repair skill 5 or 6 in the tutorial - 25Feb09
{
expMult = 20;
}
break;
case "Defence": expMult = 6; break;
case "Sneak": expMult = 3; break;
}
}
// Things we don't handle in the exp<1000 test above
if (expName == "Leadership") expMult = 3; // LDH moved outside of test - 30Apr09
if (expName == "Grappling") expMult = 4; // grappling is always high experience but doesn't happen often. - 30Apr09
if (expName == "Commerce") skillExp /= 2; // commerce is usually high, we're cutting it in half here so above test is wrong for this
skillExp *= expMult;
// Level the skill gains across ranks. Experience is worth more at lower rank.
// limit to 2 * experience - 01May09
skillExp = makeint(makefloat(skillExp) * retMin(2.0, 4.0 / stf(_refCharacter.rank)) + 0.5); // 2.0, 2.0, 1.3, 1.0, 0.75, 0.67 etc