public DuelAcceptGump(Mobile m, Duel duel)
			: base(200, 200)
		{
			m_Mobile = m;
			m_Duel = duel;

			m_Timer = new TimeoutTimer(duel, m);
			m_Timer.Start();

			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage(0);
			this.AddBackground(40, 25, 324, 167, 3500);
			this.AddLabel(130, 40, 36, @"Onsite Duel System " + DuelController.Version);
			this.AddLabel(130, 39, 36, @"Onsite Duel System " + DuelController.Version);
			this.AddLabel(60, 73, 36, m_Duel.Creator.Name + " has invited you to their duel!");
			this.AddLabel(60, 72, 36, m_Duel.Creator.Name + " has invited you to their duel!");
			this.AddLabel(60, 96, 36, @"Do you wish to join?");
			this.AddLabel(60, 95, 36, @"Do you wish to join?");
			this.AddLabel(162, 146, 36, @"Yes");
			this.AddLabel(162, 145, 36, @"Yes");
			this.AddLabel(222, 146, 36, @"No");
			this.AddLabel(222, 145, 36, @"No");
			this.AddButton(327, 44, 3, 4, (int)Buttons.closeBtn, GumpButtonType.Reply, 0);
			this.AddButton(144, 149, 4034, 4034, (int)Buttons.yesBtn, GumpButtonType.Reply, 0);
			this.AddButton(204, 149, 4034, 4034, (int)Buttons.noBtn, GumpButtonType.Reply, 0);
		}
		public DuelTeamSelectionGump( Duel duel )
			: base( 200, 200 )
		{
            m_Duel = duel;
            m_MobileEntries = new List<MobileEntry>();

			this.Closable=false;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;
			this.AddPage(0);
			this.AddBackground(36, 25, 402, 375, 3500);
            this.AddLabel( 166, 40, 36, @"Onsite Duel System "+DuelController.Version );
            this.AddLabel( 166, 39, 36, @"Onsite Duel System "+DuelController.Version );
			this.AddButton(401, 46, 3, 4, (int)Buttons.closeBtn, GumpButtonType.Reply, 0);
            this.AddLabel( 129, 56, 36, @"Please select the team for each player" );
            this.AddLabel( 129, 55, 36, @"Please select the team for each player" );
            this.AddLabel( 100, 80, 36, @"Players" );
            this.AddLabel( 100, 79, 36, @"Players" );
            this.AddLabel( 263, 80, 36, @"Team 1" );
            this.AddLabel( 263, 79, 36, @"Team 1" );
            this.AddLabel( 327, 80, 36, @"Team 2" );
            this.AddLabel( 327, 79, 36, @"Team 2" );
            this.AddLabel( 121, 360, 36, @"Start" );
            this.AddLabel( 121, 359, 36, @"Start" );
            this.AddButton( 103, 363, 4034, 4034, ( int )Buttons.startBtn, GumpButtonType.Reply, 0 );

            for( int i = 0; i < duel.Contestants.Count; i++ )
                AddEntry( duel.Contestants[i], i );         
		}
		private static void OnCommand_Duel(CommandEventArgs e)
		{
			Mobile m = e.Mobile;

			if (m == null)
				return;


			if (!m_Enabled)
			{
				m.SendMessage("Sorry the duel system is currently offline. Please try again later.");
				return;
			}

			if (!CanDuel(m))
				return;

			Duel duel = new Duel(m);

			if (!m_DuelTable.ContainsKey(m.Serial))
				m_DuelTable.Add(m.Serial, duel);

			DuelStartTimer timer = new DuelStartTimer(duel);
			DuelStartTimeoutTable[m.Serial] = timer;

			m.CloseGump(typeof(DuelConfigGump));
			m.SendGump(new DuelConfigGump(duel));
		}
		public static void AddLoss(Duel duel, Mobile m)
		{
			DuelPoints dPoints;
			if (m_PointsTable.TryGetValue(m.Serial, out dPoints))
			{
				DuelInfo dInfo = new DuelInfo(duel.Attackers.Contains(m) ? duel.Attackers : duel.Defenders,
					TimeSpan.FromSeconds(DuelController.Instance.DuelLengthInSeconds - duel.DuelTimer.SecondsRemaining));
				dPoints.AddLoss(duel.Attackers.Count, dInfo);
			}
			else
			{
				dPoints = new DuelPoints(m);
				DuelInfo dInfo = new DuelInfo(duel.Attackers.Contains(m) ? duel.Attackers : duel.Defenders,
					TimeSpan.FromSeconds(DuelController.Instance.DuelLengthInSeconds - duel.DuelTimer.SecondsRemaining));
				dPoints.AddLoss(duel.Attackers.Count, dInfo);
				m_PointsTable[m.Serial] = dPoints;
			}
		}
		public static void DestroyDuel(Duel duel)
		{
			List<Mobile> mobs = new List<Mobile>();

			if (m_DuelTable.ContainsKey(duel.Creator.Serial))
				m_DuelTable.Remove(duel.Creator.Serial);

			if (duel.Attackers != null)
				mobs.AddRange(duel.Attackers);
			if (duel.Defenders != null)
				mobs.AddRange(duel.Defenders);
			if (duel.Contestants != null)
				mobs.AddRange(duel.Contestants);

			for (int i = 0; i < mobs.Count; i++)
			{
				if (m_DuelTable.ContainsKey(mobs[i].Serial))
					m_DuelTable.Remove(mobs[i].Serial);
			}

			duel = null;
		}
		public static bool IsInDuel(Mobile m, out Duel duel)
		{
			duel = null;

			if (m_DuelTable != null && m != null && m_DuelTable.TryGetValue(m.Serial, out duel))
				return true;
			else
				return false;
		}
		public DuelConfigGump(Duel duel)
			: base(200, 00)
		{
			m_Duel = duel;
			m_DeclinesDuels = DuelController.DeclineDuelList.Contains(m_Duel.Creator);

			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;
			this.AddPage(0);
			this.AddBackground(36, 25, 402, 426, 3500);
			this.AddItem(172, 276, 7410);
			this.AddItem(127, 179, 7414);
			this.AddItem(261, 143, 7420);
			this.AddItem(284, 164, 7421);
			this.AddItem(194, 291, 7409);
			this.AddItem(238, 138, 7419);
			this.AddItem(240, 236, 7427);
			this.AddItem(194, 137, 7417);
			this.AddItem(171, 143, 7416);
			this.AddItem(149, 158, 7415);
			this.AddItem(104, 214, 7413);
			this.AddItem(127, 223, 7412);
			this.AddItem(306, 223, 7424);
			this.AddItem(150, 209, 7431);
			this.AddItem(172, 231, 7430);
			this.AddItem(195, 246, 7429);
			this.AddItem(217, 272, 7428);
			this.AddItem(240, 291, 7427);
			this.AddItem(262, 271, 7426);
			this.AddItem(284, 251, 7425);
			this.AddItem(216, 180, 7441);
			this.AddItem(193, 203, 7440);
			this.AddItem(217, 236, 7439);
			this.AddItem(328, 214, 7423);
			this.AddItem(150, 245, 7411);
			this.AddItem(284, 205, 7436);
			this.AddItem(267, 176, 7435);
			this.AddItem(239, 156, 7434);
			this.AddItem(193, 156, 7433);
			this.AddItem(172, 179, 7432);
			this.AddItem(245, 203, 7442);
			this.AddItem(215, 138, 7418);
			this.AddItem(306, 178, 7422);
			this.AddItem(262, 222, 7437);
			this.AddItem(236, 251, 7438);
			this.AddItem(212, 204, 7960);
			this.AddLabel(166, 40, 36, @"Onsite Duel System " + DuelController.Version);
			this.AddLabel(166, 39, 36, @"Onsite Duel System " + DuelController.Version);
			this.AddLabel(136, 62, 36, @"Please choose the size of the duel.");
			this.AddLabel(136, 61, 36, @"Please choose the size of the duel.");
			this.AddLabel(154, 116, 36, @"1vs1");
			this.AddLabel(154, 115, 36, @"1vs1");
			this.AddLabel(287, 116, 36, @"2vs2");
			this.AddLabel(287, 115, 36, @"2vs2");
			this.AddLabel(98, 227, 36, @"3vs3");
			this.AddLabel(98, 226, 36, @"3vs3");
			this.AddLabel(348, 227, 36, @"4vs4");
			this.AddLabel(348, 226, 36, @"4vs4");
			this.AddLabel(223, 307, 36, @"5vs5");
			this.AddLabel(223, 306, 36, @"5vs5");
			this.AddLabel(65, 424, 36, @"ver. " + DuelController.Version);
			this.AddLabel(65, 423, 36, @"ver. " + DuelController.Version);
			this.AddLabel(79, 392, 36, @"Allow Duel Invites");
			this.AddLabel(79, 391, 36, @"Allow Duel Invites");
			this.AddButton(401, 46, 3, 4, (int)Buttons.closeBtn, GumpButtonType.Reply, 0);
			this.AddButton(159, 137, 4034, 4034, (int)Buttons.oneBtn, GumpButtonType.Reply, 0);
			this.AddButton(294, 137, 4034, 4034, (int)Buttons.twoBtn, GumpButtonType.Reply, 0);
			this.AddButton(115, 246, 4034, 4034, (int)Buttons.threeBtn, GumpButtonType.Reply, 0);
			this.AddButton(344, 246, 4034, 4034, (int)Buttons.fourBtn, GumpButtonType.Reply, 0);
			this.AddButton(230, 327, 4034, 4034, (int)Buttons.fiveBtn, GumpButtonType.Reply, 0);

			this.AddButton(54, 387, m_DeclinesDuels ? 9792 : 9793, m_DeclinesDuels ? 9792 : 9793, (int)Buttons.toggleBtn, GumpButtonType.Reply, 0);
		}
        public DuelConfigGump(Duel duel)
            : base(200, 00)
        {
            m_Duel          = duel;
            m_DeclinesDuels = DuelController.DeclineDuelList.Contains(m_Duel.Creator);

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);
            this.AddBackground(36, 25, 402, 426, 3500);
            this.AddItem(172, 276, 7410);
            this.AddItem(127, 179, 7414);
            this.AddItem(261, 143, 7420);
            this.AddItem(284, 164, 7421);
            this.AddItem(194, 291, 7409);
            this.AddItem(238, 138, 7419);
            this.AddItem(240, 236, 7427);
            this.AddItem(194, 137, 7417);
            this.AddItem(171, 143, 7416);
            this.AddItem(149, 158, 7415);
            this.AddItem(104, 214, 7413);
            this.AddItem(127, 223, 7412);
            this.AddItem(306, 223, 7424);
            this.AddItem(150, 209, 7431);
            this.AddItem(172, 231, 7430);
            this.AddItem(195, 246, 7429);
            this.AddItem(217, 272, 7428);
            this.AddItem(240, 291, 7427);
            this.AddItem(262, 271, 7426);
            this.AddItem(284, 251, 7425);
            this.AddItem(216, 180, 7441);
            this.AddItem(193, 203, 7440);
            this.AddItem(217, 236, 7439);
            this.AddItem(328, 214, 7423);
            this.AddItem(150, 245, 7411);
            this.AddItem(284, 205, 7436);
            this.AddItem(267, 176, 7435);
            this.AddItem(239, 156, 7434);
            this.AddItem(193, 156, 7433);
            this.AddItem(172, 179, 7432);
            this.AddItem(245, 203, 7442);
            this.AddItem(215, 138, 7418);
            this.AddItem(306, 178, 7422);
            this.AddItem(262, 222, 7437);
            this.AddItem(236, 251, 7438);
            this.AddItem(212, 204, 7960);
            this.AddLabel(166, 40, 36, @"Onsite Duel System " + DuelController.Version);
            this.AddLabel(166, 39, 36, @"Onsite Duel System " + DuelController.Version);
            this.AddLabel(136, 62, 36, @"Please choose the size of the duel.");
            this.AddLabel(136, 61, 36, @"Please choose the size of the duel.");
            this.AddLabel(154, 116, 36, @"1vs1");
            this.AddLabel(154, 115, 36, @"1vs1");
            this.AddLabel(287, 116, 36, @"2vs2");
            this.AddLabel(287, 115, 36, @"2vs2");
            this.AddLabel(98, 227, 36, @"3vs3");
            this.AddLabel(98, 226, 36, @"3vs3");
            this.AddLabel(348, 227, 36, @"4vs4");
            this.AddLabel(348, 226, 36, @"4vs4");
            this.AddLabel(223, 307, 36, @"5vs5");
            this.AddLabel(223, 306, 36, @"5vs5");
            this.AddLabel(65, 424, 36, @"ver. " + DuelController.Version);
            this.AddLabel(65, 423, 36, @"ver. " + DuelController.Version);
            this.AddLabel(79, 392, 36, @"Allow Duel Invites");
            this.AddLabel(79, 391, 36, @"Allow Duel Invites");
            this.AddButton(401, 46, 3, 4, (int)Buttons.closeBtn, GumpButtonType.Reply, 0);
            this.AddButton(159, 137, 4034, 4034, (int)Buttons.oneBtn, GumpButtonType.Reply, 0);
            this.AddButton(294, 137, 4034, 4034, (int)Buttons.twoBtn, GumpButtonType.Reply, 0);
            this.AddButton(115, 246, 4034, 4034, (int)Buttons.threeBtn, GumpButtonType.Reply, 0);
            this.AddButton(344, 246, 4034, 4034, (int)Buttons.fourBtn, GumpButtonType.Reply, 0);
            this.AddButton(230, 327, 4034, 4034, (int)Buttons.fiveBtn, GumpButtonType.Reply, 0);

            this.AddButton(54, 387, m_DeclinesDuels ? 9792 : 9793, m_DeclinesDuels ? 9792 : 9793, (int)Buttons.toggleBtn, GumpButtonType.Reply, 0);
        }
 public TimeoutTimer( Duel duel, Mobile m ) : base( TimeSpan.FromSeconds( 15.0 ) )
 {
     m_Mobile = m;
     m_Duel = duel;
 }
 public LogoutTimeoutTimer(Mobile m, Duel duel)
     : base(TimeSpan.FromSeconds(30.0))
 {
     m_Mobile = m;
     m_Duel   = duel;
 }
 public LogoutTimeoutTimer( Mobile m, Duel duel )
     : base(TimeSpan.FromSeconds(30.0))
 {
     m_Mobile = m;
     m_Duel = duel;
 }
