Skip to content

Commit

Permalink
Check for quality too
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Sep 10, 2024
1 parent 8b14f49 commit d6d2801
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions scripts/nondisenchantable.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,26 @@
items = {}
# iterate through ItemSparse for items that can't be disenchanted
for row in itemSparse:
if (getattr(row, 'Flags[0]') & 0x10) != 0: # deprecated item
if (getattr(row, 'Flags[0]') & 0x10) != 0:
# deprecated item
continue

if (getattr(row, 'Flags[0]') & 0x8000) != 0: # "No Disenchant" flag
if row.InventoryType != 0 and row.InventoryType != 4: # equippable and not a shirt
items[row.ID] = {
'itemID': row.ID,
'name': row.Display_lang.strip(),
}
if (getattr(row, 'Flags[0]') & 0x8000) == 0:
# "No Disenchant" flag
continue

if row.OverallQualityID < 2 or row.OverallQualityID > 4:
# can't disenchant items of too low or too high quality anyways
continue

if row.InventoryType == 0 or row.InventoryType == 4:
# not equippable or a shirt
continue

items[row.ID] = {
'itemID': row.ID,
'name': row.Display_lang.strip(),
}

# print data file structure
templateLuaTable('nondisenchantable', '\t[{itemID}] = true, -- {name}', items)

0 comments on commit d6d2801

Please sign in to comment.