예제 #1
0
        public static Item FindCandyTypes(Mobile target)
        {
            Type[] types = { typeof(WrappedCandy), typeof(Lollipops), typeof(NougatSwirl), typeof(Taffy), typeof(JellyBeans) };

            if (TrickOrTreat.CheckMobile(target))
            {
                for (int i = 0; i < types.Length; i++)
                {
                    Item item = target.Backpack.FindItemByType(types[i]);

                    if (item != null)
                    {
                        return(item);
                    }
                }
            }
            return(null);
        }
예제 #2
0
        public static Item FindCandyTypes(Mobile target)
        {
            Type[] types = { typeof(WrappedCandy), typeof(RedLollipop), typeof(GreenLollipop), typeof(YellowLollipop), typeof(RedCandyCane), typeof(GreenCandyCane), typeof(Jellybeans), typeof(Nougat) };

            if (TrickOrTreat.CheckMobile(target))
            {
                for (int i = 0; i < types.Length; i++)
                {
                    Item item = target.Backpack.FindItemByType(types[i]);

                    if (item != null)
                    {
                        return(item);
                    }
                }
            }
            return(null);
        }
예제 #3
0
        public static void StealCandyOrGate(Mobile target)
        {
            if (TrickOrTreat.CheckMobile(target))
            {
                if (Utility.RandomBool())
                {
                    Item item = FindCandyTypes(target);

                    target.SendLocalizedMessage(1113967); /* Your naughty twin steals some of your candy. */

                    if (item?.Deleted == false)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    target.SendLocalizedMessage(1113972); /* Your naughty twin teleports you away with a naughty laugh! */
                    target.MoveToWorld(RandomMoongate(target), target.Map);
                }
            }
        }