public PartnerGump(PlayerMobile challenger, ChallengeStone item, int counter, PlayerMobile opponent) : base(0, 0)
        {
            i = counter;
            m_ChallengerMobile = challenger;
            m_OpponentMobile   = opponent;
            m_Item             = item;
            m_Timer2           = new ResponceTimers(m_Item, m_OpponentMobile);
            m_Timer2.Start();

            Closable = false;
            Dragable = false;

            AddImageTiled(107, 132, 14, 14, 83);
            AddImageTiled(121, 130, 245, 14, 84);
            AddImageTiled(366, 132, 14, 14, 85);
            AddImageTiled(107, 145, 14, 140, 86);
            AddImageTiled(118, 144, 252, 143, 87);
            AddImageTiled(366, 145, 14, 140, 88);
            AddImageTiled(107, 285, 14, 14, 89);
            AddImageTiled(121, 285, 245, 11, 90);
            AddImageTiled(366, 285, 14, 14, 91);
            AddHtml(115, 145, 233, 44, "<basefont color=#FF0000><center>Will you join " + m_ChallengerMobile.Name + " as your partner in a challenge?</center></basefont>", false, false);
            AddHtml(125, 190, 237, 77, "<basefont color=#CCCC33>" + message + "</basefont>", false, false);
            AddButton(135, 270, 2128, 2130, 1, GumpButtonType.Reply, 0);
            AddButton(300, 270, 2119, 2121, 2, GumpButtonType.Reply, 0);
        }
Beispiel #2
0
        public FinalGump(PlayerMobile challenger, PlayerMobile opponent, ChallengeStone item)
            : base(0, 0)
        {
            m_OpponentMobile   = opponent;
            m_ChallengerMobile = challenger;
            m_Item             = item;
            m_Timer            = new ResponseTimers(m_Item, m_OpponentMobile);
            m_Timer.Start();

            Closable = false;
            Dragable = false;

            Targeting.Target.Cancel(m_ChallengerMobile);
            Targeting.Target.Cancel(m_OpponentMobile);

            AddImageTiled(107, 132, 14, 14, 83);
            AddImageTiled(121, 130, 245, 14, 84);
            AddImageTiled(366, 132, 14, 14, 85);
            AddImageTiled(107, 145, 14, 140, 86);
            AddImageTiled(118, 144, 252, 143, 87);
            AddImageTiled(366, 145, 14, 140, 88);
            AddImageTiled(107, 285, 14, 14, 89);
            AddImageTiled(121, 285, 245, 11, 90);
            AddImageTiled(366, 285, 14, 14, 91);
            AddHtml(123, 154, 233, 20, "<basefont color=#FF0000><center>Will you accept " + challenger.Name + "'s challenge?</center></basefont>", false, false);
            AddHtml(125, 175, 237, 77, "<basefont color=#CCCC33>" + message + "</basefont>", false, false);
            AddButton(135, 260, 2128, 2130, 1, GumpButtonType.Reply, 0);
            AddButton(300, 260, 2119, 2121, 2, GumpButtonType.Reply, 0);
        }
Beispiel #3
0
 public ResponseTimers(ChallengeStone item, Mobile challenger)
     : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))
 {
     m_Item             = item;
     m_ChallengerMobile = challenger;
 }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile       from = sender.Mobile;
            PlayerMobile m    = from as PlayerMobile;

            switch (info.ButtonID)
            {
            case 3:                     // Chal on/off
            {
                if (((PlayerMobile)from).CanBeChallenged)
                {
                    ((PlayerMobile)from).CanBeChallenged = false;
                    from.SendMessage(63, "You will no longer accept challenge invitations!");
                }
                else
                {
                    ((PlayerMobile)from).CanBeChallenged = true;
                    from.SendMessage(63, "You may now accept challenge invitations!");
                }
                from.SendGump(new BeginGump((PlayerMobile)from, m_Stones));

                return;
            }

            case 2:                     // 2vs2
            {
                m_Game = ChallengeGameType.TwoPlayerTeam;
                break;
            }

            case 1:                     // 1vs1
            {
                m_Game = ChallengeGameType.OnePlayerTeam;
                break;
            }

            case 0:
            {
                from.SendMessage(43, "Cancelled!");

                return;
            }
            }

            foreach (Item chall in m_Stones)
            {
                ChallengeStone challstone = chall as ChallengeStone;
                if (challstone.Active == true && challstone.Game == m_Game)
                {
                    if (m.Frozen == true)
                    {
                        from.SendMessage(43, "You cannot use right now because you are frozen!");
                        return;
                    }
                    else if (m.GameTime < TimeSpan.FromMinutes(30.0))
                    {
                        from.SendMessage(43, "The ladder system is usable by characters who have a character age of at least 30 minutes of in-game play!");
                        return;
                    }
                    else if (m.IsInChallenge)
                    {
                        from.SendMessage(43, "You are already in the process of using the ladder system!");
                        return;
                    }
                    else if (m.Hits != m.HitsMax)
                    {
                        from.SendMessage(43, "You must be fully healed before using the ladder system!");
                        return;
                    }
                    else if (!m.CanBeChallenged)
                    {
                        from.SendMessage(43, "You currently have the challenge feature disabled, please enable it via the menu!");
                        from.SendGump(new BeginGump((PlayerMobile)from, m_Stones));
                        return;
                    }
                    else
                    {
                        challstone.ClearAll();
                        m_Challenger.IsInChallenge = true;
                        challstone.OnDoubleClick(from);
                        return;
                    }
                }
            }
            from.SendMessage(43, "There are no open ladder arenas for that type of challenge right now, please try again soon!");
            return;
        }
Beispiel #5
0
        public static void StartDuel(bool TwoPlayers, PlayerMobile challenger, ArrayList m_Stones)
        {
            Mobile       from = (Mobile)challenger;
            PlayerMobile m    = from as PlayerMobile;

            Items.ChallengeGameType m_Game;

            if (TwoPlayers)
            {
                m_Game = ChallengeGameType.TwoPlayerTeam;
            }
            else
            {
                m_Game = ChallengeGameType.OnePlayerTeam;
            }


            foreach (Item chall in m_Stones)
            {
                ChallengeStone challstone = chall as ChallengeStone;
                if (challstone.Active == true && challstone.Game == m_Game)
                {
                    if (m.Frozen == true)
                    {
                        from.SendMessage(43, "You cannot use right now because you are frozen!");
                        return;
                    }
                    else if (m.Young)
                    {
                        from.SendMessage(43, "You can not use the ladder system if your young!");
                        return;
                    }
                    else if (m.IsInChallenge)
                    {
                        from.SendMessage(43, "You are already in the process of using the ladder system!");
                        return;
                    }

                    /*     else if ( from.Map == Map.Trammel || from.Map == Map.Malas || from.Map == Map.Ilshenar )
                     *   {
                     *       from.SendMessage(1266, "You can only duel in Felucca as we are having problems dueling in other facets!" );
                     *   } */


                    else
                    {
                        challstone.ClearAll();
                        challenger.IsInChallenge = true;
                        challstone.OnDoubleClick(from);
                        {
                            if (m.Hits != m.HitsMax)
                            {
                                m.Hits = m.HitsMax;
                                m.Mana = 125;
                                m.Stam = 125;
                            }
                            return;
                        }
                    }
                }
            }
        }