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

                ISpinningWheel wheel = targeted as ISpinningWheel;

                if (wheel == null && targeted is AddonComponent component)
                {
                    wheel = component.Addon as ISpinningWheel;
                }

                if (wheel is Item)
                {
                    if (!m_Flax.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                    }
                    else if (wheel.Spinning)
                    {
                        from.SendLocalizedMessage(502656); // That spinning wheel is being used.
                    }
                    else
                    {
                        m_Flax.Consume();
                        wheel.BeginSpin(OnSpun, from, m_Flax.Hue);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502658); // Use that on a spinning wheel.
                }
            }
Ejemplo n.º 2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Flax.Deleted)
                {
                    return;
                }

                ISpinningWheel wheel = targeted as ISpinningWheel;

                if (wheel == null && targeted is AddonComponent)
                {
                    wheel = ((AddonComponent)targeted).Addon as ISpinningWheel;
                }

                if (wheel is Item)
                {
                    Item item = (Item)wheel;

                    if (!m_Flax.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1042001);                           // That must be in your pack for you to use it.
                    }
                    else if (wheel.Spinning)
                    {
                        from.SendLocalizedMessage(502656);                           // That spinning wheel is being used.
                    }
                    else
                    {
                        SpinningWheelQuotaAttachment att = (SpinningWheelQuotaAttachment)XmlAttach.FindAttachment(from, typeof(SpinningWheelQuotaAttachment));

                        if (att == null)
                        {
                            att = new SpinningWheelQuotaAttachment();
                            XmlAttach.AttachTo(from, att);
                        }
                        if (att.getNumWheels() < SpinningWheelQuotaAttachment.m_WheelQuotaCap)
                        {
                            att.AddWheels(item);
                            from.PublicOverheadMessage(Server.Network.MessageType.Emote, 51, false, "*spinning*");
                            m_Flax.Consume();
                            wheel.BeginSpin(new SpinCallback(Flax.OnSpunLoop), from, m_Flax.Hue, m_Flax);
                        }
                        else
                        {
                            from.SendMessage("You are too occupied with the " + SpinningWheelQuotaAttachment.m_WheelQuotaCap.ToString() + " spinning wheels you are running.");
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502658);                       // Use that on a spinning wheel.
                }
            }
Ejemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Flax.Deleted)
                {
                    return;
                }

                ISpinningWheel wheel = targeted as ISpinningWheel;

                if (wheel == null && targeted is AddonComponent)
                {
                    wheel = ((AddonComponent)targeted).Addon as ISpinningWheel;
                }

                if (wheel is Item)
                {
                    Item item = (Item)wheel;

                    if (!m_Flax.IsChildOf(from.Backpack))
                    {
                        from.SendAsciiMessage("That must be in your pack for you to use it.");
                    }
                    else if (wheel.Spinning)
                    {
                        from.SendAsciiMessage("That spinning wheel is being used.");
                    }
                    else
                    {
                        m_Flax.Consume();
                        wheel.BeginSpin(new SpinCallback(Flax.OnSpun), from, m_Flax.Hue);
                    }
                }
                else
                {
                    from.SendAsciiMessage("Use that on a spinning wheel.");
                }
            }