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

@ -119,16 +119,16 @@ namespace Server {
public override void OnDoubleClick( Mobile from ) {
if ( !IsChildOf( from.Backpack ) ) {
from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.
} else if ( from is PlayerMobile && ((PlayerMobile)from).DuelContext != null ) {
from.SendMessage( "You can't use that." );
} else if ( from is PlayerMobile mobile && mobile.DuelContext != null ) {
mobile.SendMessage( "You can't use that." );
} else if ( Faction.Find( from ) == null ) {
from.LocalOverheadMessage( Server.Network.MessageType.Regular, 2119, false, "The object vanishes from your hands as you touch it." );
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), delegate() {
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), delegate {
from.LocalOverheadMessage( Server.Network.MessageType.Regular, 2118, false, "You feel a strange tingling sensation throughout your body." );
} );
Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), delegate() {
Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), delegate {
from.LocalOverheadMessage( Server.Network.MessageType.Regular, 2118, false, "Your skin begins to burn." );
} );
@ -162,4 +162,4 @@ namespace Server {
int version = reader.ReadEncodedInt();
}
}
}
}