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!

Spell Delays

ervin

Wanderer
Spell Delays

Would anyone know a way to have a damage delay after casting the spell, as in on OSI after you cast e bolt it has 1.2 second delay before damage hits, same with fs and stuff... just a niffling :)

I have been trying to work on this for ages (but im a noob scripter) and know it needs timer stuff but i just cant get the timer to wait 1.2 seconds BEFORE dealing the damage... all i do seems to have no effect...
 

krrios

Administrator
[code:1]public class DealDamageTimer : Timer
{
private int m_Damage;
private Mobile m_Mobile;

public DealDamageTimer( int damage, Mobile m ) : base( TimeSpan.FromSeconds( 1.2 ) )
{
m_Damage = damage;
m_Mobile = m;
}

protected override void OnTick()
{
m_Mobile.Damage( m_Damage );
}
}[/code:1]

And to start the 1.2 second delay:

[code:1]new DealDamageTimer( 25, someMobile ).Start(); // deal 25 damage to someMobile[/code:1]
 
Top