To run some tests, I wanted to bring back the old (pre-AOS I believe) weapon poisoning system and I've encountered these:

Poisoning.cs
C#:
                protected override void OnTarget(Mobile from, object targeted)
                {
                    if (this.m_Potion.Deleted)
                        return;

                    bool startTimer = false;

                    if (targeted is Food || targeted is FukiyaDarts || targeted is Shuriken)
                    {
                        startTimer = true;
                    }
                    else if (targeted is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)targeted;

                        if (Core.AOS)
                        {
                            startTimer = (weapon.PrimaryAbility == WeaponAbility.InfectiousStrike || weapon.SecondaryAbility == WeaponAbility.InfectiousStrike);
                        }
                        else if (weapon.Layer == Layer.OneHanded)
                        {
                            // Only Bladed or Piercing weapon can be poisoned
                            startTimer = (weapon.Type == WeaponType.Slashing || weapon.Type == WeaponType.Piercing);
                        }
                    }

BaseWeapon.cs
C#:
        public bool CanShowPoisonCharges()
        {
            if (PrimaryAbility == WeaponAbility.InfectiousStrike || SecondaryAbility == WeaponAbility.InfectiousStrike)
                return true;

            return RootParent is Mobile && SkillMasterySpell.HasSpell((Mobile)RootParent, typeof(InjectedStrikeSpell));
        }

I guess toying with these could get me started, but where's the script that allows weapons without Infectious Strike to apply the poison? I believe it was based on a chance and I'd like to take a look, but cannot find it.
Any help would be great.
Thanks!
 
It's a mystery, it should have been handled in BaseWeapon.OnHit calling ApplyPoison().

I guess it got moved somewhere else...
 
I don't know why I hadn't checked the obvious places before... Guess it just seemed too obvious to be true.
BaseSword, BaseKnife and BaseSpear have this:
C#:
            if (!Core.AOS && defender is Mobile && this.Poison != null && this.PoisonCharges > 0)
            {
                --this.PoisonCharges;

                if (Utility.RandomDouble() >= 0.5) // 50% chance to poison
                    ((Mobile)defender).ApplyPoison(attacker, this.Poison);
            }
and it instantly answers my question.
Cheers :)
 
Back