private void SetupFormValues(QuestInProgressCondition condition) { cmbQuestInProgress.SelectedIndex = QuestBase.ListIndex(condition.QuestId); cmbTaskModifier.SelectedIndex = (int)condition.Progress; if (cmbTaskModifier.SelectedIndex == -1) { cmbTaskModifier.SelectedIndex = 0; } if (cmbTaskModifier.SelectedIndex != 0) { //Get Quest Task Here var quest = QuestBase.Get(QuestBase.IdFromList(cmbQuestInProgress.SelectedIndex)); if (quest != null) { for (var i = 0; i < quest.Tasks.Count; i++) { if (quest.Tasks[i].Id == condition.TaskId) { cmbQuestTask.SelectedIndex = i; } } } } }
public static bool MeetsCondition( QuestInProgressCondition condition, Player player, Event eventInstance, QuestBase questBase ) { return(player.QuestInProgress(condition.QuestId, condition.Progress, condition.TaskId)); }
public static bool MeetsCondition( QuestInProgressCondition condition, Player player, Event eventInstance, QuestBase questBase ) { var questInProgress = QuestBase.Get(condition.QuestId); if (questInProgress != null) { return(player.QuestInProgress(questInProgress, condition.Progress, condition.TaskId)); } return(false); }
private void SaveFormValues(QuestInProgressCondition condition) { condition.QuestId = QuestBase.IdFromList(cmbQuestInProgress.SelectedIndex); condition.Progress = (QuestProgressState)cmbTaskModifier.SelectedIndex; condition.TaskId = Guid.Empty; if (cmbTaskModifier.SelectedIndex != 0) { //Get Quest Task Here var quest = QuestBase.Get(QuestBase.IdFromList(cmbQuestInProgress.SelectedIndex)); if (quest != null) { if (cmbQuestTask.SelectedIndex > -1) { condition.TaskId = quest.Tasks[cmbQuestTask.SelectedIndex].Id; } } } }