public override bool CanEquip( Mobile from )
{
if ( !Ethics.Ethic.CheckEquip( from, this ) )
return false;
if( RequiredRace != null && from.Race != RequiredRace )
{
if( RequiredRace == Race.Elf )
from.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
else
from.SendMessage( "Only {0} may use this.", RequiredRace.PluralName );
return false;
}
else if ( from.Dex < DexRequirement )
{
from.SendMessage( "You are not nimble enough to equip that." );
return false;
}
else if ( from.Str < AOS.Scale( StrRequirement, 100 - GetLowerStatReq() ) )
{
from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
return false;
}
else if ( from.Int < IntRequirement )
{
from.SendMessage( "You are not smart enough to equip that." );
return false;
}
else if ( !from.CanBeginAction( typeof( BaseWeapon ) ) )
{
return false;
}
else
{
return base.CanEquip( from );
}
}
public override bool CanEquip( Mobile from )
{
if ( from.Skills[SkillName.Swords].Base <= 50.0 )//Skills[SkillName.Swords].Base
{
from.SendMessage( "You are not skilled enough to equip that." );
return false;
}
else
{
return base.CanEquip( from );
}
}
public partial class PlayerMobile : Mobile, IHonorTarget
{
//Level System
private int m_Level;
private int m_MaxLevel;
private int m_Exp;
private int m_ToLevel;
private int m_kxp;
private int m_SKPoints;
private int m_StatPoints;
[CommandProperty(AccessLevel.GameMaster)]
public int Level
{
get { return m_Level; }
set { m_Level = value; InvalidateProperties(); }
}
if (from.Player) // This makes sure you are only trying this when it IS a player, and not for every creature
{
PlayerMobile pm = from as PlayerMobile; // This is the cast I'm talking about
if (pm.Level < 100)
{
// Do you stuff
}
}
throws up a similar error but for both "player" and "level" now...
public class FireScythe : BasePoleArm
{
public override int LevelRequirement{ get{ return 70; } }
private int m_LevelRequirement;
public virtual int LevelRequirement{ get{ return 0; } }
[CommandProperty( AccessLevel.GameMaster )]
public int LevelRequirement
{
get{ return m_LevelRequirement; }
set{ m_LevelRequirement = value; InvalidateProperties(); }
}