public static bool CanOffer(PlayerMobile from, BaseQuest quest, bool message) { if (!quest.CanOffer()) return false; // if a player wants to start quest chain (already started) again (not osi) if (quest.ChainID != QuestChain.None && FirstChainQuest(quest, quest.Quester) && from.Chains.ContainsKey(quest.ChainID)) return false; if (!Delayed(from, quest, message)) return false; for (int i = quest.Objectives.Count - 1; i >= 0; i --) { Type type = quest.Objectives[i].Type(); if (type == null) continue; for (int j = from.Quests.Count - 1; j >= 0; j --) { BaseQuest pQuest = from.Quests[j]; for (int k = pQuest.Objectives.Count - 1; k >= 0; k --) { BaseObjective obj = pQuest.Objectives[k]; if (type == obj.Type()) return false; } } } return true; }
public static bool CanOffer(PlayerMobile from, BaseQuest quest, object quester, bool message) { if (!quest.CanOffer()) { return(false); } if (quest.ChainID != QuestChain.None) { // if a player wants to start quest chain (already started) again (not osi) if (from.Chains.ContainsKey(quest.ChainID) && FirstChainQuest(quest, quest.Quester)) { return(false); } // if player already has an active quest from the chain if (InChainProgress(from, quest)) { return(false); } } if (!Delayed(from, quest, quester, message)) { return(false); } for (int i = quest.Objectives.Count - 1; i >= 0; i--) { Type type = quest.Objectives[i].Type(); if (type == null) { continue; } for (int j = from.Quests.Count - 1; j >= 0; j--) { BaseQuest pQuest = from.Quests[j]; for (int k = pQuest.Objectives.Count - 1; k >= 0; k--) { BaseObjective obj = pQuest.Objectives[k]; if (type == obj.Type() && (quest.ChainID == QuestChain.None || quest.ChainID == pQuest.ChainID)) { return(false); } } } } return(true); }