Beispiel #1
0
    public void SetMarkType(QuestMarkType _type)
    {
        try
        {
            nowType = _type;

            foreach (SimpleSprite sprite in questSprites)
				sprite.gameObject.SetActive(false);

			if (nowType == QuestMarkType.CLEAR_REMAINTALK || nowType == QuestMarkType.TALK_CLEAR || nowType == QuestMarkType.TALK_HAVE)
				questSprites[(int)QuestPanelType.QUEST_NEW_TALK].gameObject.SetActive(true);
			else if (nowType == QuestMarkType.CLEAR || nowType == QuestMarkType.CLEAR_AND_HAVE)
				questSprites[(int)QuestPanelType.QUEST_CLEAR].gameObject.SetActive(true);
			else if (nowType == QuestMarkType.HAVE)
				questSprites[(int)QuestPanelType.QUEST_NEW].gameObject.SetActive(true);
			else if (nowType == QuestMarkType.UPPERLEVEL)
				questSprites[(int)QuestPanelType.QUEST_NEW_UPPERLEVEL].renderer.enabled = true;
			else if (nowType == QuestMarkType.HAVE_EVENT || nowType == QuestMarkType.HAVE_EVENT_AND_PROGRESS || nowType == QuestMarkType.LOWERLEVEL_AND_HAVE_EVENT)
				questSprites[(int)QuestPanelType.QUEST_HAVE_EVENT].gameObject.SetActive(true);
			else if (nowType == QuestMarkType.HAVE_NPC_DAILY)
				questSprites[(int)QuestPanelType.QUEST_HAVE_NPC_DAILY].gameObject.SetActive(true);
			else if (nowType == QuestMarkType.CLEAR_NPC_DAILY)
				questSprites[(int)QuestPanelType.QUEST_CLEAR_NPC_DAILY].gameObject.SetActive(true);
        }
        catch (System.Exception e)
        {
            Debug.LogError(e.Message);
        }

    }
	public void SetMarkType(QuestMarkType _type)
	{
		try
		{
			if (bInit == false)
				throw new System.Exception("Not Init");
				
			nowType = _type;

            objClearMark.SetActiveRecursively(false);
            objNothingMark.SetActiveRecursively(false);
            objUpperLvMark.SetActiveRecursively(false);

            if (nowType == QuestMarkType.CLEAR || nowType == QuestMarkType.CLEAR_AND_HAVE || nowType == QuestMarkType.CLEAR_REMAINTALK)
                objClearMark.SetActiveRecursively(true);
            else if (nowType == QuestMarkType.HAVE)
                objNothingMark.SetActiveRecursively(true);
            else if (nowType == QuestMarkType.UPPERLEVEL)
                objUpperLvMark.SetActiveRecursively(true);
		}
		catch(System.Exception e)
		{
			Debug.LogError(e.Message);	
		}
		
	}
Beispiel #3
0
	private QuestMarkType CheckInGameEvent(int _npcID, AsUserEntity _userEntity, AsNpcEntity _npcEntity)
	{
		// check have event
		List<Tbl_Event_Record> listEvent = AsTableManager.Instance.GetTbl_Event(_npcID, System.DateTime.Now.AddTicks(AsGameMain.serverTickGap));
		List<Tbl_Event_Record> listFiltered = new List<Tbl_Event_Record>();

		// filter list view
		foreach (Tbl_Event_Record record in listEvent)
		{
			if (record.viewList == true)
				continue;

			listFiltered.Add(record);
		}

		if (listFiltered.Count > 0)
		{
			// check have event and progress
			foreach (Tbl_Quest_Record questRecord in listQuestRecord)
			{
				if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IN)
				{
					QuestData questData = questRecord.QuestDataInfo;

					if (ArkQuest.IsPossibleAccept(_userEntity, questData) == true)
					{
						nowQuetMarkType = QuestMarkType.HAVE_EVENT_AND_PROGRESS;
						SetQuestMarkPanel(_npcEntity, QuestMarkType.HAVE_EVENT_AND_PROGRESS);
						return nowQuetMarkType;
					}
				}
			}

			nowQuetMarkType = QuestMarkType.HAVE_EVENT;
			SetQuestMarkPanel(_npcEntity, QuestMarkType.HAVE_EVENT);
			return nowQuetMarkType;
		}
		else
		{
			return QuestMarkType.NOTHING;
		}
	}
