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!

Help with FS Animal Taming System

Tee312

Wanderer
ya it was in there.. i had it in the custom folder.. i wonder why it wasnt reconising it being in there.. hmm
 

Celestria

Wanderer
Okay lets go back to the beginning. =)
The Potion Keg.cs.
if you are using Daat99's Custom OWLTR system, there is no potionkeg.cs in it so I am confused about what system you are talking about

In FSTATS there is it looks like this. If I am completely off base here about what system you are talking about please tell me. If I am correct however, then there is something very odd going on. Becuase if you deleted what you call daat's potion keg.cs you shard should still have worked.

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

namespace Server.Items
{
	public class PotionKeg : Item
	{
		private PotionEffect m_Type;
		private int m_Held;

		[CommandProperty( AccessLevel.GameMaster )]
		public int Held
		{
			get
			{
				return m_Held;
			}
			set
			{
				if ( m_Held != value )
				{
					this.Weight += (value - m_Held) * 0.8;

					m_Held = value;
					InvalidateProperties();
				}
			}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public PotionEffect Type
		{
			get
			{
				return m_Type;
			}
			set
			{
				m_Type = value;
				InvalidateProperties();
			}
		}

		[Constructable]
		public PotionKeg() : base( 0x1940 )
		{
			this.Weight = 1.0;
		}

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

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

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

			writer.Write( (int) m_Type );
			writer.Write( (int) m_Held );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Type = (PotionEffect)reader.ReadInt();
					m_Held = reader.ReadInt();

					break;
				}
			}
		}

		public override void AddNameProperty(ObjectPropertyList list)
		{
			if ( m_Held > 0 )
			{
				if ( m_Type == PotionEffect.PetResurrect )
				{
					list.Add( "a keg of pet resurrection potions" );
				}
				else if ( m_Type == PotionEffect.PetShrink )
				{
					list.Add( "a keg of shrink potions" );
				}
				else if ( m_Type == PotionEffect.PetHeal )
				{
					list.Add( "a keg of pet heal potions" );
				}
				else if ( m_Type == PotionEffect.PetGreaterHeal )
				{
					list.Add( "a keg of pet greater heal potions" );
				}
				else if ( m_Type == PotionEffect.PetCure )
				{
					list.Add( "a keg of pet cure potions" );
				}
				else if ( m_Type == PotionEffect.PetGreaterCure )
				{
					list.Add( "a keg of pet greater cure potions" );
				}
				else
				{
					list.Add( 1041620 + (int)m_Type );
				}
			}
			else
			{
				list.Add( "an empty potion keg" );
			}
		}

		//public override int LabelNumber{ get{ return (m_Held > 0 ? 1041620 + (int)m_Type : 1041641); } }

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );

			int number;

			if ( m_Held <= 0 )
				number = 502246; // The keg is empty.
			else if ( m_Held < 5 )
				number = 502248; // The keg is nearly empty.
			else if ( m_Held < 20 )
				number = 502249; // The keg is not very full.
			else if ( m_Held < 30 )
				number = 502250; // The keg is about one quarter full.
			else if ( m_Held < 40 )
				number = 502251; // The keg is about one third full.
			else if ( m_Held < 47 )
				number = 502252; // The keg is almost half full.
			else if ( m_Held < 54 )
				number = 502254; // The keg is approximately half full.
			else if ( m_Held < 70 )
				number = 502253; // The keg is more than half full.
			else if ( m_Held < 80 )
				number = 502255; // The keg is about three quarters full.
			else if ( m_Held < 96 )
				number = 502256; // The keg is very full.
			else if ( m_Held < 100 )
				number = 502257; // The liquid is almost to the top of the keg.
			else
				number = 502258; // The keg is completely full.

			list.Add( number );
		}

		public override void OnSingleClick( Mobile from )
		{
			base.OnSingleClick( from );

			int number;

			if ( m_Held <= 0 )
				number = 502246; // The keg is empty.
			else if ( m_Held < 5 )
				number = 502248; // The keg is nearly empty.
			else if ( m_Held < 20 )
				number = 502249; // The keg is not very full.
			else if ( m_Held < 30 )
				number = 502250; // The keg is about one quarter full.
			else if ( m_Held < 40 )
				number = 502251; // The keg is about one third full.
			else if ( m_Held < 47 )
				number = 502252; // The keg is almost half full.
			else if ( m_Held < 54 )
				number = 502254; // The keg is approximately half full.
			else if ( m_Held < 70 )
				number = 502253; // The keg is more than half full.
			else if ( m_Held < 80 )
				number = 502255; // The keg is about three quarters full.
			else if ( m_Held < 96 )
				number = 502256; // The keg is very full.
			else if ( m_Held < 100 )
				number = 502257; // The liquid is almost to the top of the keg.
			else
				number = 502258; // The keg is completely full.

			this.LabelTo( from, number );
		}

		public override void OnDoubleClick( Mobile from )
		{
			if ( from.InRange( GetWorldLocation(), 2 ) )
			{
				if ( m_Held > 0 )
				{
					Container pack = from.Backpack;

					if ( pack != null && pack.ConsumeTotal( typeof( Bottle ), 1 ) )
					{
						from.SendLocalizedMessage( 502242 ); // You pour some of the keg's contents into an empty bottle...

						BasePotion pot = FillBottle();

						if ( pack.TryDropItem( from, pot, false ) )
						{
							from.SendLocalizedMessage( 502243 ); // ...and place it into your backpack.
							from.PlaySound( 0x240 );

							if ( --Held == 0 )
								from.SendLocalizedMessage( 502245 ); // The keg is now empty.
						}
						else
						{
							from.SendLocalizedMessage( 502244 ); // ...but there is no room for the bottle in your backpack.
							pot.Delete();
						}
					}
					else
					{
						// TODO: Target a bottle
					}
				}
				else
				{
					from.SendLocalizedMessage( 502246 ); // The keg is empty.
				}
			}
			else
			{
				from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
			}
		}

		public override bool OnDragDrop( Mobile from, Item item )
		{
			if ( item is BasePotion )
			{
				BasePotion pot = (BasePotion)item;

				if ( m_Held == 0 )
				{
					if ( GiveBottle( from ) )
					{
						m_Type = pot.PotionEffect;
						Held = 1;

						from.PlaySound( 0x240 );

						from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.

						item.Delete();
						return true;
					}
					else
					{
						from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack.
						return false;
					}
				}
				else if ( pot.PotionEffect != m_Type )
				{
					from.SendLocalizedMessage( 502236 ); // You decide that it would be a bad idea to mix different types of potions.
					return false;
				}
				else if ( m_Held >= 100 )
				{
					from.SendLocalizedMessage( 502233 ); // The keg will not hold any more!
					return false;
				}
				else
				{
					if ( GiveBottle( from ) )
					{
						++Held;
						item.Delete();

						from.PlaySound( 0x240 );

						from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.

						item.Delete();
						return true;
					}
					else
					{
						from.SendLocalizedMessage( 502238 ); // You don't have room for the empty bottle in your backpack.
						return false;
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 502232 ); // The keg is not designed to hold that type of object.
				return false;
			}
		}

		public bool GiveBottle( Mobile m )
		{
			Container pack = m.Backpack;

			Bottle bottle = new Bottle();

			if ( pack == null || !pack.TryDropItem( m, bottle, false ) )
			{
				bottle.Delete();
				return false;
			}

			return true;
		}

		public BasePotion FillBottle()
		{
			switch ( m_Type )
			{
				default:
				case PotionEffect.Nightsight:		return new NightSightPotion();

				case PotionEffect.CureLesser:		return new LesserCurePotion();
				case PotionEffect.Cure:				return new CurePotion();
				case PotionEffect.CureGreater:		return new GreaterCurePotion();

				case PotionEffect.Agility:			return new AgilityPotion();
				case PotionEffect.AgilityGreater:	return new GreaterAgilityPotion();

				case PotionEffect.Strength:			return new StrengthPotion();
				case PotionEffect.StrengthGreater:	return new GreaterStrengthPotion();

				case PotionEffect.PoisonLesser:		return new LesserPoisonPotion();
				case PotionEffect.Poison:			return new PoisonPotion();
				case PotionEffect.PoisonGreater:	return new GreaterPoisonPotion();
				case PotionEffect.PoisonDeadly:		return new DeadlyPoisonPotion();

				case PotionEffect.Refresh:			return new RefreshPotion();
				case PotionEffect.RefreshTotal:		return new TotalRefreshPotion();

				case PotionEffect.HealLesser:		return new LesserHealPotion();
				case PotionEffect.Heal:				return new HealPotion();
				case PotionEffect.HealGreater:		return new GreaterHealPotion();

				case PotionEffect.ExplosionLesser:	return new LesserExplosionPotion();
				case PotionEffect.Explosion:		return new ExplosionPotion();
				case PotionEffect.ExplosionGreater:	return new GreaterExplosionPotion();
				case PotionEffect.PetResurrect:		return new PetResurrectPotion();
				case PotionEffect.PetShrink:		return new PetShrinkPotion();
				case PotionEffect.PetHeal:		return new HealPotionPet();
				case PotionEffect.PetGreaterHeal:	return new GreaterHealPotionPet();
				case PotionEffect.PetCure:		return new CurePotionPet();
				case PotionEffect.PetGreaterCure:	return new GreaterCurePotionPet();
			}
		}

		public static void Initialize()
		{
			TileData.ItemTable[0x1940].Height = 4;
		}
	}
}
 

