Joeku;740121 said:Incredible work man.
//note: "RunicTinkerTools" may not be the exact name.. working from memory here
entry.Add( new RunicToolEntry( typeof( RunicTinkerTools ), CraftResource.Valorite, "Valorite" ) );
public static Item FindItemByType( Container pack, Type type )
pack.FindItemByType( typeof( Bandage ) )
BaseStoreKey.FindItemByType( pack, typeof( Bandage ) )
public class BaseAddonDeedListEntry : ItemListEntry
{
public override int GumpWidth{ get{ return 400; } }
public override List<ItemListEntryColumn> Columns
{
get
{
if( _Columns == null )
{
List<ItemListEntryColumn> columns = base.Columns;
//add in specifics for this list type here
//no special listing for fishing nets
return columns;
}
return _Columns;
}
}
//master constructor, use the net hue to hue the entry
public BaseAddonDeedListEntry( Item item ) : base ( item, item.GetType().Name, item.Hue - 1 )
{
}
//world load constructor
public BaseAddonDeedListEntry( GenericReader reader ) : base( reader )
{
}
//clone constructor
public BaseAddonDeedListEntry( BaseAddonDeedListEntry entry ) : base( entry )
{
}
//this generates an item from what is stored in the entry. Note no exception handling
public override Item GenerateItem()
{
//this allows for derived classes of fishing net to fit into this entry.
BaseAddonDeed net = (BaseAddonDeed)Activator.CreateInstance( _Type );
//note: gump hue display is shifted by 1 for some crazy reason
net.Hue = _Hue + 1;
return net;
}
//this checks if the item you're attempting to create with is proper. The child classes define specifics for this
public override bool AllGood( Item item )
{
if( !base.AllGood( item ) )
{
return false;
}
//TODO: move this to base class, since the _Type is specified in ListEntry?
if( !( item is BaseAddonDeed ) )
{
return false;
}
return true;
}
//this is used to drive the cloning process - derived classes fire their associated clone constructor
public override ItemListEntry Clone()
{
return new BaseAddonDeedListEntry( this );
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Solaris.ItemStore; //for connection to resource store data objects
namespace Server.Items
{
//item derived from BaseResourceKey
public class AddonDeedKey : BaseStoreKey
{
public override int DisplayColumns{ get{ return 1; } }
public override List<StoreEntry> EntryStructure
{
get
{
List<StoreEntry> entry = base.EntryStructure;
entry.Add( new ListEntry( typeof( BaseAddonDeed ), typeof( BaseAddonDeedListEntry ), "Fishing Nets" ) );
return entry;
}
}
[Constructable]
public AddonDeedKey() : base( 1861 ) //hue 1861
{
Name = "Addon Deed Keys";
}
//this loads properties specific to the store, like the gump label, and whether it's a dynamic storage device
protected override ItemStore GenerateItemStore()
{
//load the basic store info
ItemStore store = base.GenerateItemStore();
//properties of this storage device
store.Label = "Treasure Hunter's Storage";
store.Dynamic = false;
store.OfferDeeds = false;
return store;
}
//serial constructor
public AddonDeedKey( Serial serial ) : base( serial )
{
}
//events
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
entry.Add(new RunicToolEntry(typeof(RunicFletcherTool), CraftResource.Pine, "Pine", 0, 30, -5, 3));