Example #1
0
		public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
		{
			if ( m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving )
				return false;

			return base.OnDragDropInto( from, item, p );
		}
Example #2
0
		public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
		{
			if ( m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving )
				return false;

			return base.CheckLift( from, item, ref reject );
		}
Example #3
0
		public override bool CheckItemUse( Mobile from, Item item )
		{
			if ( item != this && (m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving) )
				return false;

			return base.CheckItemUse( from, item );
		}
Example #4
0
        public override bool CheckItemUse(Mobile from, Item item)
        {
            if (IsDecoContainer && item is BaseBook)
                return true;

            return base.CheckItemUse(from, item);
        }
Example #5
0
		public override bool OnDragDrop(Mobile from, Item dropped)
		{
			// trigger returns true if returnoverride
			if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) &&
				UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped))
			{
				return true;
			}
			var player = from as PlayerMobile;

			if (player != null)
			{
				QuestSystem qs = player.Quest;

				if (qs is TheSummoningQuest)
				{
					if (dropped is DaemonBone)
					{
						var bones = (DaemonBone)dropped;

						QuestObjective obj = qs.FindObjective(typeof(CollectBonesObjective));

						if (obj != null && !obj.Completed)
						{
							int need = obj.MaxProgress - obj.CurProgress;

							if (bones.Amount < need)
							{
								obj.CurProgress += bones.Amount;
								bones.Delete();

								qs.ShowQuestLogUpdated();
							}
							else
							{
								obj.Complete();
								bones.Consume(need);

								if (!bones.Deleted)
								{
									// TODO: Accurate?
									SayTo(from, 1050038);
										// You have already given me all the Daemon bones necessary to weave the spell.  Keep these for a later time.
								}
							}
						}
						else
						{
							// TODO: Accurate?
							SayTo(from, 1050038);
								// You have already given me all the Daemon bones necessary to weave the spell.  Keep these for a later time.
						}

						return false;
					}
				}
			}

			return base.OnDragDrop(from, dropped);
		}
		public GuildTeleporter( Item stone ) : base( 0x1869 )
		{
			Weight = 1.0;
			LootType = LootType.Blessed;

			m_Stone = stone;
		}
Example #7
0
		public static void Resurrect(Mobile m, Item item)
		{
			if (m.Alive)
			{
				return;
			}

			if (!m.InRange(item.GetWorldLocation(), ResurrectRange))
			{
				m.SendLocalizedMessage(500446); // That is too far away.
			}
			else if (m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
			{
				m.CloseGump(typeof(ResurrectGump));

				/*PlayerMobile pres = m as PlayerMobile;

				if (pres.MurderBounty > 0)
					m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
				else*/
				m.SendGump(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
			}
			else
			{
				m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
			}
		}
Example #8
0
		public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
		{
			if ( !CheckHold( from, dropped, sendFullMessage, true ) )
				return false;

			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsLockedDown( this ) )
			{
				if ( !house.LockDown( from, dropped, false ) )
					return false;
			}

			List<Item> list = this.Items;

			for ( int i = 0; i < list.Count; ++i )
			{
				Item item = list[i];

				if ( !(item is Container) && item.StackWith( from, dropped, false ) )
					return true;
			}

			DropItem( dropped );

			return true;
		}
Example #9
0
		public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
		{
			if ( IsSecure && !BaseHouse.CheckHold( m, this, item, message, checkItems, plusItems, plusWeight ) )
				return false;

			return base.CheckHold( m, item, message, checkItems, plusItems, plusWeight );
		}
Example #10
0
		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return;
			}
			else if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
			{
				from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
				return;
			}

			from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
