Skip to content

Commit

Permalink
Juggle around some ratings in the exporter, add Speed/Avoidance ratin…
Browse files Browse the repository at this point in the history
…g conversions.
  • Loading branch information
navv1234 committed Sep 19, 2014
1 parent b700c42 commit dd7ccec
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 87 deletions.
27 changes: 20 additions & 7 deletions casc_extract/casc_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,31 @@
parser.error('No file found with md5sum %s' % args[0][4:])
else:
file_md5s = root.GetFileMD5(args[0])
keys = encoding.GetFileKeys(file_md5s[0])
print args[0], len(file_md5s) and file_md5s[0] or 0
sys.exit(0)
#sys.exit(0)

if len(keys) > 1:
parser.error('Found multiple file keys with %s' % args[0])

file_location = index.GetIndexData(keys[0])
if file_location[0] == -1:
parser.error('No file location found for %s' % args[0])

blte = casc.BLTEExtract(opts)
if not opts.online:
file_location = index.GetIndexData(keys[0])
if file_location[0] == -1:
parser.error('No file location found for %s' % args[0])


if not blte.extract_file(keys[0], md5s and md5s.decode('hex') or None, None, *file_location):
sys.exit(1)
else:
file_name = args[0]
data = build.fetch_file(keys[0])
if not data:
print 'No data for a given key %s' % keys[0].encode('hex')
sys.exit(1)

output_path = os.path.join(opts.output, build.build())
blte.extract_buffer_to_file(data, os.path.join(output_path, file_name.replace('\\', '/')))


if not blte.extract_file(keys[0], md5s and md5s.decode('hex') or None, None, *file_location):
sys.exit(1)

20 changes: 10 additions & 10 deletions dbc_extract/dbc/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,16 @@ def generate(self, ids = None):

class CombatRatingsDataGenerator(DataGenerator):
# From UIParent.lua, seems to match to gtCombatRatings too for lvl80 stuff
_combat_ratings = [ 'Dodge', 'Parry', 'Block', 'Melee hit', 'Ranged hit',
'Spell hit', 'Melee crit', 'Ranged crit', 'Spell crit', 'PvP Resilience',
'Melee haste', 'Ranged haste', 'Spell haste', 'Expertise', 'Mastery',
'PvP Power', 'Multistrike', 'Readiness',
'Damage Versatility', 'Healing Versatility', 'Mitigation Versatility', 'Leech' ]
_combat_rating_ids = [ 2, 3, 4, 5, 6,
7, 8, 9, 10, 15,
17, 18, 19, 23, 25,
26, 11, 12,
28, 29, 30, 16 ]
_combat_ratings = [ 'Dodge', 'Parry', 'Block', 'Melee hit', 'Ranged hit',
'Spell hit', 'Melee crit', 'Ranged crit', 'Spell crit', 'Multistrike',
'Readiness', 'PvP Resilience', 'Leech', 'Melee haste', 'Ranged haste',
'Spell haste', 'Expertise', 'Mastery', 'PvP Power', 'Damage Versatility',
'Healing Versatility', 'Mitigation Versatility', 'Speed', 'Avoidance' ]
_combat_rating_ids = [ 2, 3, 4, 5, 6,
7, 8, 9, 10, 11,
12, 15, 16, 17, 18,
19, 23, 25, 26, 28,
29, 30, 13, 20 ]
def __init__(self, options):
# Hardcode these, as we need two different kinds of databases for output, using the same combat rating ids
self._dbc = [ 'gtCombatRatings' ]
Expand Down
Loading

0 comments on commit dd7ccec

Please sign in to comment.