Exemple #1
0
		/// <summary>
		/// Whether the given GO can be used by the player to start or progress a quest
		/// </summary>
		public bool IsRequiredForAnyQuest(GameObject go)
		{
			// check quest start/end status
			//var questId = go.Entry.QuestId;
			//if (questId != 0)
			//{
			//    var templ = QuestMgr.GetTemplate(questId);
			//    if (templ != null)
			//    {
			//    }
			//}
			if (go.QuestHolderInfo != null && go.QuestHolderInfo.GetHighestQuestGiverStatus(Owner).CanStartOrFinish())
			{
				// GO can be used by this Character to start or finish a quest
				return true;
			}

			// check quests that require GO interaction
			for (var j = 0; j < m_RequireGOsQuests.Count; j++)
			{
				var quest = m_RequireGOsQuests[j];
				for (var i = 0; i < quest.Template.GOInteractions.Length; i++)
				{
					var interaction = quest.Template.GOInteractions[i];
					if (interaction.TemplateId == go.EntryId)
					{
						return true;
					}
				}
			}

			// check if it can contain quest loot
			return go.ContainsQuestItemsFor(Owner, LootEntryType.GameObject);
		}