RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 SVN] Universal Storage Keys

prplbeast

Sorceror
prplbeast;751686 said:
first i would like to say this is sweet & very easy to mod or make more keys to hold things that are not already there & thank you.

ok now a lil prob im having is i tryed adding runic fletcher tools & it all works except the fact that i can nopt add them in game here is how i have it in runictoolkey.cs
Code:
 entry.Add(new RunicToolEntry(typeof(RunicFletcherTool), CraftResource.Pine, "Pine", 0, 30, -5, 3));
the art & the name are all there but when i try to add them it tells me "That cannot be stored in this"
any help would be great
& thanx again great system :D

nevermind i got it working
again sweet system :D:D:D
 

Aurboda

Sorceror
Runic Tools

how are you adding your fletching tools in game?

runic tools added this way should go into the key as you have coded it
[add runicfletchertool Frostwood 40

i'm using karmageddon's package and runic tools are added
[add runicfw

those would need to be coded in the key like:
entry.Add( new ToolEntry( typeof( RunicFw ), "Frostwood", 0, 30, -5, 0 ) );

did this help?
 

prplbeast

Sorceror
i had figured it out about 20 mins or so after i posted
Code:
entry.Add(new RunicToolEntry(typeof(RunicFletcherTool), CraftResource.Pine, "Pine", 0, 30, -5, 3));
this is how i had it & it needed to be
Code:
entry.Add(new RunicToolEntry(typeof(RunicFletcherTools), CraftResource.Pine, "Pine", 0, 30, -5, 3));
like this
Thank you for your post
 

Fenn

Wanderer
Good to know you resolved the issue, prplbeast.

So these keys have been out for some time now, and people seem to be enjoying them for the most part. Does anyone have any suggestions for more things to add to them? I was thinking of power/stat scrolls, and was toying with the idea of bulk order deeds.

Also, I was considering using the structure of the list entry system to make a new (marked) rune storage system. Unlike a runebook, these rune entries could be sorted/filtered so you can find your destination quicker than pawing through whatever runebook you have.

If anyone would like to see any of these ideas worked into this system, I could see what I can do.
 

Aurboda

Sorceror
since you asked :)

I noticed on the scribe's key you have commented out for the addition of spell books - Spellbooks would be great - especially if players could cast their spells from the key without having to remove the book from the key.

also a key that could hold talismans (and all their properties)?
 

VindiKat

Wanderer
Fenn;740753 said:
Ok, thanks for the suggestions and bug reports. I've updated the file and the changelog. Also, I tested this with the latest SVN (version 286) and it works great! I bet it'll work great with RC2 as well, but if someone wants to check and confirm this, it would be appreciated!

In case no one else has said it, this works perfectly with RC2.

This is a fantastic system, so easy to use and modify for every storage need! Thank you so much for sharing it with us.
 

Fenn

Wanderer
I noticed on the scribe's key you have commented out for the addition of spell books

Right, when I was making the scribe's tomb, I commented that out because I realized spellbooks are more complicated than a simple item like a scroll. It contains info about what spells it has, and also has magical and slayer properties. Spellbooks would be better suited as a list entry.

As for casting spells from the keys, it would require some modifications to the distributed scripts, and I don't think they would be very easy. I prefer making the distribution modifications as simple as possible to minimize errors in installation. One concern, though, is that the the player would need to have a withdrawn spellbook in order to set up things like spell icons. Plus, the spellbooks provide info like what reagents are required, and so on. Overall it seems like a lot of work for little gain. If you're really passionate about this idea, I can see what I can do, though.

a key that could hold talismans (and all their properties)?

Are talisman's incorporated in the distribution version of RunUO? I've been trying to keep to things that can be installed and used in a brand new server, to minimize version conflicts and such. I was, though, considering making forked versions of this system for various popular modifications (eg. Daat99's resources, shrunken pet system, etc.) If talismans are provided by a popular custom script, then it could be a good place to start.

Oh, and thanks for the version check, VindiKat! I've updated my notes to reflect that.
 

Deegs

Sorceror
Outstanding job, I was actually in the middle of creating somthing similar when I stumbled upon this jewel of a system.
 

Fenn

Wanderer
It's been a while since I've updated this! Turns out there was a bug with blocking blessed/insured items from going into list entries, as it blocked repair deeds altogether. I've removed this restriction, and improved how stuff is stored in them.

Also, added a toggle button to gumps to disable the withdraw amount text field. This should help if you get annoyed with how the gump steals the cursor when it refreshes.

Details in log as usual.
 

greywolf79

Sorceror
Just thought I would drop my 2 cents in here...

AWESOME!!! script. I love it and am glad to have gotten a set of these for my shard. Thanks for making them. They are actually EXACTLY what I was looking to do myself for a set of keys to work with Daat and Karma's setups... I just wanted to say thanks.

GreyWolf.
 

datguy

Sorceror
drop this into DefTinkering in the region Customs if you have Daats system in around line 435, this is assuming you have all the ingredients available in your scripts.

Code:
			//tool box
            index = AddCraft(typeof(ToolKey), "Customs", "Tool Box", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Carpentry, 100.0, 150.0 );
			AddSkill( index, SkillName.Blacksmith, 100.0, 150.0 );
			AddSkill( index, SkillName.Tailoring, 100.0, 150.0 );
			AddRes( index, typeof( PlatinumIngot ), "Platinum Ingots", 100, "You need more Platinum Ingots" );
			AddRes( index, typeof( SpinedLeather ), "Spined Leather", 100, "You need more Spined Leather" );
			AddRes( index, typeof( PetrifiedBoard ), "Petrified Boards", 20, "You need more Petrified Boards" );

			//runic box
            index = AddCraft(typeof(RunicToolKey), "Customs", "Runic Tool Box", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Carpentry, 100.0, 150.0 );
			AddSkill( index, SkillName.Blacksmith, 100.0, 150.0 );
			AddSkill( index, SkillName.Tailoring, 100.0, 150.0 );
			AddRes( index, typeof( PlatinumIngot ), "Platinum Ingots", 100, "You need more Platinum Ingots" );
			AddRes( index, typeof( SpinedLeather ), "Spined Leather", 100, "You need more Spined Leather" );
			AddRes( index, typeof( PetrifiedBoard ), "Petrified Boards", 20, "You need more Petrified Boards" );
			
			// Alchemist Kit
            index = AddCraft(typeof(PotionKey), "Customs", "Potion Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Alchemy, 100.0, 150.0 );
			AddSkill( index, SkillName.Carpentry, 100.0, 150.0 );
			AddSkill( index, SkillName.ItemID, 100.0, 150.0 );
			AddRes( index, typeof( Bottle ), "Empty Bottles", 150, "You need more Empty Bottles" );
			AddRes( index, typeof( BlazeIngot ), "Blaze Ingots", 180, "You need more Blaze Ingots" );
			AddRes( index, typeof( EbonyBoard ), "Ebony Boards", 345, "You need more Ebony Boards" );			
			
			// Bards Stand
			index = AddCraft( typeof( BardsKey ), "Customs", "Bard's Tool", 100.0, 150.0, typeof( KeyRing ), "KeyRing", 2, "You need more Key Rings" );
			AddSkill( index, SkillName.Discordance, 100.0, 150.0 );
			AddSkill( index, SkillName.Provocation, 100.0, 150.0 );
			AddRes( index, typeof( OilCloth ), "Oil Cloth", 200, "You need more Oil Cloth" );
			AddRes( index, typeof( DaemonicLeather ), "Daemonic Leather", 100, "You need more Daemonic Leather" );
			AddRes( index, typeof( BambooBoard ), "Bamboo Boards", 100, "You need more Bamboo Boards" );
			
			// Metal Workers Key				
            index = AddCraft(typeof(IngotKey), "Customs", "Metal Worker's Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Blacksmith, 100.0, 150.0 );
			AddSkill( index, SkillName.Mining, 100.0, 150.0 );
			AddRes( index, typeof( PlatinumIngot ), "Platinum Ingots", 250, "You need more Platinum Ingots" );
			AddRes( index, typeof( Kindling ), "Kindling", 20, "You need more Kindling" );
			
			// Scribers Tome
            index = AddCraft(typeof(ScribeKey), "Customs", "Scriber's Tome", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Magery, 100.0, 150.0 );
			AddSkill( index, SkillName.Inscribe, 100.0, 150.0 );
			AddRes( index, typeof( BlankScroll ), "Blank Scrolls", 150, "You need more Blank Scrolls" );
			AddRes( index, typeof( FrostLeather ), "Frost Leather", 50, "You need more Frost Leather" );
			AddRes( index, typeof( PetrifiedBoard ), "Petrified Boards", 50, "You need more Petrified Boards" );
			
			// Spell Casters Key
            index = AddCraft(typeof(ReagentKey), "Customs", "Spell Caster's Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Magery, 100.0, 150.0 );
			AddSkill( index, SkillName.Necromancy, 100.0, 150.0 );
			AddRes( index, typeof( SpringWater ), "Spring Water", 10, "You need more Spring Water" ); // this line use druidic reagent, if you have it then remove the // from //AddRes
			AddRes( index, typeof( BlankScroll ), "Blank Scrolls", 50, "You need more Blank Scrolls" );
			AddRes( index, typeof( Sand ), "Sand", 15, "You need more Sand" );
			
			// Stone Workers Key			
            index = AddCraft(typeof(GraniteKey), "Customs", "Granite Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Carpentry, 100.0, 150.0 );
			AddSkill( index, SkillName.Mining, 100.0, 150.0 );
			AddRes( index, typeof( PlatinumIngot ), "Platinum Ingots", 100, "You need more Platinum Ingots" );
			AddRes( index, typeof( PlatinumGranite ), "Platinum Granite", 25, "You need more Platinum Granite" );
			AddRes( index, typeof( PetrifiedBoard ), "Petrified Boards", 50, "You need more Petrified Boards" );
			
			// Tailors Key
            index = AddCraft(typeof(TailorKey), "Customs", "Tailor's Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Tailoring, 100.0, 150.0 );
			AddRes( index, typeof( Cloth ), "Cloth", 125, "You need more Cloth" );
			AddRes( index, typeof( BarbedLeather ), "Barbed Leather", 150, "You need more Barbed Leather" );
			AddRes( index, typeof( OilCloth ), "Oil Cloth", 20, "You need more Oil Cloth" );
			
			// Wood Workers Key				
            index = AddCraft(typeof(WoodKey), "Customs", "Wood Workers Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
			AddSkill( index, SkillName.Carpentry, 100.0, 150.0 );
			AddSkill( index, SkillName.Lumberjacking, 100.0, 150.0 );
			AddRes( index, typeof( PetrifiedBoard ), "Petrified Boards", 250, "You need more Petrified Boards" );
			AddRes( index, typeof( Shaft ), "Shafts", 150, "You need more Shafts" );
			AddRes( index, typeof( FertileDirt ), "Fertile Dirt", 50, "You need more Fertile Dirt" );
            //#endregion

            //Chef's Key
            index = AddCraft(typeof(ChefKey), "Customs", "Chef's Tool", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
            AddSkill(index, SkillName.Cooking, 100.0, 150.0);
            AddSkill(index, SkillName.TasteID, 100.0, 150.0);
            AddRes(index, typeof(PlatinumIngot), "Platinum Ingots", 100, "You need more Platinum Ingots");
            AddRes(index, typeof(MoonfireBrew), "Moonfire Brew", 1, "You need a bottle of Magical Moonfire Brew.");

            //Beverage Key
            index = AddCraft(typeof(BeverageKey), "Customs", "Beverage Tool", 60.0, 150.0, typeof(KeyRing), "KeyRing", 1, "You need more Key Rings");
            AddSkill(index, SkillName.Cooking, 60.0, 150.0);
            AddSkill(index, SkillName.TasteID, 60.0, 150.0);
            AddRes(index, typeof(Bottle), "Bottle", 100, "You need more Bottle");
            AddRes(index, typeof(MoonfireBrew), "Moonfire Brew", 1, "You need a bottle of Magical Moonfire Brew.");
            
            //Treasure Hunters Key
            index = AddCraft(typeof(TreasureHuntersKey), "Customs", "Treasure Hunters Tool", 99.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
            AddSkill(index, SkillName.Inscribe, 80, 150.0);
            AddSkill(index, SkillName.Tracking, 100, 150.0);
            AddSkill(index, SkillName.Cartography, 80.0, 150.0);
            AddRes(index, typeof(BarkFragment), "Bark Fragment", 100, "You need more Bark Fragments");
            AddRes(index, typeof(TreasureMapPiece), "TMap Piece", 20, "You need more Treasure Map Piece.");
            AddRes(index, typeof(TreasureMapPieceRare), "TMap Piece Rare", 10, "You need more Rare Treasure Map Pieces.");
            //AddRes(index, typeof(TreasureMapPieceAncient), "TMap Piece Ancient", 5, "You need more Ancient Treasure Map Pieces.");
            

            //Adventurers Key
            index = AddCraft(typeof(AdventurersKey), "Customs", "Adventurers Tool", 99.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
            AddSkill(index, SkillName.Inscribe, 80, 150.0);
            AddSkill(index, SkillName.Tracking, 80, 150.0);
            AddSkill(index, SkillName.Cartography, 80.0, 150.0);
            AddRes(index, typeof(BlazeLeather), "Blaze Leather", 100, "You need more Blaze Leather");
            AddRes(index, typeof(DaemonBone), "Daemon Bone", 100, "You need more Daemon Bone");
            //AddRes(index, typeof(Lockpick), "Lockpick", 100, "You need more lockpicks");
            AddRes(index, typeof(PowderOfTranslocation), "Powder Of Translocation", 20, "You need more Powder Of Translocation");
 

mikeymaze

Wanderer
Thank you ill have to add data system i guess i am using svn 297 but i will try to get data system and add this t. Tried to add the data ores but i get to many errors with it thanks anyways i merged them but no luck. what script i need to change using the latest svn?

never mind thanks i get the point how to make it now ... got one key to work now :)
 

Fenn

Wanderer
You don't need the special resources if you want to craft them. In datguy's example he chose to use platinum ingots and such as the ingredients, but you are free to use whatever you want. In the following example, you need 10000 valorite ingots, 5 amethyst gems, and 14 tribal berries to create Ingot Keys. The skill required ranges from 100 tinkering to 120 tinkering. You also need Blacksmith and Arms Lore skill to make the keys.

Code:
			//first, define the item type, the tinker gump category. tinker gump name, min/max skill required, primary resource, resource amount, and resource error message
			index = AddCraft( typeof(IngotKey), "Resource Keys", "Ingot Keys", 100.0, 120.0, typeof(ValoriteIngot), "Valorite Ingot", 10000, "You need more Valorite Ingots");
			//make it so you need blacksmith skill checked as well
			AddSkill( index, SkillName.Blacksmith, 100.0, 120.0 );
			//make it so you need arms lore skill checked as well
			AddSkill( index, SkillName.Armslore, 100.0, 120.0 );  //NOTE: check if Armslore should be "ArmsLore"
			//include secondary resource
			AddRes( index, typeof( Amethyst ), "Amethyst", 5, "You need more Amethyst" );
			//include tertiary resource
			AddRes( index, typeof( TribalBerry ), "Tribal Berry", 14, "You need more Tribal Berries" );

It's kinda an eclectic collection of items used to make this, but just trying to emphasize that you're not limited in your creativity of what is needed to make it. Well, actually, I've noticed if you put more than 4 types of resources required, the craft gump cannot properly display them all.

Also, I don't think the percentage success rate depends on the auxiliary skills. Last I checked, it checks if you meet the minimum before proceeding. The % success comes from the primary skill (in this case, Tinkering).

So yea, feel free to use your creativity in how you make these for players. You could make it so they are easier to craft once you get the resources, but make the resources rare items that are sparse and hard to get. That way people have to work very hard to collect the necessary components, but they don't have to mangle their keyboard in rage when they fail. <sarcasm>I'm not speaking from experience or anything...</sarcasm>
 

datguy

Sorceror
Found an issue with being able to get items from trapped & unlocked containers. Player picks lock, doesn't setoff trap & uses key to take items inside . Thanks Jahn

Change ItemStore.cs Line 747

Code:
foreach( Item item in c.Items )
			{
				if( item is Container && (!( item is LockableContainer) && !(item is TrapableContainer)) ||
                    (item is TrapableContainer && ((TrapableContainer)item).TrapType == TrapType.None) &&
                    ( item is LockableContainer && !((LockableContainer)item).Locked ))
				{
					//recursively find from subpack
					items.AddRange( RecurseFindItemsInPack( (Container)item ) );
                }
 

Tylius

Sorceror
Loving this script still, I rewrote the instructions for modifying base files incase I ever had to redo the mods, I found the original ones somewhat hard to follow (no offence!), here's the easy-to-read (in my opinion) ones if you'd like to add them to the project :)
 

Attachments

  • Server Modifications.zip
    3.1 KB · Views: 64
A little help Perdy Peas

I did the upgrade and recieve an error I can't seem to fix:confused: Any suggestions?

Thanks in advance!



Error
HTML:
Errors:
 + Customs Scripts/Universal Storage Keys/Gumps/ListEntryGump.cs:
    CS1502: Line 452: The best overloaded method match for 'Solaris.ItemStore.Li
stEntry.WithdrawItem(Server.Mobile, int)' has some invalid arguments
    CS1503: Line 452: Argument '2': cannot convert from 'Solaris.ItemStore.ItemL
istEntry' to 'int'

Script.
HTML:
using System;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
using Server.Network;
using Solaris.ItemStore;

namespace Server.Gumps
{
	//list entry gump for displaying the contents of a list entry object
	public class ListEntryGump : Gump
	{
		PlayerMobile _Owner;
		ListEntry _ListEntry;
		
		//used for seeking around on the page
		int _Y = 25;
		
		
		
		//page size
		protected int _Height;
		protected int _Width;
		
		//maximum entry listing height, for multi-page calculation
		public int MaxEntryDisplayHeight{ get{ return 300; } }
		
		//line spacing between entries
		public int EntryLineSpacing{ get{ return 20; } }
		
		//page number that this gump is displaying
		protected int _Page;
		
		//this is determined based on the number of entries and the maximum number to display per page
		protected int _MaxPages;
		
		//these are used to truncate the store entry listing to fit only a subset on the page
		protected int _ListingHeight;
		protected int _ListingStart;
		protected int _ListingEnd;
		
		//a filtered entry list
		protected List<ItemListEntry> _FilteredEntries;
				
		//public accessors for gump refreshing
		public Mobile Owner{ get{ return _Owner; } }
		public int Page{ get{ return _Page; } }
		//public accessor to the list entry
		public ListEntry ListEntry{ get{ return _ListEntry; } }
		
		//static refresh method, used when withdrawing/adding
		public static bool RefreshGump( Mobile player )
		{
			return RefreshGump( player, null );
		}
		
		public static bool RefreshGump( Mobile player, ListEntry listentry )
		{
			//if this mobile has a list entry gump up
			if( player.HasGump( typeof( ListEntryGump ) ) )
			{
				ListEntryGump gump = (ListEntryGump)player.FindGump( typeof( ListEntryGump ) );
				
				//if this gump that's up is showing this list entry, or if none was specified, then refresh
				if( listentry == null || gump.ListEntry == listentry )
				{
					//then, resend this gump!
					player.SendGump( new ListEntryGump( gump ) );
					return true;
				}
			}
			
			return false;
		}
		
		//gump refresh constructor
		public ListEntryGump( ListEntryGump oldgump ) : this( oldgump.Owner, oldgump.ListEntry, oldgump.Page )
		{
		}
		
		//default first page constructor
		public ListEntryGump( Mobile owner, ListEntry listentry ) : this( owner, listentry, 0 )
		{
		}
		
		//master constructor, with page number specified
		public ListEntryGump( Mobile owner, ListEntry listentry, int page ) : base( 50, 350 )
		{
			if( !( owner is PlayerMobile ) )
			{
				return;
			}
			
			_Owner = (PlayerMobile)owner;
			_ListEntry = listentry;
			
			//clear old gumps that are up
			_Owner.CloseGump( typeof( ListEntryGump ) );
			
			//set up the page
			AddPage(0);
            
			_Page = page;
			
			ApplyFilters();
			
			
			
			//determine page layout, sizes, and what gets displayed where
			DeterminePageLayout();

			//add the background			            
            AddBackground(0, 0, _Width, _Height, 9270);
            AddImageTiled(11, 10, _Width - 23, _Height - 20, 2624);
            AddAlphaRegion(11, 10, _Width - 22, _Height - 20);
            
            AddTitle();
            
            if( !AddListEntryListing() )
            {
	            //clear old gumps that are up
				_Owner.CloseGump( typeof( ListEntryGump ) );
	            return;
            }
            if( _MaxPages > 1 )
            {
	            AddPageButtons();
            }
            
            AddControlButtons();
		}
		
		protected void ApplyFilters()
		{
			_FilteredEntries = new List<ItemListEntry>();
			
			
			foreach( ItemListEntry entry in _ListEntry.ItemListEntries )
			{
				bool addentry = true;
				
				for( int i = 0; i < entry.Columns.Count; i++ )
				{
					if( _ListEntry.FilterText[i] != null && _ListEntry.FilterText[i] != "" )
					{
						ItemListEntryColumn column = entry.Columns[i];
						
						if(  column.Text == null || column.Text.ToLower().IndexOf( _ListEntry.FilterText[i].ToLower() ) == -1 )
						{
							addentry = false;
							break;
						}
					}
				}
				
				if( addentry )
				{
					_FilteredEntries.Add( entry );
				}
			}
		}
		
		//this calculates all stuff needed to display the gump properly
		protected void DeterminePageLayout()
		{
			//page size
			if( _FilteredEntries == null || _FilteredEntries.Count == 0 )
			{
				_Height = 200;
				
				if( _ListEntry == null || _ListEntry.ItemListEntries == null || _ListEntry.ItemListEntries.Count == 0 )
				{
					_Width = 400;
				}
				else
				{
					_Width = _ListEntry.ItemListEntries[0].GumpWidth;
				}
				
				_MaxPages = 1;
				_Page = Math.Min( _MaxPages - 1, _Page );
			}
			else
			{
				
				//minimum spacing 20, maximum entry display height
				_ListingHeight = Math.Max( 20, Math.Min( MaxEntryDisplayHeight, _FilteredEntries.Count * EntryLineSpacing ) );
				
				//determine how many entries can fit on a given page
				int entriesperpage = MaxEntryDisplayHeight / EntryLineSpacing;
				
				//calculate max # of pages
				_MaxPages = _FilteredEntries.Count / entriesperpage + 1;
				
				_Page = Math.Min( _MaxPages - 1, _Page );
				
				_ListingStart = _Page * entriesperpage;
				_ListingEnd = (_Page + 1 ) * entriesperpage;
				
				_Height = 200 + + ( _MaxPages > 1 ? 30 : 0 ) + _ListingHeight;
				_Width = _FilteredEntries[0].GumpWidth;
			}

			
			
			
			
			
			
		}
		
		//this adds the title stuff for the gump
		protected void AddTitle()
		{
			if( _ListEntry == null )
			{
				return;
			}
			
			AddLabel( 20, _Y, 88, _ListEntry.Name );
			AddLabel( 120, _Y, 88, "Contents: " + _ListEntry.Amount.ToString() + "/" + _ListEntry.MaxAmount.ToString() );
			AddLabel( 270, _Y, 88, "Displayed: " + _FilteredEntries.Count.ToString() );
            
			_Y += 25;
		}
		
		//this adds the listing of all item stores
		protected bool AddListEntryListing()
		{
			if( _ListEntry == null || _ListEntry.ItemListEntries.Count == 0 )
			{
				return true;
			}
			
			//write the header info in
			ItemListEntry entry = _ListEntry.ItemListEntries[0];
			
			for( int j = 0; j < entry.Columns.Count; j++ )
			{
				AddLabel( 40 + entry.Columns[j].X, _Y, ( _ListEntry.FilterText[j] == null || _ListEntry.FilterText[j] == "" ? 1153 : 78 ), entry.Columns[j].Header );
				AddSortFilterControls( 40 + entry.Columns[j].X, _Y + 20, j, _ListEntry.FilterText[j] );
			}
			
			_Y += 40;
			
			
			//list off the items that can be displayed
			for( int i = _ListingStart; i < _ListingEnd && i < _FilteredEntries.Count; i++ )
			{
				entry = _FilteredEntries[i];
				
				//add withdrawal button - put buttonid offset of 100 to allow for control/sort/filter button id's uninterrupted
				AddButton( 20, _Y + 3, 0x4B9, 0x4B9, 100 + i, GumpButtonType.Reply, 0 );
				
				//Add the details about this entry
				for( int j = 0; j < entry.Columns.Count; j++ )
				{
					AddLabel( 40 + entry.Columns[j].X, _Y, ( entry.Hue > 1 ? entry.Hue : 1153 ), entry.Columns[j].Text );
				}
				
				_Y += EntryLineSpacing;
			}
			
			return true;
			
		}
		
		protected void AddPageButtons()
		{
			//page buttons
			_Y = _Height - 90;
			
			if ( _Page > 0 ) 
			{
				AddButton( 20, _Y, 0x15E3, 0x15E7, 4, GumpButtonType.Reply, 0 ); 
			}
			else 
			{
				AddImage( 20, _Y, 0x25EA ); 
			}
			AddLabel( 40, _Y, 88, "Previous Page" );
			
			
			if ( _Page < _MaxPages - 1 ) 
			{
				AddButton( _Width - 40, _Y, 0x15E1, 0x15E5, 5, GumpButtonType.Reply, 0 ); 
			}
			else 
			{
				AddImage( _Width - 40, _Y, 0x25E6 ); 
			}
			AddLabel( _Width - 120, _Y, 88, "Next Page" );
			
			AddLabel( _Width / 2 - 10, _Y, 88, String.Format( "({0}/{1})", _Page + 1, _MaxPages ) );
			
		}
		
		protected void AddControlButtons()
		{
			_Y = _Height - 60;
			
			AddLabel( _Width / 2 + 70 , _Y, 1153, "Add" );
			AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 1, GumpButtonType.Reply, 0 );
			
			_Y += 30;
			AddLabel( _Width / 2 + 70 , _Y, 1153, "Fill from backpack" );
			AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 2, GumpButtonType.Reply, 0 );
		}
		
		
		
		
		
		//gump utilities
		
		public void AddTextField( int x, int y, int width, int height, int index, string text )
		{
			AddImageTiled( x - 2, y - 2, width + 4, height + 4, 0xA2C );
			AddAlphaRegion( x -2, y - 2, width + 4, height + 4 );
			AddTextEntry( x + 2, y + 2, width - 4, height - 4, 1153, index, text );
		}
		
		public string GetTextField( RelayInfo info, int index )
		{
			TextRelay relay = info.GetTextEntry( index );
			return ( relay == null ? null : relay.Text.Trim() );
		}
		
		
		//this adds sort/filter components at the specified column location and specified column index
		public void AddSortFilterControls( int x, int y, int index, string filtertext )
		{
			//sort buttons
			AddButton( x, y, 0x15E0, 0x15E4, 10 + 10*index, GumpButtonType.Reply, 0 );  //Ascending
			AddButton( x + 15, y, 0x15E2, 0x15E6, 10 + 10*index + 1, GumpButtonType.Reply, 0 );  //Decending
			
			y = _Height - 90;
			
			if( _MaxPages > 1 )
			{
				y -= 30;
			}
			
			AddTextField( x, y, 50, 20, index, filtertext );
			AddButton( x + 55, y, 0x15E1, 0x15E5, 10 + 10*index + 2, GumpButtonType.Reply, 0 );
		}
		

		
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			
			if( _ListEntry == null || !_ListEntry.CanUse( _Owner ) )
			{
				return;
			}
			
			//store flags
			int buttonid = info.ButtonID;
			
			//right click
			if( buttonid == 0 )
			{
				return;
			}
			
			//add button
			if( buttonid == 1 )
			{

				_ListEntry.AddItem( _Owner );
				
				//refresh the gump
				_Owner.SendGump( new ListEntryGump( this ) );
				return;
				
			}
			
			//fill from backpack button
			if( buttonid == 2 )
			{
				
				_ListEntry.FillFromBackpack( _Owner );
				
				_Owner.SendGump( new ListEntryGump( this ) );
				return;
			}
			
			//previous page button
			if( buttonid == 4 )
			{
				if( _Page > 0 )
				{
					_Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page - 1 ) );
				}
				return;
			}
			
			//next page button
			if( buttonid == 5 )
			{
				if( _Page < _MaxPages - 1 )
				{
					_Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page + 1 ) );
				}
				return;
			}
			
			//sort/filter buttons
			
			if( buttonid >= 10 && buttonid < 100 )
			{
				int columnnum = ( buttonid - 10 ) / 10;
				int buttontype = ( buttonid - 10 ) % 10;
				
				//if it's a sort button
				if( buttontype < 2 )
				{
					ItemListEntry.SortIndex = columnnum;
					ItemListEntry.SortOrder = ( buttontype == 0 ? -1 : 1 );
					
					_ListEntry.ItemListEntries.Sort();
				}
				else 
				{
					//apply filters
					for( int i = 0; i < 10; i++ )
					{
						_ListEntry.FilterText[i] = GetTextField( info, i );
					}
				}
				
				
				
				
				_Owner.SendGump( new ListEntryGump( this ) );
				return;
			}
			
			
			
			
			

			//any button that is left is a withdraw request
			//offset of 100 between the passed value and the list index
			
			buttonid -= 100;
			
			if( buttonid >= 0 && buttonid < _FilteredEntries.Count )
			{
				_ListEntry.WithdrawItem( _Owner, _FilteredEntries[ buttonid ] );
			}
			
			_Owner.SendGump( new ListEntryGump( this ) );
			

		}
		
		
		
	}


}

My brain has bad flatulence today.
 

datguy

Sorceror
The error is coming from another script I think. That file is identical to mine & mine works fine.
 
It is crazy hehe WinMerge tells me that all selected files are identical with new scripts from this post and my server scripts.




Maybe my pc is smoking crack.
 

madphatboy2

Wanderer
I've found that I can't make runebooks with this script. It says that there aren't enough components to make one. When I take the scribe book out of my pack with just the materials it says i don't have what i need. It would be great if it were set up so that you don't have to have the keys in order to make something.
 
Top