コード例 #1
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            if (!CanThrow(m, true))
            {
                return;
            }

            if (m.Spell != null)
            {
                m.Spell.OnCasterUsingObject(this);
            }

            if (ClearHands)
            {
                m.ClearHands();
            }

            if (DismountUser)
            {
                EtherealMount.StopMounting(m);
            }

            if (DismountUser && m.Mounted)
            {
                BaseMount.Dismount(m);
            }

            m.Target = BeginTarget(m);
            OnBeginTarget(m, true);
        }
コード例 #2
0
ファイル: RetouchingTool.cs プロジェクト: dpisanu/xrunuo
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!m_Tool.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
                else if (targeted is EtherealMount)
                {
                    EtherealMount ethereal = (EtherealMount)targeted;

                    ethereal.SolidHue = !ethereal.SolidHue;

                    if (ethereal.SolidHue)
                    {
                        from.SendLocalizedMessage(1113816);                           // Your ethereal mount's body has been solidified.
                    }
                    else
                    {
                        from.SendLocalizedMessage(1113817);                           // Your ethereal mount's transparency has been restored.
                    }
                }
                else
                {
                    from.SendMessage("You cannot use your retouching tool on that.");
                }
            }
コード例 #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019);                   // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624);                   // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631);                   // This bola is already being used.
            }
            else if (!HasFreeHands(from))
            {
                from.SendLocalizedMessage(1040015);                   // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016);                   // You cannot use this while riding a mount
            }
            else
            {
                EtherealMount.StopMounting(from);

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
コード例 #4
0
        protected override void OnTarget(Mobile from, object target)           // Override the protected OnTarget() for our feature
        {
            if (_mDeed.Deleted || _mDeed.RootParent != from)
            {
                return;
            }

            EtherealMount eth = target as EtherealMount;

            if (eth != null)
            {
                if (!eth.IsDehued)
                {
                    eth.IsDehued = true;
                    _mDeed.Delete();
                    from.SendMessage(54, "You have successfully dehued your ethereal mount.");
                }
                else
                {
                    from.SendMessage(54, "This mount is already dehued.");
                }
            }
            else
            {
                from.SendMessage(54, "You must use this on an ethereal mount.");
            }
        }
コード例 #5
0
		public static void DoOnTarget( Mobile from, object o, Mercenary merc )
		{
			EtherealMount ethy = o as EtherealMount;
			if ( null != ethy )
			{
				if ( null != ethy.Rider )
					from.SendMessage( "This ethereal mount is already in use by someone else." );

				else if ( !ethy.IsChildOf( from.Backpack ) )
					from.SendMessage( "The ethereal mount must be in your pack for you to use it." );
				else
					ethy.Rider = merc;
			}
			else
			{
				BaseMount mount = o as BaseMount;

				if ( null == mount )
					from.SendMessage( "That is not a mount." );

				else if ( null != mount.Rider )
					from.SendMessage( "This mount is already in use by someone else." );

				else if ( mount.ControlMaster != from )
					from.SendMessage( "You do not own this mount." );
				else
					mount.Rider = merc;
			}
		}
コード例 #6
0
ファイル: Bola.cs プロジェクト: jaedan/runuo
            protected override void OnTarget(Mobile from, object obj)
            {
                if (m_Bola.Deleted)
                {
                    return;
                }

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!m_Bola.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
                    }
                    else if (!HasFreeHands(from))
                    {
                        from.SendLocalizedMessage(1040015); // Your hands must be free to use this
                    }
                    else if (from.Mounted)
                    {
                        from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
                    }
                    else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
                    {
                        from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
                    }
                    else if (!to.Mounted && !Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(to))
                    {
                        from.SendLocalizedMessage(1049628); // You have no reason to throw a bola at that.
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        EtherealMount.StopMounting(from);

                        from.DoHarmful(to);

                        m_Bola.Consume();

                        from.Direction = from.GetDirectionTo(to);
                        from.Animate(11, 5, 1, true, false, 0);
                        from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                        Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to });
                    }
                    else
                    {
                        from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1049629); // You cannot throw a bola at that.
                }
            }
