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

@ -78,11 +78,11 @@ namespace Server.Mobiles
Say( m_Vocabulary[ Utility.Random( m_Vocabulary.Length ) ] );
if ( to != null && Utility.RandomBool() )
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), new TimerCallback( delegate() { to.Talk(); } ) );
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), new TimerCallback( delegate { to.Talk(); } ) );
m_CanTalk = false;
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), new TimerCallback( delegate() { m_CanTalk = true; } ) );
Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), new TimerCallback( delegate { m_CanTalk = true; } ) );
}
}

View file

@ -86,7 +86,7 @@ namespace Server.Mobiles
public override void OnDamage( int amount, Mobile from, bool willKill )
{
if( Utility.RandomDouble() < 0.1 )
if ( Utility.RandomDouble() < 0.1 )
DropOoze();
base.OnDamage( amount, from, willKill );
@ -104,7 +104,7 @@ namespace Server.Mobiles
public virtual Point3D GetSpawnPosition( Point3D from, Map map, int range )
{
if( map == null )
if ( map == null )
return from;
Point3D loc = new Point3D( ( RandomPoint( X ) ), ( RandomPoint( Y ) ), Z );
@ -130,22 +130,22 @@ namespace Server.Mobiles
bool found = false;
foreach( Item item in Map.GetItemsInRange( p, 0 ) )
if( item is StainedOoze )
if ( item is StainedOoze )
{
found = true;
break;
}
if( !found )
if ( !found )
break;
}
ooze.MoveToWorld( p, Map );
}
if( Combatant != null )
if ( Combatant != null )
{
if( corrosive )
if ( corrosive )
Combatant.SendLocalizedMessage( 1072071 ); // A corrosive gas seeps out of your enemy's skin!
else
Combatant.SendLocalizedMessage( 1072072 ); // A poisonous gas seeps out of your enemy's skin!

View file

@ -90,7 +90,7 @@ namespace Server.Mobiles
SetDamage( 24, 33 );
if( version == 0 )
if ( version == 0 )
{
Server.SkillHandlers.AnimalTaming.ScaleStats( this, 0.50 );
Server.SkillHandlers.AnimalTaming.ScaleSkills( this, 0.80, 0.90 ); // 90% * 80% = 72% of original skills trainable to 90%

View file

@ -125,10 +125,10 @@ namespace Server.Mobiles
/*if ( Utility.RandomDouble() < 0.6 )
c.DropItem( new ParrotItem() ); */
if( Utility.RandomDouble() < 0.05 )
if ( Utility.RandomDouble() < 0.05 )
c.DropItem( new GrizzledMareStatuette() );
if( Utility.RandomDouble() < 0.025 )
if ( Utility.RandomDouble() < 0.025 )
c.DropItem( new CrimsonCincture() );
// TODO: Armor sets
@ -156,13 +156,13 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( Utility.RandomDouble() < 0.25 )
if ( Utility.RandomDouble() < 0.25 )
CacophonicAttack( defender );
}
public override void OnDamage( int amount, Mobile from, bool willKill )
{
if( Utility.RandomDouble() < 0.1 )
if ( Utility.RandomDouble() < 0.1 )
DropOoze();
base.OnDamage( amount, from, willKill );
@ -216,10 +216,10 @@ namespace Server.Mobiles
public virtual void CacophonicAttack( Mobile to )
{
if( m_Table == null )
if ( m_Table == null )
m_Table = new Hashtable();
if( to.Alive && to.Player && m_Table[ to ] == null )
if ( to.Alive && to.Player && m_Table[ to ] == null )
{
to.Send( SpeedControl.WalkSpeed );
to.SendLocalizedMessage( 1072069 ); // A cacophonic sound lambastes you, suppressing your ability to move.
@ -231,13 +231,13 @@ namespace Server.Mobiles
private void EndCacophonic_Callback( object state )
{
if( state is Mobile )
if ( state is Mobile )
CacophonicEnd( (Mobile)state );
}
public virtual void CacophonicEnd( Mobile from )
{
if( m_Table == null )
if ( m_Table == null )
m_Table = new Hashtable();
m_Table[ from ] = null;
@ -247,7 +247,7 @@ namespace Server.Mobiles
public static bool UnderCacophonicAttack( Mobile from )
{
if( m_Table == null )
if ( m_Table == null )
m_Table = new Hashtable();
return m_Table[ from ] != null;
@ -271,22 +271,22 @@ namespace Server.Mobiles
bool found = false;
foreach( Item item in Map.GetItemsInRange( p, 0 ) )
if( item is StainedOoze )
if ( item is StainedOoze )
{
found = true;
break;
}
if( !found )
if ( !found )
break;
}
ooze.MoveToWorld( p, Map );
}
if( Combatant != null )
if ( Combatant != null )
{
if( corrosive )
if ( corrosive )
Combatant.SendLocalizedMessage( 1072071 ); // A corrosive gas seeps out of your enemy's skin!
else
Combatant.SendLocalizedMessage( 1072072 ); // A poisonous gas seeps out of your enemy's skin!
@ -305,7 +305,7 @@ namespace Server.Mobiles
public virtual Point3D GetSpawnPosition( Point3D from, Map map, int range )
{
if( map == null )
if ( map == null )
return from;
Point3D loc = new Point3D( ( RandomPoint( X ) ), ( RandomPoint( Y ) ), Z );

View file

@ -187,10 +187,10 @@ namespace Server.Mobiles
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
if( m != null && !m.Deleted && m is PlayerMobile )
if ( m != null && !m.Deleted && m is PlayerMobile )
{
PlayerMobile pm = m as PlayerMobile;
if(pm != null && pm.Mounted)
if (pm != null && pm.Mounted)
{
pm.Mount.Rider=null;
}

View file

@ -55,11 +55,11 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
if ( 0.1 > Utility.RandomDouble() )
{
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
if ( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.