aminusia

Untitled

Feb 25th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. public static bool AddQuestProgress(){
  2. bool anyProgress = false;
  3. JSONNode tableQuest = DB.LoadTableFromLocal(DBQuest.TABLE_NAME, DBQuest.PASSWORD);
  4. JSONNode tableQuestProgress = DBUser.instance.GetJson()["questProgress"];
  5.  
  6. for(int i=0;i<3;i++){
  7. JSONNode JSONQuest = tableQuest[((QUEST) i+1).ToString()];
  8. JSONNode JSONQuestProgress = tableQuestProgress[i]["progress"];
  9. for(int j=0;j<JSONQuest.Count;j++){
  10. JSONNode JSONQuestDetail = JSONQuest[j];
  11. for(int k=0;k<questType.Count;k++){
  12. if(JSONQuestDetail["missionType"].AsInt==(int) questType[k]){
  13. if(JSONQuestProgress.Count<j+1){
  14. JSONQuestProgress[j]["progressValue"] = "0";
  15. JSONQuestProgress[j]["claimed"] = "0";
  16. }
  17.  
  18. JSONNode JSONQuestProgressDetail = JSONQuestProgress[j];
  19. if(questType[k]==MISSIONTYPE.ReachPlayerLevel){
  20. if(JSONQuestProgressDetail["progressValue"].AsInt<value[k])
  21. JSONQuestProgressDetail["progressValue"] = ""+value[k];
  22. }else JSONQuestProgressDetail["progressValue"] = ""+(JSONQuestProgressDetail["progressValue"].AsInt + value[k]);
  23. anyProgress = true;
  24. }
  25. }
  26. }
  27. }
  28.  
  29. questType = new List<DBQuest.MISSIONTYPE>();
  30. variable1 = new List<int>();
  31. variable2 = new List<int>();
  32. value = new List<int>();
  33. return anyProgress;
  34. }
Add Comment
Please, Sign In to add comment