コード例 #7
0
 public EtherealMountClone(EtherealMount original) : base(original.MountedID)
 {
     foreach (var property in (typeof(EtherealMount)).GetProperties())
     {
         if (property.CanRead && property.CanWrite && property.Name != "Rider")
         {
             property.SetValue(this, property.GetValue(original, null), null);
         }
     }
 }
コード例 #8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631); // This bola is already being used.
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendLocalizedMessage(1040015); // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
            }
            else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
            }
            else if (from.Flying)
            {
                from.SendLocalizedMessage(1113414);                 // You cannot use this while flying!
            }
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    Item one = from.FindItemOnLayer(Layer.OneHanded);
                    Item two = from.FindItemOnLayer(Layer.TwoHanded);

                    if (one != null)
                    {
                        from.AddToBackpack(one);
                    }

                    if (two != null)
                    {
                        from.AddToBackpack(two);
                    }
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);               // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
コード例 #9
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is EtherealMount)
                {
                    EtherealMount mount = targeted as EtherealMount;

                    if (mount is GMEthereal)
                    {
                        from.SendMessage("You cannot use it on this!");
                    }
                    else if (mount.IsChildOf(from.Backpack) && RewardSystem.CheckIsUsableBy(from, m_Tool, null))
                    {
                        if (m_Table.ContainsKey(mount.GetType()))
                        {
                            EtherealEntry entry = m_Table[mount.GetType()];

                            if (mount.MountedID == entry.NormalID)
                            {
                                mount.MountedID = entry.TransparentID;
                                from.SendLocalizedMessage(1113817); // Your ethereal mount's transparency has been restored.
                            }
                            else
                            {
                                mount.MountedID = entry.NormalID;
                                from.SendLocalizedMessage(1113816); // Your ethereal mount's body has been solidified.
                            }

                            if (mount.EtherealHue != 0 && mount.Hue == 0)
                            {
                                mount.EtherealHue = 0;
                            }
                        }
                        else
                        {
                            if (mount.EtherealHue != EtherealMount.DefaultEtherealHue)
                            {
                                mount.EtherealHue = EtherealMount.DefaultEtherealHue;
                                from.SendLocalizedMessage(1113817); // Your ethereal mount's transparency has been restored.
                            }
                            else
                            {
                                mount.EtherealHue = mount.OriginalHue;
                                from.SendLocalizedMessage(1113816); // Your ethereal mount's body has been solidified.
                            }
                        }

                        mount.InvalidateProperties();
                        from.PlaySound(0x242);
                    }
                }
            }
コード例 #10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1049631, from.NetState); // This bola is already being used.
            }
            else if (from.Mounted)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount!
            }
            else if (from.Flying)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying!
            }
            else if (AnimalForm.UnderTransformation(from))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form!
            }
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    Item one = from.FindItemOnLayer(Layer.OneHanded);
                    Item two = from.FindItemOnLayer(Layer.TwoHanded);

                    if (one != null)
                    {
                        from.AddToBackpack(one);
                    }

                    if (two != null)
                    {
                        from.AddToBackpack(two);
                    }
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 201, 1049632);               // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 201, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
コード例 #11
0
        public static void AddProperty(EtherealMount mount, ObjectPropertyList list)
        {
            Type   t      = mount.GetType();
            string cliloc = "";

            if (m_Table.ContainsKey(t))
            {
                cliloc = mount.MountedID == mount.DefaultMountedID ? "#1078520" : "#1153298";
            }
            else
            {
                cliloc = mount.EtherealHue == EtherealMount.DefaultEtherealHue ? "#1078520" : "#1153298";
            }

            list.Add(1113818, cliloc);
        }
