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!

Town Crates

Voran

Wanderer
Town Crates

Summary:
Crates for towns. Items spawn in them (single click and select "smurf it!" to edit what spawns), and every respawn they relock and re-trap

Description:
You can set the crates to be unlocked in [props - on the next respawn, they unlock and untrap. This is so you can change them into bookcases or barrels.
Stackables will not stack on spawn inside the crates.

Also included is a trapable containers script (not written by myself) that contains the full set of traps.

Installation:
Drop in custom folders.


**edit, 03/08/2004 18:43pm***
Here's the basic stealing.cs with town crate additions:
Code:
using System;
using Server;
using Server.Mobiles;
using Server.Targeting;
using Server.Items;
using Server.Network;
using System.Collections;


namespace Server.SkillHandlers
{
	public class Stealing
	{
		public static void Initialize()
		{
			SkillInfo.Table[33].Callback = new SkillUseCallback( OnUse );
		}

		public static readonly bool ClassicMode = false;
		public static readonly bool SuspendOnMurder = false;

		public static bool IsInGuild( Mobile m )
		{
			return ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild );
		}

		public static bool IsInnocentTo( Mobile from, Mobile to )
		{
			return ( Notoriety.Compute( from, (Mobile)to ) == Notoriety.Innocent );
		}

		private class StealingTarget : Target
		{
			private Mobile m_Thief;

			public StealingTarget( Mobile thief ) : base ( 1, false, TargetFlags.None )
			{
				m_Thief = thief;

				AllowNonlocal = true;
			}

			private Item TryStealItem( Item toSteal, ref bool caught )
			{
				
				Item stolen = null;

				object root = toSteal.RootParent;
 if(toSteal.Parent is TownCrate)
					{
					double w = toSteal.Weight + toSteal.TotalWeight;

					if ( w > 10 )
					{
						m_Thief.SendMessage( "That is too heavy to steal." );
					}
					else
					{
						if ( toSteal.Stackable && toSteal.Amount > 1 )
						{
							int amount = Utility.Random( 1, (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight) );

							if ( amount >= toSteal.Amount )
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * toSteal.Amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
									stolen = toSteal;
							}
							else
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
								{
									stolen = toSteal.Dupe( amount );
									toSteal.Amount -= amount;
								}
							}
						}
						else
						{
							int iw = (int)Math.Ceiling( w );
							iw *= 10;

							if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5 ) )
								stolen = toSteal;
						}

						if ( stolen != null )
						{
							stolen.Movable=true;
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
						}
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

						caught = ( m_Thief.Skills[SkillName.Stealing].Value < Utility.Random( 150 ) );
					}
					}
				else if ( root is Mobile && ((Mobile)root).Player && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005596 ); // You must be in the thieves guild to steal from other players.
				}
				else if ( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild( m_Thief ) && m_Thief.Kills > 0 )
				{
					m_Thief.SendLocalizedMessage( 502706 ); // You are currently suspended from the thieves guild.
				}
				else if ( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
				{
					m_Thief.SendLocalizedMessage( 1005598 ); // You can't steal from shopkeepers.
				}
				else if ( root is PlayerVendor )
				{
					m_Thief.SendLocalizedMessage( 502709 ); // You can't steal from vendors.
				}
				else if ( !m_Thief.CanSee( toSteal ) )
				{
					m_Thief.SendLocalizedMessage( 500237 ); // Target can not be seen.
				}
				else if ( !toSteal.Movable || toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed( root ) )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( !m_Thief.InRange( toSteal.GetWorldLocation(), 1 ) )
				{
					m_Thief.SendLocalizedMessage( 502703 ); // You must be standing next to an item to steal it.
				}
				else if ( toSteal.Parent is Mobile )
				{
					m_Thief.SendLocalizedMessage( 1005585 ); // You cannot steal items which are equiped.
				}
				else if ( root == m_Thief )
				{
					m_Thief.SendLocalizedMessage( 502704 ); // You catch yourself red-handed.
				}
				else if ( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( root is Mobile && !m_Thief.CanBeHarmful( (Mobile)root ) )
				{
				}
				else
				{
					double w = toSteal.Weight + toSteal.TotalWeight;

					if ( w > 10 )
					{
						m_Thief.SendMessage( "That is too heavy to steal." );
					}
					else
					{
						if ( toSteal.Stackable && toSteal.Amount > 1 )
						{
							int amount = Utility.Random( 1, (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight) );

							if ( amount >= toSteal.Amount )
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * toSteal.Amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
									stolen = toSteal;
							}
							else
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
								{
									stolen = toSteal.Dupe( amount );
									toSteal.Amount -= amount;
								}
							}
						}
						else
						{
							int iw = (int)Math.Ceiling( w );
							iw *= 10;

							if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5 ) )
								stolen = toSteal;
						}

						if ( stolen != null )
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

						caught = ( m_Thief.Skills[SkillName.Stealing].Value < Utility.Random( 150 ) );
					}
				}

				return stolen;
			}

			protected override void OnTarget( Mobile from, object target )
			{
				from.RevealingAction();

				Item stolen = null;
				object root = null;
				bool caught = false;

				if ( target is Item )
				{
					root = ((Item)target).RootParent;
					stolen = TryStealItem( (Item)target, ref caught );
				}
				else if ( target is Mobile )
				{
					Container pack = ((Mobile)target).Backpack;

					if ( pack != null && pack.Items.Count > 0 )
					{
						int randomIndex = Utility.Random( pack.Items.Count );

						root = target;
						stolen = TryStealItem( (Item) pack.Items[randomIndex], ref caught );
					}
				} 
				else 
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}

				if ( stolen != null )
					from.AddToBackpack( stolen );

				if ( caught )
				{
					if ( root == null )
					{
						m_Thief.CriminalAction( false );
					}
					else if ( root is Corpse && ((Corpse)root).IsCriminalAction( m_Thief ) )
					{
						m_Thief.CriminalAction( false );
					}
					else if ( root is Mobile )
					{
						Mobile mobRoot = (Mobile)root;

						if ( !IsInGuild( mobRoot ) && IsInnocentTo( m_Thief, mobRoot ) )
							m_Thief.CriminalAction( false );

						string message = String.Format( "You notice {0} trying to steal from {1}.", m_Thief.Name, mobRoot.Name );

						foreach ( NetState ns in m_Thief.GetClientsInRange( 8 ) )
						{
							if ( ns != m_Thief.NetState )
								ns.Mobile.SendMessage( message );
						}
					}
				}
				else if ( root is Corpse && ((Corpse)root).IsCriminalAction( m_Thief ) )
				{
					m_Thief.CriminalAction( false );
				}

				if ( root is Mobile && ((Mobile)root).Player && m_Thief is PlayerMobile && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( (Mobile)root ) )
				{
					PlayerMobile pm = (PlayerMobile)m_Thief;

					pm.PermaFlags.Add( (Mobile)root );
					pm.Delta( MobileDelta.Noto );
				}
			}
		}

		public static TimeSpan OnUse( Mobile m )
		{
			m.Target = new Stealing.StealingTarget( m );
			m.RevealingAction();

			m.SendLocalizedMessage( 502698 ); // Which item do you want to steal?

			return TimeSpan.FromSeconds( 10.0 );
		}
	}
}
 

