/// <summary> /// Get Player Quests list /// </summary> /// <param name="playerId"></param> /// <returns></returns> public static Quests GetPlayerQuest(int playerId) { using (MySqlConnection connection = new MySqlConnection(connectionString)) { connection.Open(); Quests Quests = new Quests(); using (MySqlCommand command = connection.CreateCommand()) { command.CommandText = "GAME_QUEST_GET"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@in_PlayerId", playerId); var reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { int questId = reader.GetInt32(1); int questStep = reader.GetInt32(2); Quests.AddQuest(questId, questStep); } } } connection.Close(); return Quests; } }
public static void StartDialogWithQuest(string[] dialogArray, string[] nameArray, string questName, string questDesc, int questType, string targetNPCName, string providerName, string questsFullMessage, int questMaxProgress) { dialogManager.InitializeDialogArrays(dialogArray, nameArray, Style_Paper); dialogManager.ResetDialogUI(dialogArray[0], nameArray[0]); for (int q = 0; q < GameData.activeQuests.Length; q++) //This is so that upon loading, the array has object values while will be modified on save, and it's above all else since it has to happen { Quests.emptyQuest = new Quests(); Quests.emptyQuest.questName = "None"; Quests.emptyQuest.questDescription = "No quest here"; GameData.activeQuests[q] = Quests.emptyQuest; } Quests newQuest = new Quests(); newQuest.questName = questName; newQuest.questDescription = questDesc; newQuest.questType = questType; newQuest.progress = 0; newQuest.maxProgress = questMaxProgress; newQuest.targetNPCName = targetNPCName; newQuest.askerName = providerName; if (!Quests.AddQuest(newQuest)) //tries to add the quest, and if it's full it's gonna add the quest failed line to the dialog { activeDialog.Add(questsFullMessage); speakerNames.Add(nameArray[0]); } }
/// <summary> /// Get Player Quests list /// </summary> /// <param name="playerId"></param> /// <returns></returns> public static Quests GetPlayerQuest(int playerId) { using (MySqlConnection connection = new MySqlConnection(connectionString)) { connection.Open(); Quests Quests = new Quests(); using (MySqlCommand command = connection.CreateCommand()) { command.CommandText = "GAME_QUEST_GET"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@in_PlayerId", playerId); var reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { int questId = reader.GetInt32(1); int questStep = reader.GetInt32(2); Quests.AddQuest(questId, questStep); } } } connection.Close(); return(Quests); } }
void Start() { ignoreLayerMask = LayerMask.GetMask("Selectable"); dialogue = GetComponent <Dialogue>(); quests = GetComponent <Quests>(); quests.AddQuest("Interact with objects (0/3)"); Name = "Isaac"; PartnerName = "Eric"; }
// Fügt der Liste eine neue Aufgabe hinzu public void AddQuest(Quest q) { quests.AddQuest(q); }