summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAjarmar <axel.jarmar@gmail.com>2019-10-26 19:48:39 +0200
committerAjarmar <axel.jarmar@gmail.com>2019-10-26 19:48:39 +0200
commita78debef8002afb770bc86264b3959819b925057 (patch)
tree5bb78d4002cb21e625b58e91c963f160cab37b48 /util
parent1893151ea8ebfc96f3c7bf310dee8a9640fc6972 (diff)
shop item randomization option for gen 5
Diffstat (limited to 'util')
-rw-r--r--util/narcparser.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/narcparser.py b/util/narcparser.py
index bec4a9a..a14548d 100644
--- a/util/narcparser.py
+++ b/util/narcparser.py
@@ -276,6 +276,18 @@ def main():
f.seek(-3,os.SEEK_CUR)
f.seek(return_position)
local_offset_in_file = read_word(f)
+ elif args[0] == "lsai": # List all items
+ if len(args) == 3:
+ range_start = int(args[1],16)
+ range_end = int(args[2],16) # 6A1564C
+ else:
+ range_start = 0
+ range_end = file_count
+ with open("itemprices.txt","w") as it:
+ for i in range(range_start, range_end):
+ f.seek(file_table_offset + file_offsets[i])
+ it.write("{" + str(i) + ", " + str(int.from_bytes(f.read(2),byteorder='little')) + "},\n")
+ #print("Item 0x" + '%X' % i + " price: " + str(int.from_bytes(f.read(2),byteorder='little') * 10))
except IndexError:
print("Error: No file specified")
sys.exit(2)