Attachments

  • TownCrate.cs
    17.7 KB · Views: 504
  • TrapableContainer.cs
    5.4 KB · Views: 465
  • ChestSpawnEntry.cs
    500 bytes · Views: 705
  • TownChestGump.cs
    3.7 KB · Views: 450

TomC

Wanderer
I dropped those in to my custom folder, and I realized your modified trapablecontainers is a modified distro script.

Just a little note that one replaces /items/containers, and has about 20 lines or so different.

Thanks for the submission.


TomC
 

psz

Administrator
That's because, as the error CLEARLY says, you already have a trapable container script.
 

TomC

Wanderer
Oops. Thanks psz. You replied way too fast :)

Here is my error:

Code:
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\CUSTOM\TownCrate.cs: CS0246: (line 242, column 19) The type
 namespace name 'ChestSpawnEntry' could not be found (are you missing a using
rective or an assembly reference?)
 - Error: Scripts\CUSTOM\TownCrate.cs: CS0246: (line 616, column 18) The type
 namespace name 'ItemSpawnerType' could not be found (are you missing a using
rective or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
 

Voran

Wanderer
Hmm, looks like it may need the ItemSpawner. It's ben a while since I looked at the code.
I didn't write the Item Spawner, again I can't remember who did.
 

Attachments

  • ItemspawnerGump.cs
    3.7 KB · Views: 280
  • Itemspawner.cs
    15.9 KB · Views: 278
  • Itemspawnertype.cs
    270 bytes · Views: 261

batarex

Sorceror
can someone post the stealing.cs with the added code, i know it should be simple but i keep running into errors.
 
H

hudel

Guest
hmm,... I have the same problem. Can't modify the Stealing.cs. It seems i'm to stupid. Can someone post a modified stealing.cs please....
 

Phantom

Knight
batarex said:
can someone post the stealing.cs with the added code, i know it should be simple but i keep running into errors.

Simple answer: No

But we can help YOU fix your errors yourself.
 

Alatariel

Wanderer
Problems with 'ItemSpawnerType'

Voran said:
Hmm, looks like it may need the ItemSpawner. It's ben a while since I looked at the code.
I didn't write the Item Spawner, again I can't remember who did.

Fiddle and Futz as I may I cant seem to find the solution to these errors:

- Error: Scripts\Custom Scripts\Goodies\TownChests\TownCrate.cs: CS0246: (line 616, column 18) The type or namespace name 'ItemSpawnerType' could not be found
(are you missing a using directive or an assembly reference?)
- Error: Scripts\Custom Scripts\Goodies\TownChests\TownChestGump.cs: CS0246: (line 72, column 31) The type or namespace name 'ItemSpawnerType' could not be found (are you missing a using directive or an assembly reference?)
- Error: Scripts\Custom Scripts\Goodies\TownChests\ItemspawnerGump.cs: CS0246:(line 71, column 31) The type or namespace name 'ItemSpawnerType' could not be found (are you missing a using directive or an assembly reference?)
- Error: Scripts\Custom Scripts\Goodies\TownChests\Itemspawner.cs: CS0246: (line 349, column 22) The type or namespace name 'ItemSpawnerType' could not be found (are you missing a using directive or an assembly reference?)


*sigh* any suggestions?
 

Alatariel

Wanderer
but, I did install the ItemSpawer....

Dracarys said:
It tells you. You need the ItemSpawner files. Which are custom scripts.

I have downloaded and installed the ItemSpawner.cs and ItemSpawnerGump.cs. Could there be a conflict with another spawner type?
 

Alatariel

Wanderer
ItemSpawnerType

Alatariel said:
I have downloaded and installed the ItemSpawner.cs and ItemSpawnerGump.cs. Could there be a conflict with another spawner type?

Okay, I made an ItemSpawnerType.cs and 2 errors were fixed. Both the ItemSpawnerGump and the TownChestGump still aren't finding the ItemSpawnerType.cs -so my ItemSpawnerType.cs must be missing something? I've compared how the regular Spawner.cs works with the SpawnerType.cs but this has given me no clue. Can someone show me what I'm missing or direct to a clue that I might figure it out?
 

Voran

Wanderer
See, there is here an nincompoop - and it's me, oddly enough. I forgot to upload that ile from the original irtem spawner (it was hidden away in a different folder)
It's now with the item spawner, above.
 

Alatariel

Wanderer
comparing I find...

Alatariel said:
Okay, I made an ItemSpawnerType.cs and 2 errors were fixed. Both the ItemSpawnerGump and the TownChestGump still aren't finding the ItemSpawnerType.cs -so my ItemSpawnerType.cs must be missing something? I've compared how the regular Spawner.cs works with the SpawnerType.cs but this has given me no clue. Can someone show me what I'm missing or direct to a clue that I might figure it out?

My ItemSpawnerType.cs had Server.Mobiles where I needed to have Server.Items -Doh! Problem solved. Thxs Voran :)
 
