Exemple #1
0
        public static void CheckBoss(BaseCreature bc, ref int budget)
        {
            for (var i = 0; i < Entries.Count; i++)
            {
                BossEntry entry = Entries[i];

                Type first = null;

                for (var index = 0; index < entry.List.Count; index++)
                {
                    var t = entry.List[index];

                    if (t == bc.GetType() || bc.GetType().IsSubclassOf(t))
                    {
                        first = t;
                        break;
                    }
                }

                if (first != null)
                {
                    budget += entry.Bonus;
                    return;
                }
            }
        }
Exemple #2
0
        public static bool ValidateTarget(BaseCreature bc)
        {
            if (bc is BaseRenowned || bc is BaseChampion || bc is Engines.Shadowguard.ShadowguardBoss)
            {
                return(false);
            }

            for (var index = 0; index < _CommandTypes.Length; index++)
            {
                Type t = _CommandTypes[index];

                if (t == bc.GetType())
                {
                    return(true);
                }
            }

            for (var index = 0; index < _NoCommandTypes.Length; index++)
            {
                Type t = _NoCommandTypes[index];

                if (t == bc.GetType())
                {
                    return(false);
                }
            }

            SlayerEntry entry = SlayerGroup.GetEntryByName(SlayerName.Silver);

            return(entry != null && entry.Slays(bc));
        }
Exemple #3
0
        private bool ValidateTarget(BaseCreature bc)
        {
            if (bc is BaseRenowned || bc is BaseChampion || bc is Server.Engines.Shadowguard.ShadowguardBoss)
            {
                return(false);
            }

            foreach (var t in _CommandTypes)
            {
                if (t == bc.GetType())
                {
                    return(true);
                }
            }

            foreach (var t in _NoCommandTypes)
            {
                if (t == bc.GetType())
                {
                    return(false);
                }
            }

            SlayerEntry entry = SlayerGroup.GetEntryByName(SlayerName.Silver);

            return(entry != null && entry.Slays(bc));
        }
Exemple #4
0
 public static void CheckBoss(BaseCreature bc, ref int budget)
 {
     foreach (var entry in Entries)
     {
         if (entry.List.FirstOrDefault(t => t == bc.GetType() || bc.GetType().IsSubclassOf(t)) != null)
         {
             budget += entry.Bonus;
             return;
         }
     }
 }
Exemple #5
0
 public virtual void SetRestricted(BaseCreature pet, bool restrict)
 {
     if (pet != null)
     {
         SetRestricted(pet.GetType(), restrict);
     }
 }
            protected override void OnTarget(Mobile from, object targeted)
            {
                BaseCreature male = targeted as BaseCreature;

                if (male == null)
                {
                    from.SendMessage("You must select an animal to breed with!");
                }
                else if (male.Female)
                {
                    from.SendMessage("That is a female!");
                }
                else if (!male.BreedingEnabled)
                {
                    from.SendMessage("That creature is not capable of being bred.");
                }
                else if (male.GetType() != m_Female.GetType())
                {
                    from.SendMessage("Both the male and female must be the same species.");
                }
                else if (!male.Controlled)
                {
                    from.SendMessage("The animal must be tamed before it can be bred.");
                }
                else
                {
                    from.SendMessage("Target where the child should be born.");
                    from.Target = new ChildTarget(m_Female, male);
                }
            }
