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!

Lucid Nagual's << OWLTR & FS Taming Plugin | Carpenter & Fletcher BODs >>

Greystar

Wanderer
Lucid Nagual said:
It works fine. Everyone tells me it doesn't, but I double click on it and the menu pos up. so I don't know how to help you with that. All I did was edit the BaseAddon.cs just like the one I provided. Here is proof that it works:

Question though since it didnt get answered last time I asked... Is it supposed to be locked down or secured in a house before it can be used? Cause maybe that's the issue everyone is having... I'm not using this personally cause I don't use Daat99's system anymore. I see that it works fine for you but obviously since you are in greenacres you are testing it as staff...
 
Greystar

Question though since it didnt get answered last time I asked... Is it supposed to be locked down or secured in a house before it can be used? Cause maybe that's the issue everyone is having... I'm not using this personally cause I don't use Daat99's system anymore. I see that it works fine for you but obviously since you are in greenacres you are testing it as staff...
Does it matter? If you looked at the script you would see there are no checks for accesslevels. And if it opens in GreenAcres it certainly opens in a house.
 

Greystar

Wanderer
Lucid Nagual said:
Does it matter? If you looked at the script you would see there are no checks for accesslevels. And if it opens in GreenAcres it certainly opens in a house.

Just wondering... cause if it works for some but others somethings not making sense to me... But as I said im not using this cause I dont use Daat99's system anymore.
 
Greystar

Just wondering... cause if it works for some but others somethings not making sense to me... But as I said im not using this cause I dont use Daat99's system anymore.
Well I'm not sure if it has worked for others, but I would really like to know.

If the BaseAddon was replaced with mine it would have an extra method:
Code:
[SIZE=2]public override void OnDoubleClick( Mobile from ) 
{ 
base.OnDoubleClick(from); 
}
[/SIZE]

This allows me to add a OnDoubleClick to addons. Like this:
Code:
[SIZE=2]public override void OnDoubleClick( Mobile from )
{
if ( this != null )
{
base.OnDoubleClick(from);
from.SendGump( new HouseBuildingGump() );
}
else
return;
}
[/SIZE]
 

Rosey1

Wanderer
well i looked at the scripts and i do have those lines in the scripts but nothing happens when i double click.
 
Rosey1

well i looked at the scripts and i do have those lines in the scripts but nothing happens when i double click.

Please try using this line at the top of saw scripts and the baseaddon.cs. I am at a loss but it is worth a try. Let me know what happens.
Code:
[SIZE=2]using Server.Gumps;
[/SIZE]
 

Rosey1

Wanderer
that didn't work :(
i wish i could help you but i'll show you what i have, maybe it will jog something.

this is what I have as my baseaddon

Code:
using System;
using System.Collections;
using Server;
using Server.Multis;
using Server.Regions;
using Server.Gumps;

namespace Server.Items
{
	public enum AddonFitResult
	{
		Valid,
		Blocked,
		NotInHouse,
		DoorsNotClosed,
		DoorTooClose,
		NoWall
	}

	public interface IAddon
	{
		Item Deed{ get; }

		bool CouldFit( IPoint3D p, Map map );
	}

	public abstract class BaseAddon : Item, IChopable, IAddon
	{
		private ArrayList m_Components;

		public void AddComponent( AddonComponent c, int x, int y, int z )
		{
			if ( Deleted )
				return;

			m_Components.Add( c );

			c.Addon = this;
			c.Offset = new Point3D( x, y, z );
			c.MoveToWorld( new Point3D( X + x, Y + y, Z + z ), Map );
		}

		public BaseAddon() : base( 1 )
		{
			Movable = false;
			Visible = false;

			m_Components = new ArrayList();
		}

		public virtual bool RetainDeedHue{ get{ return false; } }