Exemple #12
0
 public DuelTimer(Duel duel, int seconds) : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1.0))
 {
     m_Seconds = seconds;
     m_Duel    = duel;
 }
		public DuelStartTimer(Duel duel)
			: base(TimeSpan.FromSeconds(120.0))
		{
			m_Duel = duel;
		}
Exemple #14
0
 public TimeoutTimer(Duel duel, Mobile m) : base(TimeSpan.FromSeconds(15.0))
 {
     m_Mobile = m;
     m_Duel   = duel;
 }
Exemple #15
0
		public DuelTarget(Mobile mobile, Duel duel)
			: base(15, false, TargetFlags.None)
		{
			m_Mobile = mobile;
			m_Duel = duel;
		}
 public DuelStartTimer(Duel duel)
     : base(TimeSpan.FromSeconds(120.0))
 {
     m_Duel = duel;
 }
Exemple #17
0
 public DuelTimer( Duel duel, int seconds ) : base( TimeSpan.FromSeconds( 0 ), TimeSpan.FromSeconds( 1.0 ) )
 {
     m_Seconds = seconds;
     m_Duel = duel;
 }
Exemple #18
0
 public DuelTarget(Mobile mobile, Duel duel)
     : base(15, false, TargetFlags.None)
 {
     m_Mobile = mobile;
     m_Duel   = duel;
 }