Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool AddQuestProgress(DBQuest.MISSIONTYPE[] questType, int[] variable1, int[] variable2, int[] value){
- bool anyProgress = false;
- JSONNode tableQuest = DB.LoadTableFromLocal(DBQuest.TABLE_NAME, DBQuest.PASSWORD);
- JSONNode tableQuestProgress = DBUser.instance.GetJson()["questProgress"];
- for(int i=0;i<3;i++){
- JSONNode JSONQuest = tableQuest[((QUEST) i+1).ToString()];
- JSONNode JSONQuestProgress = tableQuestProgress[i]["progress"];
- for(int j=0;j<JSONQuest.Count;j++){
- JSONNode JSONQuestDetail = JSONQuest[j];
- for(int k=0;k<questType.Length;k++){
- if(JSONQuestDetail["missionType"].AsInt==(int) questType[k]){
- if(questType[k]==MISSIONTYPE.ReachPlayerLevel ||
- questType[k]==MISSIONTYPE.EvolveMonsterXTimes ||
- questType[k]==MISSIONTYPE.UpgradeEquipmentXTimes ||
- questType[k]==MISSIONTYPE.HatchEggXTimes){
- if(variable1[k]!=JSONQuestDetail["missionVariable1"].AsInt) continue;
- }else if(questType[k]==MISSIONTYPE.ClearStage){
- if(variable1[k]!=JSONQuestDetail["missionVariable1"].AsInt ||
- variable2[k]!=JSONQuestDetail["missionVariable2"].AsInt) continue;
- }
- if(JSONQuestProgress.Count<j+1){
- JSONQuestProgress[j]["progressValue"] = "0";
- JSONQuestProgress[j]["claimed"] = "0";
- }
- JSONNode JSONQuestProgressDetail = JSONQuestProgress[j];
- JSONQuestProgressDetail["progressValue"] = ""+(JSONQuestProgressDetail["progressValue"].AsInt + value[k]);
- anyProgress = true;
- }
- }
- }
- }
- return anyProgress;
- }
Add Comment
Please, Sign In to add comment