Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 08-15-2009, 12:05 AM   #1 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 12,196
Send a message via Yahoo to Lord_Greywolf
Default a small fix for contaiiners

UPDATED!!!

have you ever noticed that when a container is full on items, but some of them are stackable
and you want to add more into it that go with the stackable ones, that you can't?

well here is a simple fix for it

this also makes it nice for combining piles if they ever happen again lol - just drag insame bag and they combine up if possible

only draw back is you can not have multiple stacks of the same item that could stack (i.e. 5 stacks of 1 coin each, would need to be 30001 or more each)
also not tested but probably will hapen is in treasure chests, etc etc that stacks of reagent, etc will combine where same type

it does not effect the max stacking of 60k, etc, still abides by it, etc

the adding in part is optional - that would probably keep them from combining if you want seperate stacks when placing by hand in there
but still need the line moved for best results

open container.cs in the tiem/containers directory

there are 2 sections to find
1 just needs a line moved and some inserted
the 2nd one needs a line moved and a section added

find the lines in blue and make their sections match up with the parts in red (remember to remove the 1st line in each)


Code:
		public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
		{
			BaseHouse house = BaseHouse.FindHouseAt( this );
			if ( house != null && house.IsLockedDown( this ) )
			{
				if ( dropped is VendorRentalContract || ( dropped is Container && ((Container)dropped).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
				{
					from.SendLocalizedMessage( 1062492 );
					return false;
				}
				if ( !house.LockDown( from, dropped, false ) ) return false;
			}
			if (!(this.RootParentEntity is PlayerVendor || this.RootParentEntity is BaseVendor))
			{
				List<Item> list = this.Items;
				for ( int i = 0; i < list.Count; ++i )
				{
					Item item = list[i];
					if ( !(item is Container) && item.StackWith( from, dropped, false ) ) return true;
				}
			}
			if ( !CheckHold( from, dropped, sendFullMessage, true ) ) return false;//was 1st line in this section
			DropItem( dropped );
			return true;
		}

		public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
		{
			BaseHouse house = BaseHouse.FindHouseAt( this );
			if ( house != null && house.IsLockedDown( this ) )
			{
				if ( item is VendorRentalContract || ( item is Container && ((Container)item).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
				{
					from.SendLocalizedMessage( 1062492 );
					return false;
				}
				if ( !house.LockDown( from, item, false ) ) return false;
			}
			//added section for combining
			if (!(this.RootParentEntity is PlayerVendor || this.RootParentEntity is BaseVendor))
			{
				List<Item> list = this.Items;
				for ( int i = 0; i < list.Count; ++i )
				{
					Item item1 = list[i];
					if ( !(item1 is Container) && item1.StackWith( from, item, false ) )
					{	
						from.SendSound( GetDroppedSound( item1 ), GetWorldLocation() );
						return true;
					}
				}
			}
			if ( !CheckHold( from, item, true, true ) ) return false; // was 1st line
			item.Location = new Point3D( p.X, p.Y, 0 );
			AddItem( item );
			from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
			return true;
		}
nice and simple
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)

Last edited by Lord_Greywolf; 08-17-2009 at 06:37 PM.
Lord_Greywolf is online now   Reply With Quote
Old 08-15-2009, 12:35 AM   #2 (permalink)
Forum Novice
 
Join Date: Dec 2008
Age: 27
Posts: 103
Default

Reminds me of ultima 8. You could drop all your stackables in chest or bags and they would auto-combine.
Corpsecrank is offline   Reply With Quote
Old 08-17-2009, 06:38 PM   #3 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 12,196
Send a message via Yahoo to Lord_Greywolf
Default

had a small problem when placing items on a player vendor to sell (like recall scrolls or ingots, etc)

so i made the fix and the 1st post has been updated to reflect this
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is online now   Reply With Quote
Old 08-24-2009, 02:07 AM   #4 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Will this fix only work with locked down / secured containers? Or will it fix the issue with when using the [grab system gold not stacking after item count or weight max iis reached?
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 08-24-2009, 02:17 AM   #5 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 12,196
Send a message via Yahoo to Lord_Greywolf
Default

it might fix all of claim/grab issues with that - i am not certain because i had others also
but the claim/grab is what got me to do this

i found other claim grab issues though of going over weight, etc - just keeps stacking, etc - so suddenly the pack has 15 tons in it lol
plus if you use bless bags or bags of reduction with have item limits, it goes bonkers too when in them

I had to make a lot of adjustments to claim/grab to get it working right and working with the blessed & reduction bags
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is online now   Reply With Quote
Old 08-24-2009, 02:27 AM   #6 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

OK Thank you that was the issue I was having.. The 15000000 items, which in the end crash people when they recall or go into a moongate. I do not use the bless bags or reduction packs so Im hoping it wont require any editing to the claim to get it to stack gold and regs.
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 08-24-2009, 02:45 AM   #7 (permalink)
Master of the Internet
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 12,196
Send a message via Yahoo to Lord_Greywolf
Default

it should stack right BUT will still allow to go overweight though

this is how i fixed that problem

make this section look simular

Code:
		public static void DropLoot( Mobile from, Item loot, Container lootBag )
		{
			List<Item> list = lootBag.Items;
			for ( int i = 0; i < list.Count; ++i )
			{
				Item item1 = list[i];
				if ( !(item1 is Container) && item1.StackWith( from, loot, false ) )
				{
					from.PlaySound( 0x2E6 );
					return;
				}
			}
			if ( !lootBag.TryDropItem( from, loot, false ) ) loot.MoveToWorld( from.Location, from.Map );
			from.PlaySound( 0x2E6 );
		}
and i think that should fix you up then
can do gold and silver drop simular also so they do not go overweight also

and that is in claim.cs
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is online now   Reply With Quote
Old 08-24-2009, 08:10 AM   #8 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Quote:
Originally Posted by Lord_Greywolf View Post
it should stack right BUT will still allow to go overweight though

this is how i fixed that problem

make this section look simular

Code:
		public static void DropLoot( Mobile from, Item loot, Container lootBag )
		{
			List<Item> list = lootBag.Items;
			for ( int i = 0; i < list.Count; ++i )
			{
				Item item1 = list[i];
				if ( !(item1 is Container) && item1.StackWith( from, loot, false ) )
				{
					from.PlaySound( 0x2E6 );
					return;
				}
			}
			if ( !lootBag.TryDropItem( from, loot, false ) ) loot.MoveToWorld( from.Location, from.Map );
			from.PlaySound( 0x2E6 );
		}
and i think that should fix you up then
can do gold and silver drop simular also so they do not go overweight also

and that is in claim.cs
Thanks much for the snippet of code. I will give it a shot this evening once the work day ends and see how it goes.
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5