I am trying to get an item check to see if there is a player in range with the same item so it can give stat bonus. I am having an issue with the check itself not sure where it is going wrong. Here is the code for the OnMovement check:
Code:
public override void OnMovement(Mobile m, Point3D oldLocation)
{
IPooledEnumerable eable = GetMobilesInRange(18);
foreach (object o in eable)
{
if (o is PlayerMobile && ((PlayerMobile)o).InRange(Location, 17))
{
Item ring = m.FindItemOnLayer( Layer.Ring ) as WeddingRing;
if ( ring != null )
{
Attributes.BonusStr = Utility.RandomMinMax ( 5,10 );
return;
}
else
{
Attributes.BonusStr = ( 0 );
return;
}
}
}
}