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
Sasha_S said:
Voran U should post the Stealing.cs u did for me since i was to slow to figure it out hehe cause It works OMG good 0 errors n items are total stealable! :p :p ur a god!!! :p :p :eek:
Hehe, thanks :)
That's the one I added to the first page of this post ;)
 

Voran

Wanderer
Gandy897 said:
OK, my stealing script is non distro and im still having a few problems. Other then not being able to steal the items from the containers its working fine :) lol
Ill post it perhaps someone can take a look and tell me where I'm going wrong ??

PHP:
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;

   	    			BaseRare rarezor = toSteal as BaseRare;

    	    			BaseRareCont rarezorcont = toSteal as BaseRareCont;

    	    			TitansHammerRare rarezorweap = toSteal as TitansHammerRare;
    	    			ZyronicClawRare rarezorweap2 = toSteal as ZyronicClawRare;
    	    			BladeOfTheRighteousRare rarezorweap3 = toSteal as BladeOfTheRighteousRare;

    	    			InquisitorsResolutionRare rarezorarm = toSteal as InquisitorsResolutionRare;

            			if( rarezorarm !=null && rarezorarm.m_Stealable==true ) 
            			{  
                			if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                			{ 

                				if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 105.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 35 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorarm.Movable=true; 
                        					rarezorarm.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 104.9 && m_Thief.Skills[SkillName.Stealing].Value < 110.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 55 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorarm.Movable=true; 
                        					rarezorarm.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 109.9 && m_Thief.Skills[SkillName.Stealing].Value < 115.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 65 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorarm.Movable=true; 
                        					rarezorarm.m_Stealable=false; 
                        					stolen = toSteal; 
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 114.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 85 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorarm.Movable=true; 
                        					rarezorarm.m_Stealable=false; 
                        					stolen = toSteal;
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 119.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                				{
                 					rarezorarm.Movable=true; 
                        				rarezorarm.m_Stealable=false; 
                        				stolen = toSteal;

                				}
					}
					else
					{
						m_Thief.SendMessage( 1103, "You must have 100.0 or more to steal that item." );
					}


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

	    			}

            			else if( rarezorweap3 !=null && rarezorweap3.m_Stealable==true ) 
            			{  
                			if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                			{ 

                				if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 105.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 35 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap3.Movable=true; 
                        					rarezorweap3.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 104.9 && m_Thief.Skills[SkillName.Stealing].Value < 110.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 55 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap3.Movable=true; 
                        					rarezorweap3.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 109.9 && m_Thief.Skills[SkillName.Stealing].Value < 115.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 65 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap3.Movable=true; 
                        					rarezorweap3.m_Stealable=false; 
                        					stolen = toSteal; 
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 114.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 85 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap3.Movable=true; 
                        					rarezorweap3.m_Stealable=false; 
                        					stolen = toSteal;
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 119.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                				{
                 					rarezorweap3.Movable=true; 
                        				rarezorweap3.m_Stealable=false; 
                        				stolen = toSteal;

                				}
					}
					else
					{
						m_Thief.SendMessage( 1103, "You must have 100.0 or more to steal that item." );
					}


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

	    			}

            			else if( rarezorweap2 !=null && rarezorweap2.m_Stealable==true ) 
            			{  
                			if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                			{ 

                				if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 105.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 35 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap2.Movable=true; 
                        					rarezorweap2.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 104.9 && m_Thief.Skills[SkillName.Stealing].Value < 110.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 55 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap2.Movable=true; 
                        					rarezorweap2.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 109.9 && m_Thief.Skills[SkillName.Stealing].Value < 115.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 65 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap2.Movable=true; 
                        					rarezorweap2.m_Stealable=false; 
                        					stolen = toSteal; 
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 114.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 85 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap2.Movable=true; 
                        					rarezorweap2.m_Stealable=false; 
                        					stolen = toSteal;
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 119.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                				{
                 					rarezorweap2.Movable=true; 
                        				rarezorweap2.m_Stealable=false; 
                        				stolen = toSteal;

                				}
					}
					else
					{
						m_Thief.SendMessage( 1103, "You must have 100.0 or more to steal that item." );
					}


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

	    			}

            			else if( rarezorweap !=null && rarezorweap.m_Stealable==true ) 
            			{  
                			if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                			{ 

                				if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 105.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 35 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap.Movable=true; 
                        					rarezorweap.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 104.9 && m_Thief.Skills[SkillName.Stealing].Value < 110.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 55 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap.Movable=true; 
                        					rarezorweap.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 109.9 && m_Thief.Skills[SkillName.Stealing].Value < 115.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 65 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap.Movable=true; 
                        					rarezorweap.m_Stealable=false; 
                        					stolen = toSteal; 
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 114.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 85 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorweap.Movable=true; 
                        					rarezorweap.m_Stealable=false; 
                        					stolen = toSteal;
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 119.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                				{
                 					rarezorweap.Movable=true; 
                        				rarezorweap.m_Stealable=false; 
                        				stolen = toSteal;

                				}
					}
					else
					{
						m_Thief.SendMessage( 1103, "You must have 100.0 or more to steal that item." );
					}


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

	    			}
  
            			else if( rarezor !=null && rarezor.m_Stealable==true ) 
            			{  
                			if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                			{ 

                				if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 105.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 35 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezor.Movable=true; 
                        					rarezor.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 104.9 && m_Thief.Skills[SkillName.Stealing].Value < 110.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 55 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezor.Movable=true; 
                        					rarezor.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 109.9 && m_Thief.Skills[SkillName.Stealing].Value < 115.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 65 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezor.Movable=true; 
                        					rarezor.m_Stealable=false; 
                        					stolen = toSteal; 
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 114.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 85 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezor.Movable=true; 
                        					rarezor.m_Stealable=false; 
                        					stolen = toSteal;
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 119.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                				{
                 					rarezor.Movable=true; 
                        				rarezor.m_Stealable=false; 
                        				stolen = toSteal;

                				}
					}
					else
					{
						m_Thief.SendMessage( 1103, "You must have 100.0 or more to steal that item." );
					}


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

	    			}

            			else if( rarezorcont !=null && rarezorcont.m_Stealable==true ) 
            			{ 

                			if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                			{ 


                				if ( m_Thief.Skills[SkillName.Stealing].Value > 99.9 && m_Thief.Skills[SkillName.Stealing].Value < 105.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 35 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorcont.Movable=true; 
                        					rarezorcont.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 104.9 && m_Thief.Skills[SkillName.Stealing].Value < 110.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 55 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorcont.Movable=true; 
                        					rarezorcont.m_Stealable=false; 
                        					stolen = toSteal;
								break; 
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 109.9 && m_Thief.Skills[SkillName.Stealing].Value < 115.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 65 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorcont.Movable=true; 
                        					rarezorcont.m_Stealable=false; 
                        					stolen = toSteal; 
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 114.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.0 ) 
                				{ 

							if( Utility.Random( 100 ) < 85 ) 
							switch ( Utility.Random( 1 )) 
							{ 
								case 0:
                 						rarezorcont.Movable=true; 
                        					rarezorcont.m_Stealable=false; 
                        					stolen = toSteal;
								break;
							}
							else
							{
							}

                				}
                				if ( m_Thief.Skills[SkillName.Stealing].Value > 119.9 && m_Thief.Skills[SkillName.Stealing].Value < 120.1 ) 
                				{
                 					rarezorcont.Movable=true; 
                        				rarezorcont.m_Stealable=false; 
                        				stolen = toSteal;

                				}
					}
					else
					{
						m_Thief.SendMessage( 1103, "You must have 100.0 or more to steal that item." );
					}


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

            			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 ) );
                                                          
                                             }
                                                          

                                                          
                         //mod begin

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

					if ( wa > 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 ) );
					}
					}

                                                          
                          //end mod
                                                          
                                                          
                                                          

                                                          
                                                          
                                                          
                                                          
                                                          
                                                          
                                                          


            			} 

            			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 ); 
      		} 
	} 
}