Example #11
0
		public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
		{
			if ( !CheckHold( from, dropped, sendFullMessage, true ) )
				return false;

			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsLockedDown( this ) )
			{
				if ( dropped is VendorRentalContract || ( dropped is Container && ((Container)dropped).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
				{
					from.SendLocalizedMessage( 1062492 ); // You cannot place a rental contract in a locked down container.
					return false;
				}

				if ( !house.LockDown( from, dropped, false ) )
					return false;
			}

			List<Item> list = this.Items;

			for ( int i = 0; i < list.Count; ++i )
			{
				Item item = list[i];

				if ( !(item is Container) && item.StackWith( from, dropped, false ) )
					return true;
			}

			DropItem( dropped );

			return true;
		}
Example #12
0
		public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
		{
//			if ( this.IsSecure )
//				return false;

			return base.CheckHold( m, item, message, checkItems, plusItems, plusWeight );
		}
Example #13
0
		public override void OnSubItemAdded(Item item)
		{
			if (!(item is VirtualCheck))
			{
				ClearChecks();
			}
		}
Example #14
0
		public HarvestTarget( Item tool, HarvestSystem system ) : base( -1, true, TargetFlags.None )
		{
			m_Tool = tool;
			m_System = system;

			DisallowMultis = true;
		}
Example #15
0
		public override bool CheckItemUse( Mobile from, Item item )
		{
			if ( item != this )
				return false;

			return base.CheckItemUse( from, item );
		}
Example #16
0
		public override void OnItemRemoved(Item item)
		{
			if (!(item is VirtualCheck))
			{
				ClearChecks();
			}
		}
Example #17
0
        public ResurrectGump(Mobile owner, Mobile healer, Item shrine, ResurrectMessage msg, bool fromSacrifice, double hitsScalar)
            : base(100, 0)
        {
            m_Healer = healer;
            m_Shrine = shrine;
            m_FromSacrifice = fromSacrifice;
            m_HitsScalar = hitsScalar;

            AddPage(0);

            AddBackground(0, 0, 400, 350, 2600);

            AddHtmlLocalized(0, 20, 400, 35, 1011022, false, false); // <center>Resurrection</center>

            AddHtmlLocalized(50, 55, 300, 140, 1011023 + (int)msg, true, true); /* It is possible for you to be resurrected here by this healer. Do you wish to try?<br>
																				   * CONTINUE - You chose to try to come back to life now.<br>
																				   * CANCEL - You prefer to remain a ghost for now.
																				   */

            AddButton(200, 227, 4005, 4007, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(235, 230, 110, 35, 1011012, false, false); // CANCEL

            AddButton(65, 227, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(100, 230, 110, 35, 1011011, false, false); // CONTINUE
        }
Example #18
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			PlayerMobile player = from as PlayerMobile;

			if ( player != null )
			{
				QuestSystem qs = player.Quest;

				if ( qs is EminosUndertakingQuest )
				{
					if ( dropped is NoteForZoel )
					{
						QuestObjective obj = qs.FindObjective( typeof( GiveZoelNoteObjective ) );

						if ( obj != null && !obj.Completed )
						{
							dropped.Delete();
							obj.Complete();
							return true;
						}
					}
				}
			}

			return base.OnDragDrop( from, dropped );
		}
Example #19
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (Transport == null || !Transport.IsOnBoard(from) || Transport.IsMoving)
                return false;

            return base.CheckLift(from, item, ref reject);
        }
		public override void DropItem( Item dropped )
		{
			if( !dropped.EventItem )
				base.DropItem( dropped );
			else
				dropped.Delete();
		}
Example #21
0
		private void AddItem( Mobile from, int x, int y, int z, Item item, bool vis )
		{
			item.Visible = vis;
			item.MoveToWorld( new Point3D( from.Location.X + x, from.Location.Y + y, from.Location.Z + z ), from.Map );

			m_Components.Add( item );
		}
Example #22
0
        public override bool CheckItemUse(Mobile from, Item item)
        {
            if (item != this && (Transport == null || !Transport.IsOnBoard(from) || Transport.IsMoving))
                return false;

            return base.CheckItemUse(from, item);
        }
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( Addon != null )
				return Addon.OnDragDrop( from, dropped );

			return false;
		}
Example #24
0
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (Transport == null || !Transport.IsOnBoard(from) || Transport.IsMoving)
                return false;

            return base.OnDragDropInto(from, item, p);
        }
Example #25
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( !this.IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
				return false;
			}

			Key key = dropped as Key;

			if ( key == null || key.KeyValue == 0 )
			{
				from.SendLocalizedMessage( 501689 ); // Only non-blank keys can be put on a keyring.
				return false;
			}
			else if ( this.Keys.Count >= MaxKeys )
			{
				from.SendLocalizedMessage( 1008138 ); // This keyring is full.
				return false;
			}
			else
			{
				Add( key );
				from.SendLocalizedMessage( 501691 ); // You put the key on the keyring.
				return true;
			}
		}
Example #26
0
public override bool OnDragDrop( Mobile from, Item dropped ){               Mobile m = from;PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null)
{
///////////item to be dropped
if( dropped is RadioactiveAcid ){
if (dropped.Amount<30)
{
    PrivateOverheadMessage( MessageType.Regular, 1153, false, "Please return with the correct amount.", mobile.NetState );return false;
}

if (dropped.Amount>30)
mobile.AddToBackpack( new RadioactiveAcid( (dropped.Amount-30) ) );

dropped.Delete();

///////////the reward
mobile.AddToBackpack( new Gold( 5000 ) );
if (0.20>Utility.RandomDouble())
mobile.AddToBackpack( new RadioactiveGloves( ) );//replace this

///////////thanks message
PrivateOverheadMessage( MessageType.Regular, 1153, false, "Appreciate the help!!", mobile.NetState );


return true;}
    if ( dropped is Whip){PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );return false;}
    PrivateOverheadMessage( MessageType.Regular, 1153, false,"I have no need for this...", mobile.NetState );
}
    return false;}}}
Example #27
0
			public ResurrectEntry( Mobile mobile, Item item ) : base( 6195, ResurrectRange )
			{
				m_Mobile = mobile;
				m_Item = item;

				Enabled = !m_Mobile.Alive;
			}
Example #28
0
            private void DismantleItem(Mobile from, Item item)
            {
                if (!from.InRange(item.GetWorldLocation(), 2))
                {
                    from.SendMessage("You need to be closer to it.");
                    return;
                }
                else if (!item.IsChildOf(from.Backpack) && !item.Movable)
                {
                    from.SendMessage("It can't be dismantled.");
                    return;
                }

                from.SendMessage("You dismantle the object.");
                Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x3B3);

                if (item is Container)
                {
                    if (item is TrapableContainer)
                        (item as TrapableContainer).ExecuteTrap(from);

                    ((Container)item).Destroy();
                }
                else
                {
                    item.Delete();
                }
            }
Example #29
0
		public static void Resurrect( Mobile m, Item item )
		{
            if ( m.InRange(item, 2) && m.InLOS(item))
            {
                if (!m.Alive)
                {
                    if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
                    {
                        m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                    }
                    else if (m.Region is HouseRegion)
                    {
                        m.SendAsciiMessage("You can't get resurrected in house regions.");
                    }
                    else
                    {
                        m.PlaySound(0x214);
                        m.FixedEffect(0x376A, 10, 16);

                        m.Resurrect();

                        //m.CloseGump(typeof(ResurrectGump));
                        //m.SendGump(new ResurrectGump(m, item, ResurrectMessage.VirtueShrine));
                    }
                }
            }
            else
            {
                m.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
            }	
        }
