Exemple #1
0
        private void Start()
        {
            m_NextMsgTime = DateTime.Now + TimeSpan.FromMinutes(msgevery);

            foreach (Item ps in this.GetItemsInRange(range))
            {
                if (ps != null && ps is PremiumSpawner)
                {
                    PremiumSpawner sp = (PremiumSpawner)ps;
                    if (ps.Hue == 5)
                    {
                        sp.Running = true;
                        sp.Respawn();
                    }
                    if (ps.Hue == 10)
                    {
                        sp.Running = false;
                    }
                }
            }

            Regions.GuardedRegion reg = (Regions.GuardedRegion) this.Region.GetRegion(typeof(Regions.GuardedRegion));
            if (reg != null && !(reg.Disabled))
            {
                restoreguards = true;
                reg.Disabled  = true;
            }

            string meg = this.Region.Name + " is under attack by forces of " + this.Name + "!!!";

            BroadcastMessage(34, meg, true);
            init = true;
        }
Exemple #2
0
        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 spawnid, int npccount, int fakecountA, int fakecountB, int fakecountC, int fakecountD, int fakecountE )
        {
            if ( types.Length == 0 )
                return;

            List<string> tipos = new List<string>( types );
            List<string> noneA = new List<string>();
            List<string> noneB = new List<string>();
            List<string> noneC = new List<string>();
            List<string> noneD = new List<string>();
            List<string> noneE = new List<string>();

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

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

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

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

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

            PremiumSpawner spawner = new PremiumSpawner( npccount, fakecountA, fakecountB, fakecountC, fakecountD, fakecountE, spawnid, mintime, maxtime, Team, walkingrange, homerange, tipos, noneA, noneB, noneC, noneD, noneE );

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

            if ( TotalRespawn )
            {
                spawner.Respawn();

                if ( ((PremiumSpawner)spawner).SpawnID == 132 ) // if is ChampionSpawn
                {
                    spawner.BringToHome();
                }
            }

            m_Count++;
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Spawner.Deleted)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // Closed
            {
                break;
            }

            case 1:                     // Okay
            {
                m_Spawner.SubSpawnerE = CreateArray(info, state.Mobile);

                break;
            }

            case 2:                     // Bring everything home
            {
                m_Spawner.BringToHome();

                break;
            }

            case 3:                     // Complete respawn
            {
                m_Spawner.Respawn();

                break;
            }

            case 100:                     // Page 5
            {
                state.Mobile.SendGump(new PremiumSpawnerGumpD(m_Spawner));

                break;
            }

            case 101:                     // Page 1
            {
                state.Mobile.SendGump(new PremiumSpawnerGump(m_Spawner));

                break;
            }

            case 1000:                     // Props
            {
                state.Mobile.SendGump(new PropertiesGump(state.Mobile, m_Spawner));
                state.Mobile.SendGump(new PremiumSpawnerGumpE(m_Spawner));

                break;
            }

            default:
            {
                int buttonID = info.ButtonID - 4;
                int index    = buttonID / 2;
                int type     = buttonID % 2;

                TextRelay entry = info.GetTextEntry(index);

                if (entry != null && entry.Text.Length > 0)
                {
                    if (type == 0)                               // Spawn creature
                    {
                        m_Spawner.Spawn(entry.Text);
                    }
                    else                             // Remove creatures
                    {
                        m_Spawner.RemoveCreaturesE(entry.Text);
                    }

                    m_Spawner.SubSpawnerE = CreateArray(info, state.Mobile);
                }

                break;
            }
            }
        }
