ModernUO/Scripts/Spells/Bushido/Evasion.cs
asayre ce54fe8635 Bug fix for :
skillcaps and things that exceed it
Possible threading issue
Addition of Generic FindItemsByType  - List<T> findItemsByType<T>()
Change to make polymorph not have a timer and instead a toggle skill
KiAttack no longer works with ranged weapons
Poison strike speed and damage changed
Necro spells now affected by FC
Must have atleast 50 weapon skill if no shield equipped to use Evasion
Stalking bonus capped at 10 + skill/10
Stalking bonus now Clears
Bugfix w/Guilds
Crashguard Exception message moved closer to the top of the file.
Character creation of Pallys and necros using advanced skills now gives skill items 
Honor no longer works on Players
Pre-ML area HitArea attacks nolonger require LoS
Serialization fix for BladeOfTheRighteous
RidingSwipe now has paralyzation immunity as with NerveStrike and ParaBlow
AnkhEast renamed to AnkhNorth
LeggingsOfBane no longer have 510 HP
ElvenWashBasinEastAddon Fixed
AnsellaGryen won't be renamed each time the server Restarts
DiseasedCats are properly named
Localization fixes in DefBlacksmithy
BearMasks/DearMAsks and things that extend from them now can be repaired
2006-08-19 23:24:47 +00:00

129 lines
No EOL
2.8 KiB
C#

using System;
using System.Collections;
using Server.Network;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Spells.Bushido
{
public class Evasion : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Evasion", null,
SpellCircle.First, // 0 + 0.25 = 0.25s base cast delay
-1,
9002
);
public override double RequiredSkill{ get{ return 60.0; } }
public override int RequiredMana{ get{ return 10; } }
public override bool CheckCast()
{
if( Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null )
return base.CheckCast();
//Intentional having a Shield check override all.
BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if( weap == null )
weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
if( weap != null )
{
if( Core.ML && Caster.Skills[weap.Skill].Value < 50 )
{
//Does UBW affect this?
Caster.SendLocalizedMessage( 1076206 ); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
return false;
}
return base.CheckCast();
}
Caster.SendLocalizedMessage( 1062944 ); // You must have a weapon or a shield equipped to use this ability!
return false;
}
public Evasion( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnBeginCast()
{
base.OnBeginCast();
Caster.FixedEffect( 0x37C4, 10, 7, 4, 3 );
}
public override void OnCast()
{
if ( CheckSequence() )
{
Caster.SendLocalizedMessage( 1063120 ); // You feel that you might be able to deflect any attack!
Caster.FixedParticles( 0x376A, 1, 20, 0x7F5, 0x960, 0x3, EffectLayer.Waist );
Caster.PlaySound( 0x51B );
OnCastSuccessful( Caster );
BeginEvasion( Caster );
}
FinishSequence();
}
private static Hashtable m_Table = new Hashtable();
public static bool IsEvading( Mobile m )
{
return m_Table.Contains( m );
}
public static void BeginEvasion( Mobile m )
{
Timer t = (Timer)m_Table[m];
if ( t != null )
t.Stop();
t = new InternalTimer( m );
m_Table[m] = t;
t.Start();
}
public static void EndEvasion( Mobile m )
{
Timer t = (Timer)m_Table[m];
if ( t != null )
t.Stop();
m_Table.Remove( m );
OnEffectEnd( m, typeof( Evasion ) );
}
private class InternalTimer : Timer
{
private Mobile m_Mobile;
public InternalTimer( Mobile m ) : base( TimeSpan.FromSeconds( 8.0 ) )
{
m_Mobile = m;
Priority = TimerPriority.TwoFiftyMS;
}
protected override void OnTick()
{
EndEvasion( m_Mobile );
m_Mobile.SendLocalizedMessage( 1063121 ); // You no longer feel that you could deflect any attack.
}
}
}
}