		public virtual void OnChop( Mobile from )
		{
			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsOwner( from ) && house.Addons.Contains( this ) )
			{
				Effects.PlaySound( GetWorldLocation(), Map, 0x3B3 );
				from.SendLocalizedMessage( 500461 ); // You destroy the item.

				int hue = 0;

				if ( RetainDeedHue )
				{
					for ( int i = 0; hue == 0 && i < m_Components.Count; ++i )
					{
						AddonComponent c = (AddonComponent)m_Components[i];

						if ( c.Hue != 0 )
							hue = c.Hue;
					}
				}

				Delete();

				house.Addons.Remove( this );

				BaseAddonDeed deed = Deed;

				if ( deed != null )
				{
					if ( RetainDeedHue )
						deed.Hue = hue;

					from.AddToBackpack( deed );
				}
			}
		}

		public virtual BaseAddonDeed Deed{ get{ return null; } }

		Item IAddon.Deed
		{
			get{ return this.Deed; }
		}

		public ArrayList Components
		{
			get
			{
				return m_Components;
			}
		}

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

		public bool CouldFit( IPoint3D p, Map map )
		{
			ArrayList houses = null;

			return ( CouldFit( p, map, null, ref houses ) == AddonFitResult.Valid );
		}

		public AddonFitResult CouldFit( IPoint3D p, Map map, Mobile from, ref ArrayList houseList )
		{
			if ( Deleted )
				return AddonFitResult.Blocked;

			ArrayList houses = new ArrayList();

			foreach ( AddonComponent c in m_Components )
			{
				Point3D p3D = new Point3D( p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z );

				if ( !map.CanFit( p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, ( c.Z == 0 ) ) )
					return AddonFitResult.Blocked;
				else if ( !CheckHouse( from, p3D, map, c.ItemData.Height, houses ) )
					return AddonFitResult.NotInHouse;

				if ( c.NeedsWall )
				{
					Point3D wall = c.WallPosition;

					if ( !IsWall( p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map ) )
						return AddonFitResult.NoWall;
				}
			}

			foreach ( BaseHouse house in houses )
			{
				ArrayList doors = house.Doors;

				for ( int i = 0; i < doors.Count; ++i )
				{
					BaseDoor door = doors[i] as BaseDoor;

					if ( door != null && door.Open )
						return AddonFitResult.DoorsNotClosed;

					Point3D doorLoc = door.GetWorldLocation();
					int doorHeight = door.ItemData.CalcHeight;

					foreach ( AddonComponent c in m_Components )
					{
						Point3D addonLoc = new Point3D( p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z );
						int addonHeight = c.ItemData.CalcHeight;

						if ( Utility.InRange( doorLoc, addonLoc, 1 ) && (addonLoc.Z == doorLoc.Z || ((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z)) )
							return AddonFitResult.DoorTooClose;
					}
				}
			}

			houseList = houses;
			return AddonFitResult.Valid;
		}

		public bool CheckHouse( Mobile from, Point3D p, Map map, int height, ArrayList list )
		{
			if ( from == null || from.AccessLevel >= AccessLevel.GameMaster )
				return true;

			BaseHouse house = BaseHouse.FindHouseAt( p, map, height );

			if ( house == null || !house.IsOwner( from ) )
				return false;

			if ( !list.Contains( house ) )
				list.Add( house );

			return true;
		}

		public static bool IsWall( int x, int y, int z, Map map )
		{
			if ( map == null )
				return false;

			Tile[] tiles = map.Tiles.GetStaticTiles( x, y, true );

			for ( int i = 0; i < tiles.Length; ++i )
			{
				Tile t = tiles[i];
				ItemData id = TileData.ItemTable[t.ID & 0x3FFF];

				if ( (id.Flags & TileFlag.Wall) != 0 && (z + 16) > t.Z && (t.Z + t.Height) > z )
					return true;
			}

			return false;
		}

		public virtual void OnComponentLoaded( AddonComponent c )
		{
		}

		public override void OnLocationChange( Point3D oldLoc )
		{
			if ( Deleted )
				return;

			foreach ( AddonComponent c in m_Components )
				c.Location = new Point3D( X + c.Offset.X, Y + c.Offset.Y, Z + c.Offset.Z );
		}

		public override void OnMapChange()
		{
			if ( Deleted )
				return;

			foreach ( AddonComponent c in m_Components )
				c.Map = Map;
		}

		public override void OnAfterDelete()
		{
			base.OnAfterDelete();

			foreach ( AddonComponent c in m_Components )
				c.Delete();
		}

		public override void OnDoubleClick( Mobile from ) 
		{ 
			base.OnDoubleClick(from); 
		}


		public virtual bool ShareHue{ get{ return true; } }

		[Hue, CommandProperty( AccessLevel.GameMaster )]
		public override int Hue
		{
			get
			{
				return base.Hue;
			}
			set
			{
				if ( base.Hue != value )
				{
					base.Hue = value;

					if ( !Deleted && this.ShareHue && m_Components != null )
					{
						foreach ( AddonComponent c in m_Components )
							c.Hue = value;
					}
				}
			}
		}

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

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

			writer.WriteItemList( m_Components );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Components = reader.ReadItemList();
					break;
				}
			}
		}
	}
}

