public ShippingCrate(ProfessionalFisherQuest quest) { m_Quest = quest; Movable = false; LootType = LootType.Blessed; }
public static FishMonger GetRandomMonger(PlayerMobile player, FishMonger monger) { bool NOGO = true; FishMonger mob = null; List <FishMonger> mongers = new List <FishMonger>(m_Mongers); //First, remove quester if (mongers.Contains(monger)) { mongers.Remove(monger); } //Next, remove mongers from other facets in same region as quest giver for (var index = 0; index < m_Mongers.Count; index++) { FishMonger m = m_Mongers[index]; if (m.Region != null && monger.Region != null && m.Region.Name == monger.Region.Name) { mongers.Remove(m); } } //Now, remove mongers from other quests if (player.Quests != null) { for (int i = 0; i < player.Quests.Count; i++) { if (player.Quests[i] is ProfessionalFisherQuest) { ProfessionalFisherQuest q = (ProfessionalFisherQuest)player.Quests[i]; if (mongers.Contains(q.TurnIn)) { mongers.Remove(q.TurnIn); } } } } if (mongers.Count < 1) { return(null); } while (NOGO) { mob = mongers[Utility.Random(mongers.Count)]; if (mob.Region != null && mob.Region.Name != null) { NOGO = false; } } return(mob); }
public override void OnTalk(PlayerMobile player) { int distance = 100; BaseBoat boat = FishQuestHelper.GetBoat(player); if (boat == null) SayTo(player, 1116514); //Bring yer ship around, I might have some work for ye!); else { bool inRange = InRange(boat.Location, distance) && boat.Map == this.Map; if (!FishQuestHelper.HasFishQuest(player, this, inRange)) { FishMonger monger = FishQuestHelper.GetRandomMonger(player, this); if (monger == null) SayTo(player, "It seems my fellow fish mongers are on vacation. Try again later, or perhaps another Facet."); else { ProfessionalFisherQuest quest = new ProfessionalFisherQuest(player, monger, this, boat); if (quest != null) { quest.Quester = this; quest.Owner = player; player.CloseGump(typeof(MondainQuestGump)); player.SendGump(new MondainQuestGump(quest)); if (boat.IsClassicBoat) this.SayTo(player, "Such a weak vessle can only catch a weak line."); } } } } }
public static bool HasFishQuest(PlayerMobile player, MondainQuester quester, bool inRange) { //We need to bump the completed quests to the front so we can get credit before the incomplete quests. List <ProfessionalFisherQuest> quests = new List <ProfessionalFisherQuest>(); if (player.Quests != null) { for (int i = 0; i < player.Quests.Count; i++) { if (player.Quests[i] is ProfessionalFisherQuest) { ProfessionalFisherQuest quest = player.Quests[i] as ProfessionalFisherQuest; if (quest.Completed) { quests.Insert(0, quest); } else { quests.Add(quest); } } } } for (int i = 0; i < quests.Count; i++) { ProfessionalFisherQuest quest = quests[i]; if (quest.Quester is Mobile && (Mobile)quest.Quester == quester) { player.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.InProgress, false)); quest.InProgress(); return(true); } if (quest.TurnIn == quester || (quest.TurnIn != null && quest.TurnIn.Region != null && quester.Region != null && quest.TurnIn.Region.Name == quester.Region.Name)) { if (!inRange) { quester.SayTo(player, 1116519); //I can't find your ship! You need to bring it in closer. return(true); } if (quest.Completed) { quest.OnCompleted(); player.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.Complete, false, true)); } else { player.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.InProgress, false)); quest.InProgress(); } return(true); } } if (!inRange) { quester.SayTo(player, 1116514); //Bring yer ship around, I might have some work for ye! return(true); } return(false); }
public void AddQuest(ProfessionalFisherQuest quest) { m_Quest = quest; }