Aura.Channel.Skills.SkillHelper.HandleInjury C# (CSharp) Method

HandleInjury() public static method

Inflicts injuries to target, based on attacker's Injury properties and the given damage.
public static HandleInjury ( Creature attacker, Creature target, float damage ) : void
attacker Aura.Channel.World.Entities.Creature
target Aura.Channel.World.Entities.Creature
damage float
return void
		public static void HandleInjury(Creature attacker, Creature target, float damage)
		{
			if (attacker == null || target == null || damage == 0)
				return;

			var rnd = RandomProvider.Get();
			var min = attacker.InjuryMin;
			var max = Math.Max(min, attacker.InjuryMax);

			// G1 Seal Scroll = 100% for 60s
			if (attacker.Conditions.Has(ConditionsA.Blessed))
			{
				min = 100;
				max = 100;
			}

			if (max == 0)
				return;

			var rndInjure = rnd.Next(min, max + 1);
			if (rndInjure == 0)
				return;

			var injure = damage * (rndInjure / 100f);

			target.Injuries += injure;
		}
	}