also note that Im using wa and not w cause if i use w it says that variable is already in use elsewhere , but with wa it seems to work as far as loading up at least
The easiest way is to just copy the town crate stealing section from my stealing.cs, and paste it as the first entry in the stelaing checks.
 

Gandy897

Wanderer
I have copied your modifications into my stealing script and thats the problem , for some reason they are not working for me . If anyone could plz look at where i noted in the above posting begin mod and end mod.. that was copied and pasted directly from the stealing script modifications that you showed.. However for me it doesnt appear to be working.. Is there something wrong with where I placed it or something I dont know :( :(
 

Voran

Wanderer
I can't even see where you've placed it.
You need to put it here, right before the doom arti stuff:
Code:
private Item TryStealItem( Item toSteal, ref bool caught ) 
                 { 
                Item stolen = null; 
//JUST HERE
 

Sasha_S

Wanderer
ack bad

umm yeah I downloaded the doom arti spawner hehe n omg i removed it lol id rather have town crates n just make the artis spawn on a spawner n be takeable instead of stealable :p
 

madraph

Wanderer
errors

:eek: Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
- Error: Scripts\Custom\TrapableContainer.cs: CS0101: (line 5, column 17) The n
amespace 'Server.Items' already contains a definition for 'TrapType'
- Error: Scripts\Custom\TrapableContainer.cs: CS0101: (line 14, column 27) The
namespace 'Server.Items' already contains a definition for 'TrapableContainer'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

madraph

Wanderer
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
- Error: Scripts\Custom\TrapableContainer.cs: CS0101: (line 5, column 17) The n
amespace 'Server.Items' already contains a definition for 'TrapType'
- Error: Scripts\Custom\TrapableContainer.cs: CS0101: (line 14, column 27) The
namespace 'Server.Items' already contains a definition for 'TrapableContainer'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

madraph

Wanderer
namespace 'Server.Items' already contains a definition for 'TrapableContainer'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
r
Scripts: Compiling C# scripts...failed (6 errors, 2 warnings)
- Warning: Scripts\Custom\Neruns Distro\Scripts\Scripts\Customs\New\Commands\Sp
awnEditor.cs: CS0162: (line 548, column 6) Unreachable code detected
- Warning: Scripts\Custom\Neruns Distro\Scripts\Scripts\Customs\New\Commands\Sp
awnEditor.cs: CS0219: (line 614, column 10) The variable 'check' is assigned but
its value is never used
- Error: Scripts\Custom\TownCrate.cs: CS0117: (line 198, column 36) 'Server.Ite
ms.TrapType' does not contain a definition for 'DartTrap'
- Error: Scripts\Custom\TownCrate.cs: CS0117: (line 206, column 36) 'Server.Ite
ms.TrapType' does not contain a definition for 'PoisonTrap'
- Error: Scripts\Custom\TownCrate.cs: CS0117: (line 311, column 36) 'Server.Ite
ms.TrapType' does not contain a definition for 'DartTrap'
- Error: Scripts\Custom\TownCrate.cs: CS0117: (line 319, column 36) 'Server.Ite
ms.TrapType' does not contain a definition for 'PoisonTrap'
- Error: Scripts\Custom\TownCrate.cs: CS0117: (line 347, column 36) 'Server.Ite
ms.TrapType' does not contain a definition for 'DartTrap'
- Error: Scripts\Custom\TownCrate.cs: CS0117: (line 355, column 36) 'Server.Ite
ms.TrapType' does not contain a definition for 'PoisonTrap'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Gandy897

Wanderer
Voran said:
I can't even see where you've placed it.
You need to put it here, right before the doom arti stuff:
Code:
private Item TryStealItem( Item toSteal, ref bool caught ) 
                 { 
                Item stolen = null; 
//JUST HERE


Sorry I was away in LA a this last week .. Ill try that Voran and see how it goes thnx much :)
 

koluch

Sorceror
Simple Question(it is early, *yawn*)

When I smurf the crate it spawns just one on the list of items.
How can I have it spawn more than one?

**looking again at item spawner.cs

Thanks!

Shazzy
(very nice script by the by!)
 

Jack Hole

Wanderer
....Forgive my ignorance.

I know this thread is rather old, but I am trying to load the towncrates onto my shard. Everything works fine except I can not steal anything from the chests. I know there is a modified stealing.cs but I already have a modified stealing.cs and am unaware how to merge the two. Could someone crop me the modified stealing.cs to the bare min. required for townchests?

I have a stealing.cs that allows players to steal doom items, but would like to be able to steal both.


Anyhelp is appreciated.

Thanks in advance..
JH

*Edit:
Nevermind, I've figured it out! :D
 
Top