コード例 #1
0
ファイル: TrickOrTreat.cs プロジェクト: Evad-lab/ServUOX
        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);
                }
            }
        }