Esempio n. 1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                /*if ( targeted is Item && !((Item)targeted).IsStandardLoot() )
                 * {
                 *      from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
                 * }
                 * else */
                if (Core.AOS && targeted == from)
                {
                    from.SendLocalizedMessage(1062845 + Utility.Random(3));                             //"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
                }
                else if (Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 && (DateTime.Now - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
                {
                    from.SendLocalizedMessage(1063305);                       // Didn't your parents ever tell you not to run with scissors in your hand?!
                }
                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted is Item && !((Item)targeted).IsStandardLoot())
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted == from)
                {
                    if (from.HairItemID == 5147 || from.HairItemID == 7947)
                    {
                        return;
                    }

                    from.FacialHairItemID = 0;
                    from.HairItemID       = 0;

                    from.PlaySound(0x248);
                    return;
                }
                if (targeted is Item && !((Item)targeted).Movable)
                {
                    if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
                    {
                        IScissorable obj = (IScissorable)targeted;

                        if (obj.Scissor(from, m_Item))
                        {
                            from.PlaySound(0x248);
                        }
                    }
                }
                if (targeted is IScissorable)
                {
                    if (targeted is Item)
                    {
                        Item item = (Item)targeted;
                        if (item.LootType == LootType.Newbied || item.LootType == LootType.Blessed)
                        {
                            from.SendAsciiMessage("You cannot cut up newbied items");
                            return;
                        }
                    }

                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 4
0
        public static bool CanScissor(Mobile from, IScissorable obj)
        {
            if (obj is Item && ((Item)obj).Nontransferable)
            {
                from.SendLocalizedMessage(502440);                   // Scissors can not be used on that to produce anything.
                return(false);
            }

            // TODO: Move other general checks from the different implementations here

            return(true);
        }
Esempio n. 5
0
		public static bool CanScissor( Mobile from, IScissorable obj )
		{
			if ( obj is Item && ( (Item)obj ).Nontransferable )
			{
				from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
				return false;
			}

			// TODO: Move other general checks from the different implementations here

			return true;
		}
Esempio n. 6
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted == from)
                {
                    from.SendLocalizedMessage(1062845 + Utility.Random(3));
                    //"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
                }
                else if (Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 &&
                         (Core.TickCount - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
                {
                    from.SendLocalizedMessage(1063305);                     // Didn't your parents ever tell you not to run with scissors in your hand?!
                }
                else if (targeted is Item && !((Item)targeted).Movable)
                {
                    if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
                    {
                        IScissorable obj = (IScissorable)targeted;

                        if (obj.Scissor(from, m_Item))
                        {
                            from.PlaySound(0x248);

                            if (Siege.SiegeShard)
                            {
                                Siege.CheckUsesRemaining(from, m_Item);
                            }
                        }
                    }
                }
                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);

                        if (Siege.SiegeShard)
                        {
                            Siege.CheckUsesRemaining(from, m_Item);
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                     // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 7
0
        private void SalvageCloth(Mobile from)
        {
            Scissors scissors = from.Backpack.FindItemByType(typeof(Scissors)) as Scissors;

            if (scissors == null)
            {
                from.SendLocalizedMessage(1079823);   // You need scissors in order to salvage cloth.
                return;
            }

            int salvaged    = 0;
            int notSalvaged = 0;

            Container sBag = this;

            List <Item> scissorables = sBag.FindItemsByType <Item>();

            for (int i = scissorables.Count - 1; i >= 0; --i)
            {
                Item item = scissorables[i];

                if (item is IScissorable)
                {
                    IScissorable scissorable = (IScissorable)item;

                    if (Scissors.CanScissor(from, scissorable) && scissorable.Scissor(from, scissors))
                    {
                        ++salvaged;
                    }
                    else
                    {
                        ++notSalvaged;
                    }
                }
            }

            from.SendLocalizedMessage(1079974, String.Format("{0}\t{1}", salvaged, salvaged + notSalvaged));     // Salvaged: ~1_COUNT~/~2_NUM~ tailored items

            Container pack = from.Backpack;

            foreach (Item i in ((Container)this).FindItemsByType(typeof(Item), true))
            {
                if ((i is Leather) || (i is Cloth) || (i is SpinedLeather) || (i is HornedLeather) || (i is BarbedLeather) || (i is Bandage) || (i is Bone))
                {
                    from.AddToBackpack(i);
                }
            }
        }
Esempio n. 8
0
            protected override void OnNonlocalTarget(Mobile from, object targeted)
            {
                if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    base.OnNonlocalTarget(from, targeted);
                }
            }
Esempio n. 9
0
            protected override void OnNonlocalTarget(Mobile from, object targeted)
            {
                if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    base.OnNonlocalTarget(from, targeted);
                }
            }
