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();

View file

@ -72,7 +72,7 @@ namespace Server.Spells
public void StartDelayedDamageContext( Mobile m, Timer t )
{
if( DelayedDamageStacking )
if ( DelayedDamageStacking )
return; //Sanity
if (!m_ContextTable.TryGetValue( GetType(), out DelayedDamageContextWrapper contexts ))
@ -107,7 +107,7 @@ namespace Server.Spells
public virtual int GetNewAosDamage( int bonus, int dice, int sides, Mobile singleTarget )
{
if( singleTarget != null )
if ( singleTarget != null )
{
return GetNewAosDamage( bonus, dice, sides, (Caster.Player && singleTarget.Player), GetDamageScalar( singleTarget ) );
}
@ -143,7 +143,7 @@ namespace Server.Spells
TransformContext context = TransformationSpellHelper.GetContext( Caster );
if( context != null && context.Spell is ReaperFormSpell )
if ( context != null && context.Spell is ReaperFormSpell )
damageBonus += ((ReaperFormSpell)context.Spell).SpellDamageBonus;
damage = AOS.Scale( damage, 100 + damageBonus );
@ -285,19 +285,19 @@ namespace Server.Spells
{
double scalar = 1.0;
if( !Core.AOS ) //EvalInt stuff for AoS is handled elsewhere
if ( !Core.AOS ) //EvalInt stuff for AoS is handled elsewhere
{
double casterEI = m_Caster.Skills[DamageSkill].Value;
double targetRS = target.Skills[SkillName.MagicResist].Value;
/*
if( Core.AOS )
if ( Core.AOS )
targetRS = 0;
*/
//m_Caster.CheckSkill( DamageSkill, 0.0, 120.0 );
if( casterEI > targetRS )
if ( casterEI > targetRS )
scalar = (1.0 + ((casterEI - targetRS) / 500.0));
else
scalar = (1.0 + ((casterEI - targetRS) / 200.0));
@ -305,7 +305,7 @@ namespace Server.Spells
// magery damage bonus, -25% at 0 skill, +0% at 100 skill, +5% at 120 skill
scalar += (m_Caster.Skills[CastSkill].Value - 100.0) / 400.0;
if( !target.Player && !target.Body.IsHuman /*&& !Core.AOS*/ )
if ( !target.Player && !target.Body.IsHuman /*&& !Core.AOS*/ )
scalar *= 2.0; // Double magery damage to monsters/animals if not AOS
}
@ -315,12 +315,12 @@ namespace Server.Spells
if ( m_Caster is BaseCreature )
((BaseCreature)m_Caster).AlterDamageScalarTo( target, ref scalar );
if( Core.SE )
if ( Core.SE )
scalar *= GetSlayerDamageScalar( target );
target.Region.SpellDamageScalar( m_Caster, target, ref scalar );
if( Evasion.CheckSpellEvasion( target ) ) //Only single target spells an be evaded
if ( Evasion.CheckSpellEvasion( target ) ) //Only single target spells an be evaded
scalar = 0;
return scalar;
@ -331,12 +331,12 @@ namespace Server.Spells
Spellbook atkBook = Spellbook.FindEquippedSpellbook( m_Caster );
double scalar = 1.0;
if( atkBook != null )
if ( atkBook != null )
{
SlayerEntry atkSlayer = SlayerGroup.GetEntryByName( atkBook.Slayer );
SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName( atkBook.Slayer2 );
if( atkSlayer != null && atkSlayer.Slays( defender ) || atkSlayer2 != null && atkSlayer2.Slays( defender ) )
if ( atkSlayer != null && atkSlayer.Slays( defender ) || atkSlayer2 != null && atkSlayer2.Slays( defender ) )
{
defender.FixedEffect( 0x37B9, 10, 5 ); //TODO: Confirm this displays on OSIs
scalar = 2.0;
@ -345,24 +345,24 @@ namespace Server.Spells
TransformContext context = TransformationSpellHelper.GetContext( defender );
if( (atkBook.Slayer == SlayerName.Silver || atkBook.Slayer2 == SlayerName.Silver) && context != null && context.Type != typeof( HorrificBeastSpell ) )
if ( (atkBook.Slayer == SlayerName.Silver || atkBook.Slayer2 == SlayerName.Silver) && context != null && context.Type != typeof( HorrificBeastSpell ) )
scalar +=.25; // Every necromancer transformation other than horrific beast take an additional 25% damage
if( scalar != 1.0 )
if ( scalar != 1.0 )
return scalar;
}
ISlayer defISlayer = Spellbook.FindEquippedSpellbook( defender );
if( defISlayer == null )
if ( defISlayer == null )
defISlayer = defender.Weapon as ISlayer;
if( defISlayer != null )
if ( defISlayer != null )
{
SlayerEntry defSlayer = SlayerGroup.GetEntryByName( defISlayer.Slayer );
SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName( defISlayer.Slayer2 );
if( defSlayer != null && defSlayer.Group.OppositionSuperSlays( m_Caster ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( m_Caster ) )
if ( defSlayer != null && defSlayer.Group.OppositionSuperSlays( m_Caster ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( m_Caster ) )
scalar = 2.0;
}
@ -407,7 +407,7 @@ namespace Server.Spells
if ( m_State == SpellState.Casting )
{
if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First )
if ( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First )
return;
m_State = SpellState.None;
@ -428,7 +428,7 @@ namespace Server.Spells
}
else if ( m_State == SpellState.Sequencing )
{
if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First )
if ( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First )
return;
m_State = SpellState.None;
@ -693,7 +693,7 @@ namespace Server.Spells
if ( ProtectionSpell.Registry.Contains( m_Caster ) )
fc -= 2;
if( EssenceOfWindSpell.IsDebuffed( m_Caster ) )
if ( EssenceOfWindSpell.IsDebuffed( m_Caster ) )
fc -= EssenceOfWindSpell.GetFCMalus( m_Caster );
TimeSpan baseDelay = CastDelayBase;
@ -787,7 +787,7 @@ namespace Server.Spells
if ( karma != 0 )
Misc.Titles.AwardKarma( Caster, karma, true );
if( TransformationSpellHelper.UnderTransformation( m_Caster, typeof( VampiricEmbraceSpell ) ) )
if ( TransformationSpellHelper.UnderTransformation( m_Caster, typeof( VampiricEmbraceSpell ) ) )
{
bool garlic = false;

View file

@ -21,7 +21,7 @@ namespace Server
{
public static void Nullify( Mobile from )
{
if( !from.CanBeginAction( typeof( DefensiveSpell ) ) )
if ( !from.CanBeginAction( typeof( DefensiveSpell ) ) )
new InternalTimer( from ).Start();
}
@ -65,7 +65,7 @@ namespace Server.Spells
public static TimeSpan GetDamageDelayForSpell( Spell sp )
{
if( !sp.DelayedDamage )
if ( !sp.DelayedDamage )
return TimeSpan.Zero;
return (Core.AOS ? AosDamageDelay : OldDamageDelay);
@ -83,7 +83,7 @@ namespace Server.Spells
public static bool CheckMulti( Point3D p, Map map, bool houses, int housingrange )
{
if( map == null || map == Map.Internal )
if ( map == null || map == Map.Internal )
return false;
Sector sector = map.GetSector( p.X, p.Y );
@ -92,14 +92,14 @@ namespace Server.Spells
{
BaseMulti multi = sector.Multis[i];
if( multi is BaseHouse )
if ( multi is BaseHouse )
{
BaseHouse bh = (BaseHouse)multi;
if( ( houses && bh.IsInside( p, 16 ) ) || ( housingrange > 0 && bh.InRange( p, housingrange ) ) )
if ( ( houses && bh.IsInside( p, 16 ) ) || ( housingrange > 0 && bh.InRange( p, housingrange ) ) )
return true;
}
else if( multi.Contains( p ))
else if ( multi.Contains( p ))
{
return true;
}
@ -112,17 +112,17 @@ namespace Server.Spells
{
IPoint3D target = to as IPoint3D;
if( target == null )
if ( target == null )
return;
if( target is Item )
if ( target is Item )
{
Item item = (Item)target;
if( item.RootParent != from )
if ( item.RootParent != from )
from.Direction = from.GetDirectionTo( item.GetWorldLocation() );
}
else if( from != target )
else if ( from != target )
{
from.Direction = from.GetDirectionTo( target );
}
@ -133,24 +133,24 @@ namespace Server.Spells
public static bool CheckCombat( Mobile m )
{
if( !RestrictTravelCombat )
if ( !RestrictTravelCombat )
return false;
for( int i = 0; i < m.Aggressed.Count; ++i )
{
AggressorInfo info = m.Aggressed[i];
if( info.Defender.Player && (DateTime.UtcNow - info.LastCombatTime) < CombatHeatDelay )
if ( info.Defender.Player && (DateTime.UtcNow - info.LastCombatTime) < CombatHeatDelay )
return true;
}
if( Core.Expansion == Expansion.AOS )
if ( Core.Expansion == Expansion.AOS )
{
for( int i = 0; i < m.Aggressors.Count; ++i )
{
AggressorInfo info = m.Aggressors[i];
if( info.Attacker.Player && (DateTime.UtcNow - info.LastCombatTime) < CombatHeatDelay )
if ( info.Attacker.Player && (DateTime.UtcNow - info.LastCombatTime) < CombatHeatDelay )
return true;
}
}
@ -160,14 +160,14 @@ namespace Server.Spells
public static bool AdjustField( ref Point3D p, Map map, int height, bool mobsBlock )
{
if( map == null )
if ( map == null )
return false;
for( int offset = 0; offset < 10; ++offset )
{
Point3D loc = new Point3D( p.X, p.Y, p.Z - offset );
if( map.CanFit( loc, height, true, mobsBlock ) )
if ( map.CanFit( loc, height, true, mobsBlock ) )
{
p = loc;
return true;
@ -192,16 +192,16 @@ namespace Server.Spells
public static void GetSurfaceTop( ref IPoint3D p )
{
if( p is Item )
if ( p is Item )
{
p = ((Item)p).GetSurfaceTop();
}
else if( p is StaticTarget )
else if ( p is StaticTarget )
{
StaticTarget t = (StaticTarget)p;
int z = t.Z;
if( (t.Flags & TileFlag.Surface) == 0 )
if ( (t.Flags & TileFlag.Surface) == 0 )
z -= TileData.ItemTable[t.ItemID & TileData.MaxItemValue].CalcHeight;
p = new Point3D( t.X, t.Y, z );
@ -210,9 +210,9 @@ namespace Server.Spells
public static bool AddStatOffset( Mobile m, StatType type, int offset, TimeSpan duration )
{
if( offset > 0 )
if ( offset > 0 )
return AddStatBonus( m, m, type, offset, duration );
else if( offset < 0 )
else if ( offset < 0 )
return AddStatCurse( m, m, type, -offset, duration );
return true;
@ -230,12 +230,12 @@ namespace Server.Spells
StatMod mod = target.GetStatMod( name );
if( mod != null && mod.Offset < 0 )
if ( mod != null && mod.Offset < 0 )
{
target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
return true;
}
else if( mod == null || mod.Offset < offset )
else if ( mod == null || mod.Offset < offset )
{
target.AddStatMod( new StatMod( type, name, offset, duration ) );
return true;
@ -256,12 +256,12 @@ namespace Server.Spells
StatMod mod = target.GetStatMod( name );
if( mod != null && mod.Offset > 0 )
if ( mod != null && mod.Offset > 0 )
{
target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
return true;
}
else if( mod == null || mod.Offset > offset )
else if ( mod == null || mod.Offset > offset )
{
target.AddStatMod( new StatMod( type, name, offset, duration ) );
return true;
@ -272,7 +272,7 @@ namespace Server.Spells
public static TimeSpan GetDuration( Mobile caster, Mobile target )
{
if( Core.AOS )
if ( Core.AOS )
return TimeSpan.FromSeconds( ((6 * caster.Skills.EvalInt.Fixed) / 50) + 1 );
return TimeSpan.FromSeconds( caster.Skills[SkillName.Magery].Value * 1.2 );
@ -290,14 +290,14 @@ namespace Server.Spells
{
double percent;
if( curse )
if ( curse )
percent = 8 + (caster.Skills.EvalInt.Fixed / 100) - (target.Skills.MagicResist.Fixed / 100);
else
percent = 1 + (caster.Skills.EvalInt.Fixed / 100);
percent *= 0.01;
if( percent < 0 )
if ( percent < 0 )
percent = 0;
return percent;
@ -305,13 +305,13 @@ namespace Server.Spells
public static int GetOffset( Mobile caster, Mobile target, StatType type, bool curse )
{
if( Core.AOS )
if ( Core.AOS )
{
if( !m_DisableSkillCheck )
if ( !m_DisableSkillCheck )
{
caster.CheckSkill( SkillName.EvalInt, 0.0, 120.0 );
if( curse )
if ( curse )
target.CheckSkill( SkillName.MagicResist, 0.0, 120.0 );
}
@ -335,19 +335,19 @@ namespace Server.Spells
{
Guild g = m.Guild as Guild;
if( g == null && m is BaseCreature )
if ( g == null && m is BaseCreature )
{
BaseCreature c = (BaseCreature)m;
m = c.ControlMaster;
if( m != null )
if ( m != null )
g = m.Guild as Guild;
if( g == null )
if ( g == null )
{
m = c.SummonMaster;
if( m != null )
if ( m != null )
g = m.Guild as Guild;
}
}
@ -357,10 +357,10 @@ namespace Server.Spells
public static bool ValidIndirectTarget( Mobile from, Mobile to )
{
if( from == to )
if ( from == to )
return true;
if( to.Hidden && to.AccessLevel > from.AccessLevel )
if ( to.Hidden && to.AccessLevel > from.AccessLevel )
return false;
#region Dueling
@ -393,45 +393,45 @@ namespace Server.Spells
Guild fromGuild = GetGuildFor( from );
Guild toGuild = GetGuildFor( to );
if( fromGuild != null && toGuild != null && (fromGuild == toGuild || fromGuild.IsAlly( toGuild )) )
if ( fromGuild != null && toGuild != null && (fromGuild == toGuild || fromGuild.IsAlly( toGuild )) )
return false;
Party p = Party.Get( from );
if( p != null && p.Contains( to ) )
if ( p != null && p.Contains( to ) )
return false;
if( to is BaseCreature )
if ( to is BaseCreature )
{
BaseCreature c = (BaseCreature)to;
if( c.Controlled || c.Summoned )
if ( c.Controlled || c.Summoned )
{
if( c.ControlMaster == from || c.SummonMaster == from )
if ( c.ControlMaster == from || c.SummonMaster == from )
return false;
if( p != null && (p.Contains( c.ControlMaster ) || p.Contains( c.SummonMaster )) )
if ( p != null && (p.Contains( c.ControlMaster ) || p.Contains( c.SummonMaster )) )
return false;
}
}
if( from is BaseCreature )
if ( from is BaseCreature )
{
BaseCreature c = (BaseCreature)from;
if( c.Controlled || c.Summoned )
if ( c.Controlled || c.Summoned )
{
if( c.ControlMaster == to || c.SummonMaster == to )
if ( c.ControlMaster == to || c.SummonMaster == to )
return false;
p = Party.Get( to );
if( p != null && (p.Contains( c.ControlMaster ) || p.Contains( c.SummonMaster )) )
if ( p != null && (p.Contains( c.ControlMaster ) || p.Contains( c.SummonMaster )) )
return false;
}
}
if( to is BaseCreature && !((BaseCreature)to).Controlled && ((BaseCreature)to).InitialInnocent )
if ( to is BaseCreature && !((BaseCreature)to).Controlled && ((BaseCreature)to).InitialInnocent )
return true;
int noto = Notoriety.Compute( from, to );
@ -455,15 +455,15 @@ namespace Server.Spells
{
Map map = caster.Map;
if( map == null )
if ( map == null )
return;
double scale = 1.0 + ((caster.Skills[SkillName.Magery].Value - 100.0) / 200.0);
if( scaleDuration )
if ( scaleDuration )
duration = TimeSpan.FromSeconds( duration.TotalSeconds * scale );
if( scaleStats )
if ( scaleStats )
{
creature.RawStr = (int)(creature.RawStr * scale);
creature.Hits = creature.HitsMax;
@ -477,7 +477,7 @@ namespace Server.Spells
Point3D p = new Point3D( caster );
if( SpellHelper.FindValidSpawnLocation( map, ref p, true ) )
if ( SpellHelper.FindValidSpawnLocation( map, ref p, true ) )
{
BaseCreature.Summon( creature, caster, p, sound, duration );
return;
@ -492,7 +492,7 @@ namespace Server.Spells
int x = caster.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = caster.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if( map.CanSpawnMobile( x, y, caster.Z ) )
if ( map.CanSpawnMobile( x, y, caster.Z ) )
{
BaseCreature.Summon( creature, caster, new Point3D( x, y, caster.Z ), sound, duration );
return;
@ -501,7 +501,7 @@ namespace Server.Spells
{
int z = map.GetAverageZ( x, y );
if( map.CanSpawnMobile( x, y, z ) )
if ( map.CanSpawnMobile( x, y, z ) )
{
BaseCreature.Summon( creature, caster, new Point3D( x, y, z ), sound, duration );
return;
@ -516,12 +516,12 @@ namespace Server.Spells
public static bool FindValidSpawnLocation( Map map, ref Point3D p, bool surroundingsOnly )
{
if( map == null ) //sanity
if ( map == null ) //sanity
return false;
if( !surroundingsOnly )
if ( !surroundingsOnly )
{
if( map.CanSpawnMobile( p ) ) //p's fine.
if ( map.CanSpawnMobile( p ) ) //p's fine.
{
p = new Point3D( p );
return true;
@ -529,7 +529,7 @@ namespace Server.Spells
int z = map.GetAverageZ( p.X, p.Y );
if( map.CanSpawnMobile( p.X, p.Y, z ) )
if ( map.CanSpawnMobile( p.X, p.Y, z ) )
{
p = new Point3D( p.X, p.Y, z );
return true;
@ -543,7 +543,7 @@ namespace Server.Spells
int x = p.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = p.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if( map.CanSpawnMobile( x, y, p.Z ) )
if ( map.CanSpawnMobile( x, y, p.Z ) )
{
p = new Point3D( x, y, p.Z );
return true;
@ -552,7 +552,7 @@ namespace Server.Spells
{
int z = map.GetAverageZ( x, y );
if( map.CanSpawnMobile( x, y, z ) )
if ( map.CanSpawnMobile( x, y, z ) )
{
p = new Point3D( x, y, z );
return true;
@ -602,9 +602,9 @@ namespace Server.Spells
public static void SendInvalidMessage( Mobile caster, TravelCheckType type )
{
if( type == TravelCheckType.RecallTo || type == TravelCheckType.GateTo )
if ( type == TravelCheckType.RecallTo || type == TravelCheckType.GateTo )
caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
else if( type == TravelCheckType.TeleportTo )
else if ( type == TravelCheckType.TeleportTo )
caster.SendLocalizedMessage( 501035 ); // You cannot teleport from here to the destination.
else
caster.SendLocalizedMessage( 501802 ); // Thy spell doth not appear to work...
@ -625,15 +625,15 @@ namespace Server.Spells
public static bool CheckTravel( Mobile caster, Map map, Point3D loc, TravelCheckType type )
{
if( IsInvalid( map, loc ) ) // null, internal, out of bounds
if ( IsInvalid( map, loc ) ) // null, internal, out of bounds
{
if( caster != null )
if ( caster != null )
SendInvalidMessage( caster, type );
return false;
}
if( caster != null && caster.AccessLevel == AccessLevel.Player && caster.Region.IsPartOf( typeof( Regions.Jail ) ) )
if ( caster != null && caster.AccessLevel == AccessLevel.Player && caster.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
caster.SendLocalizedMessage( 1114345 ); // You'll need a better jailbreak plan than that!
return false;
@ -657,7 +657,7 @@ namespace Server.Spells
for( int i = 0; isValid && i < m_Validators.Length; ++i )
isValid = (m_Rules[v, i] || !m_Validators[i]( map, loc ));
if( !isValid && caster != null )
if ( !isValid && caster != null )
SendInvalidMessage( caster, type );
return isValid;
@ -729,7 +729,7 @@ namespace Server.Spells
public static bool IsCrystalCave( Map map, Point3D loc )
{
if( map != Map.Malas || loc.Z >= -80 )
if ( map != Map.Malas || loc.Z >= -80 )
return false;
int x = loc.X, y = loc.Y;
@ -779,15 +779,15 @@ namespace Server.Spells
public static bool IsDoomFerry( Map map, Point3D loc )
{
if( map != Map.Malas )
if ( map != Map.Malas )
return false;
int x = loc.X, y = loc.Y;
if( x >= 426 && y >= 314 && x <= 430 && y <= 331 )
if ( x >= 426 && y >= 314 && x <= 430 && y <= 331 )
return true;
if( x >= 406 && y >= 247 && x <= 410 && y <= 264 )
if ( x >= 406 && y >= 247 && x <= 410 && y <= 264 )
return true;
return false;
@ -796,7 +796,7 @@ namespace Server.Spells
public static bool IsTokunoDungeon( Map map, Point3D loc )
{
//The tokuno dungeons are really inside malas
if( map != Map.Malas )
if ( map != Map.Malas )
return false;
int x = loc.X, y = loc.Y, z = loc.Z;
@ -809,7 +809,7 @@ namespace Server.Spells
public static bool IsDoomGauntlet( Map map, Point3D loc )
{
if( map != Map.Malas )
if ( map != Map.Malas )
return false;
int x = loc.X - 256, y = loc.Y - 304;
@ -851,7 +851,7 @@ namespace Server.Spells
public static bool IsInvalid( Map map, Point3D loc )
{
if( map == null || map == Map.Internal )
if ( map == null || map == Map.Internal )
return true;
int x = loc.X, y = loc.Y;
@ -862,7 +862,7 @@ namespace Server.Spells
//towns
public static bool IsTown( IPoint3D loc, Mobile caster )
{
if( loc is Item )
if ( loc is Item )
loc = ((Item)loc).GetWorldLocation();
return IsTown( new Point3D( loc ), caster );
@ -872,7 +872,7 @@ namespace Server.Spells
{
Map map = caster.Map;
if( map == null )
if ( map == null )
return false;
#region Dueling
@ -894,7 +894,7 @@ namespace Server.Spells
public static bool CheckTown( IPoint3D loc, Mobile caster )
{
if( loc is Item )
if ( loc is Item )
loc = ((Item)loc).GetWorldLocation();
return CheckTown( new Point3D( loc ), caster );
@ -902,7 +902,7 @@ namespace Server.Spells
public static bool CheckTown( Point3D loc, Mobile caster )
{
if( IsTown( loc, caster ) )
if ( IsTown( loc, caster ) )
{
caster.SendLocalizedMessage( 500946 ); // You cannot cast this in town!
return false;
@ -919,7 +919,7 @@ namespace Server.Spells
public static void CheckReflect( int circle, ref Mobile caster, ref Mobile target )
{
if( target.MagicDamageAbsorb > 0 )
if ( target.MagicDamageAbsorb > 0 )
{
++circle;
@ -929,16 +929,16 @@ namespace Server.Spells
bool reflect = (target.MagicDamageAbsorb >= 0);
if( target is BaseCreature )
if ( target is BaseCreature )
((BaseCreature)target).CheckReflect( caster, ref reflect );
if( target.MagicDamageAbsorb <= 0 )
if ( target.MagicDamageAbsorb <= 0 )
{
target.MagicDamageAbsorb = 0;
DefensiveSpell.Nullify( target );
}
if( reflect )
if ( reflect )
{
target.FixedEffect( 0x37B9, 10, 5 );
@ -947,13 +947,13 @@ namespace Server.Spells
target = temp;
}
}
else if( target is BaseCreature )
else if ( target is BaseCreature )
{
bool reflect = false;
((BaseCreature)target).CheckReflect( caster, ref reflect );
if( reflect )
if ( reflect )
{
target.FixedEffect( 0x37B9, 10, 5 );
@ -985,12 +985,12 @@ namespace Server.Spells
{
int iDamage = (int)damage;
if( delay == TimeSpan.Zero )
if ( delay == TimeSpan.Zero )
{
if( from is BaseCreature )
if ( from is BaseCreature )
((BaseCreature)from).AlterSpellDamageTo( target, ref iDamage );
if( target is BaseCreature )
if ( target is BaseCreature )
((BaseCreature)target).AlterSpellDamageFrom( from, ref iDamage );
target.Damage( iDamage, from );
@ -1000,7 +1000,7 @@ namespace Server.Spells
new SpellDamageTimer( spell, target, from, iDamage, delay ).Start();
}
if( target is BaseCreature && from != null && delay == TimeSpan.Zero )
if ( target is BaseCreature && from != null && delay == TimeSpan.Zero )
{
BaseCreature c = (BaseCreature) target;
@ -1042,12 +1042,12 @@ namespace Server.Spells
{
int iDamage = (int)damage;
if( delay == TimeSpan.Zero )
if ( delay == TimeSpan.Zero )
{
if( from is BaseCreature )
if ( from is BaseCreature )
((BaseCreature)from).AlterSpellDamageTo( target, ref iDamage );
if( target is BaseCreature )
if ( target is BaseCreature )
((BaseCreature)target).AlterSpellDamageFrom( from, ref iDamage );
WeightOverloading.DFA = dfa;
@ -1066,7 +1066,7 @@ namespace Server.Spells
new SpellDamageTimerAOS( spell, target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa ).Start();
}
if( target is BaseCreature && from != null && delay == TimeSpan.Zero )
if ( target is BaseCreature && from != null && delay == TimeSpan.Zero )
{
BaseCreature c = (BaseCreature) target;
@ -1123,7 +1123,7 @@ namespace Server.Spells
m_Damage = damage;
m_Spell = s;
if( m_Spell != null && m_Spell.DelayedDamage && !m_Spell.DelayedDamageStacking )
if ( m_Spell != null && m_Spell.DelayedDamage && !m_Spell.DelayedDamageStacking )
m_Spell.StartDelayedDamageContext( target, this );
Priority = TimerPriority.TwentyFiveMS;
@ -1131,14 +1131,14 @@ namespace Server.Spells
protected override void OnTick()
{
if( m_From is BaseCreature )
if ( m_From is BaseCreature )
((BaseCreature)m_From).AlterSpellDamageTo( m_Target, ref m_Damage );
if( m_Target is BaseCreature )
if ( m_Target is BaseCreature )
((BaseCreature)m_Target).AlterSpellDamageFrom( m_From, ref m_Damage );
m_Target.Damage( m_Damage );
if( m_Spell != null )
if ( m_Spell != null )
m_Spell.RemoveDelayedDamageContext( m_Target );
}
}
@ -1164,7 +1164,7 @@ namespace Server.Spells
m_Nrgy = nrgy;
m_DFA = dfa;
m_Spell = s;
if( m_Spell != null && m_Spell.DelayedDamage && !m_Spell.DelayedDamageStacking )
if ( m_Spell != null && m_Spell.DelayedDamage && !m_Spell.DelayedDamageStacking )
m_Spell.StartDelayedDamageContext( target, this );
Priority = TimerPriority.TwentyFiveMS;
@ -1172,10 +1172,10 @@ namespace Server.Spells
protected override void OnTick()
{
if( m_From is BaseCreature && m_Target != null )
if ( m_From is BaseCreature && m_Target != null )
((BaseCreature)m_From).AlterSpellDamageTo( m_Target, ref m_Damage );
if( m_Target is BaseCreature && m_From != null )
if ( m_Target is BaseCreature && m_From != null )
((BaseCreature)m_Target).AlterSpellDamageFrom( m_From, ref m_Damage );
WeightOverloading.DFA = m_DFA;
@ -1189,7 +1189,7 @@ namespace Server.Spells
WeightOverloading.DFA = DFAlgorithm.Standard;
if( m_Target is BaseCreature && m_From != null )
if ( m_Target is BaseCreature && m_From != null )
{
BaseCreature c = (BaseCreature) m_Target;
@ -1197,7 +1197,7 @@ namespace Server.Spells
c.OnDamagedBySpell( m_From );
}
if( m_Spell != null )
if ( m_Spell != null )
m_Spell.RemoveDelayedDamageContext( m_Target );
}
@ -1218,13 +1218,13 @@ namespace Server.Spells
{
TransformContext context = GetContext( m );
if( context != null )
if ( context != null )
RemoveContext( m, context, resetGraphics );
}
public static void RemoveContext( Mobile m, TransformContext context, bool resetGraphics )
{
if( m_Table.ContainsKey( m ) )
if ( m_Table.ContainsKey( m ) )
{
m_Table.Remove( m );
@ -1233,7 +1233,7 @@ namespace Server.Spells
for( int i = 0; i < mods.Count; ++i )
m.RemoveResistanceMod( mods[i] );
if( resetGraphics )
if ( resetGraphics )
{
m.HueMod = -1;
m.BodyMod = 0;
@ -1266,17 +1266,17 @@ namespace Server.Spells
public static bool CheckCast( Mobile caster, Spell spell )
{
if( Factions.Sigil.ExistsOn( caster ) )
if ( Factions.Sigil.ExistsOn( caster ) )
{
caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
return false;
}
else if( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
else if ( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return false;
}
else if( AnimalForm.UnderTransformation( caster ) )
else if ( AnimalForm.UnderTransformation( caster ) )
{
caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
return false;
@ -1289,14 +1289,14 @@ namespace Server.Spells
{
ITransformationSpell transformSpell = spell as ITransformationSpell;
if( transformSpell == null )
if ( transformSpell == null )
return false;
if( Factions.Sigil.ExistsOn( caster ) )
if ( Factions.Sigil.ExistsOn( caster ) )
{
caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
}
else if( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
else if ( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
}
@ -1305,15 +1305,15 @@ namespace Server.Spells
caster.SendLocalizedMessage( 1061631 ); // You can't do that while disguised.
return false;
}
else if( AnimalForm.UnderTransformation( caster ) )
else if ( AnimalForm.UnderTransformation( caster ) )
{
caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
}
else if( !caster.CanBeginAction( typeof( IncognitoSpell ) ) || (caster.IsBodyMod && GetContext( caster ) == null) )
else if ( !caster.CanBeginAction( typeof( IncognitoSpell ) ) || (caster.IsBodyMod && GetContext( caster ) == null) )
{
spell.DoFizzle();
}
else if( spell.CheckSequence() )
else if ( spell.CheckSequence() )
{
TransformContext context = GetContext( caster );
Type ourType = spell.GetType();
@ -1321,41 +1321,41 @@ namespace Server.Spells
bool wasTransformed = (context != null);
bool ourTransform = (wasTransformed && context.Type == ourType);
if( wasTransformed )
if ( wasTransformed )
{
RemoveContext( caster, context, ourTransform );
if( ourTransform )
if ( ourTransform )
{
caster.PlaySound( 0xFA );
caster.FixedParticles( 0x3728, 1, 13, 5042, EffectLayer.Waist );
}
}
if( !ourTransform )
if ( !ourTransform )
{
List<ResistanceMod> mods = new List<ResistanceMod>();
if( transformSpell.PhysResistOffset != 0 )
if ( transformSpell.PhysResistOffset != 0 )
mods.Add( new ResistanceMod( ResistanceType.Physical, transformSpell.PhysResistOffset ) );
if( transformSpell.FireResistOffset != 0 )
if ( transformSpell.FireResistOffset != 0 )
mods.Add( new ResistanceMod( ResistanceType.Fire, transformSpell.FireResistOffset ) );
if( transformSpell.ColdResistOffset != 0 )
if ( transformSpell.ColdResistOffset != 0 )
mods.Add( new ResistanceMod( ResistanceType.Cold, transformSpell.ColdResistOffset ) );
if( transformSpell.PoisResistOffset != 0 )
if ( transformSpell.PoisResistOffset != 0 )
mods.Add( new ResistanceMod( ResistanceType.Poison, transformSpell.PoisResistOffset ) );
if( transformSpell.NrgyResistOffset != 0 )
if ( transformSpell.NrgyResistOffset != 0 )
mods.Add( new ResistanceMod( ResistanceType.Energy, transformSpell.NrgyResistOffset ) );
if( !((Body)transformSpell.Body).IsHuman )
if ( !((Body)transformSpell.Body).IsHuman )
{
Mobiles.IMount mt = caster.Mount;
if( mt != null )
if ( mt != null )
mt.Rider = null;
}
@ -1435,7 +1435,7 @@ namespace Server.Spells
protected override void OnTick()
{
if( m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Spell.Body || m_Mobile.Hue != m_Spell.Hue )
if ( m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Body != m_Spell.Body || m_Mobile.Hue != m_Spell.Hue )
{
TransformationSpellHelper.RemoveContext( m_Mobile, true );
Stop();

View file

@ -58,7 +58,7 @@ namespace Server.Spells
public static int GetRegistryNumber( Type type )
{
if( m_IDsFromTypes.ContainsKey( type ) )
if ( m_IDsFromTypes.ContainsKey( type ) )
return m_IDsFromTypes[type];
return -1;
@ -74,10 +74,10 @@ namespace Server.Spells
m_Types[spellID] = type;
if( !m_IDsFromTypes.ContainsKey( type ) )
if ( !m_IDsFromTypes.ContainsKey( type ) )
m_IDsFromTypes.Add( type, spellID );
if( type.IsSubclassOf( typeof( SpecialMove ) ) )
if ( type.IsSubclassOf( typeof( SpecialMove ) ) )
{
SpecialMove spm = null;
@ -89,7 +89,7 @@ namespace Server.Spells
{
}
if( spm != null )
if ( spm != null )
m_SpecialMoves.Add( spellID, spm );
}
}
@ -116,7 +116,7 @@ namespace Server.Spells
Type t = m_Types[spellID];
if( t != null && !t.IsSubclassOf( typeof( SpecialMove ) ) )
if ( t != null && !t.IsSubclassOf( typeof( SpecialMove ) ) )
{
m_Params[0] = caster;
m_Params[1] = scroll;

View file

@ -23,7 +23,7 @@ namespace Server.Spells.Bushido
public override bool CheckCast()
{
if( VerifyCast( Caster, true ) )
if ( VerifyCast( Caster, true ) )
return base.CheckCast();
return false;
@ -31,12 +31,12 @@ namespace Server.Spells.Bushido
public static bool VerifyCast( Mobile Caster, bool messages )
{
if( Caster == null ) // Sanity
if ( Caster == null ) // Sanity
return false;
BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if( weap == null )
if ( weap == null )
weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
if ( weap != null ) {
@ -107,7 +107,7 @@ namespace Server.Spells.Bushido
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
Caster.SendLocalizedMessage( 1063120 ); // You feel that you might be able to deflect any attack!
Caster.FixedParticles( 0x376A, 1, 20, 0x7F5, 0x960, 3, EffectLayer.Waist );
@ -142,15 +142,15 @@ namespace Server.Spells.Bushido
* o 6-7 seconds w/ GM+ Bushido and GM tactics/anatomy
*/
if( !Core.ML )
if ( !Core.ML )
return TimeSpan.FromSeconds( 8.0 );
double seconds = 3;
if( m.Skills.Bushido.Value > 60 )
if ( m.Skills.Bushido.Value > 60 )
seconds += (m.Skills.Bushido.Value - 60) / 20;
if( m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 && m.Skills.Bushido.Value > 100.0 ) //Bushido being HIGHER than 100 for bonus is intended
if ( m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 && m.Skills.Bushido.Value > 100.0 ) //Bushido being HIGHER than 100 for bonus is intended
seconds++;
return TimeSpan.FromSeconds( (int)seconds );
@ -167,15 +167,15 @@ namespace Server.Spells.Bushido
* o 42-50% bonus w/ GM+ bushido and GM tactics/anatomy
*/
if( !Core.ML )
if ( !Core.ML )
return 1.5;
double bonus = 0;
if( m.Skills.Bushido.Value >= 60 )
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
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;
@ -185,7 +185,7 @@ namespace Server.Spells.Bushido
{
Timer t = (Timer)m_Table[m];
if( t != null )
if ( t != null )
t.Stop();
t = new InternalTimer( m, GetEvadeDuration( m ) );
@ -199,7 +199,7 @@ namespace Server.Spells.Bushido
{
Timer t = (Timer)m_Table[m];
if( t != null )
if ( t != null )
t.Stop();
m_Table.Remove( m );

View file

@ -96,7 +96,7 @@ namespace Server.Spells.Chivalry
}
TransformContext context = TransformationSpellHelper.GetContext( m );
if( context != null && context.Spell is NecromancerSpell ) //Trees are not evil! TODO: OSI confirm?
if ( context != null && context.Spell is NecromancerSpell ) //Trees are not evil! TODO: OSI confirm?
{
// transformed ..

View file

@ -72,7 +72,7 @@ namespace Server.Spells.Chivalry
{
Caster.SendLocalizedMessage( 1010395 ); // The veil of death in this area is too strong and resists thy efforts to restore life.
}
else if( resChance > Utility.RandomDouble() )
else if ( resChance > Utility.RandomDouble() )
{
m.FixedParticles( 0x375A, 1, 15, 5005, 5, 3, EffectLayer.Head );
m.CloseGump( typeof( ResurrectGump ) );

View file

@ -36,7 +36,7 @@ namespace Server.Spells.Fifth
if ( !base.CheckCast() )
return false;
if( (Caster.Followers + (Core.SE ? 2 : 1)) > Caster.FollowersMax )
if ( (Caster.Followers + (Core.SE ? 2 : 1)) > Caster.FollowersMax )
{
Caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
return false;

View file

@ -99,7 +99,7 @@ namespace Server.Spells.Fifth
int timeVal = ((6 * Caster.Skills.Magery.Fixed) / 50) + 1;
if( timeVal > 144 )
if ( timeVal > 144 )
timeVal = 144;
TimeSpan length = TimeSpan.FromSeconds( timeVal );

View file

@ -50,7 +50,7 @@ namespace Server.Spells.Fifth
{
int secs = (int)((GetDamageSkill( Caster ) / 10) - (GetResistSkill( m ) / 10));
if( !Core.SE )
if ( !Core.SE )
secs += 2;
if ( !m.Player )

View file

@ -72,7 +72,7 @@ namespace Server.Spells.First
toHeal = Caster.Skills.Magery.Fixed / 120;
toHeal += Utility.RandomMinMax( 1, 4 );
if( Core.SE && Caster != m )
if ( Core.SE && Caster != m )
toHeal = (int)(toHeal * 1.5);
}
else

View file

@ -177,7 +177,7 @@ namespace Server.Spells.Fourth
}
}
if( version < 2 )
if ( version < 2 )
m_Damage = 2;
}

View file

@ -39,7 +39,7 @@ namespace Server.Spells.Fourth
{
if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( WraithFormSpell ) ) )
min = max = 0;
else if( Core.SE && m_Book != null ) //recall using Runebook charge
else if ( Core.SE && m_Book != null ) //recall using Runebook charge
min = max = 0;
else
base.GetCastSkills( out min, out max );

View file

@ -107,7 +107,7 @@ namespace Server.Spells
Register( 114, typeof( Necromancy.WitherSpell ) );
Register( 115, typeof( Necromancy.WraithFormSpell ) );
if( Core.SE )
if ( Core.SE )
Register( 116, typeof( Necromancy.ExorcismSpell ) );
// Paladin abilities

View file

@ -185,7 +185,7 @@ namespace Server.Spells.Necromancy
Corpse c = obj as Corpse;
if( c == null )
if ( c == null )
{
Caster.SendLocalizedMessage( 1061084 ); // You cannot animate that.
}
@ -193,12 +193,12 @@ namespace Server.Spells.Necromancy
{
Type type = null;
if( c.Owner != null )
if ( c.Owner != null )
{
type = c.Owner.GetType();
}
if( c.ItemID != 0x2006 || c.Animated || type == typeof( PlayerMobile ) || type == null || ( c.Owner != null && c.Owner.Fame < 100 ) || ( ( c.Owner != null ) && ( c.Owner is BaseCreature ) && ( ( ( BaseCreature )c.Owner ).Summoned || ( ( BaseCreature )c.Owner ).IsBonded ) ) )
if ( c.ItemID != 0x2006 || c.Animated || type == typeof( PlayerMobile ) || type == null || ( c.Owner != null && c.Owner.Fame < 100 ) || ( ( c.Owner != null ) && ( c.Owner is BaseCreature ) && ( ( ( BaseCreature )c.Owner ).Summoned || ( ( BaseCreature )c.Owner ).IsBonded ) ) )
{
Caster.SendLocalizedMessage( 1061085 ); // There's not enough life force there to animate.
}
@ -206,18 +206,18 @@ namespace Server.Spells.Necromancy
{
CreatureGroup group = FindGroup( type );
if( group != null )
if ( group != null )
{
if( group.m_Entries.Length == 0 || type == typeof( DemonKnight ) )
if ( group.m_Entries.Length == 0 || type == typeof( DemonKnight ) )
{
Caster.SendLocalizedMessage( 1061086 ); // You cannot animate undead remains.
}
else if( CheckSequence() )
else if ( CheckSequence() )
{
Point3D p = c.GetWorldLocation();
Map map = c.Map;
if( map != null )
if ( map != null )
{
Effects.PlaySound( p, map, 0x1FB );
Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 );

View file

@ -143,13 +143,13 @@ namespace Server.Spells.Necromancy
}
public void DoExpire()
{
if( m_OathTable.Contains( m_Caster ) )
if ( m_OathTable.Contains( m_Caster ) )
{
m_Caster.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
m_OathTable.Remove ( m_Caster );
}
if( m_OathTable.Contains( m_Target ) )
if ( m_OathTable.Contains( m_Target ) )
{
m_Target.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
m_OathTable.Remove ( m_Target );

View file

@ -31,7 +31,7 @@ namespace Server.Spells.Necromancy
public override bool CheckCast()
{
if( Caster.Skills.SpiritSpeak.Value < 100.0 )
if ( Caster.Skills.SpiritSpeak.Value < 100.0 )
{
Caster.SendLocalizedMessage( 1072112 ); // You must have GM Spirit Speak to use this spell
return false;
@ -54,20 +54,20 @@ namespace Server.Spells.Necromancy
{
ChampionSpawnRegion r = Caster.Region.GetRegion( typeof( ChampionSpawnRegion ) ) as ChampionSpawnRegion;
if( r == null || !Caster.InRange( r.ChampionSpawn, Range ) )
if ( r == null || !Caster.InRange( r.ChampionSpawn, Range ) )
{
Caster.SendLocalizedMessage( 1072111 ); // You are not in a valid exorcism region.
}
else if( CheckSequence() )
else if ( CheckSequence() )
{
Map map = Caster.Map;
if( map != null )
if ( map != null )
{
List<Mobile> targets = new List<Mobile>();
foreach( Mobile m in r.ChampionSpawn.GetMobilesInRange( Range ) )
if( IsValidTarget( m ) )
if ( IsValidTarget( m ) )
targets.Add( m );
for( int i = 0; i < targets.Count; ++i )
@ -86,18 +86,18 @@ namespace Server.Spells.Necromancy
private bool IsValidTarget( Mobile m )
{
if( !m.Player || m.Alive )
if ( !m.Player || m.Alive )
return false;
Corpse c = m.Corpse as Corpse;
Map map = m.Map;
if( c != null && !c.Deleted && map != null && c.Map == map )
if ( c != null && !c.Deleted && map != null && c.Map == map )
{
if( SpellHelper.IsAnyT2A( map, c.Location ) && SpellHelper.IsAnyT2A( map, m.Location ) )
if ( SpellHelper.IsAnyT2A( map, c.Location ) && SpellHelper.IsAnyT2A( map, m.Location ) )
return false; //Same Map, both in T2A, ie, same 'sub server'.
if( m.Region.IsPartOf( typeof( DungeonRegion ) ) == Region.Find( c.Location, map ).IsPartOf( typeof( DungeonRegion ) ) )
if ( m.Region.IsPartOf( typeof( DungeonRegion ) ) == Region.Find( c.Location, map ).IsPartOf( typeof( DungeonRegion ) ) )
return false; //Same Map, both in Dungeon region OR They're both NOT in a dungeon region.
//Just an approximation cause RunUO doens't divide up the world the same way OSI does ;p
@ -106,24 +106,24 @@ namespace Server.Spells.Necromancy
Party p = Party.Get( m );
if( p != null && p.Contains( Caster ) )
if ( p != null && p.Contains( Caster ) )
return false;
if( m.Guild != null && Caster.Guild != null )
if ( m.Guild != null && Caster.Guild != null )
{
Guild mGuild = m.Guild as Guild;
Guild cGuild = Caster.Guild as Guild;
if( mGuild.IsAlly( cGuild ) )
if ( mGuild.IsAlly( cGuild ) )
return false;
if( mGuild == cGuild )
if ( mGuild == cGuild )
return false;
}
Faction f = Faction.Find( m );
if( Faction.Facet == m.Map && f != null && f == Faction.Find( Caster ) )
if ( Faction.Facet == m.Map && f != null && f == Faction.Find( Caster ) )
return false;
return true;
@ -136,13 +136,13 @@ namespace Server.Spells.Necromancy
Point3D[] locList;
if( map == Map.Felucca || map == Map.Trammel )
if ( map == Map.Felucca || map == Map.Trammel )
locList = m_BritanniaLocs;
else if( map == Map.Ilshenar )
else if ( map == Map.Ilshenar )
locList = m_IllshLocs;
else if( map == Map.Tokuno )
else if ( map == Map.Tokuno )
locList = m_TokunoLocs;
else if( map == Map.Malas )
else if ( map == Map.Malas )
locList = m_MalasLocs;
else
locList = new Point3D[0];
@ -155,7 +155,7 @@ namespace Server.Spells.Necromancy
Point3D p = locList[i];
double dist = m.GetDistanceToSqrt( p );
if( minDist > dist )
if ( minDist > dist )
{
closest = p;
minDist = dist;

View file

@ -42,10 +42,10 @@ namespace Server.Spells.Necromancy
public override bool ConsumeReagents()
{
if( base.ConsumeReagents() )
if ( base.ConsumeReagents() )
return true;
if( ArcaneGem.ConsumeCharges( Caster, 1 ) )
if ( ArcaneGem.ConsumeCharges( Caster, 1 ) )
return true;
return false;

View file

@ -57,12 +57,12 @@ namespace Server.Spells.Necromancy
TimeSpan buffTime = TimeSpan.FromSeconds( 10.0 );
if( m_Table.Contains( m ) )
if ( m_Table.Contains( m ) )
{
damage = Utility.RandomMinMax( 3, 7 );
Timer t = m_Table[m] as Timer;
if( t != null )
if ( t != null )
{
t.Delay += TimeSpan.FromSeconds( 2.0 );

View file

@ -35,7 +35,7 @@ namespace Server.Spells.Necromancy
public void Target( Mobile m )
{
if( CheckHSequence( m ) )
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
@ -60,7 +60,7 @@ namespace Server.Spells.Necromancy
Map map = m.Map;
if( map != null )
if ( map != null )
{
List<Mobile> targets = new List<Mobile>();
@ -68,8 +68,8 @@ namespace Server.Spells.Necromancy
targets.Add( m );
foreach( Mobile targ in m.GetMobilesInRange( 2 ) )
if(!(Caster is BaseCreature && targ is BaseCreature ))
if( ( targ != Caster && m != targ ) && ( SpellHelper.ValidIndirectTarget( Caster, targ ) && Caster.CanBeHarmful( targ, false) ) )
if (!(Caster is BaseCreature && targ is BaseCreature ))
if ( ( targ != Caster && m != targ ) && ( SpellHelper.ValidIndirectTarget( Caster, targ ) && Caster.CanBeHarmful( targ, false) ) )
targets.Add( targ );
for( int i = 0; i < targets.Count; ++i )
@ -77,9 +77,9 @@ namespace Server.Spells.Necromancy
Mobile targ = targets[i];
int num;
if( targ.InRange( m.Location, 0 ) )
if ( targ.InRange( m.Location, 0 ) )
num = 1;
else if( targ.InRange( m.Location, 1 ) )
else if ( targ.InRange( m.Location, 1 ) )
num = 2;
else
num = 3;
@ -105,7 +105,7 @@ namespace Server.Spells.Necromancy
protected override void OnTarget( Mobile from, object o )
{
if( o is Mobile )
if ( o is Mobile )
m_Owner.Target( (Mobile)o );
}

View file

@ -26,7 +26,7 @@ namespace Server.Spells.Necromancy
public override bool CheckCast()
{
if( !TransformationSpellHelper.CheckCast( Caster, this ) )
if ( !TransformationSpellHelper.CheckCast( Caster, this ) )
return false;
return base.CheckCast();

View file

@ -31,7 +31,7 @@ namespace Server.Spells.Necromancy
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
/* Creates a withering frost around the Caster,
* which deals Cold Damage to all valid targets in a radius of 5 tiles.
@ -39,7 +39,7 @@ namespace Server.Spells.Necromancy
Map map = Caster.Map;
if( map != null )
if ( map != null )
{
List<Mobile> targets = new List<Mobile>();
@ -48,7 +48,7 @@ namespace Server.Spells.Necromancy
foreach( Mobile m in Caster.GetMobilesInRange( Core.ML ? 4 : 5 ) )
{
if( Caster != m && Caster.InLOS( m ) && ( isMonster || SpellHelper.ValidIndirectTarget( Caster, m ) ) && Caster.CanBeHarmful( m, false ) )
if ( Caster != m && Caster.InLOS( m ) && ( isMonster || SpellHelper.ValidIndirectTarget( Caster, m ) ) && Caster.CanBeHarmful( m, false ) )
{
if ( isMonster )
{
@ -88,7 +88,7 @@ namespace Server.Spells.Necromancy
int sdiBonus = AosAttributes.GetValue( Caster, AosAttribute.SpellDamage );
// PvP spell damage increase cap of 15% from an item<65>s magic property in Publish 33(SE)
if( Core.SE && m.Player && Caster.Player && sdiBonus > 15 )
if ( Core.SE && m.Player && Caster.Player && sdiBonus > 15 )
sdiBonus = 15;
damage *= ( 100 + sdiBonus );

View file

@ -191,7 +191,7 @@ namespace Server.Spells.Ninjitsu
}
/*
if( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) )
if ( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) )
return MorphResult.Fail;
*
* On OSI,it seems you can only gain starting at '0' using Animal form.
@ -472,7 +472,7 @@ namespace Server.Spells.Ninjitsu
{
m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
}
else if( ( m_Caster is PlayerMobile ) && ( m_Caster as PlayerMobile ).MountBlockReason != BlockMountType.None )
else if ( ( m_Caster is PlayerMobile ) && ( m_Caster as PlayerMobile ).MountBlockReason != BlockMountType.None )
{
m_Caster.SendLocalizedMessage( 1063108 ); // You cannot use this ability right now.
}

View file

@ -28,7 +28,7 @@ namespace Server.Spells.Ninjitsu
public override bool Validate( Mobile from )
{
if( !from.Hidden || from.AllowedStealthSteps <= 0 )
if ( !from.Hidden || from.AllowedStealthSteps <= 0 )
{
from.SendLocalizedMessage( 1063087 ); // You must be in stealth mode to use this ability.
return false;
@ -41,7 +41,7 @@ namespace Server.Spells.Ninjitsu
{
bool valid = Validate( attacker ) && CheckMana( attacker, true );
if( valid )
if ( valid )
{
attacker.BeginAction( typeof( Stealth ) );
Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), delegate { attacker.EndAction( typeof( Stealth ) ); } );

View file

@ -26,7 +26,7 @@ namespace Server.Spells.Ninjitsu
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
return;
ClearCurrentMove( attacker );
@ -39,12 +39,12 @@ namespace Server.Spells.Ninjitsu
if ( attacker.Weapon is BaseRanged )
isRanged = true;
if( ninjitsu < 100 ) //This formula is an approximation from OSI data. TODO: find correct formula
if ( ninjitsu < 100 ) //This formula is an approximation from OSI data. TODO: find correct formula
chance = 30 + (ninjitsu - 85) * 2.2;
else
chance = 63 + (ninjitsu - 100) * 1.1;
if( (chance / 100) < Utility.RandomDouble() )
if ( (chance / 100) < Utility.RandomDouble() )
{
attacker.SendLocalizedMessage( 1070779 ); // You missed your opponent with a Death Strike.
return;
@ -55,16 +55,16 @@ namespace Server.Spells.Ninjitsu
int damageBonus = 0;
if( m_Table.Contains( defender ) )
if ( m_Table.Contains( defender ) )
{
defender.SendLocalizedMessage( 1063092 ); // Your opponent lands another Death Strike!
info = (DeathStrikeInfo)m_Table[defender];
if( info.m_Steps > 0 )
if ( info.m_Steps > 0 )
damageBonus = attacker.Skills[SkillName.Ninjitsu].Fixed / 150;
if( info.m_Timer != null )
if ( info.m_Timer != null )
info.m_Timer.Stop();
m_Table.Remove( defender );
@ -112,10 +112,10 @@ namespace Server.Spells.Ninjitsu
{
DeathStrikeInfo info = m_Table[m] as DeathStrikeInfo;
if( info == null )
if ( info == null )
return;
if( ++info.m_Steps >= 5 )
if ( ++info.m_Steps >= 5 )
ProcessDeathStrike( m );
}
@ -125,7 +125,7 @@ namespace Server.Spells.Ninjitsu
DeathStrikeInfo info = m_Table[defender] as DeathStrikeInfo;
if( info == null ) //sanity
if ( info == null ) //sanity
return;
int maxDamage, damage = 0;
@ -163,7 +163,7 @@ namespace Server.Spells.Ninjitsu
else
AOS.Damage( info.m_Target, info.m_Attacker, damage, true, 100, 0, 0, 0, 0, 0, 0, false, false, true ); // Damage is physical.
if( info.m_Timer != null )
if ( info.m_Timer != null )
info.m_Timer.Stop();
m_Table.Remove( info.m_Target );

View file

@ -37,11 +37,11 @@ namespace Server.Spells.Ninjitsu
return false;
}
if( Core.ML )
if ( Core.ML )
{
BaseRanged ranged = from.Weapon as BaseRanged;
if( ranged != null )
if ( ranged != null )
{
from.SendLocalizedMessage( 1075858 ); // You can only use this with melee attacks.
return false;

View file

@ -72,7 +72,7 @@ namespace Server.Spells.Ninjitsu
Caster.SendLocalizedMessage( 1063133 ); // You cannot summon a mirror image because you have too many followers.
return false;
}
else if( TransformationSpellHelper.UnderTransformation( Caster, typeof( HorrificBeastSpell ) ) )
else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( HorrificBeastSpell ) ) )
{
Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
return false;
@ -103,7 +103,7 @@ namespace Server.Spells.Ninjitsu
{
Caster.SendLocalizedMessage( 1063133 ); // You cannot summon a mirror image because you have too many followers.
}
else if( TransformationSpellHelper.UnderTransformation( Caster, typeof( HorrificBeastSpell ) ) )
else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( HorrificBeastSpell ) ) )
{
Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
}

View file

@ -21,7 +21,7 @@ namespace Server.Spells.Ninjitsu
public override bool Validate( Mobile from )
{
if( !from.Hidden || from.AllowedStealthSteps <= 0 )
if ( !from.Hidden || from.AllowedStealthSteps <= 0 )
{
from.SendLocalizedMessage( 1063087 ); // You must be in stealth mode to use this ability.
return false;
@ -34,7 +34,7 @@ namespace Server.Spells.Ninjitsu
{
bool valid = Validate( attacker ) && CheckMana( attacker, true );
if( valid )
if ( valid )
{
attacker.BeginAction( typeof( Stealth ) );
Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), delegate { attacker.EndAction( typeof( Stealth ) ); } );

View file

@ -45,7 +45,7 @@ namespace Server.Spells.Seventh
Caster.SendLocalizedMessage( 1010521 ); // You cannot polymorph while you have a Town Sigil
return false;
}
else if( TransformationSpellHelper.UnderTransformation( Caster ) )
else if ( TransformationSpellHelper.UnderTransformation( Caster ) )
{
Caster.SendLocalizedMessage( 1061633 ); // You cannot polymorph while in that form.
return false;
@ -62,7 +62,7 @@ namespace Server.Spells.Seventh
}
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
if( Core.ML )
if ( Core.ML )
EndPolymorph( Caster );
else
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
@ -96,12 +96,12 @@ namespace Server.Spells.Seventh
}
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
if( Core.ML )
if ( Core.ML )
EndPolymorph( Caster );
else
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
}
else if( TransformationSpellHelper.UnderTransformation( Caster ) )
else if ( TransformationSpellHelper.UnderTransformation( Caster ) )
{
Caster.SendLocalizedMessage( 1061633 ); // You cannot polymorph while in that form.
}
@ -141,7 +141,7 @@ namespace Server.Spells.Seventh
BaseArmor.ValidateMobile( Caster );
BaseClothing.ValidateMobile( Caster );
if( !Core.ML )
if ( !Core.ML )
{
StopTimer( Caster );
@ -179,7 +179,7 @@ namespace Server.Spells.Seventh
private static void EndPolymorph( Mobile m )
{
if( !m.CanBeginAction( typeof( PolymorphSpell ) ) )
if ( !m.CanBeginAction( typeof( PolymorphSpell ) ) )
{
m.BodyMod = 0;
m.HueMod = -1;

View file

@ -24,7 +24,7 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if( !IsValidLocation( Caster.Location, Caster.Map ) )
if ( !IsValidLocation( Caster.Location, Caster.Map ) )
{
Caster.SendLocalizedMessage( 1072705 ); // You must be standing on an arcane circle, pentagram or abbatoir to use this spell.
return false;
@ -41,7 +41,7 @@ namespace Server.Spells.Spellweaving
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
Caster.FixedParticles( 0x3779, 10, 20, 0x0, EffectLayer.Waist );
Caster.PlaySound( 0x5C0 );
@ -68,7 +68,7 @@ namespace Server.Spells.Spellweaving
{
LandTile lt = map.Tiles.GetLandTile( location.X, location.Y ); // Land Tiles
if( IsValidTile( lt.ID ) && lt.Z == location.Z )
if ( IsValidTile( lt.ID ) && lt.Z == location.Z )
return true;
StaticTile[] tiles = map.Tiles.GetStaticTiles( location.X, location.Y ); // Static Tiles
@ -80,9 +80,9 @@ namespace Server.Spells.Spellweaving
int tand = t.ID;
if( t.Z + id.CalcHeight != location.Z )
if ( t.Z + id.CalcHeight != location.Z )
continue;
else if( IsValidTile( tand ) )
else if ( IsValidTile( tand ) )
return true;
}
@ -92,9 +92,9 @@ namespace Server.Spells.Spellweaving
{
ItemData id = item.ItemData;
if( item == null || item.Z + id.CalcHeight != location.Z )
if ( item == null || item.Z + id.CalcHeight != location.Z )
continue;
else if( IsValidTile( item.ItemID ) )
else if ( IsValidTile( item.ItemID ) )
{
eable.Free();
return true;
@ -132,15 +132,15 @@ namespace Server.Spells.Spellweaving
private void GiveArcaneFocus( Mobile to, TimeSpan duration, int strengthBonus )
{
if( to == null ) //Sanity
if ( to == null ) //Sanity
return;
ArcaneFocus focus = FindArcaneFocus( to );
if( focus == null )
if ( focus == null )
{
ArcaneFocus f = new ArcaneFocus( duration, strengthBonus );
if( to.PlaceInBackpack( f ) )
if ( to.PlaceInBackpack( f ) )
{
f.SendTimeRemainingMessage( to );
to.SendLocalizedMessage( 1072740 ); // An arcane focus appears in your backpack.

View file

@ -27,7 +27,7 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if( !TransformationSpellHelper.CheckCast( Caster, this ) )
if ( !TransformationSpellHelper.CheckCast( Caster, this ) )
return false;
return base.CheckCast();

View file

@ -15,10 +15,10 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if( !base.CheckCast() )
if ( !base.CheckCast() )
return false;
if( (Caster.Followers + 1) > Caster.FollowersMax )
if ( (Caster.Followers + 1) > Caster.FollowersMax )
{
Caster.SendLocalizedMessage( 1074270 ); // You have too many followers to summon another one.
return false;
@ -29,7 +29,7 @@ namespace Server.Spells.Spellweaving
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
TimeSpan duration = TimeSpan.FromMinutes( Caster.Skills.Spellweaving.Value /24 + FocusLevel*2 );
int summons = Math.Min( 1+FocusLevel, Caster.FollowersMax - Caster.Followers );
@ -48,4 +48,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Spells.Spellweaving
{
ArcaneFocus focus = FindArcaneFocus( from );
if( focus == null || focus.Deleted )
if ( focus == null || focus.Deleted )
return 0;
return focus.StrengthBonus;
@ -40,7 +40,7 @@ namespace Server.Spells.Spellweaving
public static ArcaneFocus FindArcaneFocus( Mobile from )
{
if( from == null || from.Backpack == null )
if ( from == null || from.Backpack == null )
return null;
if ( from.Holding is ArcaneFocus )
@ -51,10 +51,10 @@ namespace Server.Spells.Spellweaving
public static bool CheckExpansion( Mobile from )
{
if( !(from is PlayerMobile) )
if ( !(from is PlayerMobile) )
return true;
if( from.NetState == null )
if ( from.NetState == null )
return false;
return from.NetState.SupportsExpansion( Expansion.ML );
@ -62,7 +62,7 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if( !base.CheckCast() )
if ( !base.CheckCast() )
return false;
Mobile caster = Caster;
@ -126,7 +126,7 @@ namespace Server.Spells.Spellweaving
{
base.OnDisturb( type, message );
if( message )
if ( message )
Caster.PlaySound( 0x1D6 );
}
@ -147,10 +147,10 @@ namespace Server.Spells.Spellweaving
{
double percent = (50 + 2*(GetResistSkill( m ) - GetDamageSkill( Caster )))/100; //TODO: According to the guide this is it.. but.. is it correct per OSI?
if( percent <= 0 )
if ( percent <= 0 )
return false;
if( percent >= 1.0 )
if ( percent >= 1.0 )
return true;
return (percent >= Utility.RandomDouble());

View file

@ -23,12 +23,12 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if( m_Table.ContainsKey( Caster ) )
if ( m_Table.ContainsKey( Caster ) )
{
Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
return false;
}
else if( !Caster.CanBeginAction( typeof( AttuneWeaponSpell ) ) )
else if ( !Caster.CanBeginAction( typeof( AttuneWeaponSpell ) ) )
{
Caster.SendLocalizedMessage( 1075124 ); // You must wait before casting that spell again.
return false;
@ -39,7 +39,7 @@ namespace Server.Spells.Spellweaving
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
Caster.PlaySound( 0x5C3 );
Caster.FixedParticles( 0x3728, 1, 13, 0x26B8, 0x455, 7, EffectLayer.Waist );
@ -69,7 +69,7 @@ namespace Server.Spells.Spellweaving
public static void TryAbsorb( Mobile defender, ref int damage )
{
if( damage == 0 || !IsAbsorbing( defender ) || defender.MeleeDamageAbsorb <= 0 )
if ( damage == 0 || !IsAbsorbing( defender ) || defender.MeleeDamageAbsorb <= 0 )
return;
int absorbed = Math.Min( damage, defender.MeleeDamageAbsorb );
@ -79,7 +79,7 @@ namespace Server.Spells.Spellweaving
defender.SendLocalizedMessage( 1075127, String.Format( "{0}\t{1}", absorbed, defender.MeleeDamageAbsorb ) ); // ~1_damage~ point(s) of damage have been absorbed. A total of ~2_remaining~ point(s) of shielding remain.
if( defender.MeleeDamageAbsorb <= 0 )
if ( defender.MeleeDamageAbsorb <= 0 )
StopAbsorbing( defender, true );
}
@ -117,7 +117,7 @@ namespace Server.Spells.Spellweaving
m_Mobile.MeleeDamageAbsorb = 0;
if( message )
if ( message )
{
m_Mobile.SendLocalizedMessage( 1075126 ); // Your attunement fades.
m_Mobile.PlaySound( 0x1F8 );

View file

@ -19,7 +19,7 @@ namespace Server.Spells.Spellweaving
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
Caster.PlaySound( 0x5C6 );
@ -37,7 +37,7 @@ namespace Server.Spells.Spellweaving
foreach( Mobile m in Caster.GetMobilesInRange( range ) )
{
if( Caster != m && Caster.InLOS( m ) && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) )
if ( Caster != m && Caster.InLOS( m ) && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) )
targets.Add( m );
}
@ -49,7 +49,7 @@ namespace Server.Spells.Spellweaving
SpellHelper.Damage( this, m, damage, 0, 0, 100, 0, 0 );
if( !CheckResisted( m ) ) //No message on resist
if ( !CheckResisted( m ) ) //No message on resist
{
m_Table[m] = new EssenceOfWindInfo( m, fcMalus, ssiMalus, duration );
@ -131,7 +131,7 @@ namespace Server.Spells.Spellweaving
{
Stop();
/*
if( message )
if ( message )
{
}
*/

View file

@ -26,7 +26,7 @@ namespace Server.Spells.Spellweaving
{
EventSink.AggressiveAction += new AggressiveActionEventHandler( delegate( AggressiveActionEventArgs e )
{
if( TransformationSpellHelper.UnderTransformation( e.Aggressor, typeof( EtherealVoyageSpell ) ) )
if ( TransformationSpellHelper.UnderTransformation( e.Aggressor, typeof( EtherealVoyageSpell ) ) )
{
TransformationSpellHelper.RemoveContext( e.Aggressor, true );
}
@ -35,15 +35,15 @@ namespace Server.Spells.Spellweaving
public override bool CheckCast()
{
if( TransformationSpellHelper.UnderTransformation( Caster, typeof( EtherealVoyageSpell ) ) )
if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( EtherealVoyageSpell ) ) )
{
Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
}
else if( !Caster.CanBeginAction( typeof( EtherealVoyageSpell ) ) )
else if ( !Caster.CanBeginAction( typeof( EtherealVoyageSpell ) ) )
{
Caster.SendLocalizedMessage( 1075124 ); // You must wait before casting that spell again.
}
else if( Caster.Combatant != null )
else if ( Caster.Combatant != null )
{
Caster.SendLocalizedMessage( 1072586 ); // You cannot cast Ethereal Voyage while you are in combat.
}

View file

@ -41,25 +41,25 @@ namespace Server.Spells.Spellweaving
{
BaseCreature bc = m as BaseCreature;
if( !Caster.CanSee( m ) )
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if( m.IsDeadBondedPet || !m.Alive )
else if ( m.IsDeadBondedPet || !m.Alive )
{
// As per Osi: Nothing happens.
}
else if( m != Caster && (bc == null || !bc.IsBonded || bc.ControlMaster != Caster) )
else if ( m != Caster && (bc == null || !bc.IsBonded || bc.ControlMaster != Caster) )
{
Caster.SendLocalizedMessage( 1072077 ); // You may only cast this spell on yourself or a bonded pet.
}
else if( m_Table.ContainsKey( m ) )
else if ( m_Table.ContainsKey( m ) )
{
Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
}
else if( CheckBSequence( m ) )
else if ( CheckBSequence( m ) )
{
if( Caster == m )
if ( Caster == m )
{
Caster.SendLocalizedMessage( 1074774 ); // You weave powerful magic, protecting yourself from death.
}
@ -93,7 +93,7 @@ namespace Server.Spells.Spellweaving
public static void HandleDeath( Mobile m )
{
if( m_Table.ContainsKey( m ) )
if ( m_Table.ContainsKey( m ) )
Timer.DelayCall<Mobile>( TimeSpan.FromSeconds( Utility.RandomMinMax( 2, 4 ) ), new TimerStateCallback<Mobile>( HandleDeath_OnCallback ), m );
}
@ -103,12 +103,12 @@ namespace Server.Spells.Spellweaving
{
double hitsScalar = timer.Spell.HitsScalar;
if( m is BaseCreature && m.IsDeadBondedPet )
if ( m is BaseCreature && m.IsDeadBondedPet )
{
BaseCreature pet = (BaseCreature)m;
Mobile master = pet.GetMaster();
if( master != null && master.NetState != null && Utility.InUpdateRange( pet, master ) )
if ( master != null && master.NetState != null && Utility.InUpdateRange( pet, master ) )
{
master.CloseGump( typeof( PetResurrectGump ) );
master.SendGump( new PetResurrectGump( master, pet, hitsScalar ) );
@ -121,7 +121,7 @@ namespace Server.Spells.Spellweaving
{
Mobile friend = friends[i];
if( friend.NetState != null && Utility.InUpdateRange( pet, friend ) )
if ( friend.NetState != null && Utility.InUpdateRange( pet, friend ) )
{
friend.CloseGump( typeof( PetResurrectGump ) );
friend.SendGump( new PetResurrectGump( friend, pet ) );
@ -148,7 +148,7 @@ namespace Server.Spells.Spellweaving
{
Mobile m = e.Mobile;
if( m == null || m.Alive || m_Table[m] == null )
if ( m == null || m.Alive || m_Table[m] == null )
return;
HandleDeath_OnCallback( m );
@ -197,7 +197,7 @@ namespace Server.Spells.Spellweaving
protected override void OnTarget( Mobile m, object o )
{
if( o is Mobile )
if ( o is Mobile )
{
m_Owner.Target( (Mobile)o );
}

View file

@ -29,26 +29,26 @@ namespace Server.Spells.Spellweaving
public void Target( Mobile m )
{
if( !Caster.CanSee( m ) )
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
if( m_Table.ContainsKey( m ) )
if ( m_Table.ContainsKey( m ) )
{
Caster.SendLocalizedMessage( 501775 ); // This spell is already in effect.
}
else if( !Caster.CanBeginAction( typeof( GiftOfRenewalSpell ) ) )
else if ( !Caster.CanBeginAction( typeof( GiftOfRenewalSpell ) ) )
{
Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
}
else if( CheckBSequence( m ) )
else if ( CheckBSequence( m ) )
{
SpellHelper.Turn( Caster, m );
Caster.FixedEffect( 0x374A, 10, 20 );
Caster.PlaySound( 0x5C9 );
if( m.Poisoned )
if ( m.Poisoned )
{
m.CurePoison( m );
}
@ -64,7 +64,7 @@ namespace Server.Spells.Spellweaving
Timer.DelayCall( duration,
delegate
{
if( StopEffect( m ) )
if ( StopEffect( m ) )
{
m.PlaySound( 0x455 );
m.SendLocalizedMessage( 1075071 ); // The Gift of Renewal has faded.
@ -118,20 +118,20 @@ namespace Server.Spells.Spellweaving
{
Mobile m = m_Info.m_Mobile;
if( !m_Table.ContainsKey( m ) )
if ( !m_Table.ContainsKey( m ) )
{
Stop();
return;
}
if( !m.Alive )
if ( !m.Alive )
{
Stop();
StopEffect( m );
return;
}
if( m.Hits >= m.HitsMax )
if ( m.Hits >= m.HitsMax )
return;
int toHeal = m_Info.m_HitsPerRound;
@ -170,7 +170,7 @@ namespace Server.Spells.Spellweaving
protected override void OnTarget( Mobile m, object o )
{
if( o is Mobile )
if ( o is Mobile )
{
m_Owner.Target( (Mobile)o );
}

View file

@ -30,7 +30,7 @@ namespace Server.Items
public override bool Nontransferable => true;
public override void HandleInvalidTransfer( Mobile from )
{
if( InvalidTransferMessage != null )
if ( InvalidTransferMessage != null )
TextDefinition.SendMessageTo( from, InvalidTransferMessage );
this.Delete();
@ -41,7 +41,7 @@ namespace Server.Items
public virtual void Expire( Mobile parent )
{
if( parent != null )
if ( parent != null )
parent.SendLocalizedMessage( 1072515, (this.Name == null ? String.Format( "#{0}", LabelNumber ): this.Name) ); // The ~1_name~ expired...
Effects.PlaySound( GetWorldLocation(), Map, 0x201 );
@ -56,7 +56,7 @@ namespace Server.Items
public override void OnDelete()
{
if( m_Timer != null )
if ( m_Timer != null )
m_Timer.Stop();
base.OnDelete();
@ -64,7 +64,7 @@ namespace Server.Items
public virtual void CheckExpiry()
{
if( (m_CreationTime + m_LifeSpan) < DateTime.UtcNow )
if ( (m_CreationTime + m_LifeSpan) < DateTime.UtcNow )
Expire( RootParent as Mobile );
else
InvalidateProperties();

View file

@ -61,7 +61,7 @@ namespace Server.Mobiles
PlaySound( 0xE );
PlaySound( 0x1BC );
if( Alive && !Deleted )
if ( Alive && !Deleted )
Timer.DelayCall( TimeSpan.FromSeconds( 7.0 ), DoEffects );
}

View file

@ -18,7 +18,7 @@ namespace Server.Spells.Spellweaving
{
TransformContext context = TransformationSpellHelper.GetContext( e.Mobile );
if( context != null && context.Type == typeof( ReaperFormSpell ) )
if ( context != null && context.Type == typeof( ReaperFormSpell ) )
e.Mobile.Send( SpeedControl.WalkSpeed );
}

View file

@ -23,7 +23,7 @@ namespace Server.Spells.Spellweaving
public override void OnCast()
{
if( CheckSequence() )
if ( CheckSequence() )
{
Caster.PlaySound( 0x5CE );
@ -49,7 +49,7 @@ namespace Server.Spells.Spellweaving
foreach( Mobile m in Caster.GetMobilesInRange( range ) )
{
if( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && Caster.InLOS( m ) )
if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && Caster.InLOS( m ) )
targets.Add( m );
}
@ -63,9 +63,9 @@ namespace Server.Spells.Spellweaving
SpellHelper.Damage( this, m, ( m.Player && Caster.Player ) ? pvpDamage : pvmDamage, 0, 0, 0, 0, 100 );
if( oldSpell != null && oldSpell != m.Spell )
if ( oldSpell != null && oldSpell != m.Spell )
{
if( !CheckResisted( m ) )
if ( !CheckResisted( m ) )
{
m_Table[m] = Timer.DelayCall<Mobile>( duration, DoExpire, m );

View file

@ -24,11 +24,11 @@ namespace Server.Spells.Spellweaving
public void Target( Mobile m )
{
if( !Caster.CanSee( m ) )
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if( CheckHSequence( m ) )
else if ( CheckHSequence( m ) )
{
Point3D loc = m.Location;
loc.Z += 50;
@ -42,7 +42,7 @@ namespace Server.Spells.Spellweaving
int damage;
if( !m.Player && (((double)m.Hits / (double)m.HitsMax) < percentage ))
if ( !m.Player && (((double)m.Hits / (double)m.HitsMax) < percentage ))
{
damage = 300;
}
@ -78,7 +78,7 @@ namespace Server.Spells.Spellweaving
protected override void OnTarget( Mobile m, object o )
{
if( o is Mobile )
if ( o is Mobile )
{
m_Owner.Target( (Mobile)o );
}