one of the addons:

Code:
/*    
-<>>--<<>>--<0>>--<< <<2005>> >>--<<0>--<<>>--<<>-
|        ____________________________            |
|     -=(_)__________________________)=-         |
|          \_    All Crafts 1.0.0    _\          |
|           \_  -------------------   _\         |
|            )       Created By:        )        |
|           /_  Sirsly & Lucid Nagual _/         |
|         _/__________________________/          |
|      -=(_)__________________________)=-        |
|                                                |
-<>>-<< Based off of Daat99's OWLTR system >>-<<>-
*/
using System;
using Server;
using Server.Items;
using Server.Gumps;

namespace Server.Items
{
	public class HousebuildingSawFacingSouthAddon : BaseAddon
	{
		public override BaseAddonDeed Deed
		{
			get
			{
				return new HousebuildingSawFacingSouthAddonDeed();
			}
		}

		[ Constructable ]
		public HousebuildingSawFacingSouthAddon()
		{
			AddonComponent ac;
			ac = new AddonComponent( 6651 );
			AddComponent( ac, 0, 0, 0 );
			ac = new AddonComponent( 6652 );
			AddComponent( ac, 1, 0, 0 );
			ac = new AddonComponent( 4528 );
			AddComponent( ac, 1, 0, 2 );
		}

		public override void OnDoubleClick( Mobile from )
		{
			if ( this != null )
			{
				base.OnDoubleClick(from);
				from.SendGump( new HouseBuildingGump() );
			}
			else
				return;
		}
		
