Aura.Channel.Skills.Base.CreationSkill.GetSuccessChance C# (CSharp) Méthode

GetSuccessChance() protected méthode

Returns success chance between 0 and 100.
Unofficial. It's unlikely that officials use a table, instead of a formula, but for a lack of formula, we're forced to go with this. The success rates actually seem to be rather static, so it should work fine. We have all possible combinations, and with this function we do get the correct base chance.
protected GetSuccessChance ( Creature creature, Skill skill, SkillRank manualRank ) : int
creature Aura.Channel.World.Entities.Creature
skill Skill
manualRank SkillRank
Résultat int
		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);
		}