Tee312

Wanderer
ok hm.. interesting.. cause when i remove one of the potionkeg.cs files.. it brings up a bunch or errors about the custom leathers in the daat system.. i would post them if very needed.. just would prefer not too :p but anyway..ya its got me very confused about what im suppose to do. I know both of the PotionKeg.cs are needed or else the shard wont run because of one of the scripts i have installed, which i thought was daat, maybe not. That code u posted for me, or is it one i already posted?
 

Freya

Wanderer
Ok, then it sounds like there are more scripts that you are having errors from, that show up after you fix the potion keg one, I know when installing both the Daat system and the FS system, there are a LOT of distro scripts that need to be merged w/the ones in those systems for you to not get errors on compile... You may want to just install one, fully read the install instructions carefully for it... and then wait to add the other until you are more familiar and comfortable w/scripting as it can be tricky getting the two systems to work together if you don't know what you are doing.
 

Tee312

Wanderer
sounds good Freya.. ill just install taming system for now..considering my shard is a lot for taming..and ill just have a scritor i know merge them together and fix it..i tried out celestrias combine thing but it didnt work for me lol
 

Freya

Wanderer
=) It takes a while to get used to scripting and merging and such... that would probably be best I think in my opinion, till you get more accustomed or have your scripter help w/both systems, cuz they can be tricky to get merged when not familiar w/scripting much =)
 

