Example #1
0
        /// <summary>
        /// Counts the number of control points used by a necromancer's pets.
        /// </summary>
        /// <param name="ch"></param>
        /// <returns></returns>
        public static int CountUndeadPets(CharData ch)
        {
            CharData pet;
            int      count = 0;

            foreach (CharData flist in ch.Followers)
            {
                pet = flist;
                if (pet && pet.IsNPC())
                {
                    if ("skeleton undead".StartsWith(pet.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        count += Table[UNDEAD_SKELETON].Slots;
                    }
                    if ("zombie undead".StartsWith(pet.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        count += Table[UNDEAD_ZOMBIE].Slots;
                    }
                    if ("spectre undead".StartsWith(pet.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        count += Table[UNDEAD_SPECTRE].Slots;
                    }
                    if ("wraith undead".StartsWith(pet.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        count += Table[UNDEAD_WRAITH].Slots;
                    }
                    if ("vampire undead".StartsWith(pet.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        count += Table[UNDEAD_VAMPIRE].Slots;
                    }
                    if ("lich undead".StartsWith(pet.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        count += Table[UNDEAD_LICH].Slots;
                    }
                    if (!MUDString.IsSuffixOf("dracolich undead", pet.Name))
                    {
                        count += Table[UNDEAD_RED_DRACO].Slots;
                    }
                    if (!MUDString.IsSuffixOf("dracolich undead", pet.Name))
                    {
                        count += Table[UNDEAD_BLUE_DRACO].Slots;
                    }
                    if (!MUDString.IsSuffixOf("dracolich undead", pet.Name))
                    {
                        count += Table[UNDEAD_BLACK_DRACO].Slots;
                    }
                    if (!MUDString.IsSuffixOf("dracolich undead", pet.Name))
                    {
                        count += Table[UNDEAD_GREEN_DRACO].Slots;
                    }
                    if (!MUDString.IsSuffixOf("dracolich undead", pet.Name))
                    {
                        count += Table[UNDEAD_WHITE_DRACO].Slots;
                    }
                }
            }
            return(count);
        }