-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ jobs: | |
disenchantable: disenchantable | ||
scrappable: scrappable | ||
crushable: crushable | ||
shatterable: shatterable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from utils import * | ||
|
||
itemSparse = CSVReader(open('dbc/itemsparse.csv', 'r')) | ||
itemSalvageLoot = CSVReader(open('dbc/itemsalvageloot.csv', 'r')) | ||
spellEffect = CSVReader(open('dbc/spelleffect.csv', 'r')) | ||
|
||
recipeSpellIDs = { | ||
44: 391302, # Crystalline Shatter (Dragon Isles) | ||
45: 391304, # Elemental Shatter (Dragon Isles) | ||
86: 445466, # Shatter Essence (Khaz Algar) | ||
# TODO: add new shatter recipe for Gleaming Shard | ||
} | ||
|
||
# figure out how many items are needed to perform the salvage | ||
spellItemsRequired = {} | ||
for _, spellID in recipeSpellIDs.items(): | ||
spellItemsRequired[spellID] = 0 | ||
|
||
for row in spellEffect: | ||
if row.SpellID in spellItemsRequired: | ||
spellItemsRequired[row.SpellID] = row.EffectBasePointsF | ||
|
||
# iterate through ItemSalvageLoot for items that can be shattered | ||
items = {} | ||
for row in itemSalvageLoot: | ||
if row.ItemSalvageID in recipeSpellIDs: | ||
items[row.SalvagedItemID] = { | ||
'itemID': row.SalvagedItemID, | ||
'recipeSpellID': recipeSpellIDs[row.ItemSalvageID], | ||
'numItems': spellItemsRequired[recipeSpellIDs[row.ItemSalvageID]], | ||
} | ||
|
||
# shatterable items somehow not in ItemSalvageLoot | ||
items[124441] = { # Leylight Shard | ||
'itemID': 124441, | ||
'recipeSpellID': 224199, # Ley Shatter (Legion) | ||
'numItems': 1, | ||
} | ||
items[124442] = { # Chaos Crystal | ||
'itemID': 124442, | ||
'recipeSpellID': 252106, # Chaos Shatter (Legion) | ||
'numItems': 1, | ||
} | ||
|
||
# iterate through ItemSparse for shatterable items and add their names to the dict | ||
for row in itemSparse: | ||
if row.ID in items: | ||
if (getattr(row, 'Flags[0]') & 0x10) != 0: | ||
# deprecated item | ||
del items[row.ID] | ||
continue | ||
|
||
items[row.ID]['name'] = row.Display_lang | ||
|
||
# print data file structure | ||
templateLuaTable('shatterable', '\t[{itemID}] = {{{recipeSpellID}, {numItems}}}, -- {name}', items) |