H

hudel

Guest
I got the following error now:
- Error: Scripts\Test\Stealing.cs: CS 1525: (line 152, column 6) ; invalid expression term 'else'
- Error: Scripts\Test\Stealing.cs: CS 1002: (line 152, column 1) ; expected Scripts: one or more Scripts failed to compile or no script files where found.

can anybody help here?
 
H

hudel

Guest
Voran said:
Post your stealing.cs

Ok, I'll do so. Here it is. It inculdes the modifications that you wrote about on the start of this Thread:

Code:
using System;
using Server;
using Server.Mobiles;
using Server.Targeting;
using Server.Items;
using Server.Network;

namespace Server.SkillHandlers
{
	public class Stealing
	{
		public static void Initialize()
		{
			SkillInfo.Table[33].Callback = new SkillUseCallback( OnUse );
		}

		public static readonly bool ClassicMode = false;
		public static readonly bool SuspendOnMurder = false;

		public static bool IsInGuild( Mobile m )
		{
			return ( m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild );
		}

		public static bool IsInnocentTo( Mobile from, Mobile to )
		{
			return ( Notoriety.Compute( from, (Mobile)to ) == Notoriety.Innocent );
		}

		private class StealingTarget : Target
		{
			private Mobile m_Thief;

			public StealingTarget( Mobile thief ) : base ( 1, false, TargetFlags.None )
			{
				m_Thief = thief;

				AllowNonlocal = true;
			}

