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

@ -32,7 +32,7 @@ namespace Server.SkillHandlers
public static int GetArmorRating( Mobile m )
{
if( !Core.AOS )
if ( !Core.AOS )
return (int)m.ArmorRating;
int ar = 0;
@ -41,16 +41,16 @@ namespace Server.SkillHandlers
{
BaseArmor armor = m.Items[i] as BaseArmor;
if( armor == null )
if ( armor == null )
continue;
int materialType = (int)armor.MaterialType;
int bodyPosition = (int)armor.BodyPosition;
if( materialType >= m_ArmorTable.GetLength( 0 ) || bodyPosition >= m_ArmorTable.GetLength( 1 ) )
if ( materialType >= m_ArmorTable.GetLength( 0 ) || bodyPosition >= m_ArmorTable.GetLength( 1 ) )
continue;
if( armor.ArmorAttributes.MageArmor == 0 )
if ( armor.ArmorAttributes.MageArmor == 0 )
ar += m_ArmorTable[materialType, bodyPosition];
}
@ -68,7 +68,7 @@ namespace Server.SkillHandlers
m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding.
m.RevealingAction();
}
else if( !m.CanBeginAction( typeof( Stealth ) ) )
else if ( !m.CanBeginAction( typeof( Stealth ) ) )
{
m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now.
m.RevealingAction();
@ -77,23 +77,23 @@ namespace Server.SkillHandlers
{
int armorRating = GetArmorRating( m );
if( armorRating >= (Core.AOS ? 42 : 26) ) //I have a hunch '42' was chosen cause someone's a fan of DNA
if ( armorRating >= (Core.AOS ? 42 : 26) ) //I have a hunch '42' was chosen cause someone's a fan of DNA
{
m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor.
m.RevealingAction();
}
else if( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2) ) )
else if ( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2) ) )
{
int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));
if( steps < 1 )
if ( steps < 1 )
steps = 1;
m.AllowedStealthSteps = steps;
PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
if( pm != null )
if ( pm != null )
pm.IsStealthing = true;
m.SendLocalizedMessage( 502730 ); // You begin to move quietly.