protected int GetSuccessChance(Creature creature, Skill skill, SkillRank manualRank)
{
var diff = ((int)skill.Info.Rank - (int)manualRank);
var chance = SuccessTable[29 - (diff + 15)];
// Production Mastery bonus
var pm = creature.Skills.Get(SkillId.ProductionMastery);
if (pm != null)
chance += (byte)pm.Info.Rank;
// Party bonus
// http://mabination.com/threads/579-Sooni-s-Guide-to-Tailoring!-(Please-claim-back-from-me)
if (creature.IsInParty)
{
var members = creature.Party.GetMembers();
var tailorsCount = members.Where(a => a != creature && a.Skills.Has(skill.Info.Id, SkillRank.RF)).Count();
if (tailorsCount != 0)
chance += (int)(tailorsCount * 5 / 100f * chance);
}
return Math2.Clamp(0, 99, chance);
}