コード例 #12
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is EtherealMount)
     {
         EtherealMount EtherealMount = targeted as EtherealMount;
         if (!from.InRange(m_LTub.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1))
         {
             from.SendLocalizedMessage(500446); // That is too far away.
         }
         else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile))
         {
             from.SendMessage("You cannot dye that in it's current location.");
         }
         EtherealMount.Hue = m_LTub.Hue;
         from.PlaySound(0x23E);
     }
 }
コード例 #13
0
ファイル: Bola.cs プロジェクト: StoryOfTheBard/UOLegends
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("The bola must be in your pack to use it.");
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendAsciiMessage("You have to wait a few moments before you can use another bola!");
            }
            else if (from.Target is BolaTarget)
            {
                from.SendAsciiMessage("This bola is already being used.");
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendAsciiMessage("Your hands must be free to use this");
            }
            else if (from.Mounted)
            {
                from.SendAsciiMessage("You cannot use this while riding a mount.");
            }
            else
            {
                EtherealMount.StopMounting(from);

                Item one = from.FindItemOnLayer(Layer.OneHanded);
                Item two = from.FindItemOnLayer(Layer.TwoHanded);

                if (one != null)
                {
                    from.AddToBackpack(one);
                }

                if (two != null)
                {
                    from.AddToBackpack(two);
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
コード例 #14
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Tool.IsChildOf(from.Backpack) && targeted is EtherealMount)
                {
                    EtherealMount mount = targeted as EtherealMount;

                    if (mount is GMEthereal)
                    {
                        from.SendMessage("You cannot use it on this!");
                    }
                    else if (mount.IsChildOf(from.Backpack) && RewardSystem.CheckIsUsableBy(from, m_Tool, null))
                    {
                        mount.Transparent = mount.Transparent ? false : true;
                        from.PlaySound(0x242);

                        mount.InvalidateProperties();
                    }
                }
            }
コード例 #15
0
        protected virtual void OnBeforeThrownAt(Mobile m, TEntity target)
        {
            if (m == null || m.Deleted || target == null || !CanThrowAt(m, target, false))
            {
                return;
            }

            if (m.Spell != null)
            {
                m.Spell.OnCasterUsingObject(this);
            }

            if (DismountUser)
            {
                EtherealMount.StopMounting(m);
            }

            if (ClearHands)
            {
                m.ClearHands();
            }

            if (DismountUser && m.Mounted)
            {
                BaseMount.Dismount(m);
            }

            if ((m.Direction & Direction.Running) != Direction.Running)
            {
                m.Direction = m.GetDirectionTo(target.Location);
            }

            m.Animate(11, 5, 1, true, false, 0);

            if (ThrowSound >= 0)
            {
                m.PlaySound(ThrowSound);
            }
        }
コード例 #16
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is EtherealMount)
                {
                    EtherealMount ethereal = (EtherealMount)targeted;

                    ethereal.SolidHue = !ethereal.SolidHue;

                    if (ethereal.SolidHue)
                    {
                        from.SendLocalizedMessage(1113816);                           // Your ethereal mount's body has been solidified.
                    }
                    else
                    {
                        from.SendLocalizedMessage(1113817);                           // Your ethereal mount's transparency has been restored.
                    }
                }
                else
                {
                    from.SendMessage("You cannot use your retouching tool on that.");
                }
            }
コード例 #17
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!m_Tool.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
                else if (targeted is EtherealMount)
                {
                    EtherealMount mount = targeted as EtherealMount;

                    if (!mount.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it.
                    }
                    else if (mount is GMEthereal || mount is EtherealWarBoar)
                    {
                        from.SendLocalizedMessage(1071117); // You cannot use this item for it.
                    }
                    else if (RewardSystem.CheckIsUsableBy(from, m_Tool, null))
                    {
                        if (mount.Transparent)
                        {
                            from.SendLocalizedMessage(1113816); // Your ethereal mount's body has been solidified.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1113817); // Your ethereal mount's transparency has been restored.
                        }
                        mount.Transparent = mount.Transparent ? false : true;
                        mount.InvalidateProperties();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1046439); // That is not a valid target.
                }
            }
