ModernUO/Projects/UOContent/Items/Weapons/Swords/BaseSword.cs
Kamron Batman 8e01db8555
fix: Fixes random bias & Adds back champion arties for UOML (#1235)
* Fixes RNG bias, we should never do `Utility.RandomDouble() <=`
* Adds back champion artifacts behind UOML flag.
2022-11-09 16:33:27 -08:00

39 lines
1.1 KiB
C#

using ModernUO.Serialization;
using Server.Targets;
namespace Server.Items
{
[SerializationGenerator(0, false)]
public abstract partial class BaseSword : BaseMeleeWeapon
{
public BaseSword(int itemID) : base(itemID)
{
}
public override SkillName DefSkill => SkillName.Swords;
public override WeaponType DefType => WeaponType.Slashing;
public override WeaponAnimation DefAnimation => WeaponAnimation.Slash1H;
public override void OnDoubleClick(Mobile from)
{
from.SendLocalizedMessage(1010018); // What do you want to use this item on?
from.Target = new BladedItemTarget(this);
}
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus = 1)
{
base.OnHit(attacker, defender, damageBonus);
if (!Core.AOS && Poison != null && PoisonCharges > 0)
{
--PoisonCharges;
if (Utility.RandomBool()) // 50% chance to poison
{
defender.ApplyPoison(attacker, Poison);
}
}
}
}
}