コード例 #1
0
ファイル: Scissors.cs プロジェクト: zerodowned/RunUO.T2A
            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.
                }
            }
コード例 #2
0
ファイル: Scissors.cs プロジェクト: zerodowned/UO-Forever
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            var item = m_Target as Item;

            if (item == null || item.Deleted || m_Scissors == null)
            {
                return;
            }

            if (info.ButtonID == (int)Buttons.Confirm)
            {
                Mobile m = sender.Mobile;
                if (item.RootParentEntity == m)
                {
                    if (m_Target.Scissor(m, m_Scissors))
                    {
                        m.PlaySound(0x248);
                    }
                }
                else
                {
                    m.SendMessage("That item must be in your backpack to cut it!");
                }
            }
        }
コード例 #3
0
ファイル: Scissors.cs プロジェクト: Delphi79/RunUO-2.0-RC1
            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.
                }
            }
コード例 #4
0
ファイル: Scissors.cs プロジェクト: rberiot/imaginenation
            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.
                }
            }
コード例 #5
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.
                }
            }
コード例 #6
0
ファイル: SalvageBag.cs プロジェクト: zerodowned/last-wish
        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);
                }
            }
        }
コード例 #7
0
ファイル: Scissors.cs プロジェクト: Delphi79/RunUO-2.3.1
            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);
                }
            }
コード例 #8
0
ファイル: Scissors.cs プロジェクト: slawdis/uoodyssey-scripts
            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);
                }
            }
コード例 #9
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.
                }
            }
コード例 #10
0
ファイル: Scissors.cs プロジェクト: Pumpk1ns/outlands
            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.
                }
            }
コード例 #11
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.
                }
            }
コード例 #12
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.
                }
            }