Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 10-13-2006, 11:36 AM   #1 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 21
Send a message via ICQ to baddman
Default Custom Supply Bag

I am Tring to remake one of the distro supply bags. The script compiles fine, I just do not get the items I added to it. I must be overlooking something simple and need a little direction.

Here is the script:

SicknessBag.cs

Code:
using System;
using Server;
using Server.Items;

namespace Server.Items
{
	public class SicknessBag : Bag
	{
		public override string DefaultName
		{
			get { return "a Medic Kit"; }
		}

		[Constructable]
		public SicknessBag() : this( 1 )
		{
			Movable = true;
			Hue = 0x105;
		}

		[Constructable]
		public SicknessBag( int amount )
		{
			DropItem( new ColdCurePotion( 2 ) );
			DropItem( new FluCurePotion( 2 ) );
			DropItem( new HeadacheCurePotion( 2 ) );
			DropItem( new VirusCurePotion( 1 ) );
			DropItem( new VampTurnCurePotion( 1 ) );
			DropItem( new Bandage( 30 ) );
		}

		public SicknessBag( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
Like i said it compiles fine, just when i create it in game, all that is in the bag are the bandages, no potions. Can any help me with where i went wrong?
baddman is offline   Reply With Quote
Old 10-13-2006, 11:43 AM   #2 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,753
Send a message via Yahoo to Lord_Greywolf
Default

ok - you based this off of like the bagofingots - good place to start, but the amount part is not used and probaly goofing you up - try replacing this:


Code:
		[Constructable]
		public SicknessBag() : this( 1 )
		{
			Movable = true;
			Hue = 0x105;
		}

		[Constructable]
		public SicknessBag( int amount )
		{
			DropItem( new ColdCurePotion( 2 ) );
			DropItem( new FluCurePotion( 2 ) );
			DropItem( new HeadacheCurePotion( 2 ) );
			DropItem( new VirusCurePotion( 1 ) );
			DropItem( new VampTurnCurePotion( 1 ) );
			DropItem( new Bandage( 30 ) );
		}
with this:

Code:
		[Constructable]
		public SicknessBag()
		{
			Movable = true;
			Hue = 0x105;
			DropItem( new ColdCurePotion( 2 ) );
			DropItem( new FluCurePotion( 2 ) );
			DropItem( new HeadacheCurePotion( 2 ) );
			DropItem( new VirusCurePotion( 1 ) );
			DropItem( new VampTurnCurePotion( 1 ) );
			DropItem( new Bandage( 30 ) );
		}

also could just replace :


Code:
		public override string DefaultName
		{
			get { return "a Medic Kit"; }
		}
with :

Code:
			Hue = 0x105;
			Name = "a Medic Kit";
also
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 10-13-2006, 12:42 PM   #3 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 21
Send a message via ICQ to baddman
Default

Thanks for you help on this, but I still get the same thing, no potions in bag. I am still tring other things to see if I can get this to work, but any other help you or any can offer will be greatly apprieciated .
baddman is offline   Reply With Quote
Old 10-13-2006, 01:11 PM   #4 (permalink)
Master of the Internet
 
Join Date: Oct 2005
Age: 45
Posts: 6,283
Default

Post the whole changed script so we can see what has been changed and where.
Malaperth is offline   Reply With Quote
Old 10-13-2006, 02:00 PM   #5 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,753
Send a message via Yahoo to Lord_Greywolf
Default

just a quick question - do these potions use the standard "bottle" item id or something else?
if it is not the bottle item id - is it a graphic that makes it appear in a higher position? I have had graphics that you can see in chests and not bags (or in 3d make them much bigger and you can see them) and even some can not be seen in chests either (and bookcases can be realy bad for these also)

can you just [add ColdCurePotion and have it appear on the ground?

if not that may be your problem
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 10-13-2006, 02:16 PM   #6 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Quote:
Originally Posted by Lord_Greywolf
also could just replace :


Code:
		public override string DefaultName
		{
			get { return "a Medic Kit"; }
		}
with :

Code:
			Hue = 0x105;
			Name = "a Medic Kit";
what would you do that for? slower saves or what?
Kenko is offline   Reply With Quote
Old 10-13-2006, 02:25 PM   #7 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 21
Send a message via ICQ to baddman
Default

Quote:
Originally Posted by Lord_Greywolf
just a quick question - do these potions use the standard "bottle" item id or something else?
if it is not the bottle item id - is it a graphic that makes it appear in a higher position? I have had graphics that you can see in chests and not bags (or in 3d make them much bigger and you can see them) and even some can not be seen in chests either (and bookcases can be realy bad for these also)
now that you metion that, i thought it was strange that the bag count was like they were there, this may be the issue, have to do more testing thank you


Quote:
Post the whole changed script so we can see what has been changed and where.
The full script is in first post


Thank you all for tring to help me with this, I finally got it to work. I think the problem is that this was tring to stack the potions in the bag and they are not stackable. I changed it to this and it worked fine. I still think theres a better way to code it , but this will work for now.

Code:
 	public class SicknessBag : Bag
	{
		[Constructable]
		public SicknessBag()
		{
			Movable = true;
			Hue = 0x106;
			Name = "Medic Kit";
			DropItem( new ColdCurePotion() );
			DropItem( new ColdCurePotion() );
			DropItem( new FluCurePotion() );
			DropItem( new FluCurePotion() );
			DropItem( new HeadacheCurePotion() );
			DropItem( new HeadacheCurePotion() );
			DropItem( new VirusCurePotion() );
			DropItem( new VampTurnCurePotion() );
			DropItem( new Bandage( 30 ) );
		}
Thanks again for your help

Last edited by baddman; 10-13-2006 at 07:22 PM.
baddman 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5