Exemple #7
0
        private bool IsHerdable(BaseCreature bc)
        {
            if (bc.IsParagon)
            {
                return(false);
            }

            if (bc.Tamable)
            {
                return(true);
            }

            Map map = bc.Map;


            if (Region.Find(bc.Home, map) is ChampionSpawnRegion region)
            {
                ChampionSpawn spawn = region.ChampionSpawn;

                if (spawn != null && spawn.IsChampionSpawn(bc))
                {
                    Type t = bc.GetType();

                    foreach (Type type in m_ChampTamables)
                    {
                        if (type == t)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
        public static string GetOriginalName(BaseCreature bc)
        {
            if (bc == null)
            {
                return(null);
            }

            Type t = bc.GetType();

            if (m_NameBuffer.ContainsKey(t))
            {
                return(m_NameBuffer[t]);
            }

            BaseCreature c = Activator.CreateInstance(t) as BaseCreature;

            if (c != null)
            {
                c.Delete();
                AddToBuffer(t, c.Name);
                return(c.Name);
            }

            return(t.Name);
        }
Exemple #9
0
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            BaseCreature bc = victim as BaseCreature;

            if (bc == null || bc.Map != Map.TerMur || damager.Map != Map.TerMur)
            {
                return;
            }

            Type type = bc.GetType();

            if (!Entries.ContainsKey(type))
            {
                return;
            }

            if (damager is BaseCreature && (((BaseCreature)damager).Controlled || ((BaseCreature)damager).Summoned))
            {
                damager = ((BaseCreature)damager).GetMaster();
            }

            if (damager == null)
            {
                return;
            }

            if (bc.GetHighestDamager() == damager)
            {
                AwardPoints(damager, Entries[type].Item1, false);
            }
            else
            {
                AwardPoints(damager, Entries[type].Item2, false);
            }
        }
Exemple #10
0
        public override void ProcessKill(BaseCreature victim, Mobile damager, int index)
        {
            if (victim.Map != Map.TerMur || damager.Map != Map.TerMur)
            {
                return;
            }

            Type type = victim.GetType();

            if (damager is BaseCreature && (((BaseCreature)damager).Controlled || ((BaseCreature)damager).Summoned))
            {
                damager = ((BaseCreature)damager).GetMaster();
            }

            if (damager == null)
            {
                return;
            }

            if (index == 0)
            {
                if (Entries.ContainsKey(type))
                {
                    AwardPoints(damager, Entries[type].Item1, false);
                }
            }
            else
            {
                if (Entries.ContainsKey(type))
                {
                    AwardPoints(damager, Entries[type].Item2, false);
                }
            }
        }
Exemple #11
0
        public static void ProcessKill(BaseCreature victim, Mobile damager, bool highestDamager)
        {
            Type type = victim.GetType();

            if (damager is BaseCreature && (((BaseCreature)damager).Controlled || ((BaseCreature)damager).Summoned))
            {
                damager = ((BaseCreature)damager).GetMaster();
            }

            if (damager == null)
            {
                return;
            }

            if (highestDamager)
            {
                if (PointsEntry.Entries.ContainsKey(type))
                {
                    AwardPoints(damager, PointsEntry.Entries[type].TopAttackerPoints, false);
                }
            }
            else
            {
                if (PointsEntry.Entries.ContainsKey(type))
                {
                    AwardPoints(damager, PointsEntry.Entries[type].RightsPoints, false);
                }
            }
        }
Exemple #12
0
            public bool QuestTargets(BaseCreature creature, Mobile from)
            {
                if (creature != null)
                {
                    Mobile getmaster = creature.GetMaster();

                    if (getmaster != null)
                    {
                        if (getmaster is PlayerMobile)
                        {
                            return(false);
                        }
                    }

                    if (from is PlayerMobile && (m_Creature.GetType() == typeof(Rabbit) || m_Creature.GetType() == typeof(JackRabbit)) && ((creature is WanderingHealer) || (creature is EvilWanderingHealer)))
                    {
                        return(true);
                    }

                    return(false);
                }
                else
                {
                    return(false);
                }
            }
        public StabledGump(Mobile from, Mobile targeted, List <Mobile> list) : base(50, 50)
        {
            m_From     = from;
            m_Targeted = targeted;
            m_List     = list;

            AddPage(0);

            AddBackground(0, 0, 500, 50 + (list.Count * 20), 9250);
            AddAlphaRegion(5, 5, 495, 40 + (list.Count * 20));

            AddHtml(15, 15, 275, 20, "<BASEFONT COLOR=#FFFFFF>Select a pet to retrieve from the stables:</BASEFONT>", false, false);

            for (int i = 0; i < list.Count; ++i)
            {
                BaseCreature pet = list[i] as BaseCreature;

                if (pet == null || pet.Deleted)
                {
                    continue;
                }
                string fullPetType = pet.GetType().ToString();
                string petType     = fullPetType.Substring(15);   //remove the Server.Mobile. from Type string
                AddButton(15, 39 + (i * 20), 10006, 10006, i + 1, GumpButtonType.Reply, 0);
                AddHtml(32, 35 + (i * 20), 218, 18, String.Format("<BASEFONT COLOR=#C0C0EE>{0}</BASEFONT>", pet.Name), false, false);
                AddHtml(251, 35 + (i * 20), 218, 18, String.Format("<BASEFONT COLOR=#C0C0EE>{0}</BASEFONT>", petType), false, false);
            }
        }
            private bool IsHerdable(BaseCreature bc)
            {
                if (bc.IsParagon)
                {
                    return(false);
                }

                if (bc.Tamable)
                {
                    return(true);
                }

                var map = bc.Map;

                if (Region.Find(bc.Home, map) is ChampionSpawnRegion region)
                {
                    var spawn = region.Spawn;

                    if (spawn?.IsChampionSpawn(bc) == true)
                    {
                        var t = bc.GetType();

                        foreach (var type in m_ChampTamables)
                        {
                            if (type == t)
                            {
                                return(true);
                            }
                        }
                    }
                }

                return(false);
            }
Exemple #15
0
 public override void OnKill(BaseCreature creature, Container corpse)
 {
     if (System is TimeForLegendsQuest && creature.GetType() == ((TimeForLegendsQuest)System).ToSlay)
     {
         Complete();
     }
 }
Exemple #16
0
        public static void HandleKill(BaseCreature victim, Mobile damager, bool highestDamager)
        {
            if (victim == null || damager == null || damager.Map != Map.TerMur)
                return;

            if(PointsEntry.Entries.ContainsKey(victim.GetType()))
                ProcessKill(victim, damager, highestDamager);
        }
Exemple #17
0
            public bool QuestTargets(BaseCreature creature, Mobile from)
            {
                if (creature != null && from is PlayerMobile && (m_Creature.GetType() == typeof(Rabbit) || m_Creature.GetType() == typeof(JackRabbit)) && ((creature is WanderingHealer) || (creature is EvilWanderingHealer)))
                {
                    return(true);
                }

                return(false);
            }
Exemple #18
0
        public static void HandleKill(BaseCreature victim, Mobile damager, bool highestDamager)
        {
            if (victim == null || damager == null || damager.Map != Map.TerMur)
            {
                return;
            }

            if (PointsEntry.Entries.ContainsKey(victim.GetType()))
            {
                ProcessKill(victim, damager, highestDamager);
            }
        }
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Item)
                {
                    from.SendMessage("That cannot be shrunken.");
                }

                else if (o is PlayerMobile)
                {
                    from.SendMessage("That cannot be shrunken.");
                }

                else if (o is BaseEscortable)
                {
                    from.SendMessage("You can't shrink me.");
                }

                /*else if ( o is RoninsBaseCreature && ( (RoninsBaseCreature)o).Pregnant == true )
                 *  from.SendMessage( 53, "Warning! Shrinking a pet while pregnant could cause a server crash." );
                 *
                 * else if ( o is RoninsBaseCreature && ( (RoninsBaseCreature)o).IsMating == true )
                 *  from.SendMessage( 53, "Warning! Shrinking a pet while mating could cause a server crash." );*/

                else if (o is BaseCreature)
                {
                    BaseCreature c    = (BaseCreature)o;
                    Type         type = c.GetType();
                    ShrinkItem   si   = new ShrinkItem();
                    si.MobType  = type;
                    si.Pet      = c;
                    si.PetOwner = from;

                    if (c is BaseMount)
                    {
                        BaseMount mount = (BaseMount)c;
                        si.MountID = mount.ItemID;
                    }
                    from.AddToBackpack(si);

                    c.Controlled    = true;
                    c.ControlMaster = null;
                    c.Internalize();

                    c.OwnerAbandonTime = DateTime.MinValue;

                    c.IsStabled = true;
                }
                else
                {
                    from.SendMessage("You cannot shrink that, MOBILES ONLY");
                }
            }
Exemple #20
0
            protected override void OnTarget(Mobile from, object targ)
            {
                if (targ is BaseCreature)
                {
                    bool summoned = false;
                    m_Creature = (BaseCreature)targ;

                    Type[] m_Summoned = new Type[]
                    {
                        typeof(Skeleton),
                        typeof(SkeletalKnight),
                        typeof(Mummy),
                        typeof(Zombie),
                        typeof(SkeletalDragon),
                        typeof(Wraith),
                        typeof(ChaosDaemon),
                        typeof(BoneDemon)
                    };

                    if (m_Creature.Controled && m_Creature.ControlMaster == m_Player)
                    {
                        for (int i = 0; i < m_Summoned.Length; i++)
                        {
                            if (m_Summoned[i] == m_Creature.GetType())
                            {
                                summoned = true;
                                break;
                            }
                        }

                        if (summoned)
                        {
                            m_Player.SendMessage("You send the creature back to the netherworld!");
                            m_Player.Emote("*You see {0} send the {1} back to the netherworld*", m_Player.Name, m_Creature.Name);
                            m_Creature.Delete();
                        }
                        else
                        {
                            m_Player.SendMessage("That is not a creature from the netherworld.");
                        }
                    }
                    else
                    {
                        m_Player.SendMessage("You don't have power over that creature.");
                    }
                }
                else
                {
                    m_Player.SendMessage("You can only dismiss summoned creatures.");
                }
            }
Exemple #21
0
        private bool ValidateTarget(BaseCreature bc)
        {
            foreach (var t in _CommandTypes)
            {
                if (t == bc.GetType())
                {
                    return(true);
                }
            }

            SlayerEntry entry = SlayerGroup.GetEntryByName(SlayerName.Silver);

            return(entry != null && entry.Slays(bc));
        }
Exemple #22
0
        public virtual void DonatePet(PlayerMobile player, BaseCreature pet)
        {
            for (int i = 0; i < m_Donations.Count; i++)
            {
                if (m_Donations[i].Type == pet.GetType() || MoonglowDonationBox.HasGroup(pet.GetType(), m_Donations[i].Type))
                {
                    pet.Delete();
                    Donate(player, m_Donations[i], 1);
                    return;
                }
            }

            player.SendLocalizedMessage(1073113); // This Collection is not accepting that type of creature.
        }
Exemple #23
0
        private static bool IsDropKeyMobile(BaseCreature bc)
        {
            for (var index = 0; index < m_Mobile.Length; index++)
            {
                var t = m_Mobile[index];

                if (t == bc.GetType())
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #24
0
        private static bool IsSnake(BaseCreature bc)
        {
            Type type = bc.GetType();

            for (int i = 0; i < m_SnakeTypes.Length; i++)
            {
                if (type == m_SnakeTypes[i])
                {
                    return(true);
                }
            }

            return(false);
        }
        public static string GetFormattedBreedString(BaseCreature pet)
        {
            string breed     = pet.GetType().Name;
            int    capsBreak = breed.IndexOfAny("ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(), 1);

            if (capsBreak > -1)
            {
                return(breed.Substring(0, capsBreak) + " " + breed.Substring(capsBreak));
            }
            else
            {
                return(breed);
            }
        }
        public virtual void DonatePet(PlayerMobile player, BaseCreature pet)
        {
            for (int i = 0; i < this.m_Donations.Count; i++)
            {
                if (this.m_Donations[i].Type == pet.GetType())
                {
                    pet.Delete();
                    this.Donate(player, this.m_Donations[i], 1);
                    return;
                }
            }

            player.SendLocalizedMessage(1073113); // This Collection is not accepting that type of creature.
        }
Exemple #27
0
        public static void CacheName(MobileCreatedEventArgs e)
        {
            if (NameCache.ContainsKey(e.Mobile.GetType()))
            {
                return;
            }

            BaseCreature bc = e.Mobile as BaseCreature;

            if (bc != null && !bc.Blessed && !bc.IsInvulnerable && (bc.Owners == null || bc.Owners.Count == 0))
            {
                AddNameToCache(bc.GetType());
            }
        }
Exemple #28
0
        static bool IsAuthorizedAccount(IAccount account, BaseCreature Subject)
        {
            if (account == null)
            {
                return(false);
            }

            if (IsAuthorizedStaff(account))
            {
                return(true);
            }

            if (PseudoSeerStone.Instance == null)
            {
                return(false);
            }

            Type creaturetype = Subject.GetType();
            //Console.WriteLine("Creature: " + creaturetype.ToString());
            string perms = PseudoSeerStone.Instance.GetPermissionsFor(account);

            //Console.WriteLine("perms: " + perms);
            if (perms == null)
            {
                return(false);
            }
            string[] permittedTypeStrings = perms.Split();
            string[] typesegments         = (creaturetype.ToString()).Split('.'); // string is something like Server.Mobiles.Orc
            if (typesegments.Length == 0)
            {
                return(false);
            }
            //Console.WriteLine("permittedTypeStrings: " + permittedTypeStrings);
            foreach (string permittedTypeString in permittedTypeStrings)
            {
                //Console.WriteLine(permittedTypeString.ToLower() + "=" + typesegments[typesegments.Length - 1] + "?");
                //Console.WriteLine("" + permittedTypeString.ToLower() == typesegments[typesegments.Length - 1].ToLower());
                if (permittedTypeString.ToLower() == typesegments[typesegments.Length - 1].ToLower() || permittedTypeString == "all")
                {
                    return(true);
                }
            }
            return(false);
            //PossessPermissions reqPerms;
            //if (PermissionDictionary.TryGetValue(creaturetype, out reqPerms))
            //    return (perms & reqPerms) != 0;
            // return false;
        }
Exemple #29
0
        /// <summary>
        /// Creates a new MobileStatuette object - for internal use only
        /// </summary>
        private MobileStatuette(BaseCreature creature)
        {
            m_Creature = creature;
            ItemID     = ShrinkTable.Lookup(m_Creature);
            Hue        = m_Creature.Hue;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();
            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;
            m_Creature.IsStabled    = true;

            // Set the type of the creature as the name for this item
            Name = Xanthos.Utilities.Misc.GetFriendlyClassName(creature.GetType().Name);
        }
Exemple #30
0
        /// <summary>
        /// Creates a new MobileStatuette object - for internal use only
        /// </summary>
        private MobileStatuette(BaseCreature creature)
        {
            m_Creature = creature;
            ItemID     = ShrinkTable.Lookup(m_Creature);
            Hue        = m_Creature.Hue;

            m_Creature.ControlTarget = null;
            m_Creature.ControlOrder  = OrderType.Stay;
            m_Creature.Internalize();
            m_Creature.SetControlMaster(null);
            m_Creature.SummonMaster = null;
            m_Creature.IsStabled    = true;

            // Set the type of the creature as the name for this item
            Name = InsertSpaces(creature.GetType().Name);
        }
Exemple #31
0
		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = InsertSpaces( creature.GetType().Name );
		}
		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = Xanthos.Utilities.Misc.GetFriendlyClassName( creature.GetType().Name );
		}
        public PetBrokerEntry(GenericReader reader)
        {
            int version = reader.ReadInt();

            m_Pet       = reader.ReadMobile() as BaseCreature;
            m_SalePrice = reader.ReadInt();
            m_TypeName  = reader.ReadString();

            if (m_Pet != null)
            {
                AddToBuffer(m_Pet.GetType(), m_TypeName);

                m_Pet.IsStabled = true;

                Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(Internalize));
            }
        }
Exemple #34
0
        public static void ProcessKill(BaseCreature victim, Mobile damager, bool highestDamager)
        {
            Type type = victim.GetType();

            if (damager is BaseCreature && (((BaseCreature)damager).Controlled || ((BaseCreature)damager).Summoned))
                damager = ((BaseCreature)damager).GetMaster();

            if (damager == null)
                return;

            if(highestDamager)
            {
                if(PointsEntry.Entries.ContainsKey(type))
                    AwardPoints(damager, PointsEntry.Entries[type].TopAttackerPoints, false);
            }
            else
            {
                if(PointsEntry.Entries.ContainsKey(type))
                    AwardPoints(damager, PointsEntry.Entries[type].RightsPoints, false);
            }
        }
        public static void OnDeath(BaseCreature bc, Container corpse)
        {
            if (corpse == null || corpse.Map == Map.Internal || corpse.Map == null)
                return;

            Type type = bc.GetType();

            foreach(KeyValuePair<Type, List<DropEntry>> kvp in m_Table)
            {
                if (type == kvp.Key || type.IsSubclassOf(kvp.Key))
                {
                    Region r = Region.Find(corpse.Location, corpse.Map);
                    Map map = corpse.Map;

                    if (r != null)
                    {
                        foreach (DropEntry entry in kvp.Value)
                        {
                            if (entry.Region == null || entry.Region == r.Name || entry.Region == map.ToString())
                            {
                                for (int i = 0; i < entry.Amount; i++)
                                {
                                    if (Utility.Random(100) < entry.Probability)
                                    {
                                        Item item = RunicReforging.GenerateRandomItem(bc.LastKiller, bc);

                                        if (item != null)
                                            corpse.DropItem(item);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #36
0
		public override void ProcessKill(BaseCreature victim, Mobile damager, int index)
		{
			if(victim.Map != Map.TerMur || damager.Map != Map.TerMur)
				return;
				
			Type type = victim.GetType();

            if (damager is BaseCreature && (((BaseCreature)damager).Controlled || ((BaseCreature)damager).Summoned))
                damager = ((BaseCreature)damager).GetMaster();

            if (damager == null)
                return;

			if(index == 0)
			{
				if(Entries.ContainsKey(type))
					AwardPoints(damager, Entries[type].Item1, false);
			}
			else
			{
				if(Entries.ContainsKey(type))
					AwardPoints(damager, Entries[type].Item2, false);
			}
		}
		public static void CheckLevel( Mobile defender, BaseCreature attacker, int count )
		{
			bool nolevel = false;
			Type typ = attacker.GetType();
			string nam = attacker.Name;

			foreach ( string check in FSATS.NoLevelCreatures )
			{
  				if ( check == nam )
    					nolevel = true;
			}

			if ( nolevel != false )
				return;

			int expgainmin, expgainmax;

			if ( attacker is BaseBioCreature || attacker is BioCreature || attacker is BioMount )
			{
			}
			else if ( defender is BaseCreature )
			{
				if ( attacker.Controlled == true && attacker.ControlMaster != null && attacker.Summoned == false )
				{
					BaseCreature bc = (BaseCreature)defender;

					expgainmin = bc.HitsMax * 25;
					expgainmax = bc.HitsMax * 50;

					int xpgain = Utility.RandomMinMax( expgainmin, expgainmax );
					
					if ( count > 1 )
						xpgain = xpgain / count;

					if ( attacker.Level <= attacker.MaxLevel - 1 )
					{
						attacker.Exp += xpgain;
						attacker.ControlMaster.SendMessage( "Your pet has gained {0} experience points.", xpgain );
					}
			
					int nextLevel = attacker.NextLevel * attacker.Level;

					if ( attacker.Exp >= nextLevel && attacker.Level <= attacker.MaxLevel - 1 )
					{
						DoLevelBonus( attacker );

						Mobile cm = attacker.ControlMaster;
						attacker.Level += 1;
						attacker.Exp = 0;
						attacker.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
						attacker.PlaySound( 503 );
						cm.SendMessage( 38, "Your pets level has increased to {0}.", attacker.Level );

						int gain = Utility.RandomMinMax( 10, 50 );

						attacker.AbilityPoints += gain;

						if ( attacker.ControlMaster != null )
						{
							attacker.ControlMaster.SendMessage( 38, "Your pet {0} has gained some ability points.", gain );
						}

						if ( attacker.Level == 9 )
						{
							attacker.AllowMating = true;
							cm.SendMessage( 1161, "Your pet is now at the level to mate." );
						}
						if ( attacker.Evolves == true )
						{
							if ( attacker.UsesForm1 == true && attacker.F0 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form1;
								attacker.BaseSoundID = attacker.Sound1;
								attacker.F1 = true;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm1 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm2 == true && attacker.F1 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form2;
								attacker.BaseSoundID = attacker.Sound2;
								attacker.F1 = false;
								attacker.F2 = true;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm2 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm3 == true && attacker.F2 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form3;
								attacker.BaseSoundID = attacker.Sound3;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = true;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm3 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm4 == true && attacker.F3 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form4;
								attacker.BaseSoundID = attacker.Sound4;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = true;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm4 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm5 == true && attacker.F4 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form5;
								attacker.BaseSoundID = attacker.Sound5;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = true;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm5 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm6 == true && attacker.F5 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form6;
								attacker.BaseSoundID = attacker.Sound6;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = true;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm6 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm7 == true && attacker.F6 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form7;
								attacker.BaseSoundID = attacker.Sound7;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = true;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm7 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm8 == true && attacker.F7 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form8;
								attacker.BaseSoundID = attacker.Sound8;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = true;
								attacker.F9 = false;
								attacker.UsesForm8 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm9 == true && attacker.F8 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form9;
								attacker.BaseSoundID = attacker.Sound9;
								attacker.F1 = false;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = true;
								attacker.UsesForm9 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}	
						}
					}
				}
			}
		}
        private static bool IsSnake( BaseCreature bc )
        {
            Type type = bc.GetType();

            for ( int i = 0; i < m_SnakeTypes.Length; i++ )
            {
                if ( type == m_SnakeTypes[i] )
                    return true;
            }

            return false;
        }
		public virtual void DonatePet( PlayerMobile player, BaseCreature pet )
		{
			for ( int i = 0; i < m_Donations.Count; i ++ )
				if ( m_Donations[ i ].Type == pet.GetType() )
				{
					pet.Delete();
					Donate( player, m_Donations[ i ], 1 );
					return;
				}
				
			player.SendLocalizedMessage( 1073113 ); // This Collection is not accepting that type of creature.
		}
Exemple #40
0
		public static bool IsPackAnimal( BaseCreature pet )
		{
			if ( null == pet || pet.Deleted )
				return false;

			Type breed = pet.GetType();

			foreach ( Type packBreed in ShrinkConfig.PackAnimals )
				if ( packBreed == breed )
					return true;
	
			return false;
		}
Exemple #41
0
            public TransferItem( BaseCreature creature )
                : base(ShrinkTable.Lookup( creature ))
            {
                m_Creature = creature;

                Movable = false;

                if( !Core.AOS )
                {
                    Name = creature.Name;
                }
                else if( this.ItemID == ShrinkTable.DefaultItemID ||  creature.GetType().IsDefined( typeof( FriendlyNameAttribute ), false ) )
                    Name = FriendlyNameAttribute.GetFriendlyNameFor( creature.GetType() ).ToString();

                //(As Per OSI)No name.  Normally, set by the ItemID of the Shrink Item unless we either explicitly set it with an Attribute, or, no lookup found
            }
		public BaseCreature BreedWith(BaseCreature male)
		{
			if (!BreedingEnabled)
				return null;
			if (!Female || male.Female)
				return null; // must call BreedWith on the female, and lezzies can't make babies!
			if (male.GetType() != this.GetType())
				return null; // cannot cross-breed
			if (!CheckBreedWith(male))
				return null; // some other check failed

			BaseCreature child = null;
			try
			{
				child = (BaseCreature)GetType().GetConstructor(Type.EmptyTypes).Invoke(Type.EmptyTypes);

				PropertyInfo[] props = GetType().GetProperties();
				System.ComponentModel.TypeConverter doubleconv = System.ComponentModel.TypeDescriptor.GetConverter(typeof(double));

				for (int i = 0; i < props.Length; i++)
				{
					// note: props[i].GetCustomAttributes() does not traverse inheritance tree!
					GeneAttribute attr = (GeneAttribute)Attribute.GetCustomAttribute(props[i], typeof(GeneAttribute), true);
					if (attr == null)
						continue;

					double high = Convert.ToDouble(props[i].GetValue(this, null));
					double low = Convert.ToDouble(props[i].GetValue(male, null));
					if (high < low)
					{
						double t = high;
						high = low;
						low = t;
					}

                    double lowrange = low - attr.LowFactor * (attr.BreedMax - attr.BreedMin);
                    double highrange = high + attr.HighFactor * (attr.BreedMax - attr.BreedMin);

                    if (props[i].PropertyType == typeof(int) &&
                        attr.MinVariance == GeneAttribute.DefaultMinVariance)
                    {
                        if (attr.LowFactor * (attr.BreedMax - attr.BreedMin) < 1)
                            lowrange = low - 1;
                        if (attr.HighFactor * (attr.BreedMax - attr.BreedMin) < 1)
                            highrange = high + 1;
                    }
                    else if (highrange - lowrange < attr.MinVariance)
                    {
                        lowrange -= attr.MinVariance / 2;
                        highrange += attr.MinVariance / 2;
                    } 
                    
                    if (lowrange > highrange) // shouldn't ever happen, sanity check
                    {
                        Exception ex = new Exception(String.Format("Sanity Check: Child range for {0} was inverted.\r\nLowFactor: {1}\r\nHighFactor: {2}\r\nMinVariance: {3}", attr.GetType().FullName, attr.LowFactor, attr.HighFactor, attr.MinVariance));
                        LogHelper.LogException(ex);
                        lowrange = low;
                        highrange = high;
                    }         

                    double childval = Utility.RandomDouble() * (highrange - lowrange) + lowrange;

					if (childval < attr.BreedMin)
						childval = attr.BreedMin;
					if (childval > attr.BreedMax)
						childval = attr.BreedMax;

					props[i].SetValue(child, doubleconv.ConvertTo(childval, props[i].PropertyType), null);
				}

				ValidateGenes();
			}
			catch (Exception e)
			{
				LogHelper.LogException(e);
				Console.WriteLine(e.ToString());
				if (child != null)
					child.Delete();
				return null;
			}

			return child;
		}
            /// <summary>
            /// Checks the blood amount in the creature.
            /// </summary>
            /// <param name="bc"></param>
            /// <returns>Returns -1 if not enough blood.</returns>
            private int CheckBloodAmount(BaseCreature bc, out string errorMsg)
            {
                // Default msg
                errorMsg = "There's not enough blood in that corpse.";

                if (bc == null)
                    return -1;

                if (bc.HitsMax < CreatureMinHits)
                    return -1;

                foreach (Type type in CreaturesWithoutBlood)
                {
                    if (bc.GetType() == type)
                    {
                        errorMsg = "You cant seem to find any blood in that corpse.";
                        return -1;
                    }
                }

                int returnValue = 1;
                if (bc.HitsMax > BloodAmountScale)
                    returnValue = (int)(bc.HitsMax / BloodAmountScale);

                if (returnValue > MaxBloodPerCreature)
                    return MaxBloodPerCreature;
                else
                    return returnValue;
            }
Exemple #44
0
        public static void CheckSummonLimits( BaseCreature creature )
        {
            ArrayList creatures = new ArrayList();

            int limit = 6; // 6 creatures
            int range = 5; // per 5x5 area

            var eable = creature.GetMobilesInRange( range );

            foreach ( Mobile mobile in eable )
            {
                if ( mobile != null && mobile.GetType() == creature.GetType() )
                    creatures.Add( mobile );
            }

            int amount = 0;

            if ( creatures.Count > limit )
                amount = creatures.Count - limit;

            while ( amount > 0 )
            {
                for ( int i = 0; i < creatures.Count; i++ )
                {
                    Mobile m = creatures[i] as Mobile;

                    if ( m != null && ( (BaseCreature) m ).Summoned )
                    {
                        if ( Utility.RandomBool() && amount > 0 )
                        {
                            m.Delete();
                            amount--;
                        }
                    }
                }
            }
        }
		public override void OnKill( BaseCreature creature, Container corpse )
		{
			IngredientInfo info = IngredientInfo.Get( this.Ingredient );

			for ( int i = 0; i < info.Creatures.Length; i++ )
			{
				Type type = info.Creatures[i];

				if ( creature.GetType() == type )
				{
					System.From.SendLocalizedMessage( 1055043, "#" + info.Name ); // You gather a ~1_INGREDIENT_NAME~ from the corpse.

					CurProgress++;

					break;
				}
			}
		}
		public static bool Check( TalismanSlayerName name, BaseCreature creature )
		{
			Type[] types = GetSlayer( name );
			
			if ( types == null || creature == null )
				return false;
				
			for ( int i = 0; i < types.Length; i ++ )
			{
				Type type = types[ i ];
				
				if ( type == creature.GetType() )
					return true;
			}
			
			return false;
		}
Exemple #47
0
		public PetBrokerEntry(GenericReader reader)
		{
			int version = reader.ReadInt();
			
			m_Pet = reader.ReadMobile() as BaseCreature;
			m_SalePrice = reader.ReadInt();
			m_TypeName = reader.ReadString();

            if (m_Pet != null)
            {
                AddToBuffer(m_Pet.GetType(), m_TypeName);

                m_Pet.IsStabled = true;

                Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(Internalize));
            }
		}
Exemple #48
0
 public static bool ShareType( BaseCreature one, BaseCreature two )
 {
     return ( one.GetType().ToString() == two.GetType().ToString() && !one.GetType().ToString().ToLower().Contains("generic") );
 }
 public override void OnKill( BaseCreature creature, Container corpse )
 {
     if ( creature != null && m_MonsterType != null && creature.GetType() == m_MonsterType.Monster && creature.Region is CursedCaveRegion )
         CurProgress++;
 }
Exemple #50
0
		public static string GetOriginalName(BaseCreature bc)
		{
			if(bc == null)
				return null;
				
			Type t = bc.GetType();
			
			if(m_NameBuffer.ContainsKey(t))
				return m_NameBuffer[t];
			
			BaseCreature c = Activator.CreateInstance(t) as BaseCreature;

			if(c != null)
			{
				c.Delete();
				AddToBuffer(t, c.Name);
				return c.Name;
			}
			
			return t.Name;
		}
Exemple #51
0
		public AnimalLoreGump(BaseCreature c, Mobile user, int page)
			: base(250, 50)
		{
			m_User = user;
			m_Target = c;
			m_Page = page;
			if (m_Page < 0)
				m_Page = 0;
			if (m_Page >= NumTotalPages)
				m_Page = NumTotalPages - 1;

			AddPage(0);

			AddImage(100, 100, 2080);
			AddImage(118, 137, 2081);
			AddImage(118, 207, 2081);
			AddImage(118, 277, 2081);
			AddImage(118, 347, 2083);

			AddHtml(147, 108, 210, 18, String.Format("<center><i>{0}</i></center>", c.Name), false, false);

			AddButton(240, 77, 2093, 2093, 2, GumpButtonType.Reply, 0);

			AddImage(140, 138, 2091);
			AddImage(140, 335, 2091);

			AddPage(0);
			switch (m_Page)
			{
				case 0:
				{
					#region Attributes
					AddImage(128, 152, 2086);
					AddHtmlLocalized(147, 150, 160, 18, 1049593, 200, false, false); // Attributes

					AddHtmlLocalized(153, 168, 160, 18, 1049578, LabelColor, false, false); // Hits
					AddHtml(280, 168, 75, 18, FormatAttributes(c.Hits, c.HitsMax), false, false);

					AddHtmlLocalized(153, 186, 160, 18, 1049579, LabelColor, false, false); // Stamina
					AddHtml(280, 186, 75, 18, FormatAttributes(c.Stam, c.StamMax), false, false);

					AddHtmlLocalized(153, 204, 160, 18, 1049580, LabelColor, false, false); // Mana
					AddHtml(280, 204, 75, 18, FormatAttributes(c.Mana, c.ManaMax), false, false);

					AddHtmlLocalized(153, 222, 160, 18, 1028335, LabelColor, false, false); // Strength
					AddHtml(320, 222, 35, 18, FormatStat(c.Str), false, false);
					AddStatLock(355, 222, c.StrLock, ButtonID.StrLock);

					AddHtmlLocalized(153, 240, 160, 18, 3000113, LabelColor, false, false); // Dexterity
					AddHtml(320, 240, 35, 18, FormatStat(c.Dex), false, false);
					AddStatLock(355, 240, c.DexLock, ButtonID.DexLock);

					AddHtmlLocalized(153, 258, 160, 18, 3000112, LabelColor, false, false); // Intelligence
					AddHtml(320, 258, 35, 18, FormatStat(c.Int), false, false);
					AddStatLock(355, 258, c.IntLock, ButtonID.IntLock);

					AddImage(128, 278, 2086);
					AddHtmlLocalized(147, 276, 160, 18, 3001016, 200, false, false); // Miscellaneous

					AddHtmlLocalized(153, 294, 160, 18, 1049581, LabelColor, false, false); // Armor Rating
					AddHtml(320, 294, 35, 18, FormatStat(c.VirtualArmor), false, false);

					AddHtmlLocalized(153, 312, 160, 18, 3000120, LabelColor, false, false); // Gender
					AddHtml(280, 312, 75, 18, String.Format("<div align=right>{0}</div>", c.Female ? "Female" : "Male"), false, false);

					break;
					#endregion
				}
				case 1:
				{
					#region Skills
					AddImage(128, 152, 2086);
					AddHtmlLocalized(147, 150, 160, 18, 3001030, 200, false, false); // Combat Ratings

					AddHtmlLocalized(153, 168, 160, 18, 1044103, LabelColor, false, false); // Wrestling
					AddHtml(320, 168, 35, 18, FormatSkill(c, SkillName.Wrestling), false, false);
					AddSkillLock(355, 168, c, SkillName.Wrestling, ButtonID.SkillLock + (int)SkillName.Wrestling);

					AddHtmlLocalized(153, 186, 160, 18, 1044087, LabelColor, false, false); // Tactics
					AddHtml(320, 186, 35, 18, FormatSkill(c, SkillName.Tactics), false, false);
					AddSkillLock(355, 186, c, SkillName.Tactics, ButtonID.SkillLock + (int)SkillName.Tactics);

					AddHtmlLocalized(153, 204, 160, 18, 1044086, LabelColor, false, false); // Magic Resistance
					AddHtml(320, 204, 35, 18, FormatSkill(c, SkillName.MagicResist), false, false);
					AddSkillLock(355, 204, c, SkillName.MagicResist, ButtonID.SkillLock + (int)SkillName.MagicResist);

					AddHtmlLocalized(153, 222, 160, 18, 1044061, LabelColor, false, false); // Anatomy
					AddHtml(320, 222, 35, 18, FormatSkill(c, SkillName.Anatomy), false, false);
					AddSkillLock(355, 222, c, SkillName.Anatomy, ButtonID.SkillLock + (int)SkillName.Anatomy);

					AddHtmlLocalized(153, 240, 160, 18, 1044090, LabelColor, false, false); // Poisoning
					AddHtml(320, 240, 35, 18, FormatSkill(c, SkillName.Poisoning), false, false);
					AddSkillLock(355, 240, c, SkillName.Poisoning, ButtonID.SkillLock + (int)SkillName.Poisoning);

					AddImage(128, 260, 2086);
					AddHtmlLocalized(147, 258, 160, 18, 3001032, 200, false, false); // Lore & Knowledge

					AddHtmlLocalized(153, 276, 160, 18, 1044085, LabelColor, false, false); // Magery
					AddHtml(320, 276, 35, 18, FormatSkill(c, SkillName.Magery), false, false);
					AddSkillLock(355, 276, c, SkillName.Magery, ButtonID.SkillLock + (int)SkillName.Magery);

					AddHtmlLocalized(153, 294, 160, 18, 1044076, LabelColor, false, false); // Evaluating Intelligence
					AddHtml(320, 294, 35, 18, FormatSkill(c, SkillName.EvalInt), false, false);
					AddSkillLock(355, 294, c, SkillName.EvalInt, ButtonID.SkillLock + (int)SkillName.EvalInt);

					AddHtmlLocalized(153, 312, 160, 18, 1044106, LabelColor, false, false); // Meditation
					AddHtml(320, 312, 35, 18, FormatSkill(c, SkillName.Meditation), false, false);
					AddSkillLock(355, 312, c, SkillName.Meditation, ButtonID.SkillLock + (int)SkillName.Meditation);

					break;
					#endregion
				}
				case 2:
				{
					#region Misc
					AddImage(128, 152, 2086);
					AddHtmlLocalized(147, 150, 160, 18, 1049563, 200, false, false); // Preferred Foods

					int foodPref = 3000340;

					if ((c.FavoriteFood & FoodType.FruitsAndVegies) != 0)
						foodPref = 1049565; // Fruits and Vegetables
					else if ((c.FavoriteFood & FoodType.GrainsAndHay) != 0)
						foodPref = 1049566; // Grains and Hay
					else if ((c.FavoriteFood & FoodType.Fish) != 0)
						foodPref = 1049568; // Fish
					else if ((c.FavoriteFood & FoodType.Meat) != 0)
						foodPref = 1049564; // Meat

					AddHtmlLocalized(153, 168, 160, 18, foodPref, LabelColor, false, false);

					AddImage(128, 188, 2086);
					AddHtmlLocalized(147, 186, 160, 18, 1049569, 200, false, false); // Pack Instincts

					int packInstinct = 3000340;

					if ((c.PackInstinct & PackInstinct.Canine) != 0)
						packInstinct = 1049570; // Canine
					else if ((c.PackInstinct & PackInstinct.Ostard) != 0)
						packInstinct = 1049571; // Ostard
					else if ((c.PackInstinct & PackInstinct.Feline) != 0)
						packInstinct = 1049572; // Feline
					else if ((c.PackInstinct & PackInstinct.Arachnid) != 0)
						packInstinct = 1049573; // Arachnid
					else if ((c.PackInstinct & PackInstinct.Daemon) != 0)
						packInstinct = 1049574; // Daemon
					else if ((c.PackInstinct & PackInstinct.Bear) != 0)
						packInstinct = 1049575; // Bear
					else if ((c.PackInstinct & PackInstinct.Equine) != 0)
						packInstinct = 1049576; // Equine
					else if ((c.PackInstinct & PackInstinct.Bull) != 0)
						packInstinct = 1049577; // Bull

					AddHtmlLocalized(153, 204, 160, 18, packInstinct, LabelColor, false, false);

					AddImage(128, 224, 2086);
					AddHtmlLocalized(147, 222, 160, 18, 1049594, 200, false, false); // Loyalty Rating

					// loyalty redo
					int loyaltyval = (int)c.Loyalty / 10;
					if (loyaltyval < 0)
						loyaltyval = 0;
					if (loyaltyval > 11)
						loyaltyval = 11;
					AddHtmlLocalized(153, 240, 160, 18, (!c.Controlled || c.Loyalty == PetLoyalty.None) ? 1061643 : 1049594 + loyaltyval, LabelColor, false, false);

					break;
					#endregion
				}
				default: // rest of the pages are filled with genes - be sure to adjust "pg" calc in here when adding pages
				{
                    int nextpage = 3;

                    // idea for later - flesh out custom pages more, a string[] is hackish

                    //List<string[]> custompages = c.GetAnimalLorePages();
                    //if (custompages != null && page >= nextpage && page < (nextpage + custompages.Count))
                    //{
                    //    foreach (string[] s in custompages)
                    //    {
                    //        for (int i = 0; i < s.Length; i++)
                    //        {
                    //            AddHtml(153, 168 + 18 * i, 150, 18, s[i], false, false);
                    //        }
                    //    }

                    //    nextpage += custompages.Count;
                    //}

					#region Genetics
                    if (page >= nextpage)
                    {
                        List<PropertyInfo> genes = new List<PropertyInfo>();

                        foreach (PropertyInfo pi in c.GetType().GetProperties())
                        {
                            GeneAttribute attr = (GeneAttribute)Attribute.GetCustomAttribute(pi, typeof(GeneAttribute), true);
                            if (attr == null)
                                continue;
                            if (m_User.AccessLevel < AccessLevel.Counselor && !Server.Misc.TestCenter.Enabled)
                            {
                                if (attr.Visibility == GeneVisibility.Invisible)
                                    continue;
                                if (attr.Visibility == GeneVisibility.Tame && m_User != c.ControlMaster)
                                    continue;
                            }

                            genes.Add(pi);
                        }

                        int pg = m_Page - nextpage;

                        AddImage(128, 152, 2086);
                        AddHtml(147, 150, 160, 18, "Genetics", false, false);

                        for (int i = 0; i < 9; i++)
                        {
                            if (pg * 9 + i >= genes.Count)
                                break;

                            GeneAttribute attr = (GeneAttribute)Attribute.GetCustomAttribute(genes[pg * 9 + i], typeof(GeneAttribute), true);
                            AddHtml(153, 168 + 18 * i, 120, 18, attr.Name, false, false);
                            AddHtml(240, 168 + 18 * i, 115, 18, String.Format("<div align=right>{0:G3}</div>", c.DescribeGene(genes[pg * 9 + i], attr)), false, false);
                        }
                    }
					break;
					#endregion
				}
			}

			if (m_Page < NumTotalPages - 1)
				AddButton(340, 358, 5601, 5605, (int)ButtonID.NextPage, GumpButtonType.Reply, 0);
			if (m_Page > 0)
				AddButton(317, 358, 5603, 5607, (int)ButtonID.PrevPage, GumpButtonType.Reply, 0);
		}