Explosion Potion Help (ServUO Pub 57)

Operating System
Windows
ServUO Version
57
Hello,
I'm needing help with setting up explosion potions to have a 5-second delay BUT also able to cancel the pot mid-way through the timer and bring it back up.

(Line 142)
BasePotion.cs:
Timer.DelayCall(TimeSpan.FromMilliseconds(5000), () => from.EndAction(this.GetType())); // Default (500)

I've changed this line here to (5000) to give the explosion potions that 5-second delay but you cant bring the potion back up after canceling the timer until that 5-second delay timer has finished, resulting in damage to the thrower. Any help or guidance is greatly appreciated. I'm sure there's a ton of others looking to resolve this issue as well. All of the old posts that fixed this issue no longer exist.

Maybe BaseExplosionPotion.cs has some lines to settle this issue.

I've attached my current files below.

Thanks in advance.
 

Attachments

  • BasePotion.cs
    8.3 KB · Views: 0
  • BaseExplosionPotion.cs
    6.4 KB · Views: 0
SOLVED
BaseExplosionPotion.cs changes to add delay are listed below.

Around Line 70

BaseExplosionPotion.cs:
        public override void Drink(Mobile from)
        {
            if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
            {
                from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
                return;
            }

            int delay = GetDelay(from);

            if (delay > 0)
            {
                from.SendLocalizedMessage(1072529, String.Format("{0}\t{1}", delay, delay > 1 ? "seconds." : "second.")); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
                return;
            }


Around Line 328

BaseExplosionPotion.cs:
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Potion.Deleted || m_Potion.Map == Map.Internal)
                    return;

                IPoint3D p = targeted as IPoint3D;

                if (p == null)
                    return;

                // Add delay
                if (from.AccessLevel == AccessLevel.Player)
                {
                    BaseExplosionPotion.AddDelay(from);
                }

                Map map = from.Map;

                if (map == null)
                    return;

                SpellHelper.GetSurfaceTop(ref p);

                from.RevealingAction();

                IEntity to;

                to = new Entity(Serial.Zero, new Point3D(p), map);

                if (p is Mobile)
                {
                    if (!RelativeLocation) // explosion location = current mob location.
                        p = ((Mobile)p).Location;
                    else
                        to = (Mobile)p;
                }