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

@ -61,7 +61,7 @@ namespace Server.Mobiles
public Item CreateArtifact( Type[] list )
{
if( list.Length == 0 )
if ( list.Length == 0 )
return null;
int random = Utility.Random( list.Length );
@ -70,7 +70,7 @@ namespace Server.Mobiles
Item artifact = Loot.Construct( type );
if( artifact is MonsterStatuette && StatueTypes.Length > 0 )
if ( artifact is MonsterStatuette && StatueTypes.Length > 0 )
{
((MonsterStatuette)artifact).Type = StatueTypes[Utility.Random( StatueTypes.Length )];
((MonsterStatuette)artifact).LootType = LootType.Regular;
@ -117,16 +117,16 @@ namespace Server.Mobiles
{
Mobile m = toGive[i];
if( !(m is PlayerMobile) )
if ( !(m is PlayerMobile) )
continue;
bool gainedPath = false;
int pointsToGain = 800;
if( VirtueHelper.Award( m, VirtueName.Valor, pointsToGain, ref gainedPath ) )
if ( VirtueHelper.Award( m, VirtueName.Valor, pointsToGain, ref gainedPath ) )
{
if( gainedPath )
if ( gainedPath )
m.SendLocalizedMessage( 1054032 ); // You have gained a path in Valor!
else
m.SendLocalizedMessage( 1054030 ); // You have gained in Valor!
@ -156,22 +156,22 @@ namespace Server.Mobiles
public static void GivePowerScrollTo( Mobile m, PowerScroll ps )
{
if( ps == null || m == null ) //sanity
if ( ps == null || m == null ) //sanity
return;
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
if( !Core.SE || m.Alive )
if ( !Core.SE || m.Alive )
m.AddToBackpack( ps );
else
{
if( m.Corpse != null && !m.Corpse.Deleted )
if ( m.Corpse != null && !m.Corpse.Deleted )
m.Corpse.DropItem( ps );
else
m.AddToBackpack( ps );
}
if( m is PlayerMobile )
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
@ -179,7 +179,7 @@ namespace Server.Mobiles
{
Mobile prot = pm.JusticeProtectors[j];
if( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
@ -191,17 +191,17 @@ namespace Server.Mobiles
case VirtueLevel.Knight: chance = 100; break;
}
if( chance > Utility.Random( 100 ) )
if ( chance > Utility.Random( 100 ) )
{
PowerScroll powerScroll = new PowerScroll( ps.Skill, ps.Value );
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
if( !Core.SE || prot.Alive )
if ( !Core.SE || prot.Alive )
prot.AddToBackpack( powerScroll );
else
{
if( prot.Corpse != null && !prot.Corpse.Deleted )
if ( prot.Corpse != null && !prot.Corpse.Deleted )
prot.Corpse.DropItem( powerScroll );
else
prot.AddToBackpack( powerScroll );
@ -217,7 +217,7 @@ namespace Server.Mobiles
{
GivePowerScrolls();
if( NoGoodies )
if ( NoGoodies )
return base.OnBeforeDeath();
Map map = this.Map;

View file

@ -56,7 +56,7 @@ namespace Server.Mobiles
}
Utility.AssignRandomHair( this );
if( Utility.RandomBool() )
if ( Utility.RandomBool() )
Utility.AssignRandomFacialHair( this, HairHue );
VikingSword weapon = new VikingSword();
@ -148,4 +148,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -399,7 +399,7 @@ namespace Server.Mobiles
public virtual void RegisterDamageTo( Mobile m )
{
if( m == null )
if ( m == null )
return;
foreach( DamageEntry de in m.DamageEntries )
@ -408,7 +408,7 @@ namespace Server.Mobiles
Mobile master = damager.GetDamageMaster( m );
if( master != null )
if ( master != null )
damager = master;
RegisterDamage( damager, de.DamageGiven );
@ -417,10 +417,10 @@ namespace Server.Mobiles
public void RegisterDamage( Mobile from, int amount )
{
if( from == null || !from.Player )
if ( from == null || !from.Player )
return;
if( m_DamageEntries.ContainsKey( from ) )
if ( m_DamageEntries.ContainsKey( from ) )
m_DamageEntries[from] += amount;
else
m_DamageEntries.Add( from, amount );
@ -439,7 +439,7 @@ namespace Server.Mobiles
foreach (KeyValuePair<Mobile, int> kvp in m_DamageEntries)
{
if( IsEligible( kvp.Key, artifact ) )
if ( IsEligible( kvp.Key, artifact ) )
{
validEntries.Add( kvp.Key, kvp.Value );
totalDamage += kvp.Value;
@ -454,7 +454,7 @@ namespace Server.Mobiles
{
totalDamage += kvp.Value;
if( totalDamage >= randomDamage )
if ( totalDamage >= randomDamage )
{
GiveArtifact( kvp.Key, artifact );
return;
@ -496,7 +496,7 @@ namespace Server.Mobiles
public Item CreateArtifact( Type[] list )
{
if( list.Length == 0 )
if ( list.Length == 0 )
return null;
int random = Utility.Random( list.Length );

View file

@ -146,7 +146,7 @@ namespace Server.Mobiles
public void CheckQueen()
{
if( this.Map == null )
if ( this.Map == null )
return;
if ( !m_SpawnedQueen )

View file

@ -106,16 +106,16 @@ namespace Server.Mobiles
private void CheckSpeedBoost()
{
if( Hits < (HitsMax / 4 ) )
if ( Hits < (HitsMax / 4 ) )
{
if( !m_SpeedBoost )
if ( !m_SpeedBoost )
{
ActiveSpeed /= SpeedBoostScalar;
PassiveSpeed /= SpeedBoostScalar;
m_SpeedBoost = true;
}
}
else if( m_SpeedBoost )
else if ( m_SpeedBoost )
{
ActiveSpeed *= SpeedBoostScalar;
PassiveSpeed *= SpeedBoostScalar;
@ -189,7 +189,7 @@ namespace Server.Mobiles
m_Rider = reader.ReadMobile();
if( m_Rider == null )
if ( m_Rider == null )
Delete();
}
}
@ -231,7 +231,7 @@ namespace Server.Mobiles
public void AddUnholyBone( Mobile target, double chanceToThrow )
{
if( this.Map == null )
if ( this.Map == null )
return;
if ( chanceToThrow >= Utility.RandomDouble() )

View file

@ -30,7 +30,7 @@ namespace Server.Mobiles
protected override void OnTick()
{
if( !m_Owner.Deleted && m_Owner.IsParagon && m_Owner .Map != Map.Internal )
if ( !m_Owner.Deleted && m_Owner.IsParagon && m_Owner .Map != Map.Internal )
{
m_Owner.Stam++;
@ -117,7 +117,7 @@ namespace Server.Mobiles
{
bc.Karma = (int)( bc.Karma * KarmaBuff );
if( Math.Abs( bc.Karma ) > 32000 )
if ( Math.Abs( bc.Karma ) > 32000 )
bc.Karma = 32000 * Math.Sign( bc.Karma );
}
@ -126,12 +126,12 @@ namespace Server.Mobiles
public static void UnConvert( BaseCreature bc )
{
if( !bc.IsParagon )
if ( !bc.IsParagon )
return;
bc.Hue = 0;
if( bc.HitsMaxSeed >= 0 )
if ( bc.HitsMaxSeed >= 0 )
bc.HitsMaxSeed = (int)( bc.HitsMaxSeed / HitsBuff );
bc.RawStr = (int)( bc.RawStr / StrBuff );
@ -214,4 +214,4 @@ namespace Server.Mobiles
m.SendMessage( "As your backpack is full, your reward for destroying the legendary paragon has been placed at your feet." );
}
}
}
}

View file

@ -77,7 +77,7 @@ namespace Server.Mobiles
public void DrainLife()
{
if( this.Map == null )
if ( this.Map == null )
return;
ArrayList list = new ArrayList();