protected override void OnTick() { if (countdown == 6) { //announcer.Say( String.Format( "The match is {0} v.s. {1}.", m1.Name, m2.Name ) ); countdown -= 1; } else if (countdown == 5) { t.announcer.Say(String.Format("The Match begins in {0}", countdown)); countdown -= 1; } else if (countdown == 0) { t.announcer.Say("FIGHT!"); foreach (Mobile m in Team1.getOwners()) { m.Paralyzed = false; } foreach (Mobile m in Team2.getOwners()) { m.Paralyzed = false; } //announcer.Delete(); } else { t.announcer.Say(String.Format("{0}", countdown)); countdown -= 1; } this.Stop(); }
public TeamConfirmGump(Mobile from, Tournament tournament, Teams fullteam) : this() { caller = from; t = tournament; team = fullteam; size = team.getOwners().Count-1; TeamInfo(); }
/// <summary> /// Move the selected team /// </summary> /// <param name="team">Team to be moved</param> /// <param name="map">Map to be moved to</param> /// <param name="location">List of Point3D Locations to be moved to</param> /// <param name="msg">Message to tell the players being moved</param> /// <param name="paralyze">Should they be paralyzed after the move</param> public void MoveTeam(Teams team, Map map, List <Point3D> location, string msg, bool paralyze) { Mobile m; for (int i = 0; i < team.getOwners().Count; i++) { m = team.getOwners()[i]; m.MoveToWorld(location[i], map); //Arena Area Manager.RefreshPlayer((PlayerMobile)m); if (msg.Length > 0 && (Manager.IsOnline((PlayerMobile)m))) { m.SendMessage(msg); } if (paralyze) { m.Paralyzed = true; } } }
/// <summary> /// Rewards the top 3 place winners by giving the specified item(s) and /// placing them in thier banks.Notifies the winners that thier winnings /// have been placed in thier bank. /// Loads the previous tournaments.xml file /// Saves the results to the tournaments.xml file /// Removes the spectator gates. /// Moves the winners so they may leave. /// Stops the tournament timer to officially end the tournament. /// </summary> /// <param name="first"> First place contestant</param> /// <param name="second"> Second place contestant</param> /// <param name="third"> Third place contestant</param> public static void TournamentReward(Tournament t, string place, Teams team) { BankBox bank; Item prize = (Item)Activator.CreateInstance(t.Prizes[place].GetType(), false); Dupe.CopyProperties(prize, t.Prizes[place]); foreach (Mobile m in team.getOwners()) { bank = m.BankBox; bank.AddItem(prize); m.SendMessage("Your winnings have been sent to your bankbox."); if (place.Contains("first")) { World.Broadcast(0, false, m.Name + " has won the " + t.TeamSize + " tournament."); } } }
/// <summary> /// Adds a team to the tournament list /// </summary> /// <param name="m">team to add</param> /// <returns>did the team add?</returns> public bool AddTeam(Teams m) { bool Add = true; foreach (PlayerMobile pm in m.getOwners()) { if (IsRegistered(pm)) { Add = false; } } if (Add) { Teams.Add(m); XMLDates.Save(); } return(Add); }
/// <summary> /// Removes a team from the tournament list /// </summary> /// <param name="m">team to be removed</param> public void RemoveTeam(Teams m) { List <Teams> remove = new List <Teams>(); foreach (PlayerMobile pm in m.getOwners()) { remove.Add(GetTeam(pm)); } foreach (Teams team in remove) { foreach (PlayerMobile pm in team.getOwners()) { if (Manager.IsOnline(pm)) { pm.SendMessage(String.Format("You have been removed from the {0} tournament on {1} at {2}.", TeamSize, Date.ToString("MM/dd/yy"), Date.ToString("hh:mm tt"))); } } Teams.Remove(team); } XMLDates.Save(); }
/// <summary> /// Removes a team from the tournament list /// </summary> /// <param name="m">team to be removed</param> public void RemoveTeam(Teams m) { List<Teams> remove = new List<Teams>(); foreach (PlayerMobile pm in m.getOwners()) { remove.Add(GetTeam(pm)); } foreach (Teams team in remove) { foreach(PlayerMobile pm in team.getOwners()) { if (Manager.IsOnline(pm)) pm.SendMessage(String.Format("You have been removed from the {0} tournament on {1} at {2}.", TeamSize, Date.ToString("MM/dd/yy"), Date.ToString("hh:mm tt"))); } Teams.Remove(team); } XMLDates.Save(); }
/// <summary> /// Adds a team to the tournament list /// </summary> /// <param name="m">team to add</param> /// <returns>did the team add?</returns> public bool AddTeam(Teams m) { bool Add = true; foreach(PlayerMobile pm in m.getOwners()) if (IsRegistered(pm)) Add = false; if (Add) { Teams.Add(m); XMLDates.Save(); } return Add; }
/// <summary> /// Rewards the top 3 place winners by giving the specified item(s) and /// placing them in thier banks.Notifies the winners that thier winnings /// have been placed in thier bank. /// Loads the previous tournaments.xml file /// Saves the results to the tournaments.xml file /// Removes the spectator gates. /// Moves the winners so they may leave. /// Stops the tournament timer to officially end the tournament. /// </summary> /// <param name="first"> First place contestant</param> /// <param name="second"> Second place contestant</param> /// <param name="third"> Third place contestant</param> public static void TournamentReward(Tournament t, string place, Teams team) { BankBox bank; Item prize = (Item)Activator.CreateInstance(t.Prizes[place].GetType(), false); Dupe.CopyProperties(prize,t.Prizes[place]); foreach(Mobile m in team.getOwners()) { bank = m.BankBox; bank.AddItem(prize); m.SendMessage("Your winnings have been sent to your bankbox."); if (place.Contains("first")) World.Broadcast(0,false, m.Name+" has won the " + t.TeamSize + " tournament."); } }
/// <summary> /// Move the selected team /// </summary> /// <param name="team">Team to be moved</param> /// <param name="map">Map to be moved to</param> /// <param name="location">List of Point3D Locations to be moved to</param> /// <param name="msg">Message to tell the players being moved</param> /// <param name="paralyze">Should they be paralyzed after the move</param> public void MoveTeam(Teams team, Map map, List<Point3D> location, string msg, bool paralyze) { Mobile m; for (int i = 0; i < team.getOwners().Count; i++) { m = team.getOwners()[i]; m.MoveToWorld(location[i], map); //Arena Area Manager.RefreshPlayer((PlayerMobile)m); if (msg.Length > 0 && (Manager.IsOnline((PlayerMobile)m))) m.SendMessage(msg); if (paralyze) m.Paralyzed = true; } }