Aura.Channel.World.Entities.Creature.GetProductionPartyBonus C# (CSharp) Method

GetProductionPartyBonus() public method

Returns party production bonus for the given skill if creature is in a party.
http://wiki.mabinogiworld.com/view/Party#Production_Bonus
public GetProductionPartyBonus ( Skill skill ) : float
skill Skill
return float
		public float GetProductionPartyBonus(Skill skill)
		{
			// No bonus when not in party
			if (!this.IsInParty)
				return 0;

			var result = 0f;

			var members = this.Party.GetMembers();
			foreach (var member in members)
			{
				// Exclude this creature
				if (member == this)
					continue;

				// Exclude members that don't have Production Master rF+
				var productionMastery = member.Skills.Get(SkillId.ProductionMastery);
				if (productionMastery == null || productionMastery.Info.Rank < SkillRank.RF)
					continue;

				// Exclude members that don't have the production skill on rF+
				var memberSkill = member.Skills.Get(skill.Info.Id);
				if (memberSkill == null || memberSkill.Info.Rank < SkillRank.RF)
					continue;

				// +1% if member has the skill on a lower rank
				if (memberSkill.Info.Rank < skill.Info.Rank)
					result += 1;
				// +5% if member has the skill on same or higher rank
				else
					result += 5;
			}

			// Cap at 35
			return Math.Min(35, result);
		}