Exemple #1
0
 private static void StartEvent_Target(Mobile from, object o, object state)
 {
     if (o is BaseGame)
     {
         BaseGame game = (BaseGame)o;
         if (game.Open)
         {
             try
             {
                 game.StartCommand(from);
             }
             catch (EventException e)
             {
                 from.SendMessage(e.ToString());
             }
         }
         else
         {
             from.SendMessage("You have to open the game first.");
         }
     }
     else if (o is DMStone)
     {
         DMStone game = (DMStone)o;
         game.Started = true;
     }
     else if (o is TournamentStone)
     {
         TournamentStone game = (TournamentStone)o;
         game.Started = true;
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(StartEvent_Target), false);
         from.SendMessage("Target the game stone.");
     }
 }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 1:
            {
                from.SendGump(new PropertiesGump(m_User, m_Game));
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 2:
            {
                from.SendGump(new PropertiesGump(m_User, m_Game.Supplier));
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 3:
            {
                m_Game.Supplier.OnDoubleClick(m_User);
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 4:
            {
                m_Game.Open = true;
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 5:
            {
                m_Game.Open = false;
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 6:
            {
                m_Game.StartCommand(m_User);
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 7:
            {
                m_Game.EndGameCommand();
                m_Game.OnDoubleClick(m_User);
                break;
            }

            case 8:
            {
                from.SendGump(new GameAdminGump(from, m_Game));
                m_Game.OnDoubleClick(m_User);
                break;
            }
            }
        }