Ejemplo n.º 1
0
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID > 0)
            {
                int         id      = info.ButtonID - 100;
                TOSDSpawner spawner = TOSDSpawner.Instance;

                if (spawner != null && id >= 0 && id < spawner.Entries.Count)
                {
                    TOSDSpawnEntry entry = spawner.Entries[id];

                    do
                    {
                        Point3D p = Map.Ilshenar.GetRandomSpawnPoint(entry.SpawnArea);

                        if (Map.Ilshenar.CanSpawnMobile(p))
                        {
                            User.MoveToWorld(p, Map.Ilshenar);
                            Refresh();

                            break;
                        }
                    }while (true);
                }
            }
        }
Ejemplo n.º 2
0
        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 500, 300, 9300);
            AddHtml(0, 10, 500, 20, Center("Treasures of Sorcerer's Dungeon Spawner"), false, false);

            TOSDSpawner spawner = TOSDSpawner.Instance;

            if (spawner == null)
            {
                AddHtml(10, 40, 150, 20, "Spawner Disabled", false, false);
            }
            else
            {
                int y = 60;

                AddLabel(10, 40, 0, "Go");
                AddLabel(40, 40, 0, "Boss");
                AddLabel(240, 40, 0, "Current");
                AddLabel(320, 40, 0, "Max");
                AddLabel(400, 40, 0, "Killed");

                for (int i = 0; i < spawner.Entries.Count; i++)
                {
                    TOSDSpawnEntry entry = spawner.Entries[i];
                    string         hue   = i == spawner.Index ? "green" : "red";

                    AddButton(7, y, 1531, 1532, i + 100, GumpButtonType.Reply, 0);
                    AddHtml(40, y, 200, 20, Color(hue, entry.Boss.Name), false, false);
                    AddHtml(320, y, 80, 20, Color(hue, entry.MaxSpawn.ToString()), false, false);

                    if (hue == "green")
                    {
                        AddHtml(240, y, 80, 20, Color(hue, spawner.Spawn.Count.ToString()), false, false);
                        AddHtml(400, y, 80, 20, Color(hue, spawner.KillCount.ToString()), false, false);
                    }
                    else
                    {
                        AddHtml(240, y, 80, 20, Color(hue, "0"), false, false);
                        AddHtml(400, y, 80, 20, Color(hue, "0"), false, false);
                    }

                    y += 22;
                }
            }
        }