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!

Stackable Potions

Stackable Potions

Hello!
I have made all potions stackable in my server but for some reason i keep getting these messages:
Code:
Warning: 0x4001248F: Amount changed for non-stackable item 'AgilityPotion'. (100
)
Warning: 0x40012490: Amount changed for non-stackable item 'CurePotion'. (100)
Warning: 0x40012491: Amount changed for non-stackable item 'ExplosionPotion'. (1
00)
Warning: 0x40012492: Amount changed for non-stackable item 'HealPotion'. (100)
Warning: 0x40012493: Amount changed for non-stackable item 'PoisonPotion'. (100)

Warning: 0x40012494: Amount changed for non-stackable item 'RefreshPotion'. (100
)
Warning: 0x40012495: Amount changed for non-stackable item 'StrengthPotion'. (10
0)
Warning: 0x40012496: Amount changed for non-stackable item 'NightSightPotion'. (
100)
I have wrote Stackable=true; in every script and i clicked the Generic/Stackable options in the mul editor for every potion, this is how my potion script looks:
Code:
using System;
using Server;

namespace Server.Items
{
	public class RefreshPotion : BaseRefreshPotion
	{
		public override double Refresh{ get{ return 0.25; } }

		[Constructable]
		public RefreshPotion() : this( 1 )
		{
		}

		[Constructable]
		public RefreshPotion( int amount ) : base( PotionEffect.Refresh, amount )
		{
			Stackable = true;
		}

		public RefreshPotion( 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();
		}
	}
}
Best Regards.
 
look in basepotion and the other "base" ones to make sure it is not set stackable false in there also

remember you also have to patch your tiledata to all players, besides just the server's files
 
Lord_Greywolf;770073 said:
look in basepotion and the other "base" ones to make sure it is not set stackable false in there also

remember you also have to patch your tiledata to all players, besides just the server's files

This is how all my base potions look:
Code:
using System;
using Server;

namespace Server.Items
{
	public abstract class BaseAgilityPotion : BasePotion
	{
		public abstract int DexOffset{ get; }
		public abstract TimeSpan Duration{ get; }

		[Constructable]
		public BaseAgilityPotion() : this( 1 )
		{
		}

                [Constructable]
		public BaseAgilityPotion( PotionEffect effect, int amount ) : base( 0xF08, effect, amount )
		{
			Stackable = true;
		}

		public BaseAgilityPotion( 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();
		}

		public bool DoAgility( Mobile from )
		{
			// TODO: Verify scaled; is it offset, duration, or both?
			if ( Spells.SpellHelper.AddStatOffset( from, StatType.Dex, Scale( from, DexOffset ), Duration ) )
			{
				from.FixedEffect( 0x375A, 10, 15 );
				from.PlaySound( 0x1E7 );
				return true;
			}

			from.SendLocalizedMessage( 502173 ); // You are already under a similar effect.
			return false;
		}

		public override void Drink( Mobile from )
		{
			if ( DoAgility( from ) )
			{
				BasePotion.PlayDrinkEffect( from );

				this.Consume();
			}
		}
	}
}
Every potion is set to stackable true in BasePotion.cs

EDIT: Hmm.. What textures are used for? Only the 3d client?
 
no idea then, unless tiledata is set up wrong for it for the potions - or you missed 1 fraphic in there - and liek i said, has to be in the server's files and players files both to be set up right
 

b0b01

Sorceror
I have never played with this before

but you will have to set it in the deserialisation too.

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

			int version = reader.ReadInt();
Stackable = true;
		}
 
b0b01;770408 said:
I have never played with this before

but you will have to set it in the deserialisation too.

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

			int version = reader.ReadInt();
Stackable = true;
		}

Ok ill try this, thanks!
I'm using UO ML with RunUo 2.0 RC2
 

Garret

Sorceror
Don't forgot to patch client on server side.
As i remember that's message only appers when making item stackable, but in tiledata it's not.
 

Alex21

Sorceror
potions in the latest svn are stack able and work fine for me? and i don't have any custom artwork?
 

Garret

Sorceror
about svn dunno.
any item can be stackable without additional artwork. it's only a tiledata and serverside option.
 
Top