Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseCarvablePumpkin)
                {
                    BaseCarvablePumpkin pumpkin = (BaseCarvablePumpkin)targeted;

                    if (!pumpkin.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it.
                    }
                    else if (pumpkin.CarvedBy == null)
                    {
                        from.PlaySound(0x249);

                        pumpkin.ItemID   = pumpkin.PumpkinDefinition[Utility.Random(pumpkin.PumpkinDefinition.Length)].UnlitItemID;
                        pumpkin.CarvedBy = from.Name;
                        pumpkin.InvalidateProperties();

                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1154339); // *You carefully carve the pumpkin*

                        m_Item.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1154272); // That is not suitable for carving.
                }
            }
Exemple #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseCarvablePumpkin)
                {
                    BaseCarvablePumpkin pumpkin = (BaseCarvablePumpkin)targeted;

                    from.PlaySound(0x249);

                    pumpkin.ItemID   = pumpkin.PumpkinDefinition[Utility.Random(pumpkin.PumpkinDefinition.Length)].UnlitItemID;
                    pumpkin.CarvedBy = from.Name;

                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1154339); // *You carefully carve the pumpkin*

                    m_Item.Delete();
                }
                else
                {
                    from.SendLocalizedMessage(1154272); // That is not suitable for carving.
                }
            }