Tiea1
Sorceror
Minimum requirements for items
I know this is an old post but I was trying to put a min taming and str req for players to use these items but keep coming up with errors. I'll post the Bracelet script and error.
Error
Thanks in advance.
I know this is an old post but I was trying to put a min taming and str req for players to use these items but keep coming up with errors. I'll post the Bracelet script and error.
Code:
using System;
using Server;
using Server.Mobiles;
namespace Server.Items
{
public class BraceletOfControlling : SilverBracelet
{
[Constructable]
public BraceletOfControlling()
{
Name = "Bracelet of Controlling";
Attributes.StrReq = 100;
Attributes.MinTaming = 105.0;
}
public BraceletOfControlling( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override bool OnEquip( Mobile from )
{
if ( from is PlayerMobile )
{
PlayerMobile m = (PlayerMobile)from;
m.FollowersMax += 1;
this.Movable = false;
}
return base.OnEquip( from );
}
public override void OnRemoved( object parent )
{
if ( parent is PlayerMobile )
{
PlayerMobile mm = (PlayerMobile)parent;
if (!((mm.FollowersMax - 1) < mm.Followers))
{
this.Movable = true;
mm.FollowersMax -= 1;
}
else
{
mm.SendMessage( "You must reduce your followers before you can remove this." );
}
}
return;
}
public override void OnDoubleClick( Mobile fromm )
{
if ( this.Parent == fromm )
{
if ( fromm is PlayerMobile )
{
PlayerMobile mmm = (PlayerMobile)fromm;
if (!((mmm.FollowersMax - 1) < mmm.Followers))
{
this.Movable = true;
mmm.AddToBackpack( this );
}
else
{
mmm.SendMessage( "You must reduce your followers before you can remove this." );
}
}
}
return;
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
Error
Code:
RunUO - [www.runuo.com] Version 2.0, Build 3567.2838
Core: Running on .NET Framework Version 2.0.50727
Core: Running with arguments: -debug
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (21errors, 0 warnings)
Errors:
+ Customs/Deco/BraceletOfControlling.cs:
CS0117: Line 18: 'Server.AosAttributes' does not contain a definition for 'S
trReq'
CS0117: Line 19: 'Server.AosAttributes' does not contain a definition for 'M
inTaming'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Thanks in advance.