G
GM_Nexus
Guest
Problem with a script...
I have set my basetools.cs and all nessary scripts to where one type of ore andleather is all there is....it all seems too work fine except basetool.cs which now gives me these 4 errors....Does anyone know how to fix them? Any assistance will be GREATLY appeicated
[code:1]
using System;
using Server;
using Server.Network;
using Server.Engines.Craft;
namespace Server.Items
{
public abstract class BaseTool : Item
{
private int m_Durability;
[CommandProperty( AccessLevel.GameMaster )]
public int Durability
{
get { return m_Durability; }
set { m_Durability = value; InvalidateProperties(); }
}
public abstract CraftSystem CraftSystem{ get; }
public BaseTool( int itemID ) : this( 50, itemID )
{
}
public BaseTool( int durability, int itemID ) : base( itemID )
{
m_Durability = durability;
}
public BaseTool( Serial serial ) : base( serial )
{
}
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
list.Add( 1060584, m_Durability.ToString() ); // uses remaining: ~1_val~
}
public virtual void DisplayDurabilityTo( Mobile m )
{
LabelToAffix( m, 1017323, AffixType.Append, ": " + m_Durability.ToString() ); // Durability
}
public static bool CheckTool( Item tool, Mobile m )
{
Item check = m.FindItemOnLayer( Layer.OneHanded );
if ( check is BaseTool && check != tool )
return false;
check = m.FindItemOnLayer( Layer.TwoHanded );
if ( check is BaseTool && check != tool )
return false;
return true;
}
public override void OnSingleClick( Mobile from )
{
DisplayDurabilityTo( from );
base.OnSingleClick( from );
}
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) || Parent == from )
{
CraftSystem system = this.CraftSystem;
int num = system.CanCraft( from, this, null );
if (num)
{
from.SendLocalizedMessage( num );
}
else
{
CraftContext context = system.GetContext( from );
from.SendGump( new CraftGump( from, system, context == null ? -1 : context.LastGroupIndex, context == null ? -1 : context.LastResourceIndex, this, null ) );
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) m_Durability );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Durability = reader.ReadInt();
break;
}
}
}
}
}
[/code:1]
I have set my basetools.cs and all nessary scripts to where one type of ore andleather is all there is....it all seems too work fine except basetool.cs which now gives me these 4 errors....Does anyone know how to fix them? Any assistance will be GREATLY appeicated
Heres the script...BaseTools.csScripts: Compiling...failed (4 errors, 0 warnings)
- Error: Scripts\Items\Skill Items\Tools\BaseTool.cs: CS0029: (line 74, column
15) Cannot implicitly convert type 'bool' to 'int'
- Error: Scripts\Items\Skill Items\Tools\BaseTool.cs: CS0029: (line 76, column
9) Cannot implicitly convert type 'int' to 'bool'
- Error: Scripts\Items\Skill Items\Tools\BaseTool.cs: CS0117: (line 82, column
29) 'Server.Engines.Craft.CraftSystem' does not contain a definition for 'GetCon
text'
- Error: Scripts\Items\Skill Items\Tools\BaseTool.cs: CS1501: (line 84, column
21) No overload for method 'CraftGump' takes '6' arguments
Scripts: One or more scripts failed to compile
- Press return to exit
[code:1]
using System;
using Server;
using Server.Network;
using Server.Engines.Craft;
namespace Server.Items
{
public abstract class BaseTool : Item
{
private int m_Durability;
[CommandProperty( AccessLevel.GameMaster )]
public int Durability
{
get { return m_Durability; }
set { m_Durability = value; InvalidateProperties(); }
}
public abstract CraftSystem CraftSystem{ get; }
public BaseTool( int itemID ) : this( 50, itemID )
{
}
public BaseTool( int durability, int itemID ) : base( itemID )
{
m_Durability = durability;
}
public BaseTool( Serial serial ) : base( serial )
{
}
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
list.Add( 1060584, m_Durability.ToString() ); // uses remaining: ~1_val~
}
public virtual void DisplayDurabilityTo( Mobile m )
{
LabelToAffix( m, 1017323, AffixType.Append, ": " + m_Durability.ToString() ); // Durability
}
public static bool CheckTool( Item tool, Mobile m )
{
Item check = m.FindItemOnLayer( Layer.OneHanded );
if ( check is BaseTool && check != tool )
return false;
check = m.FindItemOnLayer( Layer.TwoHanded );
if ( check is BaseTool && check != tool )
return false;
return true;
}
public override void OnSingleClick( Mobile from )
{
DisplayDurabilityTo( from );
base.OnSingleClick( from );
}
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) || Parent == from )
{
CraftSystem system = this.CraftSystem;
int num = system.CanCraft( from, this, null );
if (num)
{
from.SendLocalizedMessage( num );
}
else
{
CraftContext context = system.GetContext( from );
from.SendGump( new CraftGump( from, system, context == null ? -1 : context.LastGroupIndex, context == null ? -1 : context.LastResourceIndex, this, null ) );
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) m_Durability );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Durability = reader.ReadInt();
break;
}
}
}
}
}
[/code:1]