Example #30
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			PlayerMobile player = from as PlayerMobile;

			if ( player != null )
			{
				QuestSystem qs = player.Quest;

				if ( qs is HaochisTrialsQuest )
				{
					QuestObjective obj = qs.FindObjective( typeof( FourthTrialCatsObjective ) );

					if ( obj != null && !obj.Completed )
					{
						Gold gold = dropped as Gold;

						if ( gold != null )
						{
							obj.Complete();
							qs.AddObjective( new FourthTrialReturnObjective( false ) );

							SayTo( from, 1063241 ); // I thank thee.  This gold will be a great help to me and mine!

							gold.Consume(); // Intentional difference from OSI: don't take all the gold of poor newbies!
							return gold.Deleted;
						}
					}
				}
			}

			return base.OnDragDrop( from, dropped );
		}
Example #31
0
		public static void SetStealable(Item target, bool value)
		{
            if(target != null)
		        target.SetSavedFlag( StealableFlag, value);
		}
Example #32
0
        public override bool OnEquip(Mobile from)
        {
            Item glove = from.FindItemOnLayer(Layer.Gloves);
            Item pants = from.FindItemOnLayer(Layer.Pants);
            Item neck  = from.FindItemOnLayer(Layer.Neck);
            Item helm  = from.FindItemOnLayer(Layer.Helm);
            Item arms  = from.FindItemOnLayer(Layer.Arms);

            if (glove != null && glove.GetType() == typeof(MyrmidonGloves) && pants != null && pants.GetType() == typeof(MyrmidonLegs) && neck != null && neck.GetType() == typeof(MyrmidonGorget) && helm != null && helm.GetType() == typeof(MyrmidonHelm) && arms != null && arms.GetType() == typeof(MyrmidonArms))
            {
                Effects.PlaySound(from.Location, from.Map, 503);
                from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);

                Hue = 0x2CA;
                ArmorAttributes.SelfRepair = 3;
                Attributes.NightSight      = 1;
                Attributes.Luck            = 500;
                PhysicalBonus = 3;
                FireBonus     = 3;
                ColdBonus     = 3;
                PoisonBonus   = 3;
                EnergyBonus   = 3;


                MyrmidonGloves gloves = from.FindItemOnLayer(Layer.Gloves) as MyrmidonGloves;
                MyrmidonLegs   legs   = from.FindItemOnLayer(Layer.Pants) as MyrmidonLegs;
                MyrmidonGorget gorget = from.FindItemOnLayer(Layer.Neck) as MyrmidonGorget;
                MyrmidonHelm   helmet = from.FindItemOnLayer(Layer.Helm) as MyrmidonHelm;
                MyrmidonArms   arm    = from.FindItemOnLayer(Layer.Arms) as MyrmidonArms;

                gloves.Hue = 0x2CA;
                gloves.ArmorAttributes.SelfRepair = 3;
                gloves.PhysicalBonus = 3;
                gloves.FireBonus     = 3;
                gloves.ColdBonus     = 3;
                gloves.PoisonBonus   = 3;
                gloves.EnergyBonus   = 3;

                legs.Hue = 0x2CA;
                legs.ArmorAttributes.SelfRepair = 3;
                legs.PhysicalBonus = 3;
                legs.FireBonus     = 3;
                legs.ColdBonus     = 3;
                legs.PoisonBonus   = 3;
                legs.EnergyBonus   = 3;

                gorget.Hue = 0x2CA;
                gorget.ArmorAttributes.SelfRepair = 3;
                gorget.PhysicalBonus = 3;
                gorget.FireBonus     = 3;
                gorget.ColdBonus     = 3;
                gorget.PoisonBonus   = 3;
                gorget.EnergyBonus   = 3;

                helmet.Hue = 0x2CA;
                helmet.ArmorAttributes.SelfRepair = 3;
                helmet.PhysicalBonus = 3;
                helmet.FireBonus     = 3;
                helmet.ColdBonus     = 3;
                helmet.PoisonBonus   = 3;
                helmet.EnergyBonus   = 3;

                arm.Hue = 0x2CA;
                arm.ArmorAttributes.SelfRepair = 3;
                arm.PhysicalBonus = 3;
                arm.FireBonus     = 3;
                arm.ColdBonus     = 3;
                arm.PoisonBonus   = 3;
                arm.EnergyBonus   = 3;


                from.SendLocalizedMessage(1072391);
            }
            this.InvalidateProperties();
            return(base.OnEquip(from));
        }
Example #33
0
        public override void OnComponentUsed(AddonComponent c, Mobile from)
        {
            BaseHouse house = BaseHouse.FindHouseAt(this);

            /*
             * Unique problems have unique solutions.  OSI does not have a problem with 1000s of mining carts
             * due to the fact that they have only a miniscule fraction of the number of 10 year vets that a
             * typical RunUO shard will have (RunUO's scaled down account aging system makes this a unique problem),
             * and the "freeness" of free accounts. We also dont have mitigating factors like inactive (unpaid)
             * accounts not gaining veteran time.
             *
             * The lack of high end vets and vet rewards on OSI has made testing the *exact* ranging/stacking
             * behavior of these things all but impossible, so either way its just an estimation.
             *
             * If youd like your shard's carts/stumps to work the way they did before, simply replace the check
             * below with this line of code:
             *
             * if (!from.InRange(GetWorldLocation(), 2)
             *
             * However, I am sure these checks are more accurate to OSI than the former version was.
             *
             */

            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this) || !((from.Z - Z) > -3 && (from.Z - Z) < 3))
            {
                from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045);                 // I can't reach that.
            }
            else if (house != null && house.HasSecureAccess(from, SecureLevel.Friends))
            {
                if (m_Logs > 0)
                {
                    Item logs = null;

                    switch (Utility.Random(7))
                    {
                    case 0: logs = new Log(); break;

                    case 1: logs = new AshLog(); break;

                    case 2: logs = new OakLog(); break;

                    case 3: logs = new YewLog(); break;

                    case 4: logs = new HeartwoodLog(); break;

                    case 5: logs = new BloodwoodLog(); break;

                    case 6: logs = new FrostwoodLog(); break;
                    }

                    int amount = Math.Min(10, m_Logs);
                    logs.Amount = amount;

                    if (!from.PlaceInBackpack(logs))
                    {
                        logs.Delete();
                        from.SendLocalizedMessage(1078837); // Your backpack is full! Please make room and try again.
                    }
                    else
                    {
                        m_Logs -= amount;
                        PublicOverheadMessage(MessageType.Regular, 0, 1094719, m_Logs.ToString()); // Logs: ~1_COUNT~
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1094720); // There are no more logs available.
                }
            }
            else
            {
                from.SendLocalizedMessage(1061637); // You are not allowed to access this.
            }
        }
