public static string TeleportToQuest(Player player, Random rand = null) { var lastAttackTimeAgo = Math.Abs(DateTime.UtcNow.Subtract(player.GetLastCombatTimestamp()).TotalMinutes); if (lastAttackTimeAgo < TurnTimesStatics.GetMinutesSinceLastCombatBeforeQuestingOrDuelling()) { return(null); } var quests = QuestProcedures.GetAllAvailableQuestsForPlayer(player, PvPWorldStatProcedures.GetWorldTurnNumber()); if (quests == null || !quests.Any()) { return(null); } rand = rand ?? new Random(); var index = rand.Next(quests.Count()); var quest = quests.ToArray()[index]; if (!Teleport(player, quest.dbName, rand.Next(2) == 0)) { return(null); } return($"You notice a gold chalice on the shelf, its engraving obscured by dirt. You decide to blow the dust off and a cloud fills the room. A frail man with a long white beard and crooked staff emerges from the mist. \"So, it's a quest you seek?\" comes his shrill, wheezing voice. \"Well, I have just the thing. Seek out your victory, young mage.\" He hands you a scroll. At the top it is written <b>{quest.Name}</b>. As you take it you feel yourself transported to a far-off place..."); }