Tee312

Wanderer
ok maybe not...i just tried to install it and it gave me god knows how many errors.. too many errors to even see...first it gave me 13 errors..had double script files..so i remvoed them to my desktop..then after that it gave me all these errors so i guess ill have to do without it :(
 

Freya

Wanderer
Thats cuz both systems used modified distro scripts... you have to basically take their scripts and paste them over the ones you have of the same name... or just delete yours already in there of the same name and keep Daat's in or FS's in, depending which system you decide to put in for now
 

Tee312

Wanderer
ok i redid my shard and got the taming system in.. i simplified everything down in the daats system and this is my final result
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (7 errors, 0 warnings)
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 7, column 23) The
namespace 'Server.Engines.BulkOrders' already contains a definition for 'Constr
uctCallback'
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 9, column 22) The
namespace 'Server.Engines.BulkOrders' already contains a definition for 'Reward
Type'
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 35, column 22) Th
e namespace 'Server.Engines.BulkOrders' already contains a definition for 'Rewar
dItem'
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 63, column 22) Th
e namespace 'Server.Engines.BulkOrders' already contains a definition for 'Rewar
dGroup'
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 105, column 24) T
he namespace 'Server.Engines.BulkOrders' already contains a definition for 'Rewa
rdCalculator'
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 173, column 22) T
he namespace 'Server.Engines.BulkOrders' already contains a definition for 'Smit
hRewardCalculator'
- Error: Scripts\Engines\BulkOrders\Rewards.cs: CS0101: (line 390, column 22) T
he namespace 'Server.Engines.BulkOrders' already contains a definition for 'Tail
orRewardCalculator'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Tee312

Wanderer
thanks for everyones help. I figured out a solution, i didnt want all the custom leathers, ores, and wood. So i just put in what i wanted and it worked out pretty good.
 
Top