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); }
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); }
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); } } }