			private Item TryStealItem( Item toSteal, ref bool caught )
			{
				Item stolen = null;

				object root = toSteal.RootParent;

				if ( !IsEmptyHanded( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005584 ); // Both hands must be free to steal.
				}
				else if ( root is Mobile && ((Mobile)root).Player && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( m_Thief ) )
				{
					m_Thief.SendLocalizedMessage( 1005596 ); // You must be in the thieves guild to steal from other players.
				}
				else if ( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild( m_Thief ) && m_Thief.Kills > 0 )
				{
					m_Thief.SendLocalizedMessage( 502706 ); // You are currently suspended from the thieves guild.
				}
				else if ( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
				{
					m_Thief.SendLocalizedMessage( 1005598 ); // You can't steal from shopkeepers.
				}
				else if ( root is PlayerVendor )
				{
					m_Thief.SendLocalizedMessage( 502709 ); // You can't steal from vendors.
				}
				else if ( !m_Thief.CanSee( toSteal ) )
				{
					m_Thief.SendLocalizedMessage( 500237 ); // Target can not be seen.
				}
				else if ( toSteal.Parent == null || !toSteal.Movable || toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed( root ) )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( !m_Thief.InRange( toSteal.GetWorldLocation(), 1 ) )
				{
					m_Thief.SendLocalizedMessage( 502703 ); // You must be standing next to an item to steal it.
				}
				else if ( toSteal.Parent is Mobile )
				{
					m_Thief.SendLocalizedMessage( 1005585 ); // You cannot steal items which are equiped.
				}
				else if ( root == m_Thief )
				{
					m_Thief.SendLocalizedMessage( 502704 ); // You catch yourself red-handed.
				}
				else if ( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}
				else if ( root is Mobile && !m_Thief.CanBeHarmful( (Mobile)root ) )
				{
				}
				else
				{
					double w = toSteal.Weight + toSteal.TotalWeight;

					if ( w > 10 )
					{
						m_Thief.SendMessage( "That is too heavy to steal." );
					}
					else
					{
						if ( toSteal.Stackable && toSteal.Amount > 1 )
						{
							int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

							if ( maxAmount < 1 )
								maxAmount = 1;
							else if ( maxAmount > toSteal.Amount )
								maxAmount = toSteal.Amount;

							int amount = Utility.RandomMinMax( 1, maxAmount );

							if ( amount >= toSteal.Amount )
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * toSteal.Amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
									stolen = toSteal;
							}
							else
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
								{
									stolen = toSteal.Dupe( amount );
									toSteal.Amount -= amount;
								}
							}
						}
						else
						{
							int iw = (int)Math.Ceiling( w );
							iw *= 10;

							if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5 ) )
								stolen = toSteal;
						}

						if ( stolen != null )
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

						caught = ( m_Thief.Skills[SkillName.Stealing].Value < Utility.Random( 150 ) );
					}
//Mod. Start
else if(toSteal.Parent is TownCrate)
					{
					double w = toSteal.Weight + toSteal.TotalWeight;

					if ( w > 10 )
					{
						m_Thief.SendMessage( "That is too heavy to steal." );
					}
					else
					{
						if ( toSteal.Stackable && toSteal.Amount > 1 )
						{
							int amount = Utility.Random( 1, (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight) );

							if ( amount >= toSteal.Amount )
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * toSteal.Amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
									stolen = toSteal;
							}
							else
							{
								int pileWeight = (int)Math.Ceiling( toSteal.Weight * amount );
								pileWeight *= 10;

								if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5 ) )
								{
									stolen = toSteal.Dupe( amount );
									toSteal.Amount -= amount;
								}
							}
						}
						else
						{
							int iw = (int)Math.Ceiling( w );
							iw *= 10;

							if ( m_Thief.CheckTargetSkill( SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5 ) )
								stolen = toSteal;
						}