Example #34
0
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
 {
     reject = LRReason.CannotLift;
     return(false);
 }
Example #35
0
        public virtual void Fill_OnTarget(Mobile from, object targ)
        {
            if (!IsEmpty || !Fillable || !ValidateUse(from, false))
            {
                return;
            }

            if (targ is BaseBeverage)
            {
                BaseBeverage bev = (BaseBeverage)targ;

                if (bev.IsEmpty || !bev.ValidateUse(from, true))
                {
                    return;
                }

                Content  = bev.Content;
                Poison   = bev.Poison;
                Poisoner = bev.Poisoner;

                if (bev.Quantity > MaxQuantity)
                {
                    Quantity      = MaxQuantity;
                    bev.Quantity -= MaxQuantity;
                }
                else
                {
                    Quantity    += bev.Quantity;
                    bev.Quantity = 0;
                }
            }
            else if (targ is BaseWaterContainer)
            {
                BaseWaterContainer bwc = targ as BaseWaterContainer;

                if (Quantity == 0 || (Content == BeverageType.Water && !IsFull))
                {
                    Content = BeverageType.Water;

                    int iNeed = Math.Min((MaxQuantity - Quantity), bwc.Quantity);

                    if (iNeed > 0 && !bwc.IsEmpty && !IsFull)
                    {
                        bwc.Quantity -= iNeed;
                        Quantity     += iNeed;

                        from.PlaySound(0x4E);
                    }
                }
            }
            else if (targ is Item)
            {
                Item         item = (Item)targ;
                IWaterSource src;

                src = (item as IWaterSource);

                if (src == null && item is AddonComponent)
                {
                    src = (((AddonComponent)item).Addon as IWaterSource);
                }

                if (src == null || src.Quantity <= 0)
                {
                    if (item is DecorativeWishingWell dw)
                    {
                        dw.CheckWaterSource(from, this);
                    }

                    if (item.ItemID >= 0xB41 && item.ItemID <= 0xB44)
                    {
                        Caddellite.CheckWaterSource(from, this, item);
                    }

                    return;
                }

                if (from.Map != item.Map || !from.InRange(item.GetWorldLocation(), 2) || !from.InLOS(item))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                    return;
                }

                Content  = BeverageType.Water;
                Poison   = null;
                Poisoner = null;

                if (src.Quantity > MaxQuantity)
                {
                    Quantity      = MaxQuantity;
                    src.Quantity -= MaxQuantity;
                }
                else
                {
                    Quantity    += src.Quantity;
                    src.Quantity = 0;
                }

                if (!(src is WaterContainerComponent))
                {
                    from.SendLocalizedMessage(1010089); // You fill the container with water.
                }
            }
            else if (targ is Cow)
            {
                Cow cow = (Cow)targ;

                if (cow.TryMilk(from))
                {
                    Content  = BeverageType.Milk;
                    Quantity = MaxQuantity;
                    from.SendLocalizedMessage(1080197); // You fill the container with milk.
                }
            }
            else if (targ is LandTarget)
            {
                int tileID = ((LandTarget)targ).TileID;

                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is WitchApprenticeQuest)
                    {
                        FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                        if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.SwampWater)
                        {
                            bool contains = false;

                            for (int i = 0; !contains && i < m_SwampTiles.Length; i += 2)
                            {
                                contains = (tileID >= m_SwampTiles[i] && tileID <= m_SwampTiles[i + 1]);
                            }

                            if (contains)
                            {
                                Delete();

                                player.SendLocalizedMessage(1055035); // You dip the container into the disgusting swamp water, collecting enough for the Hag's vile stew.
                                obj.Complete();
                            }
                        }
                    }
                }
            }
        }
Example #36
0
 public FreeTimer(Item item, TimeSpan delay) : base(delay)
 {
     m_Item   = item;
     Priority = TimerPriority.OneSecond;
 }