コード例 #18
0
ファイル: Bola.cs プロジェクト: StoryOfTheBard/UOLegends
            protected override void OnTarget(Mobile from, object obj)
            {
                if (m_Bola.Deleted)
                {
                    return;
                }

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!m_Bola.IsChildOf(from.Backpack))
                    {
                        from.SendAsciiMessage("The bola must be in your pack to use it.");
                    }
                    else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
                    {
                        from.SendAsciiMessage("Your hands must be free to use this.");
                    }
                    else if (from.Mounted)
                    {
                        from.SendAsciiMessage("You cannot use this while riding a mount.");
                    }
                    else if (!to.Mounted)
                    {
                        from.SendAsciiMessage("You have no reason to throw a bola at that.");
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        EtherealMount.StopMounting(from);

                        Item one = from.FindItemOnLayer(Layer.OneHanded);
                        Item two = from.FindItemOnLayer(Layer.TwoHanded);

                        if (one != null)
                        {
                            from.AddToBackpack(one);
                        }

                        if (two != null)
                        {
                            from.AddToBackpack(two);
                        }

                        from.DoHarmful(to);

                        if (Core.AOS)
                        {
                            Timer timer = new BolaTimer(from);
                            timer.Start();

                            AddContext(from, new BolaContext(timer));
                        }

                        m_Bola.Consume();

                        from.Direction = from.GetDirectionTo(to);
                        from.Animate(11, 5, 1, true, false, 0);
                        from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                        Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishThrow), new object[] { from, to });
                    }
                    else
                    {
                        from.SendAsciiMessage("You have to wait a few moments before you can use another bola!");
                    }
                }
                else
                {
                    from.SendAsciiMessage("You cannot throw a bola at that.");
                }
            }
コード例 #19
0
 public static void AddProperty(EtherealMount mount, ObjectPropertyList list)
 {
     list.Add(1113818, mount.Transparent ? "#1078520" : "#1153298");
 }
コード例 #20
0
            protected override void OnTarget(Mobile from, object obj)
            {
                if (m_Bola.Deleted)
                {
                    return;
                }

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!m_Bola.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1040019);                           // The bola must be in your pack to use it.
                    }
                    else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
                    {
                        from.SendLocalizedMessage(1040015);                           // Your hands must be free to use this
                    }
                    else if (from.Mounted)
                    {
                        from.SendLocalizedMessage(1040016);                           // You cannot use this while riding a mount
                    }
                    else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
                    {
                        from.SendLocalizedMessage(1070902);                           // You can't use this while in an animal form!
                    }
                    else if (!to.Mounted)
                    {
                        from.SendLocalizedMessage(1049628);                           // You have no reason to throw a bola at that.
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        EtherealMount.StopMounting(from);

                        Item one = from.FindItemOnLayer(Layer.OneHanded);
                        Item two = from.FindItemOnLayer(Layer.TwoHanded);

                        if (one != null)
                        {
                            from.AddToBackpack(one);
                        }

                        if (two != null)
                        {
                            from.AddToBackpack(two);
                        }

                        from.DoHarmful(to);

                        if (Core.AOS)
                        {
                            BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(3.0));
                        }

                        m_Bola.Consume();

                        from.Direction = from.GetDirectionTo(to);
                        from.Animate(11, 5, 1, true, false, 0);
                        from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                        Timer.DelayCall <Mobile[]>(TimeSpan.FromSeconds(0.5), new TimerStateCallback <Mobile[]>(FinishThrow), new Mobile[] { from, to });
                    }
                    else
                    {
                        from.SendLocalizedMessage(1049624);                           // You have to wait a few moments before you can use another bola!
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1049629);                       // You cannot throw a bola at that.
                }
            }
