[COMPLETE] Evasion spell
UPDATED AGAIN
Also includes chance to evade spells.
NEEDS TESTING!
Fixes
* Will evade spells.
* Will not evade spells while casting.
* Will not block spells if mage weapon or UBW is equipped without a shield.
* Will wait 20 seconds before allowing recast of evasion.
Important note: To Block dragons breath, add these two lines to BaseCreature.cs
I will remove needs testing once positive testing feedback comes in.
Type: Math && Missing feature.
Basic Description: wrong evasion/parry% && won't evade spells.
Way to experience: Cast Evasion. || get hit with spells while under the effect of evasion.
Detailed Description: Casting evasion with 60.01 skill results in a bonus of 28%. instead of 16.04% what it's suppose to be. spells aren't blocked with evasion.
Links: http://update.uo.com/design_530.html
Link#2:http://www.uodemise.com/forum/showthread.php?t=115137
Code:
UPDATED AGAIN
Also includes chance to evade spells.
NEEDS TESTING!
Fixes
* Will evade spells.
* Will not evade spells while casting.
* Will not block spells if mage weapon or UBW is equipped without a shield.
* Will wait 20 seconds before allowing recast of evasion.
Important note: To Block dragons breath, add these two lines to BaseCreature.cs
Code:
int poisDamage = BreathPoisonDamage;
int nrgyDamage = BreathEnergyDamage;
[COLOR="Red"]if( Evasion.CheckSpellEvasion( target ) )
return;[/COLOR]
if ( physDamage == 0 && fireDamage == 0 && coldDamage == 0 && poisDamage == 0 && nrgyDamage == 0 )
Type: Math && Missing feature.
Basic Description: wrong evasion/parry% && won't evade spells.
Way to experience: Cast Evasion. || get hit with spells while under the effect of evasion.
Detailed Description: Casting evasion with 60.01 skill results in a bonus of 28%. instead of 16.04% what it's suppose to be. spells aren't blocked with evasion.
Links: http://update.uo.com/design_530.html
Link#2:http://www.uodemise.com/forum/showthread.php?t=115137
Code:
Code:
Index: Bushido/Evasion.cs
===================================================================
--- Bushido/Evasion.cs (revision 319)
+++ Bushido/Evasion.cs (working copy)
@@ -4,6 +4,7 @@
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
+using Server.Spells;
namespace Server.Spells.Bushido
{
@@ -26,24 +27,29 @@
return base.CheckCast();
return false;
- }
+ }
public static bool VerifyCast( Mobile Caster, bool messages )
{
if( Caster == null ) //sanity
return false;
- if( Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null )
- return true;
+ /* //if( Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null )
+ //return true;
- //Intentional having a Shield check override all.
+ //Intentional having a Shield check override all.
+
+ overrides the 20 second delay if shield is equipped, thus removed.
+
+ */
+
BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if( weap == null )
weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
- if( weap != null )
+ if( weap != null || Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null )
{
if( Core.ML && Caster.Skills[weap.Skill].Base < 50 )
{
@@ -71,15 +77,35 @@
public static bool CheckSpellEvasion( Mobile defender )
{
- if( IsEvading( defender ) && VerifyCast( defender, false ) && BaseWeapon.CheckParry( defender ) ) //As per OSI, uses the exact same parry code
+
+
+ BaseWeapon weap = defender.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
+
+ if( weap == null )
+ weap = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
+
+
+ if( Core.ML && defender.Spell != null && defender.Spell.IsCasting )
{
+ return false;
+ }
+
+
+ else if( Core.ML && IsEvading( defender ) && BaseWeapon.CheckParry( defender ) && defender.Skills[weap.Skill].Base > 50 && ( weap != null || defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null) )
+ {
defender.Emote( "*evades*" ); //Yes. Eew. Blame OSI.
defender.FixedEffect( 0x37B9, 10, 16 );
return true;
}
-
+ else if( !Core.ML && IsEvading( defender ) && BaseWeapon.CheckParry( defender ) && (weap != null || defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null) )
+ {
+ defender.Emote( "*evades*" ); //Yes. Eew. Blame OSI.
+ defender.FixedEffect( 0x37B9, 10, 16 );
+ return true;
+ }
return false;
}
+
public Evasion( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@@ -144,6 +170,7 @@
return TimeSpan.FromSeconds( (int)seconds );
}
+
public static double GetParryScalar( Mobile m )
{
/* Evasion modifier to parry now scales with Bushido skill
@@ -158,15 +185,15 @@
if( !Core.ML )
return 1.5;
- double bonus = 80;
+ double bonus = 0;
- if( m.Skills.Bushido.Value > 60 )
- bonus += m.Skills.Bushido.Value;
+ if( m.Skills.Bushido.Value >= 60 )
+ bonus += ( (m.Skills.Bushido.Value - 60 *.004) + 0.16);
- if( m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 && m.Skills.Bushido.Value > 100 ) //Bushido being HIGHER than 100 for bonus is intended
- bonus += 50;
+ if( m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 && m.Skills.Bushido.Value > 100 ) //Bushido being HIGHER than 100 for bonus is intended
+ bonus += 0.10;
- return 1.0 + bonus/500;
+ return 1.0 + bonus;
}
public static void BeginEvasion( Mobile m )
@@ -191,7 +218,7 @@
t.Stop();
m_Table.Remove( m );
-
+
OnEffectEnd( m, typeof( Evasion ) );
}