Esempio n. 10
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted is BaseArmor && ((BaseArmor)targeted).LootType == LootType.Cursed)
                {
                    from.SendMessage("It would be unwise to put cursed goods to such use.");
                }
                else if (targeted == from)
                {
                    from.SendLocalizedMessage(1062845 + Utility.Random(3));                             //"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
                }
                else if (Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 && (DateTime.Now - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
                {
                    from.SendLocalizedMessage(1063305);                       // Didn't your parents ever tell you not to run with scissors in your hand?!
                }
                else if (targeted is Item && !((Item)targeted).Movable)
                {
                    if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
                    {
                        IScissorable obj = (IScissorable)targeted;

                        if (obj.Scissor(from, m_Item))
                        {
                            from.PlaySound(0x248);
                        }
                    }
                }
                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 11
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                PlayerMobile player = from as PlayerMobile;

                if (m_Item.Deleted)
                {
                    return;
                }

                if (Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 && (Core.TickCount - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
                {
                    from.SendLocalizedMessage(1063305);                       // Didn't your parents ever tell you not to run with scissors in your hand?!
                }

                else if (targeted is Item && !((Item)targeted).Movable)
                {
                    if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
                    {
                        IScissorable obj = (IScissorable)targeted;

                        if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
                        {
                            from.PlaySound(0x248);
                        }
                    }
                }

                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }

                else
                {
                    from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 12
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                if (targeted == from)
                {
                    // "That doesn't seem like the smartest thing to do."
                    // "That was an encounter you don't wish to repeat."
                    // "Ha! You missed!"
                    from.SendLocalizedMessage(1062845 + Utility.Random(3));
                }
                else if (Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 && (DateTime.UtcNow - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
                {
                    from.SendLocalizedMessage(1063305);                       // Didn't your parents ever tell you not to run with scissors in your hand?!
                }
                else if (targeted is Item && (!((Item)targeted).Movable || ((Item)targeted).QuestItem))
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
                else if (targeted is Mobile || (targeted is Item && !((Item)targeted).IsChildOf(from.Backpack)))
                {
                    from.SendLocalizedMessage(502437);                       // Items you wish to cut must be in your backpack.
                }
                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
            }
Esempio n. 13
0
        public BlessedClothingCutGump(IScissorable target, Scissors scissors)
            : base(150, 50)
        {
            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            m_Target   = target;
            m_Scissors = scissors;

            AddBackground(0, 0, 250, 170, 0x13BE);
            AddBackground(10, 10, 200, 150, 0xBB8);

            AddHtml(20, 30, 140, 60, "WARNING: If you cut that blessed cloth, the blessing will be lost!", false, false);
            // Do you wish to re-deed this decoration?

            AddHtmlLocalized(55, 100, 150, 25, 1011011, false, false);             // CONTINUE
            AddButton(20, 100, 0xFA5, 0xFA7, (int)Buttons.Confirm, GumpButtonType.Reply, 0);

            AddHtmlLocalized(55, 125, 150, 25, 1011012, false, false);             // CANCEL
            AddButton(20, 125, 0xFA5, 0xFA7, (int)Buttons.Cancel, GumpButtonType.Reply, 0);
        }
Esempio n. 14
0
 public static bool CanScissor(Mobile from, IScissorable obj)
 {
     return(true);
 }
Esempio n. 15
0
		public BlessedClothingCutGump(IScissorable target, Scissors scissors)
			: base(150, 50)
		{
			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;

			m_Target = target;
			m_Scissors = scissors;

			AddBackground(0, 0, 250, 170, 0x13BE);
			AddBackground(10, 10, 200, 150, 0xBB8);

			AddHtml(20, 30, 140, 60, "WARNING: If you cut that blessed cloth, the blessing will be lost!", false, false);
				// Do you wish to re-deed this decoration?

			AddHtmlLocalized(55, 100, 150, 25, 1011011, false, false); // CONTINUE
			AddButton(20, 100, 0xFA5, 0xFA7, (int)Buttons.Confirm, GumpButtonType.Reply, 0);

			AddHtmlLocalized(55, 125, 150, 25, 1011012, false, false); // CANCEL
			AddButton(20, 125, 0xFA5, 0xFA7, (int)Buttons.Cancel, GumpButtonType.Reply, 0);
		}
Esempio n. 16
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                /*if ( targeted is Item && !((Item)targeted).IsStandardLoot() )
                 * {
                 *      from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
                 * }
                 * else */
                if (Core.AOS && targeted == from)
                {
                    from.SendLocalizedMessage(1062845 + Utility.Random(3));                             //"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
                }
                else if (Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 && (DateTime.Now - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
                {
                    from.SendLocalizedMessage(1063305);                       // Didn't your parents ever tell you not to run with scissors in your hand?!
                }
                else if (targeted is Item && !((Item)targeted).Movable)
                {
                    if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
                    {
                        IScissorable obj = (IScissorable)targeted;

                        if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
                        {
                            from.PlaySound(0x248);
                        }
                    }
                }
                else if (targeted is PlayerMobile)
                {
                    PlayerMobile hair = (PlayerMobile)targeted;

                    if (hair.HairItemID == 0)
                    {
                        from.SendMessage("Cette personne est chauve");
                        return;
                    }

                    int delay = 4;
                    if (from.Dex > 80)
                    {
                        delay--;
                    }
                    if (from.Skills[SkillName.Stealing].Value > 50)
                    {
                        delay--;
                    }

                    from.Say("*Approche discrètement, ciseaux à la main*");
                    Timer.DelayCall(TimeSpan.FromSeconds(delay), new TimerStateCallback <object[]>(CutHair), new object[] { from, hair });
                }
                else if (targeted is IScissorable)
                {
                    IScissorable obj = (IScissorable)targeted;

                    if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
                    {
                        from.PlaySound(0x248);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502440);                       // Scissors can not be used on that to produce anything.
                }
            }