Пример #1
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            m_Timer2.Stop();
            switch (info.ButtonID)
            {
            case 2:
            {
                foreach (PlayerMobile opponent in m_Item.OpponentTeam)
                {
                    opponent.SendMessage(43, String.Format(Affraid, from.Name));
                }
                foreach (PlayerMobile challenger in m_Item.ChallengeTeam)
                {
                    challenger.SendMessage(43, String.Format(Affraid, from.Name));
                }

                m_Item.ClearAll();
                break;
            }

            case 1:
            {
                if (m_Item.Game == ChallengeGameType.TwoPlayerTeam)
                {
                    if (i == 1)
                    {
                        m_ChallengerMobile.SendMessage("Choose each of your opponents.");
                    }
                    else if (i == 2)
                    {
                        m_ChallengerMobile.SendMessage("Choose the last opponent.");
                    }
                }

                m_ChallengerMobile.Target = new ChallengeTarget(m_ChallengerMobile, m_Item, i);
                break;
            }

            case 0:
            {
                m_Item.ClearAll();
                break;
            }
            }
        }
Пример #2
0
        public override void OnResponse(NetState state, RelayInfo info) //Function for GumpButtonType.Reply Buttons
        {
            Mobile from = state.Mobile;

            m_Timer.Stop();
            m_Players.AddRange(m_Item.ChallengeTeam);
            m_Players.AddRange(m_Item.OpponentTeam);

            switch (info.ButtonID)
            {
            case 2:
            {
                foreach (PlayerMobile pm in m_Players)
                {
                    pm.SendMessage(43, String.Format(Affraid, from.Name));
                }

                m_Item.ClearAll();
                break;
            }

            case 1:
            {
                m_Item.m_ChallengerExitPointDest = m_ChallengerMobile.Location;
                m_Item.m_OpponentExitPointDest   = from.Location;
                m_Item.m_MapOrig = m_ChallengerMobile.Map;

                foreach (PlayerMobile pm in m_Players)
                {
                    Mobile fighters = pm as Mobile;
                    pm.SendMessage(63, "The Challenge is accepted. Let the duel begin!");
                    m_Item.makeready(fighters);
                }

                Point3D temp1 = m_Item.m_ChallengerPointDest;
                Point3D temp2 = m_Item.m_OpponentPointDest;
                Map     map   = m_Item.m_MapDest;

                foreach (PlayerMobile challenger in m_Item.ChallengeTeam)
                {
                    Point3D p = new Point3D((temp1.X + 1), temp1.Y, temp1.Z);
                    if (p == Point3D.Zero)
                    {
                        p = challenger.Location;
                    }

                    if (map == null || map == Map.Internal)
                    {
                        map = challenger.Map;
                    }

                    challenger.MoveToWorld(p, map);
                }

                foreach (PlayerMobile opponent in m_Item.OpponentTeam)
                {
                    Point3D q = new Point3D((temp2.X - 1), temp2.Y, temp2.Z);
                    if (q == Point3D.Zero)
                    {
                        q = opponent.Location;
                    }

                    if (map == null || map == Map.Internal)
                    {
                        map = opponent.Map;
                    }

                    opponent.MoveToWorld(q, map);
                }
                m_Item.TimerStart();
                break;
            }

            case 0:
            {
                m_Item.ClearAll();
                break;
            }
            }
        }