Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Wool.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_Wool.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_Wool.Consume();
                            if (m_Wool is TaintedWool)
                            {
                                wheel.BeginSpin(new SpinCallback(TaintedWool.OnSpunLoop), from, m_Wool.Hue, m_Wool);
                            }
                            else
                            {
                                wheel.BeginSpin(new SpinCallback(Wool.OnSpunLoop), from, m_Wool.Hue, m_Wool);
                            }
                        }
                        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.
                }
            }
Exemple #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Wool.Deleted)
                {
                    return;
                }

                ISpinningWheel wheel = targeted as ISpinningWheel;

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

                if (wheel is Item)
                {
                    if (!m_Wool.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_Wool.Consume();
                        wheel.BeginSpin(new SpinCallback(Wool.OnSpun), from, m_Wool.Hue);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502658);                       // Use that on a spinning wheel.
                }
            }