Fixes casting checks

This commit is contained in:
Kamron Batman 2018-08-19 01:38:55 +08:00
parent 7ea00fbf4f
commit 03dd5f1926
431 changed files with 5616 additions and 6250 deletions

View file

@ -15,10 +15,10 @@ namespace Server.Spells
public override bool ConsumeReagents()
{
if( base.ConsumeReagents() )
if ( base.ConsumeReagents() )
return true;
if( ArcaneGem.ConsumeCharges( Caster, (Core.SE ? 1 : 1 + (int)Circle) ) )
if ( ArcaneGem.ConsumeCharges( Caster, (Core.SE ? 1 : 1 + (int)Circle) ) )
return true;
return false;
@ -30,7 +30,7 @@ namespace Server.Spells
{
int circle = (int)Circle;
if( Scroll != null )
if ( Scroll != null )
circle -= 2;
double avg = ChanceLength * circle;
@ -43,7 +43,7 @@ namespace Server.Spells
public override int GetMana()
{
if( Scroll is BaseWand )
if ( Scroll is BaseWand )
return 0;
return m_ManaTable[(int)Circle];
@ -54,7 +54,7 @@ namespace Server.Spells
int maxSkill = (1 + (int)Circle) * 10;
maxSkill += (1 + ((int)Circle / 6)) * 25;
if( m.Skills[SkillName.MagicResist].Value < maxSkill )
if ( m.Skills[SkillName.MagicResist].Value < maxSkill )
m.CheckSkill( SkillName.MagicResist, 0.0, m.Skills[SkillName.MagicResist].Cap );
return m.Skills[SkillName.MagicResist].Value;
@ -66,16 +66,16 @@ namespace Server.Spells
n /= 100.0;
if( n <= 0.0 )
if ( n <= 0.0 )
return false;
if( n >= 1.0 )
if ( n >= 1.0 )
return true;
int maxSkill = (1 + (int)Circle) * 10;
maxSkill += (1 + ((int)Circle / 6)) * 25;
if( target.Skills[SkillName.MagicResist].Value < maxSkill )
if ( target.Skills[SkillName.MagicResist].Value < maxSkill )
target.CheckSkill( SkillName.MagicResist, 0.0, target.Skills[SkillName.MagicResist].Cap );
return (n >= Utility.RandomDouble());
@ -96,10 +96,10 @@ namespace Server.Spells
public override TimeSpan GetCastDelay()
{
if( !Core.ML && Scroll is BaseWand )
if ( !Core.ML && Scroll is BaseWand )
return TimeSpan.Zero;
if( !Core.AOS )
if ( !Core.AOS )
return TimeSpan.FromSeconds( 0.5 + (0.25 * (int)Circle) );
return base.GetCastDelay();