RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Changing the disturb recovery math. Syntax help needed.

SnapDFI

Wanderer
Changing the disturb recovery math. Syntax help needed.

Ello there. I've been trying to change the Pre-AOS disturb recovery to mimic that of OSI's during that era, which means the spell timer is effectively meant to carry on after you have disturbed, and you can't recast until it has finished. Example: If you cast blade spirits got interupted 1 second in to the cast, there'd be another 5 seconds to wait until you are able to recast.

I think I have a good idea of what the sum needs to be. Something along the lines of simply DateTime.Now - m_StartCastTime if I understand what they do exactly. The main problem is I'm not quite sure of the syntax, everything I've tried produces errors.

Here is the code from spell.cs that needs to be modified, the "double delay =" is the line I'm looking at changing. If anyone could help me with the syntax I'd be very greatful, thanks. ;)

Code:
		public virtual TimeSpan GetDisturbRecovery()
		{
			if ( Core.AOS )
				return TimeSpan.Zero;

			double delay = 1.0 - Math.Sqrt( (DateTime.Now - m_StartCastTime).TotalSeconds / GetCastDelay().TotalSeconds );

			if ( delay < 0.2 )
				delay = 0.2;

			return TimeSpan.FromSeconds( delay );
		}
 
Top