No, you just add:[code:1]public override TimeSpan GetCastDelay()
{
return TimeSpan.FromSeconds( 3.0 );
}[/code:1]to the spell script that you want to change the delay time on.
So, if you want the Fireball spell to take 3 second to cast. Change your FireBall.cs file, or whatever spell you wish to change, like this:[code:1]using System;
using Server.Targeting;
using Server.Network;
namespace Server.Spells.Third
{
public class FireballSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo(
"Fireball", "Vas Flam",
SpellCircle.Third,
203,
9041,
Reagent.BlackPearl
);
public FireballSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
//
///// Begin: Added for spell delay /////////////////////
//
public override TimeSpan GetCastDelay()
{
return TimeSpan.FromSeconds( 3.0 );
}
//
///// End: Added for spell delay ///////////////////////
//
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public override bool DelayedDamage{ get{ return true; } }
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
Mobile source = Caster;
SpellHelper.Turn( source, m );
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
double damage;
if ( Core.AOS )
{
damage = GetAosDamage( 6, 3, 5.5 );
}
else
{
damage = Utility.Random( 10, 7 );
if ( CheckResisted( m ) )
{
damage *= 0.75;
m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
damage *= GetDamageScalar( m );
}
//Effects.SendMovingEffect( source, m, 0x36E4, 7, 0, false, true, 1151, 0);
source.MovingParticles( m, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160 );
source.PlaySound( Core.AOS ? 0x15E : 0x44B );
SpellHelper.Damage( this, m, damage, 0, 100, 0, 0, 0 );
}
FinishSequence();
}
private class InternalTarget : Target
{
private FireballSpell m_Owner;
public InternalTarget( FireballSpell owner ) : base( 12, false, TargetFlags.Harmful )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile )
m_Owner.Target( (Mobile)o );
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}[/code:1]
The first piece of code, in my last post, is the base GetCastDelay() from the Spell.cs file. I was just showing that that method is virtual, so it can be overridden within a derived class, and you can create your own version of that method. For that matter, a method that use the modifier override or abstract can be overridden as well, as long as it has the same access level modifier.