Welcome, Guest. To unlock the rest of the forums please login or register.Did you miss your activation email?
import jsonimport pandasimport redef CalculateHP(HP): HP = int(HP) if HP < 1000: return str(HP * 3) return str(HP * 1.5)file_content = ""with open('npcstatD.engb.json') as f: for line in f: if line.find('specific_health') != -1: currentHP = "" for c in line: if c.isdigit(): currentHP = currentHP + c newHP = CalculateHP(currentHP) newLine = line.replace(currentHP, newHP) file_content += newLine else: file_content += linewriting_file = open("npcstat.ENGB.json", "w")writing_file.write(file_content)writing_file.close()file_content = ""with open('npcstatD.XMLB.json') as f: for line in f: #print(line) if line.find('specific_health') != -1: currentHP = "" for c in line: if c.isdigit(): currentHP = currentHP + c newHP = CalculateHP(currentHP) newLine = line.replace(currentHP, newHP) file_content += newLine else: file_content += linewriting_file = open("npcstat.XMLB.json", "w")writing_file.write(file_content)writing_file.close()print('Done')
Any chance you could upload this file to somewhere like Google Drive or Mediafire? As I seemingly can't download the file from the site you're using.Welcome aboard to the world of modding by the way!