Example #37
0
        public void EndHeal()
        {
            StopHeal();
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(Healer, Patient);
            SkillName secondarySkill = GetSecondarySkill(Healer, Patient);

            BaseCreature petPatient = Patient as BaseCreature;
            int          patientNumber;
            int          healerNumber;

            if (!Healer.Alive)
            {
                healerNumber  = 500962; // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!Healer.InRange(Patient, Bandage.Range))
            {
                healerNumber  = 500963; // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = Healer.Skills[primarySkill].Value;
                double anatomy = Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == Healer) ||
                    (Engines.VvV.ViceVsVirtueSystem.Enabled && petPatient is Server.Engines.VvV.VvVMount && petPatient.ControlMaster == Healer))
                //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (Patient.Map == null || !Patient.Map.CanFit(Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042; // Target can not be resurrected at that location.
                        patientNumber = 502391; // Thou can not be resurrected there!
                    }
                    else if (Patient.Region != null && Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965; // You are able to resurrect your patient.
                        patientNumber = -1;

                        Patient.PlaySound(0x214);
                        Patient.FixedEffect(0x376A, 10, 16);

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 1049658; // The owner has been asked to sanctify the resurrection.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                var friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 1049658; // The owner has been asked to sanctify the resurrection.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049659; // Neither the owner or friends of the pet are nearby to sanctify the resurrection.
                                }
                            }
                        }
                        else
                        {
                            Patient.CloseGump(typeof(ResurrectGump));
                            Patient.SendGump(new ResurrectGump(Patient, Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256; // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966; // You are unable to resurrect your patient.
                    }

                    patientNumber = -1;
                }
            }
            else if (Patient.Poisoned)
            {
                Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                double healing = Healer.Skills[primarySkill].Value;
                double anatomy = Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (Patient.Poison.RealLevel * 0.1) - (Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (Patient.CurePoison(Healer))
                    {
                        healerNumber  = (Healer == Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                            // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060; // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(Patient))
            {
                healerNumber  = 1060088; // You bind the wound and stop the bleeding
                patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(Patient, false);
            }
            else if (MortalStrike.IsWounded(Patient))
            {
                healerNumber  = (Healer == Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (Patient.Hits == Patient.HitsMax)
            {
                healerNumber  = 500967; // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = Healer.Skills[primarySkill].Value;
                double anatomy = Healer.Skills[secondarySkill].Value;

                FirstAidBelt belt = Healer.FindItemOnLayer(Layer.Waist) as FirstAidBelt;

                if (belt != null)
                {
                    HealingBonus += belt.HealingBonus;
                }

                Item item = Healer.FindItemOnLayer(Layer.TwoHanded);

                if (item is Asclepius || item is GargishAsclepius)
                {
                    HealingBonus += 15;
                }

                if (HealingBonus > 0)
                {
                    healing += HealingBonus;
                }

                double chance = ((healing + 10.0) / 100.0) - (Slips * 0.02);

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969; // You finish applying the bandages.

                    double min, max;

                    if (Core.AOS)
                    {
                        min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                        max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
                    }
                    else
                    {
                        min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                        max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                    }

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (Patient.Body.IsMonster || Patient.Body.IsAnimal)
                    {
                        toHeal += Patient.HitsMax / 100;
                    }

                    if (Core.AOS)
                    {
                        toHeal -= toHeal * Slips * 0.35; // TODO: Verify algorithm
                    }
                    else
                    {
                        toHeal -= Slips * 4;
                    }

                    #region City Loyalty
                    if (Server.Engines.CityLoyalty.CityLoyaltySystem.HasTradeDeal(Healer, Engines.CityLoyalty.TradeDeal.GuildOfHealers))
                    {
                        toHeal += (int)Math.Ceiling(toHeal * 0.05);
                    }
                    #endregion

                    if (HealedPoisonOrBleed > 0)
                    {
                        toHeal /= HealedPoisonOrBleed;
                    }

                    if (SearingWounds.IsUnderEffects(Patient))
                    {
                        toHeal /= 2;
                        Patient.SendLocalizedMessage(1151178); // The cauterized wound resists some of your healing.
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968; // You apply the bandages, but they barely help.
                    }
                    else if (Patient != Healer && Patient is PlayerMobile && Healer is PlayerMobile)
                    {
                        SpiritualityVirtue.OnHeal(Healer, Math.Min((int)toHeal, Patient.HitsMax - Patient.Hits));
                    }

                    Patient.Heal((int)toHeal, Healer, false);
                }
                else
                {
                    healerNumber = 500968; // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }

            if (Patient is PlayerMobile)
            {
                BuffInfo.RemoveBuff(Healer, BuffIcon.Healing);
            }
            else
            {
                BuffInfo.RemoveBuff(Healer, BuffIcon.Veterinary);
            }
        }
Example #38
0
 public InternalTarget(Item item)
     : base(2, false, TargetFlags.None)
 {
     m_Item = item;
 }
Example #39
0
            public SpawnTimer(Item item) : base(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10)))
            {
                Priority = TimerPriority.FiftyMS;

                m_Item = item;
            }
 public virtual void Carve(Mobile from, Item with)
 {
 }
Example #41
0
        protected virtual void EndLockpick(object state)
        {
            object[]      objs         = (object[])state;
            ILockpickable lockpickable = objs[0] as ILockpickable;
            Mobile        from         = objs[1] as Mobile;

            Item item = (Item)lockpickable;

            if (!from.InRange(item.GetWorldLocation(), 1))
            {
                return;
            }

            if (lockpickable.LockLevel == 0 || lockpickable.LockLevel == -255)
            {
                // LockLevel of 0 means that the door can't be picklocked
                // LockLevel of -255 means it's magic locked
                item.SendLocalizedMessageTo(from, 502073); // This lock cannot be picked by normal means
                return;
            }

            if (from.Skills[SkillName.Lockpicking].Value < lockpickable.RequiredSkill - SkillBonus)
            {
                /*
                 * // Do some training to gain skills
                 * from.CheckSkill( SkillName.Lockpicking, 0, lockpickable.LockLevel );*/
                // The LockLevel is higher thant the LockPicking of the player
                item.SendLocalizedMessageTo(from, 502072); // You don't see how that lock can be manipulated.
                return;
            }

            int maxlevel = lockpickable.MaxLockLevel;
            int minLevel = lockpickable.LockLevel;

            if (lockpickable is Skeletonkey)
            {
                minLevel -= SkillBonus;
                maxlevel -= SkillBonus; //regulars subtract the bonus from the max level
            }

            if (this is MasterSkeletonKey || from.CheckTargetSkill(SkillName.Lockpicking, lockpickable, minLevel, maxlevel))
            {
                // Success! Pick the lock!
                OnUse();

                item.SendLocalizedMessageTo(from, 502076); // The lock quickly yields to your skill.
                from.PlaySound(0x4A);
                lockpickable.LockPick(from);
            }
            else
            {
                // The player failed to pick the lock
                BrokeLockPickTest(from);
                item.SendLocalizedMessageTo(from, 502075); // You are unable to pick the lock.

                if (item is TreasureMapChest chest)
                {
                    if (TreasureMapInfo.NewSystem)
                    {
                        if (!chest.FailedLockpick)
                        {
                            chest.FailedLockpick = true;
                        }
                    }
                    else if (chest.Items.Count > 0 && 0.25 > Utility.RandomDouble())
                    {
                        Item toBreak = chest.Items[Utility.Random(chest.Items.Count)];

                        if (!(toBreak is Container))
                        {
                            toBreak.Delete();
                            Effects.PlaySound(item.Location, item.Map, 0x1DE);
                            from.SendMessage(0x20, "The sound of gas escaping is heard from the chest.");
                        }
                    }
                }
            }
        }
Example #42
0
        public override void OnComponentUsed(AddonComponent c, Mobile from)
        {
            var house = HousingHelper.FindHouseAt(this);

            if (house != null && house.HasSecureAccess(from, SecureLevel.Friends))
            {
                switch (m_CartType)
                {
                case MiningCartType.OreSouth:
                case MiningCartType.OreEast:
                    if (m_Ore > 0)
                    {
                        Item ingots = null;

                        switch (Utility.Random(9))
                        {
                        case 0:
                            ingots = new IronIngot();
                            break;

                        case 1:
                            ingots = new DullCopperIngot();
                            break;

                        case 2:
                            ingots = new ShadowIronIngot();
                            break;

                        case 3:
                            ingots = new CopperIngot();
                            break;

                        case 4:
                            ingots = new BronzeIngot();
                            break;

                        case 5:
                            ingots = new GoldIngot();
                            break;

                        case 6:
                            ingots = new AgapiteIngot();
                            break;

                        case 7:
                            ingots = new VeriteIngot();
                            break;

                        case 8:
                            ingots = new ValoriteIngot();
                            break;
                        }

                        int amount = Math.Min(10, m_Ore);
                        ingots.Amount = amount;

                        if (!from.PlaceInBackpack(ingots))
                        {
                            ingots.Delete();
                            from.SendLocalizedMessage(1078837);                                       // Your backpack is full! Please make room and try again.
                        }
                        else
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, 1094724, amount.ToString());                                       // Ore: ~1_COUNT~
                            m_Ore -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);                                   // There are no more resources available at this time.
                    }
                    break;

                case MiningCartType.GemSouth:
                case MiningCartType.GemEast:
                    if (m_Gems > 0)
                    {
                        Item gems = null;

                        switch (Utility.Random(9))
                        {
                        case 0:
                            gems = new Amber();
                            break;

                        case 1:
                            gems = new Amethyst();
                            break;

                        case 2:
                            gems = new Citrine();
                            break;

                        case 3:
                            gems = new Diamond();
                            break;

                        case 4:
                            gems = new Emerald();
                            break;

                        case 5:
                            gems = new Ruby();
                            break;

                        case 6:
                            gems = new Sapphire();
                            break;

                        case 7:
                            gems = new StarSapphire();
                            break;

                        case 8:
                            gems = new Tourmaline();
                            break;
                        }

                        int amount = Math.Min(5, m_Gems);
                        gems.Amount = amount;

                        if (!from.PlaceInBackpack(gems))
                        {
                            gems.Delete();
                            from.SendLocalizedMessage(1078837);                                       // Your backpack is full! Please make room and try again.
                        }
                        else
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, 1094723, amount.ToString());                                       // Gems: ~1_COUNT~
                            m_Gems -= amount;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1094725);                                   // There are no more resources available at this time.
                    }
                    break;
                }
            }
            else
            {
                from.SendLocalizedMessage(1061637);                   // You are not allowed to access this.
            }
        }
