Can someone help me add a delay to explosion potions. I want them to have a delay like the heal potion but for only 5 seconds? I tried taking double delay from basehealpotion.cs and i seem to get errors?
I am using the latest ServUO publish.
 
You can do this by using a timer delay and the action lock functions, something like this should do the trick;

BaseExplosionPotion.cs
Code:
        public override void Drink( Mobile from )
        {
                var locker = typeof( BaseExplosionPotion );

                if ( !from.BeginAction( locker ) )
                {
                        from.SendMessage( "You must wait a moment before using another purple potion." );
                        return;
                }

                Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), from.EndAction, locker  ); // end the lock in 5s

                // rest of the existing code ->
 
You can do this by using a timer delay and the action lock functions, something like this should do the trick;

BaseExplosionPotion.cs
Code:
        public override void Drink( Mobile from )
        {
                var locker = typeof( BaseExplosionPotion );

                if ( !from.BeginAction( locker ) )
                {
                        from.SendMessage( "You must wait a moment before using another purple potion." );
                        return;
                }

                Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), from.EndAction, locker  ); // end the lock in 5s

                // rest of the existing code ->
Ah works great thank you so much :D
 
Back