CountCreatures() public méthode

public CountCreatures ( string creatureName ) : int
creatureName string
Résultat int
        public SpawnerGump(Spawner spawner) : base(50, 50)
        {
            m_Spawner = spawner;

            m_SpawnBefore = new SpawnerMemory();
            m_SpawnAfter  = new SpawnerMemory();

            AddPage(0);

            AddBackground(0, 0, 260, 371, 5054);

            AddLabel(95, 1, 0, "Creatures List");

            AddButton(5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddLabel(38, 347, 0x384, "Cancel");

            AddButton(5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddLabel(38, 325, 0x384, "Okay");

            AddButton(110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0);
            AddLabel(143, 325, 0x384, "Bring to Home");

            AddButton(110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0);
            AddLabel(143, 347, 0x384, "Total Respawn");

            for (int i = 0; i < 13; i++)
            {
                AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0);
                AddButton(38, (22 * i) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0);

                AddImageTiled(71, (22 * i) + 20, 159, 23, 0xA40);
                AddImageTiled(72, (22 * i) + 21, 157, 21, 0xBBC);

                string str = "";

                if (i < spawner.CreaturesName.Count)
                {
                    str = (string)spawner.CreaturesName[i];
                    int count = m_Spawner.CountCreatures(str);

                    if (str != "")
                    {
                        m_SpawnBefore.Add(str);
                    }

                    AddLabel(232, (22 * i) + 20, 0, count.ToString());
                }

                AddTextEntry(75, (22 * i) + 21, 154, 21, 0, i, str);
            }
        }
		public SpawnerGump( Spawner spawner ) : base( 50, 50 )
		{
			m_Spawner = spawner;

			AddPage( 0 );

			AddBackground( 0, 0, 305, 371, 5054 );

			AddLabel( 95, 1, 0, "Creatures List" );

			AddButton( 5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0 );
			AddLabel( 38, 347, 0x384, "Cancel" );

			AddButton( 5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0 );
			AddLabel( 38, 325, 0x384, "Okay" );

			AddButton( 110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0 );
			AddLabel( 143, 325, 0x384, "Bring to Home" );

			AddButton( 110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0 );
			AddLabel( 143, 347, 0x384, "Total Respawn" );

			for ( int i = 0;  i < 13; i++ )
			{
				AddButton( 5, ( 22 * i ) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0 );
				AddButton( 38, ( 22 * i ) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0 );

				AddImageTiled( 71, ( 22 * i ) + 20, 159, 23, 0xA40 ); //creature text box
				AddImageTiled( 72, ( 22 * i ) + 21, 157, 21, 0xBBC ); //creature text box

                AddImageTiled(235, (22 * i) + 20, 35, 23, 0xA40); //probability text box
                AddImageTiled(236, (22 * i) + 21, 33, 21, 0xBBC); //probability text box

                string name = "";
                string probability = "";

				if ( i < spawner.CreaturesName.Count )
				{
					name = (string)spawner.CreaturesName[i];
                    probability = spawner.CreaturesProbability[i].ToString();
					int count = m_Spawner.CountCreatures( name );

					AddLabel( 277, ( 22 * i ) + 20, 0, count.ToString() );
				}

				AddTextEntry( 75, ( 22 * i ) + 21, 154, 21, 0, i, name ); //creature

                AddTextEntry(239, (22 * i) + 21, 30, 21, 0, i + 20, probability); //probability
            }
		}
        public SpawnerGump(Spawner spawner)
            : base(50, 50)
        {
            m_Spawner = spawner;

            AddPage(0);

            AddBackground(0, 0, 410, 371, 5054);

            AddLabel(160, 1, 0, "Creatures List");

            AddButton(5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddLabel(38, 347, 0x384, "Cancel");

            AddButton(5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddLabel(38, 325, 0x384, "Apply");

            AddButton(110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0);
            AddLabel(143, 325, 0x384, "Bring to Home");

            AddButton(110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0);
            AddLabel(143, 347, 0x384, "Total Respawn");

            for (int i = 0; i < 13; i++)
            {
                AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0);
                AddButton(38, (22 * i) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0);

                AddImageTiled(71, (22 * i) + 20, 309, 23, 0xA40);
                AddImageTiled(72, (22 * i) + 21, 307, 21, 0xBBC);

                string str = "";

                if (i < spawner.SpawnNames.Count)
                {
                    str = (string)spawner.SpawnNames[i];
                    int count = m_Spawner.CountCreatures(str);

                    AddLabel(382, (22 * i) + 20, 0, count.ToString());
                }

                AddTextEntry(75, (22 * i) + 21, 304, 21, 0, i, str);
            }
        }
        public SpawnerGump(Spawner spawner)
            : base(50, 50)
        {
            m_Spawner = spawner;

            AddPage(0);

            AddBackground(0, 0, 260, 371, 5054);

            AddLabel(95, 1, 0, "Creatures List");

            AddButton(5, 347, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddLabel(38, 347, 0x384, "Cancel");

            AddButton(5, 325, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddLabel(38, 325, 0x384, "Okay");

            AddButton(110, 325, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0);
            AddLabel(143, 325, 0x384, "Bring to Home");

            AddButton(110, 347, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0);
            AddLabel(143, 347, 0x384, "Total Respawn");

            for (int i = 0; i < 13; i++)
            {
                AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0);
                AddButton(38, (22 * i) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0);

                AddImageTiled(71, (22 * i) + 20, 159, 23, 0xA40);
                AddImageTiled(72, (22 * i) + 21, 157, 21, 0xBBC);

                string str = "";

                if (i < spawner.SpawnNames.Count)
                {
                    str = (string)spawner.SpawnNames[i];
                    int count = m_Spawner.CountCreatures(str);

                    AddLabel(382, (22 * i) + 20, 0, count.ToString());
                }

                AddTextEntry(75, (22 * i) + 21, 154, 21, 0, i, str);
            }
        }
        public SpawnerGump(Spawner spawner, SpawnerEntry focusentry, int page) : base(50, 50)
        {
            m_Spawner = spawner;
            m_Entry   = focusentry;
            m_Page    = page;

            AddPage(0);

            AddBackground(0, 0, 343, 371 + (m_Entry != null ? 44 : 0), 5054);

            AddLabel(95, 1, 0, "Creatures List");

            int offset = 0;

            for (int i = 0; i < 13; i++)
            {
                int textindex  = i * 5;
                int entryindex = (m_Page * 13) + i;

                SpawnerEntry entry = null;

                if (entryindex < spawner.Entries.Count)
                {
                    entry = m_Spawner.Entries[entryindex];
                }

                if (entry == null || m_Entry != entry)
                {
                    AddButton(5, (22 * i) + 20 + offset, entry != null ? 0xFBA : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID(2, (i * 2)), GumpButtonType.Reply, 0);                           //Expand
                }
                else
                {
                    AddButton(5, (22 * i) + 20 + offset, entry != null ? 0xFBB : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID(2, (i * 2)), GumpButtonType.Reply, 0); //Unexpand
                }
                AddButton(38, (22 * i) + 20 + offset, 0xFA2, 0xFA4, GetButtonID(2, 1 + (i * 2)), GumpButtonType.Reply, 0);                                                //Delete

                AddImageTiled(71, (22 * i) + 20 + offset, 159, 23, 0xA40);                                                                                                //creature text box
                AddImageTiled(72, (22 * i) + 21 + offset, 157, 21, 0xBBC);                                                                                                //creature text box

                AddImageTiled(235, (22 * i) + 20 + offset, 35, 23, 0xA40);                                                                                                //maxcount text box
                AddImageTiled(236, (22 * i) + 21 + offset, 33, 21, 0xBBC);                                                                                                //maxcount text box

                AddImageTiled(273, (22 * i) + 20 + offset, 35, 23, 0xA40);                                                                                                //probability text box
                AddImageTiled(274, (22 * i) + 21 + offset, 33, 21, 0xBBC);                                                                                                //probability text box

                string     name        = "";
                string     probability = "";
                string     maxcount    = "";
                EntryFlags flags       = EntryFlags.None;

                if (entry != null)
                {
                    name        = (string)entry.CreaturesName;
                    probability = entry.CreaturesProbability.ToString();
                    maxcount    = entry.CreaturesMaxCount.ToString();
                    flags       = entry.Valid;

                    AddLabel(315, (22 * i) + 20 + offset, 0, spawner.CountCreatures(entry).ToString());
                }

                AddTextEntry(75, (22 * i) + 21 + offset, 154, 21, ((flags & EntryFlags.InvalidType) != 0) ? 33 : 0, textindex, name); //creature
                AddTextEntry(239, (22 * i) + 21 + offset, 30, 21, 0, textindex + 1, maxcount);                                        //max count
                AddTextEntry(277, (22 * i) + 21 + offset, 30, 21, 0, textindex + 2, probability);                                     //probability

                if (entry != null && m_Entry == entry)
                {
                    AddLabel(5, (22 * i) + 42, 0x384, "Parameters:");
                    AddImageTiled(91, (22 * i) + 42, 159, 23, 0xA40);                       //Parameters
                    AddImageTiled(92, (22 * i) + 43, 157, 21, 0xBBC);                       //Parameters

                    AddLabel(5, (22 * i) + 64, 0x384, "Properties:");
                    AddImageTiled(91, (22 * i) + 64, 159, 23, 0xA40);                                                                              //Properties
                    AddImageTiled(92, (22 * i) + 65, 157, 21, 0xBBC);                                                                              //Properties

                    AddTextEntry(95, (22 * i) + 41, 154, 21, ((flags & EntryFlags.InvalidParams) != 0) ? 33 : 0, textindex + 3, entry.Parameters); //parameters
                    AddTextEntry(95, (22 * i) + 61, 154, 21, ((flags & EntryFlags.InvalidProps) != 0) ? 33 : 0, textindex + 4, entry.Properties);  //properties

                    AddButton(263, (22 * i) + 52, 0xFB7, 0xFB9, GetButtonID(1, 2), GumpButtonType.Reply, 0);
                    AddLabel(296, (22 * i) + 52, 0x384, "Apply");

                    offset += 44;
                }
            }

            AddButton(5, 347 + offset, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddLabel(38, 347 + offset, 0x384, "Cancel");

            AddButton(5, 325 + offset, 0xFB7, 0xFB9, GetButtonID(1, 2), GumpButtonType.Reply, 0);
            AddLabel(38, 325 + offset, 0x384, "Okay");

            AddButton(110, 325 + offset, 0xFB4, 0xFB6, GetButtonID(1, 3), GumpButtonType.Reply, 0);
            AddLabel(143, 325 + offset, 0x384, "Bring to Home");

            AddButton(110, 347 + offset, 0xFA8, 0xFAA, GetButtonID(1, 4), GumpButtonType.Reply, 0);
            AddLabel(143, 347 + offset, 0x384, "Total Respawn");

            if (m_Page > 0)
            {
                AddButton(276, 308 + offset, 0x15E3, 0x15E7, GetButtonID(1, 0), GumpButtonType.Reply, 0);
            }
            else
            {
                AddImage(276, 308 + offset, 0x25EA);
            }

            if ((m_Page + 1) * 13 <= m_Spawner.Entries.Count)
            {
                AddButton(293, 308 + offset, 0x15E1, 0x15E5, GetButtonID(1, 1), GumpButtonType.Reply, 0);
            }
            else
            {
                AddImage(293, 308 + offset, 0x25E6);
            }
        }
Exemple #6
0
        public SpawnerGump(Spawner spawner)
            : base(50, 50)
        {
            m_Spawner = spawner;

            AddPage(0);

            AddBackground(0, 0, 410, 381, 5054);

            AddLabel(75, 1, 0, "Spawn List");
            AddLabel(335, 1, 0, "Max");
            AddLabel(378, 1, 0, "Total");

            AddButton(5, 310, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
            AddLabel(38, 310, 0x384, "Apply");

            AddButton(5, 333, 0xFA8, 0xFAB, 1025, GumpButtonType.Reply, 0);
            AddLabel(38, 333, 0x384, "Props");

            AddButton(5, 356, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddLabel(38, 356, 0x384, "Cancel");

            AddButton(110, 310, 0xFA5, 0xFA7, 1500, GumpButtonType.Reply, 0);
            AddLabel(143, 310, 0x384, String.Format("Running: {0}", m_Spawner.Running ? "Yes" : "No"));

            AddButton(110, 333, 0xFA5, 0xFA7, 1000, GumpButtonType.Reply, 0);
            AddLabel(143, 333, 0x384, String.Format("Group: {0}", m_Spawner.Group ? "Yes" : "No"));

            AddButton(110, 356, 0xFB4, 0xFB6, 2, GumpButtonType.Reply, 0);
            AddLabel(143, 356, 0x384, "Bring to Home");

            AddButton(270, 333, 0xFA8, 0xFAA, 3, GumpButtonType.Reply, 0);
            AddLabel(303, 333, 0x384, "Total Respawn");

            AddButton(270, 356, 0xFA8, 0xFAA, 1750, GumpButtonType.Reply, 0);
            AddLabel(303, 356, 0x384, "Total Reset");

            AddImageTiled(350, 306, 30, 23, 0xA40);
            AddImageTiled(351, 307, 28, 21, 0xBBC);

            AddLabel(270, 306, 0x384, "Max Spawn:");
            AddTextEntry(353, 307, 28, 21, 0, 500, m_Spawner.MaxCount.ToString());

            AddLabel(382, 307, 0, m_Spawner.SpawnCount.ToString());

            for (int i = 0; i < MaxEntries; i++)
            {
                AddButton(5, (22 * i) + 20, 0xFA5, 0xFA7, 4 + (i * 2), GumpButtonType.Reply, 0);
                AddButton(38, (22 * i) + 20, 0xFA2, 0xFA4, 5 + (i * 2), GumpButtonType.Reply, 0);

                AddImageTiled(71, (22 * i) + 20, 279, 23, 0xA40);
                AddImageTiled(72, (22 * i) + 21, 277, 21, 0xBBC);

                AddImageTiled(330, (22 * i) + 20, 50, 23, 0xA40);
                AddImageTiled(331, (22 * i) + 21, 48, 21, 0xBBC);

                string str = "";
                int    max = 0;

                if (i < spawner.SpawnObjects.Count)
                {
                    var so = spawner.SpawnObjects[i];

                    str = so.SpawnName;
                    max = so.MaxCount;

                    int count = m_Spawner.CountCreatures(so);
                    AddLabel(382, (22 * i) + 20, 0, count.ToString());
                }

                AddTextEntry(75, (22 * i) + 21, 304, 21, 0, i, str);
                AddTextEntry(332, (22 * i) + 21, 28, 21, 0, i + 20, max.ToString());
            }
        }
        public SpawnerGump( Spawner spawner, SpawnerEntry focusentry, int page )
            : base(50, 50)
        {
            m_Spawner = spawner;
            m_Entry = focusentry;
            m_Page = page;

            AddPage( 0 );

            AddBackground( 0, 0, 343, 371 + ( m_Entry != null ? 44 : 0 ), 5054 );

            AddLabel( 95, 1, 0, "Creatures List" );

            int offset = 0;

            for ( int i = 0; i < 13; i++ )
            {
                int textindex = i * 5;
                int entryindex = ( m_Page * 13 ) + i;

                SpawnerEntry entry = null;

                if ( entryindex < spawner.Entries.Count )
                    entry = m_Spawner.Entries[entryindex];

                if ( entry == null || m_Entry != entry )
                    AddButton( 5, ( 22 * i ) + 20 + offset, entry != null ? 0xFBA : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID( 2, (i * 2) ), GumpButtonType.Reply, 0 ); //Expand
                else
                    AddButton( 5, ( 22 * i ) + 20 + offset, entry != null ? 0xFBB : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID( 2, (i * 2) ), GumpButtonType.Reply, 0 ); //Unexpand

                AddButton( 38, ( 22 * i ) + 20 + offset, 0xFA2, 0xFA4, GetButtonID( 2, 1 + (i * 2) ), GumpButtonType.Reply, 0 ); //Delete

                AddImageTiled( 71, (22 * i) + 20 + offset, 159, 23, 0xA40 ); //creature text box
                AddImageTiled( 72, (22 * i) + 21 + offset, 157, 21, 0xBBC ); //creature text box

                AddImageTiled( 235, (22 * i) + 20 + offset, 35, 23, 0xA40 ); //maxcount text box
                AddImageTiled( 236, (22 * i) + 21 + offset, 33, 21, 0xBBC ); //maxcount text box

                AddImageTiled( 273, (22 * i) + 20 + offset, 35, 23, 0xA40 ); //probability text box
                AddImageTiled( 274, (22 * i) + 21 + offset, 33, 21, 0xBBC ); //probability text box

                string name = "";
                string probability = "";
                string maxcount = "";
                EntryFlags flags = EntryFlags.None;

                if ( entry != null )
                {
                    name = (string)entry.CreaturesName;
                    probability = entry.CreaturesProbability.ToString();
                    maxcount = entry.CreaturesMaxCount.ToString();
                    flags = entry.Valid;

                    AddLabel( 315, (22 * i) + 20 + offset, 0, spawner.CountCreatures( entry ).ToString() );
                }

                AddTextEntry( 75, (22 * i) + 21 + offset, 154, 21, ( ( flags & EntryFlags.InvalidType ) != 0 ) ? 33 : 0, textindex, name ); //creature
                AddTextEntry( 239, (22 * i) + 21 + offset, 30, 21, 0, textindex + 1, maxcount); //max count
                AddTextEntry( 277, (22 * i) + 21 + offset, 30, 21, 0, textindex + 2, probability); //probability

                if ( entry != null && m_Entry == entry )
                {
                    AddLabel( 5, (22 * i) + 42, 0x384, "Parameters:" );
                    AddImageTiled( 91, (22 * i) + 42, 159, 23, 0xA40 ); //Parameters
                    AddImageTiled( 92, (22 * i) + 43, 157, 21, 0xBBC ); //Parameters

                    AddLabel( 5, (22 * i) + 64, 0x384, "Properties:" );
                    AddImageTiled( 91, (22 * i) + 64, 159, 23, 0xA40 ); //Properties
                    AddImageTiled( 92, (22 * i) + 65, 157, 21, 0xBBC ); //Properties

                    AddTextEntry( 95, (22 * i) + 41, 154, 21, ( ( flags & EntryFlags.InvalidParams ) != 0 ) ? 33 : 0, textindex + 3, entry.Parameters ); //parameters
                    AddTextEntry( 95, (22 * i) + 61, 154, 21, ( ( flags & EntryFlags.InvalidProps ) != 0 ) ? 33 : 0, textindex + 4, entry.Properties ); //properties

                    AddButton( 263, (22 * i) + 52, 0xFB7, 0xFB9, GetButtonID( 1, 2 ), GumpButtonType.Reply, 0 );
                    AddLabel( 296, (22 * i) + 52, 0x384, "Apply" );

                    offset += 44;
                }
            }

            AddButton( 5, 347 + offset, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0 );
            AddLabel( 38, 347 + offset, 0x384, "Cancel" );

            AddButton( 5, 325 + offset, 0xFB7, 0xFB9, GetButtonID( 1, 2 ), GumpButtonType.Reply, 0 );
            AddLabel( 38, 325 + offset, 0x384, "Okay" );

            AddButton( 110, 325 + offset, 0xFB4, 0xFB6, GetButtonID( 1, 3 ), GumpButtonType.Reply, 0 );
            AddLabel( 143, 325 + offset, 0x384, "Bring to Home" );

            AddButton( 110, 347 + offset, 0xFA8, 0xFAA, GetButtonID( 1, 4 ), GumpButtonType.Reply, 0 );
            AddLabel( 143, 347 + offset, 0x384, "Total Respawn" );

            if ( m_Page > 0 )
                AddButton( 276, 308 + offset, 0x15E3, 0x15E7, GetButtonID( 1, 0 ), GumpButtonType.Reply, 0 );
            else
                AddImage( 276, 308 + offset, 0x25EA );

            if ( (m_Page + 1) * 13 <= m_Spawner.Entries.Count )
                AddButton( 293, 308 + offset, 0x15E1, 0x15E5, GetButtonID( 1, 1 ), GumpButtonType.Reply, 0 );
            else
                AddImage( 293, 308 + offset, 0x25E6 );
        }