Example #43
0
        public override void RemoveItem(Item dropped)
        {
            base.RemoveItem(dropped);

            this.InvalidateWeight();
        }
Example #44
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (this.m_Powder.Deleted || this.m_Powder.UsesRemaining <= 0)
                {
                    from.SendLocalizedMessage(1049086); // You have used up your powder of temperament.
                    return;
                }

                if (targeted is IDurability && targeted is Item)
                {
                    IDurability wearable = (IDurability)targeted;
                    Item        item     = (Item)targeted;

                    if (!wearable.CanFortify)
                    {
                        from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
                        return;
                    }

                    if ((item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) && this.m_Powder.IsChildOf(from.Backpack))
                    {
                        int origMaxHP = wearable.MaxHitPoints;
                        int origCurHP = wearable.HitPoints;

                        if (origMaxHP > 0)
                        {
                            int initMaxHP = Core.AOS ? 255 : wearable.InitMaxHits;

                            wearable.UnscaleDurability();

                            if (wearable.MaxHitPoints < initMaxHP)
                            {
                                int bonus = initMaxHP - wearable.MaxHitPoints;

                                if (bonus > 10)
                                {
                                    bonus = 10;
                                }

                                wearable.MaxHitPoints += bonus;
                                wearable.HitPoints    += bonus;

                                wearable.ScaleDurability();

                                if (wearable.MaxHitPoints > 255)
                                {
                                    wearable.MaxHitPoints = 255;
                                }
                                if (wearable.HitPoints > 255)
                                {
                                    wearable.HitPoints = 255;
                                }

                                if (wearable.MaxHitPoints > origMaxHP)
                                {
                                    from.SendLocalizedMessage(1049084); // You successfully use the powder on the item.
                                    from.PlaySound(0x247);

                                    --this.m_Powder.UsesRemaining;

                                    if (this.m_Powder.UsesRemaining <= 0)
                                    {
                                        from.SendLocalizedMessage(1049086); // You have used up your powder of fortifying.
                                        this.m_Powder.Delete();
                                    }
                                }
                                else
                                {
                                    wearable.MaxHitPoints = origMaxHP;
                                    wearable.HitPoints    = origCurHP;
                                    from.SendLocalizedMessage(1049085); // The item cannot be improved any further.
                                }
                            }
                            else
                            {
                                from.SendLocalizedMessage(1049085); // The item cannot be improved any further.
                                wearable.ScaleDurability();
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
                }
            }
Example #45
0
        public override void UpdateTotal(Item sender, TotalType type, int delta)
        {
            this.InvalidateProperties();

            base.UpdateTotal(sender, type, delta);
        }
Example #46
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (this.m_Crafter != null)
            {
                list.Add(1050043, this.m_Crafter.Name); // crafted by ~1_NAME~
            }
            if (this.m_Quality == ClothingQuality.Exceptional)
            {
                list.Add(1063341); // exceptional
            }
            Item ammo = this.Ammo;

            if (ammo != null)
            {
                if (ammo is Arrow)
                {
                    list.Add(1075265, "{0}\t{1}", ammo.Amount, this.Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
                }
                else if (ammo is Bolt)
                {
                    list.Add(1075266, "{0}\t{1}", ammo.Amount, this.Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ bolts
                }
            }
            else
            {
                list.Add(1075265, "{0}\t{1}", 0, this.Capacity); // Ammo: ~1_QUANTITY~/~2_CAPACITY~ arrows
            }
            int prop;

            if ((prop = this.m_DamageIncrease) != 0)
            {
                list.Add(1074762, prop.ToString()); // Damage modifier: ~1_PERCENT~%
            }
            int phys, fire, cold, pois, nrgy, chaos, direct;

            phys = fire = cold = pois = nrgy = chaos = direct = 0;

            this.AlterBowDamage(ref phys, ref fire, ref cold, ref pois, ref nrgy, ref chaos, ref direct);

            if (phys != 0)
            {
                list.Add(1060403, phys.ToString()); // physical damage ~1_val~%
            }
            if (fire != 0)
            {
                list.Add(1060405, fire.ToString()); // fire damage ~1_val~%
            }
            if (cold != 0)
            {
                list.Add(1060404, cold.ToString()); // cold damage ~1_val~%
            }
            if (pois != 0)
            {
                list.Add(1060406, pois.ToString()); // poison damage ~1_val~%
            }
            if (nrgy != 0)
            {
                list.Add(1060407, nrgy.ToString()); // energy damage ~1_val
            }
            if (chaos != 0)
            {
                list.Add(1072846, chaos.ToString()); // chaos damage ~1_val~%
            }
            if (direct != 0)
            {
                list.Add(1079978, direct.ToString()); // Direct Damage: ~1_PERCENT~%
            }
            list.Add(1075085);                        // Requirement: Mondain's Legacy

            if ((prop = this.m_Attributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = this.m_Attributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = this.m_Attributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = this.m_Attributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = this.m_Attributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = this.m_Attributes.AttackChance) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = this.m_Attributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = this.m_Attributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = this.m_Attributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = this.m_Attributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = this.m_Attributes.Luck) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = this.m_Attributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = this.m_Attributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = this.m_Attributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = this.m_Attributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = this.m_Attributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = this.m_Attributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = this.m_Attributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = this.m_Attributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = this.m_Attributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            if ((prop = this.m_Attributes.WeaponSpeed) != 0)
            {
                list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
            }
            if ((prop = this.m_LowerAmmoCost) > 0)
            {
                list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
            }
            #region Mondain's Legacy Sets
            if (this.IsSetItem)
            {
                list.Add(1073491, this.Pieces.ToString()); // Part of a Weapon/Armor Set (~1_val~ pieces)

                if (this.m_SetEquipped)
                {
                    list.Add(1073492); // Full Weapon/Armor Set Present
                    SetHelper.GetSetProperties(list, this);
                }
            }
            #endregion

            double weight = 0;

            if (ammo != null)
            {
                weight = ammo.Weight * ammo.Amount;
            }

            list.Add(1072241, "{0}\t{1}\t{2}\t{3}", this.Items.Count, this.DefaultMaxItems, (int)weight, this.DefaultMaxWeight); // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones

            if ((prop = this.m_WeightReduction) != 0)
            {
                list.Add(1072210, prop.ToString()); // Weight reduction: ~1_PERCENTAGE~%
            }
            #region Mondain's Legacy Sets
            if (this.IsSetItem && !this.m_SetEquipped)
            {
                list.Add(1072378); // <br>Only when full set is present:
                SetHelper.GetSetProperties(list, this);
            }
            #endregion
        }
Example #47
0
        public static void GoldSweep(Mobile m, Gold gold)
        {
            Item item = m.Backpack.FindItemByType(typeof(GoldLedger));

            GoldLedger ledger = item as GoldLedger;

            if (ledger == null)
            {
                return;
            }

            if (!ledger.GoldSweeper || !GoldLedger.GoldSweeperAvailable || !gold.Movable)
            {
                return;
            }

            if (gold != null)
            {
                if (ledger.Gold < 999999999)
                {
                    double maxWeight = (WeightOverloading.GetMaxWeight(m));
                    if ((Mobile.BodyWeight + m.TotalWeight) < (maxWeight))
                    {
                        int golda = gold.Amount;
                        if ((gold.Amount + ledger.Gold) > 999999999)
                        {
                            golda = (999999999 - ledger.Gold);
                        }
                        double maxgold = golda;
                        if (ledger.d_WeightScale > 0)
                        {
                            maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)m.TotalWeight)) / ledger.d_WeightScale);
                        }
                        if (golda > maxgold)
                        {
                            golda = (int)maxgold;
                        }
                        int GoldID = 0;
                        if (golda == 1)
                        {
                            GoldID = gold.ItemID;
                        }
                        else if (golda > 1 && golda < 6)
                        {
                            GoldID = gold.ItemID + 1;
                        }
                        else if (golda >= 6)
                        {
                            GoldID = gold.ItemID + 2;
                        }
                        if (golda < gold.Amount)
                        {
                            gold.Amount -= golda;
                        }
                        else
                        {
                            gold.Delete();
                        }
                        ledger.Gold += golda;
                        if (ledger.b_open && golda > 0)
                        {
                            m.CloseGump(typeof(GoldLedgerGump));
                            m.SendGump(new GoldLedgerGump(ledger));
                        }

                        if (golda > 4999)
                        {
                            m.SendMessage(2125, "You deposit {0} gold into your gold ledger.", golda.ToString("#,0"));
                            if (!m.Mounted)
                            {
                                m.Animate(32, 5, 1, true, false, 0);
                            }
                            Effects.SendMovingEffect(gold, m, GoldID, 5, 50, true, false);
                            m.PlaySound(0x2E6);
                        }
                    }
                }
            }
        }
