public string QueueIgnoringRequirements(IParty party) { Unqueue(party); int minLevel = PartyUtils.GetLowestLevelPlayer(party).Level; IList <IAdventure> adventures = repository .Get(a => { return(a.MinimumLevel <= minLevel && AdventureUtils.GetCostRequirementPredicate(party).Invoke(a)); }); if (adventures.Count == 0) { return("A member in your party is either too low a level or cannot afford, " + "and dungeons!"); } Random rnd = new Random(); IAdventure adventure = adventures[rnd.Next(0, adventures.Count - 1)]; adventureQueue.Add(new KeyValuePair <IParty, IAdventure>(party, adventure)); return(string.Format("Your party has joined the adventure queue for {0}, which " + "will start shortly. Maximum level requirements have been ignored, Xp is capped at " + "the adventures maximum level ({1}). ", adventure.Name, adventure.MaximumLevel)); }
private string AutoLevelSyncParty(IParty party) { StringBuilder sb = new StringBuilder(); IPlayer sync = PartyUtils.GetLowestLevelPlayer(party); party.LevelSync(sync.Level); sb.AppendFormat("Automatically Level syncing to lowest level player ({0}) ", sync.Name); sb.Append("and finding dungeons based on this level. "); return(sb.ToString()); }
public string QueueIgnoringRequirements(IParty party, int[] ids) { Unqueue(party); int minLevel = PartyUtils.GetLowestLevelPlayer(party).Level; IList <IAdventure> adventures = repository.Get(a => { return(ids.Contains(a.ID) && a.MinimumLevel < minLevel); }); if (adventures.Count == 0) { return("A member in your party is too low a level to Queue."); } Random rnd = new Random(); IAdventure adventure = adventures[rnd.Next(0, adventures.Count - 1)]; adventureQueue.Add(new KeyValuePair <IParty, IAdventure>(party, adventure)); return(string.Format("Your party has joined the adventure queue for {0}, which " + "will start shortly. Maximum level requirements have been ignored.", adventure.Name)); }