Example #1
0
        public string IsValidTarget(NWCreature user, NWItem item, NWObject target, Location targetLocation)
        {
            string type   = item.GetLocalString("BONUS_TYPE");
            int    length = item.GetLocalInt("BONUS_LENGTH");
            int    amount = item.GetLocalInt("BONUS_AMOUNT");

            if (string.IsNullOrWhiteSpace(type) || length <= 0 || amount <= 0)
            {
                return("ERROR: This food isn't set up properly. Please inform an admin. Resref: " + item.Resref);
            }

            bool hasFoodEffect = _customEffect.DoesPCHaveCustomEffectByCategory(user.Object, CustomEffectCategoryType.FoodEffect);

            if (hasFoodEffect)
            {
                return("You are not hungry right now.");
            }

            return(null);
        }