public static int GetLevel(int GP) { int num = Convert.ToInt32(PetMgr.FindConfig("MaxLevel").Value); if (GP >= PetMgr.FindPetLevel(num).GP) { return(num); } int i = 1; while (i <= num) { if (GP < PetMgr.FindPetLevel(i).GP) { if (i - 1 != 0) { return(i - 1); } return(1); } else { i++; } } return(1); }
public static int GetGP(int level) { int num = Convert.ToInt32(PetMgr.FindConfig("MaxLevel").Value); for (int i = 1; i <= num; i++) { if (level == PetMgr.FindPetLevel(i).Level) { return(PetMgr.FindPetLevel(i).GP); } } return(0); }