						if ( stolen != null )
						{
							stolen.Movable=true;
							m_Thief.SendLocalizedMessage( 502724 ); // You succesfully steal the item.
						}
						else
							m_Thief.SendLocalizedMessage( 502723 ); // You fail to steal the item.

						caught = ( m_Thief.Skills[SkillName.Stealing].Value < Utility.Random( 150 ) );
					}
					}
//Mod. End

				}

				return stolen;
			}

			protected override void OnTarget( Mobile from, object target )
			{
				from.RevealingAction();

				Item stolen = null;
				object root = null;
				bool caught = false;

				if ( target is Item )
				{
					root = ((Item)target).RootParent;
					stolen = TryStealItem( (Item)target, ref caught );
				} 
				else if ( target is Mobile )
				{
					Container pack = ((Mobile)target).Backpack;

					if ( pack != null && pack.Items.Count > 0 )
					{
						int randomIndex = Utility.Random( pack.Items.Count );

						root = target;
						stolen = TryStealItem( (Item) pack.Items[randomIndex], ref caught );
					}
				} 
				else 
				{
					m_Thief.SendLocalizedMessage( 502710 ); // You can't steal that!
				}

				if ( stolen != null )
					from.AddToBackpack( stolen );

				if ( caught )
				{
					if ( root == null )
					{
						m_Thief.CriminalAction( false );
					}
					else if ( root is Corpse && ((Corpse)root).IsCriminalAction( m_Thief ) )
					{
						m_Thief.CriminalAction( false );
					}
					else if ( root is Mobile )
					{
						Mobile mobRoot = (Mobile)root;

						if ( !IsInGuild( mobRoot ) && IsInnocentTo( m_Thief, mobRoot ) )
							m_Thief.CriminalAction( false );

						string message = String.Format( "You notice {0} trying to steal from {1}.", m_Thief.Name, mobRoot.Name );

						foreach ( NetState ns in m_Thief.GetClientsInRange( 8 ) )
						{
							if ( ns != m_Thief.NetState )
								ns.Mobile.SendMessage( message );
						}
					}
				}
				else if ( root is Corpse && ((Corpse)root).IsCriminalAction( m_Thief ) )
				{
					m_Thief.CriminalAction( false );
				}

				if ( root is Mobile && ((Mobile)root).Player && m_Thief is PlayerMobile && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( (Mobile)root ) )
				{
					PlayerMobile pm = (PlayerMobile)m_Thief;

					pm.PermaFlags.Add( (Mobile)root );
					pm.Delta( MobileDelta.Noto );
				}
			}
		}

		public static bool IsEmptyHanded( Mobile from )
		{
			if ( from.FindItemOnLayer( Layer.OneHanded ) != null )
				return false;

			if ( from.FindItemOnLayer( Layer.TwoHanded ) != null )
				return false;

			return true;
		}

		public static TimeSpan OnUse( Mobile m )
		{
			if ( !IsEmptyHanded( m ) )
			{
				m.SendLocalizedMessage( 1005584 ); // Both hands must be free to steal.
			}
			else
			{
				m.Target = new Stealing.StealingTarget( m );
				m.RevealingAction();

				m.SendLocalizedMessage( 502698 ); // Which item do you want to steal?
			}

			return TimeSpan.FromSeconds( 10.0 );
		}
	}
}
 
A

AdminX

Guest
anyone ever get this stealing script to work.. i try to fix 1 error and i get 4 more.. ahhhh figured it out.. the top 5 lines of the modified script should be changed to this...

Code:
				if (toSteal.Parent is TownCrate)
					{
					double wa = toSteal.Weight + toSteal.TotalWeight;

					if ( wa > 10 )


the "w" was alrdy in use in the script. and else if.. should have been just if
 

Rogue

Wanderer
Only Admins can use the "Smruf it"

I have these crates on my shard and cannot seem to get the Game Masters to be able to use the "Smurf it" command on these crates. They can place them- but they cannot spawn items in them? Anyone have any hints how to fix this? Thanks in advance.
 
Top