Beispiel #4
0
	public static void SetQuestMarkPanel(AsNpcEntity _npcEntity, QuestMarkType _markType)
	{
		if (_npcEntity != null)
		{
			if (_npcEntity.questPanel != null)
				_npcEntity.questPanel.SetMarkType(_markType);
		}
	}
Beispiel #5
0
	public QuestMarkType UpdateQuestMark(int _npcID)
	{
		if (!settingQuest)
			return nowQuetMarkType;

		AsNpcEntity npcEntity = AsEntityManager.Instance.GetNPCEntityByTableID(_npcID);
		AsUserEntity userEntity = AsEntityManager.Instance.UserEntity;
		int userLv = userEntity.GetProperty<int>(eComponentProperty.LEVEL);

		if (listQuestRecord.Count <= 0)
		{
			// check have talk
			if (ArkQuestmanager.instance.HaveTalkAchievement(_npcID))
			{
				nowQuetMarkType = QuestMarkType.TALK_HAVE;
				SetQuestMarkPanel(npcEntity, QuestMarkType.TALK_HAVE);
			}
			else
			{
				nowQuetMarkType = QuestMarkType.NOTHING;
				SetQuestMarkPanel(npcEntity, QuestMarkType.NOTHING);
			}

			return nowQuetMarkType;
		}


		// check clear
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listCompleteQuest.Contains(questRecord.QuestDataInfo.Info.ID) == false)
				continue;

			if (questRecord.QuestDataInfo.Info.QuestType == QuestType.QUEST_NPC_DAILY)
				continue;

			if (questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_CLEAR || questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IMMEDIATELY_CLEAR)
			{
				nowQuetMarkType = QuestMarkType.CLEAR;
				SetQuestMarkPanel(npcEntity, QuestMarkType.CLEAR);
				return nowQuetMarkType;
			}
		}

		// check npc daily Clear
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listCompleteQuest.Contains(questRecord.QuestDataInfo.Info.ID) == false)
				continue;

			if (questRecord.QuestDataInfo.Info.QuestType != QuestType.QUEST_NPC_DAILY)
				continue;

			if (questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_CLEAR || questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IMMEDIATELY_CLEAR)
			{
				nowQuetMarkType = QuestMarkType.CLEAR_NPC_DAILY;
				SetQuestMarkPanel(npcEntity, QuestMarkType.CLEAR_NPC_DAILY);
				return nowQuetMarkType;
			}
		}

		// check talk Clear
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listCompleteQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IN)
			{
				QuestData questData = questRecord.QuestDataInfo;

				if (!questData.Achievement.ContainTalkWithNpcOnly())
					continue;

				List<AchTalkNPC> listTalkNPC = questData.Achievement.GetDatas<AchTalkNPC>();

				if (listTalkNPC[0].NpcID == npcTableID)
				{
					nowQuetMarkType = QuestMarkType.TALK_CLEAR;

					SetQuestMarkPanel(npcEntity, QuestMarkType.TALK_CLEAR);
					return nowQuetMarkType;
				}
			}
		}


		// check remain talk
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listCompleteQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IN)
			{
				QuestData questData = questRecord.QuestDataInfo;

				if (questData.Achievement.IsCompleteWithoutTalkWithNPC() == true)
				{
					AchTalkNPC talkNpc = questData.Achievement.GetTalkWithNpc();

					if (talkNpc == null)
						continue;

					if (talkNpc.NpcID == _npcID)
					{
						nowQuetMarkType = QuestMarkType.CLEAR_REMAINTALK;
						SetQuestMarkPanel(npcEntity, QuestMarkType.CLEAR_REMAINTALK);
						return nowQuetMarkType;
					}
				}
			}
		}

		// check have talk
		if (ArkQuestmanager.instance.HaveTalkAchievement(_npcID))
		{
			nowQuetMarkType = QuestMarkType.TALK_HAVE;
			SetQuestMarkPanel(npcEntity, QuestMarkType.TALK_HAVE);
			return nowQuetMarkType;
		}

		// lower Level
		List<bool> listLower = new List<bool>();
		int lvGap = 0;
		bool haveNpcDaily = false;
		bool cancelLowerLevelByNpcDaily = false;
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_NOTHING)
			{
				QuestData questData = questRecord.QuestDataInfo;

				if (ArkQuest.IsPossibleAccept(userEntity, questData) == false)
					continue;

				if (questData.Info.QuestType == QuestType.QUEST_NPC_DAILY)
				{
					haveNpcDaily = true;
					continue;
				}
		
				List<ConditionLevel> listConditionLevel = questData.Condition.GetCondition<ConditionLevel>();

				if (listConditionLevel.Count > 0)
				{
					lvGap = userLv - listConditionLevel[0].MinLevel;
					listLower.Add(lvGap >= 10);
				}
				else
					listLower.Add(false);
			}
		}

		if (listLower.Count > 0 && !listLower.Contains(false) )
		{
			if (haveNpcDaily == false)
			{
				QuestMarkType eventMark = CheckInGameEvent(_npcID, userEntity, npcEntity);

				if (eventMark != QuestMarkType.NOTHING)
				{
					nowQuetMarkType = QuestMarkType.LOWERLEVEL_AND_HAVE_EVENT;
					SetQuestMarkPanel(npcEntity, QuestMarkType.LOWERLEVEL_AND_HAVE_EVENT);
					return QuestMarkType.LOWERLEVEL_AND_HAVE_EVENT;
				}

				nowQuetMarkType = QuestMarkType.LOWERLEVEL;
				SetQuestMarkPanel(npcEntity, QuestMarkType.LOWERLEVEL);
				return nowQuetMarkType;
			}
			else
			{
				cancelLowerLevelByNpcDaily = true;
			}
		}

		// have
		if (cancelLowerLevelByNpcDaily == false)
		{
			foreach (Tbl_Quest_Record questRecord in listQuestRecord)
			{
				if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_NOTHING)
				{
					QuestData questData = questRecord.QuestDataInfo;

					if (ArkQuest.IsPossibleAccept(userEntity, questData) == false)
						continue;

					if (questData.Info.QuestType == QuestType.QUEST_NPC_DAILY)
						continue;

					nowQuetMarkType = QuestMarkType.HAVE;
					SetQuestMarkPanel(npcEntity, QuestMarkType.HAVE);
					return nowQuetMarkType;
				}
			}
		}

		// npc daily have
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_NOTHING)
			{
				QuestData questData = questRecord.QuestDataInfo;

				if (ArkQuest.IsPossibleAccept(userEntity, questData) == false)
					continue;

				if (questData.Info.QuestType != QuestType.QUEST_NPC_DAILY)
					continue;

				nowQuetMarkType = QuestMarkType.HAVE_NPC_DAILY;
				SetQuestMarkPanel(npcEntity, QuestMarkType.HAVE_NPC_DAILY);
				return nowQuetMarkType;
			}
		}

		// check have event
		QuestMarkType type = CheckInGameEvent(_npcID, userEntity, npcEntity);
		if (type != QuestMarkType.NOTHING)
			return type;

		// upper Level
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_NOTHING)
			{
				QuestData questData = questRecord.QuestDataInfo;

				if (ArkQuest.IsPossibleAccept(userEntity, questData, 3) == true)
				{
					nowQuetMarkType = QuestMarkType.UPPERLEVEL;
					SetQuestMarkPanel(npcEntity, QuestMarkType.UPPERLEVEL);
					return nowQuetMarkType;
				}
			}
		}

		// check progress
		foreach (Tbl_Quest_Record questRecord in listQuestRecord)
		{
			if (listSuggestQuest.Contains(questRecord.QuestDataInfo.Info.ID) && questRecord.QuestDataInfo.NowQuestProgressState == QuestProgressState.QUEST_PROGRESS_IN)
			{
				QuestData questData = questRecord.QuestDataInfo;

				if (ArkQuest.IsPossibleAccept(userEntity, questData) == true)
				{
					nowQuetMarkType = QuestMarkType.PROGRESS;
					SetQuestMarkPanel(npcEntity, QuestMarkType.PROGRESS);
					return nowQuetMarkType;
				}
			}
		}

		nowQuetMarkType = QuestMarkType.NOTHING;
		SetQuestMarkPanel(npcEntity, QuestMarkType.NOTHING);
		return nowQuetMarkType;
	}