Exemple #4
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Spawner.Deleted)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // Cancel (mouse's right button click anywhere on the gump)
            {
                break;
            }

            case 200:                     // Bring everything home
            {
                m_Spawner.BringToHome();
                break;
            }

            case 300:                     // Complete respawn
            {
                m_Spawner.Respawn();
                break;
            }

            case 400:                     // Props
            {
                state.Mobile.SendGump(new PropertiesGump(state.Mobile, m_Spawner));
                state.Mobile.SendGump(new PremiumSpawnerGump(m_Spawner));
                break;
            }

            case 500:                     // Cancel (button "Cancel")
            {
                break;
            }

            case 1001:                     // Okay
            {
                m_Spawner.CreaturesName = CreateArray(info, state.Mobile, 100);
                break;
            }

            case 1002:                     // Okay
            {
                m_Spawner.SubSpawnerA = CreateArray(info, state.Mobile, 200);
                break;
            }

            case 1003:                     // Okay
            {
                m_Spawner.SubSpawnerB = CreateArray(info, state.Mobile, 300);
                break;
            }

            case 1004:                     // Okay
            {
                m_Spawner.SubSpawnerC = CreateArray(info, state.Mobile, 400);
                break;
            }

            case 1005:                     // Okay
            {
                m_Spawner.SubSpawnerD = CreateArray(info, state.Mobile, 500);
                break;
            }

            case 1006:                     // Okay
            {
                m_Spawner.SubSpawnerE = CreateArray(info, state.Mobile, 600);
                break;
            }

            default:
            {                     //ButtonID: 1-90 spawn; 91-180 remove
                int ID = info.ButtonID;

                int Type = 0;

                // Spawn creature
                if ((ID >= 1) && (ID <= 15))
                {
                    Type += 100 + ID;
                    m_Spawner.Spawn(GetEntry(Type, info));
                }
                else if ((ID >= 16) && (ID <= 30))
                {
                    Type += 200 + ID - 15;
                    m_Spawner.SpawnA(GetEntry(Type, info));
                }
                else if ((ID >= 31) && (ID <= 45))
                {
                    Type += 300 + ID - 30;
                    m_Spawner.SpawnB(GetEntry(Type, info));
                }
                else if ((ID >= 46) && (ID <= 60))
                {
                    Type += 400 + ID - 45;
                    m_Spawner.SpawnC(GetEntry(Type, info));
                }
                else if ((ID >= 61) && (ID <= 75))
                {
                    Type += 500 + ID - 60;
                    m_Spawner.SpawnD(GetEntry(Type, info));
                }
                else if ((ID >= 76) && (ID <= 90))
                {
                    Type += 600 + ID - 75;
                    m_Spawner.SpawnE(GetEntry(Type, info));
                }
                // Remove creature
                else if ((ID >= 91) && (ID <= 105))
                {
                    Type += 100 + ID - 90;
                    m_Spawner.RemoveCreatures(GetEntry(Type, info));
                }
                else if ((ID >= 106) && (ID <= 120))
                {
                    Type += 200 + ID - 105;
                    m_Spawner.RemoveCreaturesA(GetEntry(Type, info));
                }
                else if ((ID >= 121) && (ID <= 135))
                {
                    Type += 300 + ID - 120;
                    m_Spawner.RemoveCreaturesB(GetEntry(Type, info));
                }
                else if ((ID >= 136) && (ID <= 150))
                {
                    Type += 400 + ID - 135;
                    m_Spawner.RemoveCreaturesC(GetEntry(Type, info));
                }
                else if ((ID >= 151) && (ID <= 165))
                {
                    Type += 500 + ID - 150;
                    m_Spawner.RemoveCreaturesD(GetEntry(Type, info));
                }
                else if ((ID >= 166) && (ID <= 180))
                {
                    Type += 600 + ID - 165;
                    m_Spawner.RemoveCreaturesE(GetEntry(Type, info));
                }

                string entry = GetEntry(Type, info);

                if (entry != null && entry.Length > 0)
                {
                    m_Spawner.CreaturesName = CreateArray(info, state.Mobile, 100);
                    m_Spawner.SubSpawnerA   = CreateArray(info, state.Mobile, 200);
                    m_Spawner.SubSpawnerB   = CreateArray(info, state.Mobile, 300);
                    m_Spawner.SubSpawnerC   = CreateArray(info, state.Mobile, 400);
                    m_Spawner.SubSpawnerD   = CreateArray(info, state.Mobile, 500);
                    m_Spawner.SubSpawnerE   = CreateArray(info, state.Mobile, 600);
                }

                break;
            }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Spawner.Deleted)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // Cancel (mouse's right button click anywhere on the gump)
            {
                break;
            }

            case 200:                     // Bring everything home
            {
                m_Spawner.BringToHome();
                break;
            }

            case 300:                     // Total respawn
            {
                // 1st save changes
                m_Spawner.CreaturesName = CreateArray(info, state.Mobile, 100);
                m_Spawner.SubSpawnerA   = CreateArray(info, state.Mobile, 200);
                m_Spawner.SubSpawnerB   = CreateArray(info, state.Mobile, 300);
                m_Spawner.SubSpawnerC   = CreateArray(info, state.Mobile, 400);
                m_Spawner.SubSpawnerD   = CreateArray(info, state.Mobile, 500);
                m_Spawner.SubSpawnerE   = CreateArray(info, state.Mobile, 600);
                // then respwan
                m_Spawner.Respawn();
                m_Spawner.Running = true;
                break;
            }

            case 400:                     // Props
            {
                state.Mobile.SendGump(new PropertiesGump(state.Mobile, m_Spawner));
                state.Mobile.SendGump(new PremiumSpawnerGump(m_Spawner));
                break;
            }

            case 500:                     // Cancel button
            {
                break;
            }

            case 1000:                     // Okay
            {
                m_Spawner.CreaturesName = CreateArray(info, state.Mobile, 100);
                m_Spawner.SubSpawnerA   = CreateArray(info, state.Mobile, 200);
                m_Spawner.SubSpawnerB   = CreateArray(info, state.Mobile, 300);
                m_Spawner.SubSpawnerC   = CreateArray(info, state.Mobile, 400);
                m_Spawner.SubSpawnerD   = CreateArray(info, state.Mobile, 500);
                m_Spawner.SubSpawnerE   = CreateArray(info, state.Mobile, 600);
                m_Spawner.Running       = true;
                break;
            }

            default:
            {                     //ButtonID: 1-90 spawn; 91-180 remove
                int ID = info.ButtonID;

                int Type = 0;

                // Spawn creature
                if ((ID >= 1) && (ID <= 15))
                {
                    Type += 100 + ID;
                    m_Spawner.SpawnFromGump(m_Spawner.CreaturesName, m_Spawner.Creatures, m_Spawner.Count, m_Spawner.CreaturesNameCount, GetEntry(Type, info));
                }
                else if ((ID >= 16) && (ID <= 30))
                {
                    Type += 200 + ID - 15;
                    m_Spawner.SpawnFromGump(m_Spawner.SubSpawnerA, m_Spawner.CreaturesA, m_Spawner.CountA, m_Spawner.CreaturesNameCountA, GetEntry(Type, info));
                }
                else if ((ID >= 31) && (ID <= 45))
                {
                    Type += 300 + ID - 30;
                    m_Spawner.SpawnFromGump(m_Spawner.SubSpawnerB, m_Spawner.CreaturesB, m_Spawner.CountB, m_Spawner.CreaturesNameCountB, GetEntry(Type, info));
                }
                else if ((ID >= 46) && (ID <= 60))
                {
                    Type += 400 + ID - 45;
                    m_Spawner.SpawnFromGump(m_Spawner.SubSpawnerC, m_Spawner.CreaturesC, m_Spawner.CountC, m_Spawner.CreaturesNameCountC, GetEntry(Type, info));
                }
                else if ((ID >= 61) && (ID <= 75))
                {
                    Type += 500 + ID - 60;
                    m_Spawner.SpawnFromGump(m_Spawner.SubSpawnerD, m_Spawner.CreaturesD, m_Spawner.CountD, m_Spawner.CreaturesNameCountD, GetEntry(Type, info));
                }
                else if ((ID >= 76) && (ID <= 90))
                {
                    Type += 600 + ID - 75;
                    m_Spawner.SpawnFromGump(m_Spawner.SubSpawnerE, m_Spawner.CreaturesE, m_Spawner.CountE, m_Spawner.CreaturesNameCountE, GetEntry(Type, info));
                }
                // Remove creature
                else if ((ID >= 91) && (ID <= 105))
                {
                    Type += 100 + ID - 90;
                    m_Spawner.RemoveCreaturesFromGump(m_Spawner.Creatures, GetEntry(Type, info));
                }
                else if ((ID >= 106) && (ID <= 120))
                {
                    Type += 200 + ID - 105;
                    m_Spawner.RemoveCreaturesFromGump(m_Spawner.CreaturesA, GetEntry(Type, info));
                }
                else if ((ID >= 121) && (ID <= 135))
                {
                    Type += 300 + ID - 120;
                    m_Spawner.RemoveCreaturesFromGump(m_Spawner.CreaturesB, GetEntry(Type, info));
                }
                else if ((ID >= 136) && (ID <= 150))
                {
                    Type += 400 + ID - 135;
                    m_Spawner.RemoveCreaturesFromGump(m_Spawner.CreaturesC, GetEntry(Type, info));
                }
                else if ((ID >= 151) && (ID <= 165))
                {
                    Type += 500 + ID - 150;
                    m_Spawner.RemoveCreaturesFromGump(m_Spawner.CreaturesD, GetEntry(Type, info));
                }
                else if ((ID >= 166) && (ID <= 180))
                {
                    Type += 600 + ID - 165;
                    m_Spawner.RemoveCreaturesFromGump(m_Spawner.CreaturesE, GetEntry(Type, info));
                }

                string entry = GetEntry(Type, info);

                if (entry != null && entry.Length > 0)
                {
                    m_Spawner.CreaturesName = CreateArray(info, state.Mobile, 100);
                    m_Spawner.SubSpawnerA   = CreateArray(info, state.Mobile, 200);
                    m_Spawner.SubSpawnerB   = CreateArray(info, state.Mobile, 300);
                    m_Spawner.SubSpawnerC   = CreateArray(info, state.Mobile, 400);
                    m_Spawner.SubSpawnerD   = CreateArray(info, state.Mobile, 500);
                    m_Spawner.SubSpawnerE   = CreateArray(info, state.Mobile, 600);
                    m_Spawner.Running       = true;
                }

                break;
            }
            }
        }
Exemple #6
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Spawner.Deleted)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:                     // Closed
            {
                break;
            }

            case 1:                     // Okay
            {
                m_Spawner.CreaturesName = CreateArray(info, state.Mobile);

                break;
            }

            case 2:                     // Bring everything home
            {
                m_Spawner.BringToHome();

                break;
            }

            case 3:                     // Complete respawn
            {
                m_Spawner.Respawn();

                break;
            }

            default:
            {
                int buttonID = info.ButtonID - 4;
                int index    = buttonID / 2;
                int type     = buttonID % 2;

                TextRelay entry = info.GetTextEntry(index);

                if (entry != null && entry.Text.Length > 0)
                {
                    if (type == 0)                               // Spawn creature
                    {
                        m_Spawner.Spawn(entry.Text);
                    }
                    else                             // Remove creatures
                    {
                        m_Spawner.RemoveCreatures(entry.Text);
                    }

                    m_Spawner.CreaturesName = CreateArray(info, state.Mobile);
                }

                break;
            }
            }
        }