Example #48
0
        public override void AddItem(Item dropped)
        {
            base.AddItem(dropped);

            this.InvalidateWeight();
        }
Example #49
0
			public MoveTimer( Item sphere, int coord ) : base( TimeSpan.FromSeconds( 0.0 ), TimeSpan.FromSeconds( 1.5 ) )
			{
				item = sphere;
				num = coord;
			}
Example #50
0
        public TreasureChestLevel1()
            : base(0xE41)
        {
            SetChestAppearance();
            Movable = false;

            TrapType  = TrapType.DartTrap;
            TrapPower = m_Level * Utility.Random(1, 25);
            Locked    = true;

            RequiredSkill = 57;
            LockLevel     = RequiredSkill - Utility.Random(1, 10);
            MaxLockLevel  = RequiredSkill + Utility.Random(1, 10);

            // According to OSI, loot in level 1 chest is:
            //  Gold 25 - 50
            //  Bolts 10
            //  Gems
            //  Normal weapon
            //  Normal armour
            //  Normal clothing
            //  Normal jewelry

            // Gold
            DropItem(new Gold(Utility.Random(30, 100)));

            // Drop bolts
            // DropItem( new Bolt( 10 ) );

            // Gems
            if (Utility.RandomBool())
            {
                Item GemLoot = Loot.RandomGem();
                GemLoot.Amount = Utility.Random(1, 3);
                DropItem(GemLoot);
            }

            // Weapon
            if (Utility.RandomBool())
            {
                DropItem(Loot.RandomWeapon());
            }

            // Armour
            if (Utility.RandomBool())
            {
                DropItem(Loot.RandomArmorOrShield());
            }

            // Clothing
            if (Utility.RandomBool())
            {
                DropItem(Loot.RandomClothing());
            }

            // Jewelry
            if (Utility.RandomBool())
            {
                DropItem(Loot.RandomJewelry());
            }
        }