コード例 #21
0
ファイル: JailCommand.cs プロジェクト: Orion321/unknown-shard
        public static void JailThem(PlayerMobile player, JailOption option)
        {
            if (null == player || player.AccessLevel >= JailConfig.JailImmuneLevel)
            {
                return;
            }

            if (JailOption.Squelch == option)
            {
                player.Squelched = true;
            }

            foreach (Item item in player.Items)
            {
                if (item is JailHammer)                                                     // Jailed while jailed gets them another load of rock to mine
                {
                    if (0 > (((JailHammer)item).UsesRemaining += JailConfig.UsesRemaining)) // handle integer overflow
                    {
                        ((JailHammer)item).UsesRemaining *= -1;
                    }

                    Banker.Withdraw(player, JailConfig.FineAmount);
                    player.SendMessage("Your remaining sentence has been increased!");
                    player.SendMessage("You have been fined {0} gold and are being kicked!", JailConfig.FineAmount);

                    // This gives a nice little delay for the message to be read
                    s_KickProcessingQueue.Enqueue(player);
                    player.Squelched = true;
                    Server.Timer.DelayCall(TimeSpan.FromSeconds(kSecondsTillKick), new Server.TimerCallback(KickPlayerInQueue));
                    return;
                }
            }

            // If mounted, dismount them and stable mount
            if (player.Mounted)
            {
                if (player.Mount is EtherealMount)
                {
                    EtherealMount pet = player.Mount as EtherealMount;
                    pet.Internalize();
                    pet.Rider = null;
                }
                else if (player.Mount is BaseMount)
                {
                    BaseMount pet = player.Mount as BaseMount;
                    pet.Rider = null;
                    Jail.StablePet(player, pet);
                }
            }

            // Stable all other pets
            foreach (Mobile mobile in World.Mobiles.Values)
            {
                if (mobile is BaseCreature)
                {
                    BaseCreature bc = mobile as BaseCreature;

                    if (null != bc && (bc.Controlled && bc.ControlMaster == player) || (bc.Summoned && bc.SummonMaster == player))
                    {
                        Jail.StablePet(player, bc);
                    }
                }
            }

            // Move all items to a bag and move that to the bank
            Container backpack     = player.Backpack;
            Backpack  bag          = new Backpack(); bag.Hue = JailConfig.RobeHue;
            ArrayList equipedItems = new ArrayList(player.Items);

            foreach (Item item in equipedItems)
            {
                if (item.Layer == Layer.Bank || item.Layer == Layer.Backpack || item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || item is DeathShroud)
                {
                    continue;
                }
                bag.DropItem(item);
            }

            ArrayList backpackItems = new ArrayList(backpack.Items);

            foreach (Item item in backpackItems)
            {
                if (item is JailRock)
                {
                    item.Delete();
                }
                else if (item.Movable)                          // Non movable pack items must remain (i.e. skill balls)
                {
                    bag.DropItem(item);
                }
            }

            // Remember their access level and make them a player
            JailHammer hammer = new JailHammer();

            hammer.PlayerAccessLevel = player.AccessLevel;
            player.AccessLevel       = AccessLevel.Player;

            // Bank the bag of belongings, give them a hammer and welcome them
            player.BankBox.DropItem(bag);
            player.AddItem(hammer);

            // Explosively move player to jail
            player.BoltEffect(0);
            player.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Waist);
            player.PlaySound(0x307);
            player.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
            player.PlaySound(0x225);

            // This gives a nice little delay for the effect to complete
            s_JailProcessingQueue.Enqueue(player);
            Server.Timer.DelayCall(TimeSpan.FromSeconds(kSecondsTillJail), new Server.TimerCallback(JailPlayerInQueue));
        }
