protected override void OnTarget(Mobile mob, object targeted) { if (targeted is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)targeted; Type t = CraftResources.GetTypeFromCraftResource(weapon.Resource); if (t != null) { Item i = mob.Backpack.FindItemByType(t); if (i != null) { int RequiredResAmount = 1 + (weapon.MaxDurability - weapon.Durability) / 25; if (i.Amount > RequiredResAmount) { if (0.5 > Utility.RandomDouble()) { weapon.MaxDurability = (int)(weapon.MaxDurability * 0.95); } weapon.Durability = weapon.MaxDurability; i.Consume(RequiredResAmount); } else { mob.SendMessage("Vous ne possédez pas assez de ressources pour réparer l'arme."); } } } } else if (targeted is BaseArmor) { BaseArmor armor = (BaseArmor)targeted; Type t = CraftResources.GetTypeFromCraftResource(armor.Resource); if (t != null) { Item i = mob.Backpack.FindItemByType(t); if (i != null) { int RequiredResAmount = 1 + (armor.MaxDurability - armor.Durability) / 25; if (i.Amount > RequiredResAmount) { if (0.5 > Utility.RandomDouble()) { armor.MaxDurability = (int)(armor.MaxDurability * 0.85); } armor.Durability = armor.MaxDurability; i.Consume(RequiredResAmount); } else { mob.SendMessage("Vous ne possédez pas assez de ressources pour réparer l'armure."); } } } } }