Example #51
0
 public static int GetSBSellValue()
 {
     return(Item.SBDetermineSellPrice(GetSBPurchaseValue()));
 }
Example #52
0
        public void EndAddGold(Mobile from, object obj)
        {
            from.CloseGump(typeof(GoldLedgerGump));

            if (obj is Item)
            {
                Item   item      = obj as Item;
                double maxWeight = (WeightOverloading.GetMaxWeight(from));
                int    golda     = 0;

                if (!this.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                    return;
                }
                if (!item.IsAccessibleTo(from))
                {
                    from.SendGump(new GoldLedgerGump(this));
                    from.SendLocalizedMessage(3000270); // That is not accessible.
                    return;
                }

                if (obj is Gold)
                {
                    Gold gold = obj as Gold;

                    golda = gold.Amount;
                    if ((gold.Amount + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0 && gold.RootParent != from)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    if (golda < gold.Amount)
                    {
                        gold.Amount -= golda;
                    }
                    else
                    {
                        gold.Delete();
                    }

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You deposit {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else if (obj is BankCheck)
                {
                    BankCheck check = obj as BankCheck;

                    golda = check.Worth;
                    if ((check.Worth + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    if (golda < check.Worth)
                    {
                        check.Worth -= golda;
                    }
                    else
                    {
                        check.Delete();
                    }

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You deposit a bank check worth {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else if (obj is GoldLedger && obj != this)
                {
                    GoldLedger gledger = obj as GoldLedger;

                    golda = gledger.Gold;
                    if ((gledger.Gold + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    gledger.Gold -= golda;

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You transfer {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else
                {
                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, "You can only deposit gold or bank checks into your gold ledger.");
                }
            }
            else
            {
                from.SendGump(new GoldLedgerGump(this));
                from.SendMessage(2125, "You can only deposit gold or bank checks into your gold ledger.");
            }

            from.SendMessage(2125, "Do you want to deposit anything else? (ESC to cancel)");
            from.Target = new AddGoldTarget(this);
        }