コード例 #22
0
ファイル: Bola.cs プロジェクト: Tauriella/ServUO-1
            protected override void OnTarget(Mobile from, object obj)
            {
                if (m_Bola.Deleted)
                {
                    return;
                }

                if ((obj is Item))
                {
                    ((Item)obj).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049628, from.NetState); // You have no reason to throw a bola at that.
                    return;
                }

                if (obj is Mobile)
                {
                    Mobile to = (Mobile)obj;

                    if (!m_Bola.IsChildOf(from.Backpack))
                    {
                        m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
                    }
                    else if (from.Mounted)
                    {
                        m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount!
                    }
                    else if (from.Flying)
                    {
                        m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying!
                    }
                    else if (from == to)
                    {
                        from.SendLocalizedMessage(1005576); // You can't throw this at yourself.
                    }
                    else if (AnimalForm.UnderTransformation(from))
                    {
                        from.PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form!
                    }
                    else if (!to.Mounted && !to.Flying && !AnimalForm.UnderTransformation(to))
                    {
                        to.PrivateOverheadMessage(MessageType.Regular, 946, 1049628, from.NetState); // You have no reason to throw a bola at that.
                    }
                    else if (!from.CanBeHarmful(to))
                    {
                    }
                    else if (from.BeginAction(typeof(Bola)))
                    {
                        from.RevealingAction();

                        EtherealMount.StopMounting(from);

                        Item one = from.FindItemOnLayer(Layer.OneHanded);
                        Item two = from.FindItemOnLayer(Layer.TwoHanded);

                        if (one != null)
                        {
                            from.AddToBackpack(one);
                        }

                        if (two != null)
                        {
                            from.AddToBackpack(two);
                        }

                        from.DoHarmful(to);

                        BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(10.0));
                        Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseBolaLock), from);
                        Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(FinishThrow), new object[] { from, to, m_Bola });
                    }
                    else
                    {
                        m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // You have to wait a few moments before you can use another bola!
                    }
                }
            }
コード例 #23
0
        public void makeready(Mobile who)
        {
            PlayerMobile c = (PlayerMobile)who;

            if (!who.Alive)
            {
                who.Resurrect();
            }

            Container bp      = c.Backpack;
            Container bankbag = new Bag();

            bankbag.Hue = 63;
            BankBox bank   = c.BankBox;
            Item    oncurs = c.Holding;

            if (oncurs != null)
            {
                bp.DropItem(oncurs);
            }

            c.SendMessage("You have 10 seconds until the duel begins");
            c.SendMessage(63, "After one of you dies, both of you will be teleported out");

            c.Criminal = true;
            c.CurePoison(c);

            c.Blessed = true;
            c.Frozen  = true;

            c.Hits = c.HitsMax;
            c.Mana = c.ManaMax;
            c.Stam = c.StamMax;

            c.StatMods.Clear();

            if (bp != null)
            {
                Item toDisarm = c.FindItemOnLayer(Layer.OneHanded);

                if (toDisarm == null || !toDisarm.Movable)
                {
                    toDisarm = c.FindItemOnLayer(Layer.TwoHanded);
                }

                if (toDisarm != null)
                {
                    bp.DropItem(toDisarm);
                }

                if (c.Mount != null)
                {
                    IMount mount = c.Mount;
                    mount.Rider = null;
                    if (mount is BaseMount)
                    {
                        BaseMount oldMount = (BaseMount)mount;
                        oldMount.Map = Map.Internal;
                        c.TempMount  = oldMount;
                    }
                }

                //while((BasePotion)bp.FindItemByType(typeof(BasePotion)) != null)
                //{
                //	BasePotion potion = (BasePotion)bp.FindItemByType(typeof(BasePotion));
                //	bankbag.DropItem(potion);
                //}
                while ((EtherealMount)bp.FindItemByType(typeof(EtherealMount)) != null)
                {
                    EtherealMount mount = (EtherealMount)bp.FindItemByType(typeof(EtherealMount));
                    bankbag.DropItem(mount);
                }

                /*Item[] weps = bp.FindItemsByType( typeof( BaseWeapon ) );
                 * for ( int i = 0; i < weps.Length; ++i )
                 * {
                 *      Item item = (Item)weps[i];
                 *      BaseWeapon weapon = item as BaseWeapon;
                 *      if( weapon.DamageLevel > WeaponDamageLevel.Regular )
                 *                              bankbag.DropItem( item );
                 * }*/
                if (bankbag.Items.Count > 0)
                {
                    bank.DropItem(bankbag);
                }
                else
                {
                    bankbag.Delete();
                }
            }
        }