示例#1
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;
            }
            }
        }