This commit is contained in:
mark 2012-11-10 20:06:36 +00:00
parent 8ff1a903a0
commit 14873aaa3e
78 changed files with 360 additions and 231 deletions

View file

@ -90,7 +90,9 @@ namespace Server.Spells.Fourth
{
Caster.DoBeneficial( m );
m.VirtualArmorMod += val;
new InternalTimer( m, Caster, val ).Start();
AddEntry( m, val );
new InternalTimer( m, Caster ).Start();
m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
m.PlaySound( 0x1F7 );
@ -103,12 +105,30 @@ namespace Server.Spells.Fourth
FinishSequence();
}
private static Dictionary<Mobile, Int32> _Table = new Dictionary<Mobile, Int32>();
private static void AddEntry( Mobile m, Int32 v )
{
_Table[m] = v;
}
public static void RemoveEntry( Mobile m )
{
if ( _Table.ContainsKey( m ) ) {
int v = _Table[m];
_Table.Remove( m );
m.EndAction( typeof( ArchProtectionSpell ) );
m.VirtualArmorMod -= v;
if ( m.VirtualArmorMod < 0 )
m.VirtualArmorMod = 0;
}
}
private class InternalTimer : Timer
{
private Mobile m_Owner;
private int m_Val;
public InternalTimer( Mobile target, Mobile caster, int val ) : base( TimeSpan.FromSeconds( 0 ) )
public InternalTimer( Mobile target, Mobile caster ) : base( TimeSpan.FromSeconds( 0 ) )
{
double time = caster.Skills[SkillName.Magery].Value * 1.2;
if ( time > 144 )
@ -117,15 +137,11 @@ namespace Server.Spells.Fourth
Priority = TimerPriority.OneSecond;
m_Owner = target;
m_Val = val;
}
protected override void OnTick()
{
m_Owner.EndAction( typeof( ArchProtectionSpell ) );
m_Owner.VirtualArmorMod -= m_Val;
if ( m_Owner.VirtualArmorMod < 0 )
m_Owner.VirtualArmorMod = 0;
ArchProtectionSpell.RemoveEntry( m_Owner );
}
}