Inheritance: Item, ISpawner
コード例 #1
0
        public List <string> CreateArray(RelayInfo info, Mobile from)
        {
            List <string> creaturesName = new List <string>();

            for (int i = 0; i < 13; i++)
            {
                TextRelay te = info.GetTextEntry(i);

                if (te != null)
                {
                    string str = te.Text;

                    if (str.Length > 0)
                    {
                        str = str.Trim();

                        string t = IntelliSpawner.ParseType(str);

                        Type type = ScriptCompiler.FindTypeByName(t);

                        if (type != null)
                        {
                            creaturesName.Add(str);
                        }
                        else
                        {
                            from.SendMessage("{0} is not a valid type name.", t);
                        }
                    }
                }
            }

            return(creaturesName);
        }
コード例 #2
0
            protected override void OnTick()
            {
                List <Item> spawners = new List <Item>();

                foreach (NetState state in NetState.Instances)
                {
                    if (state.Mobile != null)
                    {
                        foreach (Item item in state.Mobile.GetItemsInRange(100))
                        {
                            if (item is IntelliSpawner)
                            {
                                spawners.Add(item);
                            }
                        }
                    }
                }

                foreach (Item item in spawners)
                {
                    IntelliSpawner spawner = item as IntelliSpawner;

                    if (!spawner.Running)
                    {
                        spawner.Running = true;
                        spawner.Respawn();
                        spawner.DoTimer();
                    }
                }
            }
コード例 #3
0
ファイル: IntelliSpawner.cs プロジェクト: Pumpk1ns/last-wish
            public InternalTimer(IntelliSpawner spawner, TimeSpan delay)
                : base(delay)
            {
                Priority = spawner.IsFull ? TimerPriority.FiveSeconds : TimerPriority.OneSecond;

                m_Spawner = spawner;
            }
コード例 #4
0
        public override void OnAfterDuped(Item newItem)
        {
            IntelliSpawner s = newItem as IntelliSpawner;

            if (s == null)
            {
                return;
            }

            s.m_SpawnNames = new List <string>(m_SpawnNames);
            s.m_Spawned    = new List <ISpawnable>();
        }
コード例 #5
0
            public InternalTimer(IntelliSpawner spawner, TimeSpan delay)
                : base(delay)
            {
                if (spawner.IsFull)
                {
                    Priority = TimerPriority.FiveSeconds;
                }
                else
                {
                    Priority = TimerPriority.OneSecond;
                }

                m_Spawner = spawner;
            }
コード例 #6
0
        public IntelliSpawnerGump(IntelliSpawner spawner) : base(50, 50)
        {
            m_IntelliSpawner = 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_IntelliSpawner.CountCreatures(str);

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

                AddTextEntry(75, (22 * i) + 21, 304, 21, 0, i, str);
            }
        }
コード例 #7
0
		public IntelliSpawnerGump( IntelliSpawner spawner ) : base( 50, 50 )
		{
			m_IntelliSpawner = 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_IntelliSpawner.CountCreatures( str );

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

				AddTextEntry( 75, ( 22 * i ) + 21, 304, 21, 0, i, str );
			}
		}
コード例 #8
0
            public InternalTimer(IntelliSpawner spawner, TimeSpan delay)
                : base(delay)
            {
                if (spawner.IsFull)
                    Priority = TimerPriority.FiveSeconds;
                else
                    Priority = TimerPriority.OneSecond;

                m_Spawner = spawner;
            }
コード例 #9
0
ファイル: SpawnGen.cs プロジェクト: greeduomacro/last-wish
        private static void MakeSpawner(string[] types, string[] fakespawnsA, string[] fakespawnsB, string[] fakespawnsC, string[] fakespawnsD, string[] fakespawnsE, int x, int y, int z, Map map, TimeSpan mintime, TimeSpan maxtime, int walkingrange, int homerange, int npccount, int fakecountA, int fakecountB, int fakecountC, int fakecountD, int fakecountE)
        {
            if (types.Length == 0)
                return;

            IntelliSpawner spawner;

            if (types[0] != "")
            {
                List<string> tipos = new List<string>(types);

                spawner = new IntelliSpawner(npccount, mintime, maxtime, Team, homerange, tipos);

                spawner.MoveToWorld(new Point3D(x, y, z), map);
            }

            if (fakespawnsA[0] != "")
            {
                List<string> noneA = new List<string>(fakespawnsA);

                spawner = new IntelliSpawner(fakecountA, mintime, maxtime, Team, homerange, noneA);

                spawner.MoveToWorld(new Point3D(x, y, z), map);
            }

            if (fakespawnsB[0] != "")
            {
                List<string> noneB = new List<string>(fakespawnsB);

                spawner = new IntelliSpawner(fakecountB, mintime, maxtime, Team, homerange, noneB);

                spawner.MoveToWorld(new Point3D(x, y, z), map);
            }

            if (fakespawnsC[0] != "")
            {
                List<string> noneC = new List<string>(fakespawnsC);

                spawner = new IntelliSpawner(fakecountC, mintime, maxtime, Team, homerange, noneC);

                spawner.MoveToWorld(new Point3D(x, y, z), map);
            }

            if (fakespawnsD[0] != "")
            {
                List<string> noneD = new List<string>(fakespawnsD);

                spawner = new IntelliSpawner(fakecountD, mintime, maxtime, Team, homerange, noneD);

                spawner.MoveToWorld(new Point3D(x, y, z), map);
            }

            if (fakespawnsE[0] != "")
            {
                List<string> noneE = new List<string>(fakespawnsE);

                spawner = new IntelliSpawner(fakecountE, mintime, maxtime, Team, homerange, noneE);

                spawner.MoveToWorld(new Point3D(x, y, z), map);
            }

            m_Count++;
        }
コード例 #10
0
ファイル: IntelliSpawner.cs プロジェクト: felladrin/last-wish
            public InternalTimer(IntelliSpawner spawner, TimeSpan delay)
                : base(delay)
            {
                Priority = spawner.IsFull ? TimerPriority.FiveSeconds : TimerPriority.OneSecond;

                m_Spawner = spawner;
            }