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 08-14-2005, 08:22 AM   #1 (permalink)
Forum Novice
 
Join Date: May 2005
Location: In the world of candies
Age: 40
Posts: 151
Unhappy Fill factor

How would I add a fillfactor to this script?

Code:
using System;
using System.Collections;
using Server;
using Server.Network;

namespace Server.Items
{
	public class ChocolateSwampDragon : Food
	{

		[Constructable]
		public ChocolateSwampDragon() : this( 1 )
		{
			Hue = 443;
			Name = "Chocolate Swamp Dragon";
			Movable = true;
			ItemID = 9753;
			Amount = 1;	
		}
		
		[Constructable]
		public ChocolateSwampDragon( int amount ) : base( 0xF8F, amount )
		{
			this.FillFactor = 3;
		}

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

		public override Item Dupe( int amount )
		{
			return base.Dupe( new ChocolateSwampDragon( amount ), amount );
		}
	
		public override void OnDoubleClick( Mobile from )
		{
				from.PlaySound( Utility.Random( 0x3A, 3 ) );
			
				if ( from.Body.IsHuman && !from.Mounted )
				{
					from.Animate( 34, 5, 1, true, false, 0 );

				Consume();
			}
		}
		
		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();
		}
	}
}
any idea?

Or would I need to put THIS in Food.cs so it would work?


Help please



XSTG
XSTG is offline   Reply With Quote
Old 08-14-2005, 08:46 AM   #2 (permalink)
Forum Expert
 
Join Date: Feb 2004
Age: 27
Posts: 1,834
Default

Hue = 443;
Name = "Chocolate Swamp Dragon";
Movable = true;
ItemID = 9753;
First off, this all should be in the next constructor maybe? I didn't try it, but are you sure this one doesn't have a correct fillfactor? It should have. O.o Anyways: Damn cute idea! ^_^
Kamuflaro is offline   Reply With Quote
Old 08-14-2005, 09:08 AM   #3 (permalink)
Forum Novice
 
Join Date: May 2005
Location: In the world of candies
Age: 40
Posts: 151
Talking hE, he he

Thanks, Im going to try it now.


Good idea eh?
XSTG is offline   Reply With Quote
Old 08-14-2005, 09:11 AM   #4 (permalink)
Forum Novice
 
Join Date: May 2005
Location: In the world of candies
Age: 40
Posts: 151
Red face Hrm.

No it doesn't work, I put all fillfactor and all, but it still doesn't work (even in 2nd constructable) Is there another way to do it?


EDIT: Im not using this in FOod.cs but really in a custom item script so if it can help to solve...
XSTG is offline   Reply With Quote
Old 08-14-2005, 09:43 AM   #5 (permalink)
Forum Expert
 
Axle's Avatar
 
Join Date: Oct 2002
Location: Iowa, USA
Age: 38
Posts: 395
Default

As long ans the constructors are like this it should work.

Code:
[Constructable]
        public ChocolateSwampDragon() : this( 1 )
        {
        }

        [Constructable]
        ChocolateSwampDragon( int amount ) : base( amount, 0xF8F )
        {
            Hue = 443;
            Name = "Chocolate Swamp Dragon";
            Movable = true;
            ItemID = 9753;
            this.FillFactor = 3;

        }


also I think this:
Code:
public override void OnDoubleClick( Mobile from )
		{
				from.PlaySound( Utility.Random( 0x3A, 3 ) );
			
				if ( from.Body.IsHuman && !from.Mounted )
				{
					from.Animate( 34, 5, 1, true, false, 0 );

				Consume();
			}
		}
should be:
Code:
public override void OnDoubleClick( Mobile from )
		{
				from.PlaySound( Utility.Random( 0x3A, 3 ) );
			
				if ( from.Body.IsHuman && !from.Mounted )
				{
					from.Animate( 34, 5, 1, true, false, 0 );

				this.Consume();
			}
		}
Axle is offline   Reply With Quote
Old 08-14-2005, 09:59 AM   #6 (permalink)
Forum Novice
 
Join Date: May 2005
Location: In the world of candies
Age: 40
Posts: 151
Talking Hmmmmmmmm

No it doesN't work more, you can still eat a lot and without limits....

Another idea!?
XSTG is offline   Reply With Quote
Old 08-14-2005, 10:11 AM   #7 (permalink)
Forum Expert
 
Axle's Avatar
 
Join Date: Oct 2002
Location: Iowa, USA
Age: 38
Posts: 395
Default

Quote:
Originally Posted by XSTG
No it doesN't work more, you can still eat a lot and without limits....

Another idea!?
then you need to create a bool with a method to check their fillfactor.

if you do a search on the forum for FillFactor, I'll bet you'll get a lot of good examples.
some friendly advice: if you plan to learn to script, learn to use the runuo search engine first.

2 main reasons:
1. most cases can be quicker than waiting on response (that may never come).
2. will keep you from getting flamed.

Axle is offline   Reply With Quote
Old 08-14-2005, 11:06 AM   #8 (permalink)
Forum Expert
 
Join Date: Feb 2004
Age: 27
Posts: 1,834
Default

Code:
using System;
using System.Collections;
using Server;
using Server.Network;

namespace Server.Items
{
	public class ChocolateSwampDragon : Food
	{

		[Constructable]
		public ChocolateSwampDragon() : this( 1 )
		{
		}
		
		[Constructable]
		public ChocolateSwampDragon( int amount ) : base( 0xF8F, amount )
		{
			this.Stackable = true;
			this.Hue = 443;
			this.Name = "Chocolate Swamp Dragon";
			this.ItemID = 9753;
			this.Amount = amount;
			this.Weight = 1;
			this.FillFactor = 3;
		}

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

		public override Item Dupe( int amount )
		{
			return base.Dupe( new ChocolateSwampDragon( amount ), amount );
		}
		
		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();
		}
	}
}
Try to work from here again... the problem was in your OnDoubleClick.
Kamuflaro 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