Ejemplo n.º 1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 100:     // Ir Invisivel para o evento
            {
                from.Hidden = true;
                BaseEventHelper.GoEvent(from);
                from.SendGump(this);
                break;
            }

            case 101:     // Ir como Juiz para o evento
            {
                BaseEventHelper.GoEvent(from);
                from.SendGump(this);
                break;
            }

            case 1:
            {
                SurvivorStone.AnnounceAndStartSurvivor(from);
                from.SendGump(this);
                break;
            }

            case 2:
            {
                SurvivorStone.FinishSurvivorEvent(from);
                from.SendGump(this);
                break;
            }

            case 5:
            {
                from.SendGump(this);
                from.SendGump(new EventRewardGump(from));
                break;
            }

            case 6:
            {
                from.SendGump(this);
                from.SendGump(new EventModeGump(from));
                break;
            }

            case 7:
            {
                from.SendGump(new SurvivorArenaConfigGump(from, SurvivorStone));
                break;
            }

            case 0:
            default:
                break;
            }
        }
        public void AutoStartEvent()
        {
            // Sorteia alguma SurvivorStone pelo mundo
            List <SurvivorStone> survivorStoneList = new List <SurvivorStone>();

            foreach (Item item in World.Items.Values)
            {
                if (item is SurvivorStone && ((SurvivorStone)item).IsArenaConfigValid())
                {
                    survivorStoneList.Add((SurvivorStone)item);
                }
            }

            if (survivorStoneList.Count > 0)
            {
                currentSurvivorStone = survivorStoneList[new Random().Next(survivorStoneList.Count)];
                currentSurvivorStone.AnnounceAndStartSurvivor(null);
            }
            else
            {
                Logger.LogMessage("Survivor Automatico Cancelado. Nenhuma Arena Configurada.", "Survivor");
            }
        }