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

@ -109,11 +109,11 @@ namespace Server.Items
public override bool OnDragDrop( Mobile from, Item dropped )
{
if( dropped is Bandage )
if ( dropped is Bandage )
{
bool allow = base.OnDragDrop( from, dropped );
if( allow )
if ( allow )
Enhance( from );
return allow;
@ -127,11 +127,11 @@ namespace Server.Items
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if( item is Bandage )
if ( item is Bandage )
{
bool allow = base.OnDragDropInto( from, item, p );
if( allow )
if ( allow )
Enhance( from );
return allow;
@ -152,7 +152,7 @@ namespace Server.Items
public override void OnDelete()
{
if( m_Timer != null )
if ( m_Timer != null )
m_Timer.Stop();
base.OnDelete();
@ -178,7 +178,7 @@ namespace Server.Items
DateTime next = reader.ReadDateTime();
if( next < DateTime.UtcNow )
if ( next < DateTime.UtcNow )
m_Timer = Timer.DelayCall( TimeSpan.Zero, RechargeTime, new TimerCallback( Recharge ) );
else
m_Timer = Timer.DelayCall( next - DateTime.UtcNow, RechargeTime, new TimerCallback( Recharge ) );
@ -200,11 +200,11 @@ namespace Server.Items
Bandage bandage = Items[i] as Bandage;
if( bandage != null )
if ( bandage != null )
{
Item enhanced;
if( bandage.Amount > m_Charges )
if ( bandage.Amount > m_Charges )
{
bandage.Amount -= m_Charges;
enhanced = new EnhancedBandage( m_Charges );

View file

@ -20,7 +20,7 @@ namespace Server.Items
{
bool allow = base.OnMoveOver( m );
if( allow && Addon is BedOfNailsAddon )
if ( allow && Addon is BedOfNailsAddon )
( (BedOfNailsAddon)Addon ).OnMoveOver( m );
return allow;
@ -64,17 +64,17 @@ namespace Server.Items
public override bool OnMoveOver( Mobile m )
{
if( m.Alive && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) )
if ( m.Alive && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) )
{
if( m.Player )
if ( m.Player )
{
if( m.Female )
if ( m.Female )
Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x53B, 0x53D ) );
else
Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x53E, 0x540 ) );
}
if( m_Timer == null || !m_Timer.Running )
if ( m_Timer == null || !m_Timer.Running )
( m_Timer = new InternalTimer( m ) ).Start();
}
@ -124,13 +124,13 @@ namespace Server.Items
protected override void OnTick()
{
if( m_Mobile == null || m_Mobile.Map == null || m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Map == Map.Internal )
if ( m_Mobile == null || m_Mobile.Map == null || m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Map == Map.Internal )
{
Stop();
}
else
{
if( m_Location != m_Mobile.Location )
if ( m_Location != m_Mobile.Location )
{
int amount = Utility.RandomMinMax( 0, 7 );
@ -140,11 +140,11 @@ namespace Server.Items
int y = m_Mobile.Y + Utility.RandomMinMax( -1, 1 );
int z = m_Mobile.Z;
if( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
{
z = m_Mobile.Map.GetAverageZ( x, y );
if( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
{
continue;
}

View file

@ -73,7 +73,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if( version < 1 )
if ( version < 1 )
{
Timer.DelayCall( TimeSpan.FromSeconds( 0 ), new TimerCallback( OnAfterDeserialize_Callback ) );
}

View file

@ -160,11 +160,11 @@ namespace Server.Items
m_Type = value;
ItemID = MonsterStatuetteInfo.GetInfo( m_Type ).ItemID;
if( m_Type == MonsterStatuetteType.Slime )
if ( m_Type == MonsterStatuetteType.Slime )
Hue = Utility.RandomSlimeHue();
else if( m_Type == MonsterStatuetteType.RedDeath )
else if ( m_Type == MonsterStatuetteType.RedDeath )
Hue = 0x21;
else if( m_Type == MonsterStatuetteType.HalloweenGhoul )
else if ( m_Type == MonsterStatuetteType.HalloweenGhoul )
Hue = 0xF4;
else
Hue = 0;
@ -195,11 +195,11 @@ namespace Server.Items
m_Type = type;
if( m_Type == MonsterStatuetteType.Slime )
if ( m_Type == MonsterStatuetteType.Slime )
Hue = Utility.RandomSlimeHue();
else if( m_Type == MonsterStatuetteType.RedDeath )
else if ( m_Type == MonsterStatuetteType.RedDeath )
Hue = 0x21;
else if( m_Type == MonsterStatuetteType.HalloweenGhoul )
else if ( m_Type == MonsterStatuetteType.HalloweenGhoul )
Hue = 0xF4;
}
@ -211,7 +211,7 @@ namespace Server.Items
{
int[] sounds = MonsterStatuetteInfo.GetInfo( m_Type ).Sounds;
if( sounds.Length > 0 )
if ( sounds.Length > 0 )
Effects.PlaySound( this.Location, this.Map, sounds[Utility.Random( sounds.Length )] );
}

View file

@ -23,7 +23,7 @@
}
set
{
if( value != m_Quantity )
if ( value != m_Quantity )
{
m_Quantity = ( value < 1 ) ? 0 : ( value > MaxQuantity ) ? MaxQuantity : value;
@ -31,11 +31,11 @@
ItemID = ( IsEmpty ) ? voidItem_ID : fullItem_ID;
if( !IsEmpty )
if ( !IsEmpty )
{
IEntity rootParent = RootParent;
if( rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal )
if ( rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal )
MoveToWorld( rootParent.Location, rootParent.Map );
}
@ -54,7 +54,7 @@
public override void OnDoubleClick( Mobile from )
{
if( IsEmpty )
if ( IsEmpty )
{
base.OnDoubleClick( from );
}
@ -62,13 +62,13 @@
public override void OnSingleClick( Mobile from )
{
if( IsEmpty )
if ( IsEmpty )
{
base.OnSingleClick( from );
}
else
{
if( Name == null )
if ( Name == null )
LabelTo( from, LabelNumber );
else
LabelTo( from, Name );
@ -77,13 +77,13 @@
public override void OnAosSingleClick( Mobile from )
{
if( IsEmpty )
if ( IsEmpty )
{
base.OnAosSingleClick( from );
}
else
{
if( Name == null )
if ( Name == null )
LabelTo( from, LabelNumber );
else
LabelTo( from, Name );
@ -92,7 +92,7 @@
public override void GetProperties( ObjectPropertyList list )
{
if( IsEmpty )
if ( IsEmpty )
{
base.GetProperties( list );
}
@ -100,7 +100,7 @@
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if( !IsEmpty )
if ( !IsEmpty )
{
return false;
}

View file

@ -155,15 +155,15 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendMessage( "You may not do that in jail." );
}
else if( !this.IsChildOf( from.Backpack ) )
else if ( !this.IsChildOf( from.Backpack ) )
{
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
}
else if( this.Charges == 0 )
else if ( this.Charges == 0 )
{
MessageHelper.SendLocalizedMessageTo( this, from, 1042544, 0x59 ); // This item is out of charges.
}
@ -187,11 +187,11 @@ namespace Server.Items
if ( m_Bag.Deleted )
return;
if( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendMessage( "You may not do that in jail." );
}
else if( !m_Bag.IsChildOf( from.Backpack ) )
else if ( !m_Bag.IsChildOf( from.Backpack ) )
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response
}

View file

@ -154,7 +154,7 @@ namespace Server.Items
AnimalFormContext animalContext = AnimalForm.GetContext( from );
if( Core.ML && animalContext != null )
if ( Core.ML && animalContext != null )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1080073 ); // You cannot use a Crystal Ball of Pet Summoning while in animal form.
return;
@ -266,7 +266,7 @@ namespace Server.Items
}
else
{
if( Core.ML )
if ( Core.ML )
new PetSummoningSpell( this, from ).Cast();
else
SummonPet( from );
@ -436,7 +436,7 @@ namespace Server.Items
public override bool CheckDisturb( DisturbType type, bool checkFirst, bool resistable )
{
if( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
if ( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
return false;
return true;
@ -444,19 +444,19 @@ namespace Server.Items
public override void DoHurtFizzle()
{
if( !m_Stop )
if ( !m_Stop )
base.DoHurtFizzle();
}
public override void DoFizzle()
{
if( !m_Stop )
if ( !m_Stop )
base.DoFizzle();
}
public override void OnDisturb( DisturbType type, bool message )
{
if( message && !m_Stop )
if ( message && !m_Stop )
Caster.SendLocalizedMessage( 1080074 ); // You have been disrupted while attempting to summon your pet!
}

View file

@ -33,7 +33,7 @@ namespace Server.Items
{
m_ActiveItemID = value;
if( !IsEmpty )
if ( !IsEmpty )
this.ItemID = m_ActiveItemID;
}
}
@ -46,7 +46,7 @@ namespace Server.Items
{
m_InactiveItemID = value;
if( IsEmpty )
if ( IsEmpty )
this.ItemID = m_InactiveItemID;
}
}
@ -642,11 +642,11 @@ namespace Server.Items
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
if( m_Stone is SoulstoneFragment )
if ( m_Stone is SoulstoneFragment )
{
SoulstoneFragment frag = m_Stone as SoulstoneFragment;
if( --frag.UsesRemaining <= 0 )
if ( --frag.UsesRemaining <= 0 )
from.SendLocalizedMessage( 1070974 ); // You have used up your soulstone fragment.
}
}
@ -807,7 +807,7 @@ namespace Server.Items
}
}
if( version == 0 )
if ( version == 0 )
{
m_ActiveItemID = 0x2A94;
m_InactiveItemID = 0x2A93;
@ -879,9 +879,9 @@ namespace Server.Items
m_UsesRemaining = reader.ReadEncodedInt();
if( version <= 1 )
if ( version <= 1 )
{
if( ItemID == 0x2A93 || ItemID == 0x2A94 )
if ( ItemID == 0x2A93 || ItemID == 0x2A94 )
{
ActiveItemID = Utility.Random( 0x2AA1, 9 );
}
@ -905,9 +905,9 @@ namespace Server.Items
{
bool canUse = base.CheckUse( from );
if( canUse )
if ( canUse )
{
if( m_UsesRemaining <= 0 )
if ( m_UsesRemaining <= 0 )
{
from.SendLocalizedMessage( 1070975 ); // That soulstone fragment has no more uses.
return false;

View file

@ -132,9 +132,9 @@ namespace Server.Items
{
Mobile from = state.Mobile;
if( info.ButtonID == 1 || info.ButtonID == 2 )
if ( info.ButtonID == 1 || info.ButtonID == 2 )
{
if( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) )
if ( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) )
{
from.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
return;

View file

@ -258,7 +258,7 @@ namespace Server.Items
}
else
{
if( relay.Text.Length > 64 )
if ( relay.Text.Length > 64 )
m_Target.EngravedText = Utility.FixHtml( relay.Text.Substring( 0, 64 ) );
else
m_Target.EngravedText = Utility.FixHtml( relay.Text );