Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool AddQuestProgress(){
- 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.Count;k++){
- if(JSONQuestDetail["missionType"].AsInt==(int) questType[k]){
- if(JSONQuestProgress.Count<j+1){
- JSONQuestProgress[j]["progressValue"] = "0";
- JSONQuestProgress[j]["claimed"] = "0";
- }
- JSONNode JSONQuestProgressDetail = JSONQuestProgress[j];
- if(questType[k]==MISSIONTYPE.ReachPlayerLevel){
- if(JSONQuestProgressDetail["progressValue"].AsInt<value[k])
- JSONQuestProgressDetail["progressValue"] = ""+value[k];
- }else JSONQuestProgressDetail["progressValue"] = ""+(JSONQuestProgressDetail["progressValue"].AsInt + value[k]);
- anyProgress = true;
- }
- }
- }
- }
- questType = new List<DBQuest.MISSIONTYPE>();
- variable1 = new List<int>();
- variable2 = new List<int>();
- value = new List<int>();
- return anyProgress;
- }
Add Comment
Please, Sign In to add comment