		public HousebuildingSawFacingSouthAddon( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( 0 ); // Version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}

	public class HousebuildingSawFacingSouthAddonDeed : BaseAddonDeed
	{
		private AddonComponent ac;
		
		public override BaseAddon Addon
		{
			get
			{
				return new HousebuildingSawFacingSouthAddon();
			}
		}

		[Constructable]
		public HousebuildingSawFacingSouthAddonDeed()
		{
			Name = "HousebuildingSawFacingSouth";
		}

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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( 0 ); // Version
		}

		public override void	Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
}
 
Rosey1

Maybe remove:
Code:
     public override void OnDoubleClick( Mobile from )
        {
            if ( this != null )
            {
      [COLOR=sienna][B]base.OnDoubleClick(from);    <-- This Part.[/B][/COLOR]
       from.SendGump( new HouseBuildingGump() );
            }
            else
                return;
        }
This is very weird. It should work fine.
 

Rosey1

Wanderer
i have problems with the intrument bods. It won't fill them, it keeps saying that it's not the right object. Anyone else have that problem?
 
slayer1ss

Code:
ı have same problems wıth ınstrument bod s does anyone have a fıx or somethıng lıke that for thıs?
I don't have a fix yet. I just got done updating All spells and I have to work all weekend. :(
 

blueocean

Wanderer
Fix for Instruments Bod:

in Scripts/Engines/BulkOrders/SmallBOD.cs

change:

Code:
		public void EndCombine( Mobile from, object o )
		{
			if ( o is Item && ((Item)o).IsChildOf( from.Backpack ) )
			{
				Type objectType = o.GetType();

				if ( m_AmountCur >= m_AmountMax )
				{
					from.SendLocalizedMessage( 1045166 ); // The maximum amount of requested items have already been combined to this deed.
				}
				else if ( m_Type == null || (objectType != m_Type && !objectType.IsSubclassOf( m_Type )) || (!(o is BaseWeapon) && !(o is BaseArmor) && !(o is BaseClothing) && !(o is CBaseRanged) && !(o is BaseStaff) && !(o is BaseShield)) )
				{
					from.SendLocalizedMessage( 1045169 ); // The item is not in the request.
				}
				else
				{
					BulkMaterialType material = BulkMaterialType.None;

					if ( o is BaseArmor )
						material = GetMaterial( ((BaseArmor)o).Resource );
					else if ( o is BaseShoes )
						material = GetMaterial( ((BaseShoes)o).Resource );
					else if ( o is BaseWeapon )
						material = GetMaterial( ((BaseWeapon)o).Resource );
					else if ( o is CBaseRanged )
						material = GetMaterial( ((CBaseRanged)o).Resource );
					else if ( o is BaseStaff )
						material = GetMaterial( ((BaseStaff)o).Resource );
					else if ( o is BaseShield )
						material = GetMaterial( ((BaseShield)o).Resource );


					if ( m_Material >= BulkMaterialType.DullCopper && m_Material <= BulkMaterialType.OreN && material != m_Material )
					{
						from.SendLocalizedMessage( 1045168 ); // The item is not made from the requested ore.
					}
					else if ( m_Material >= BulkMaterialType.Spined && m_Material <= BulkMaterialType.LeatherK && material != m_Material )
					{
						from.SendLocalizedMessage( 1049352 ); // The item is not made from the requested leather type.
					}
					else if ( m_Material >= BulkMaterialType.LogB && m_Material <= BulkMaterialType.LogL && material != m_Material )
					{
						from.SendMessage( "The item is not made from the requested wood type." ); // The item is not made from the requested leather type.
					}
					else
					{
						bool isExceptional = false;

						if ( o is BaseWeapon )
							isExceptional = ( ((BaseWeapon)o).Quality == WeaponQuality.Exceptional );
						else if ( o is BaseArmor )
							isExceptional = ( ((BaseArmor)o).Quality == ArmorQuality.Exceptional );
						else if ( o is BaseClothing )
							isExceptional = ( ((BaseClothing)o).Quality == ClothingQuality.Exceptional );
						
						if ( m_RequireExceptional && !isExceptional )
						{
							from.SendLocalizedMessage( 1045167 ); // The item must be exceptional.
						}
						else
						{
							((Item)o).Delete();
							++AmountCur;

							from.SendLocalizedMessage( 1045170 ); // The item has been combined with the deed.

							from.SendGump( new SmallBODGump( from, this ) );

							if ( m_AmountCur < m_AmountMax )
								BeginCombine( from );
						}
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 1045158 ); // You must have the item in your backpack to target it.
			}
		}

to:

Code:
		public void EndCombine( Mobile from, object o )
		{
			if ( o is Item && ((Item)o).IsChildOf( from.Backpack ) )
			{
				Type objectType = o.GetType();

				if ( m_AmountCur >= m_AmountMax )
				{
					from.SendLocalizedMessage( 1045166 ); // The maximum amount of requested items have already been combined to this deed.
				}
				[b]else if ( m_Type == null || (objectType != m_Type && !objectType.IsSubclassOf( m_Type )) || (!(o is BaseWeapon) && !(o is BaseArmor) && !(o is BaseClothing) && !(o is CBaseRanged) && !(o is BaseStaff) && !(o is BaseShield) && !(o is BaseInstrument)) )[/b]
				{
					from.SendLocalizedMessage( 1045169 ); // The item is not in the request.
				}
				else
				{
					BulkMaterialType material = BulkMaterialType.None;

					if ( o is BaseArmor )
						material = GetMaterial( ((BaseArmor)o).Resource );
					else if ( o is BaseShoes )
						material = GetMaterial( ((BaseShoes)o).Resource );
					else if ( o is BaseWeapon )
						material = GetMaterial( ((BaseWeapon)o).Resource );
					else if ( o is CBaseRanged )
						material = GetMaterial( ((CBaseRanged)o).Resource );
					else if ( o is BaseStaff )
						material = GetMaterial( ((BaseStaff)o).Resource );
					else if ( o is BaseShield )
						material = GetMaterial( ((BaseShield)o).Resource );


					if ( m_Material >= BulkMaterialType.DullCopper && m_Material <= BulkMaterialType.OreN && material != m_Material )
					{
						from.SendLocalizedMessage( 1045168 ); // The item is not made from the requested ore.
					}
					else if ( m_Material >= BulkMaterialType.Spined && m_Material <= BulkMaterialType.LeatherK && material != m_Material )
					{
						from.SendLocalizedMessage( 1049352 ); // The item is not made from the requested leather type.
					}
					else if ( m_Material >= BulkMaterialType.LogB && m_Material <= BulkMaterialType.LogL && material != m_Material )
					{
						from.SendMessage( "The item is not made from the requested wood type." ); // The item is not made from the requested leather type.
					}
					else
					{
						bool isExceptional = false;

						if ( o is BaseWeapon )
							isExceptional = ( ((BaseWeapon)o).Quality == WeaponQuality.Exceptional );
						else if ( o is BaseArmor )
							isExceptional = ( ((BaseArmor)o).Quality == ArmorQuality.Exceptional );
						else if ( o is BaseClothing )
							isExceptional = ( ((BaseClothing)o).Quality == ClothingQuality.Exceptional );
						[b]else if ( o is BaseInstrument )
							isExceptional = ( ((BaseInstrument)o).Quality == InstrumentQuality.Exceptional );[/b]
						
						if ( m_RequireExceptional && !isExceptional )
						{
							from.SendLocalizedMessage( 1045167 ); // The item must be exceptional.
						}
						else
						{
							((Item)o).Delete();
							++AmountCur;

							from.SendLocalizedMessage( 1045170 ); // The item has been combined with the deed.

							from.SendGump( new SmallBODGump( from, this ) );

							if ( m_AmountCur < m_AmountMax )
								BeginCombine( from );
						}
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 1045158 ); // You must have the item in your backpack to target it.
			}
		}
 
Ok We All Understand That You Re A Busy Person So No Need To Hury We All Can Wait Right? ;)
Actually I wish I coulda gotten to it soon so you wouldn't have to wait, but not able to sry :(

Fix for Instruments Bod:

in Scripts/Engines/BulkOrders/SmallBOD.cs
Thanks BlueOcean. I will look over the system soon to see if I can make any improvements.
 

slayer1ss

Sorceror
today ı got a carp bod ıt was wrıtıng that ıt asked drump but when ı tryed addıng drum to bod ıt dıdnt accept ıt then ı props to bod and saw that ıt wants gnarled staff so ı assume there ıs somethıng wrong wıth clılocs... where and how can ı fıx thıs?
 
slayer1ss

Code:
today ı got a carp bod ıt was wrıtıng that ıt asked drump but when ı tryed addıng drum to bod ıt dıdnt accept ıt then ı props to bod and saw that ıt wants gnarled staff so ı assume there ıs somethıng wrong wıth clılocs... where and how can ı fıx thıs?
I wasn't able to duplicate that problem. I added a drum BOD and prop'd it and the type said: Drums.
 
Top