diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/HPMHookGen/HPMHookGen.pl | 4 | ||||
-rw-r--r-- | tools/HPMHookGen/doxygen.conf | 2 | ||||
-rwxr-xr-x | tools/mobdbconverter.py | 32 |
3 files changed, 29 insertions, 9 deletions
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl index 35c83f367..cd4f10e2a 100755 --- a/tools/HPMHookGen/HPMHookGen.pl +++ b/tools/HPMHookGen/HPMHookGen.pl @@ -244,6 +244,10 @@ sub parse($$) { $rtinit = ' = DB_OPT_BASE'; } elsif ($x =~ /^enum\s+thread_priority$/) { # Known enum thread_priority $rtinit = ' = THREADPRIO_NORMAL'; + } elsif ($x =~ /^enum\s+market_buy_result$/) { # Known enum market_buy_result + $rtinit = ' = MARKET_BUY_RESULT_ERROR'; + } elsif ($x =~ /^enum\s+unit_dir$/) { # Known enum unit_dir + $rtinit = ' = UNIT_DIR_UNDEFINED'; } elsif ($x eq 'DBComparator' or $x eq 'DBHasher' or $x eq 'DBReleaser') { # DB function pointers $rtinit = ' = NULL'; } elsif ($x =~ /^(?:struct|union)\s+.*$/) { # Structs and unions diff --git a/tools/HPMHookGen/doxygen.conf b/tools/HPMHookGen/doxygen.conf index c302f7f2f..ead1deeca 100644 --- a/tools/HPMHookGen/doxygen.conf +++ b/tools/HPMHookGen/doxygen.conf @@ -282,12 +282,10 @@ GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = NO EXTERNAL_PAGES = YES -PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO -MSCGEN_PATH = DIA_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO diff --git a/tools/mobdbconverter.py b/tools/mobdbconverter.py index 2073d083c..8a220b08d 100755 --- a/tools/mobdbconverter.py +++ b/tools/mobdbconverter.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: utf8 -*- # # This file is part of Hercules. @@ -141,6 +141,24 @@ def isHaveData(fields, start, cnt): return True return False +def convertToSize(size): + sizes = ["Size_Small", "Size_Medium", "Size_Large"] + if (size >= len(sizes)): + return size + return f'"{sizes[size]}"' + +def convertToRace(race): + races = ["RC_Formless", "RC_Undead", "RC_Brute", "RC_Plant", "RC_Insect", "RC_Fish", "RC_Demon", "RC_DemiHuman", "RC_Angel", "RC_Dragon"] + if (race >= len(races)): + return race + return f'"{races[race]}"' + +def convertToElement(element): + elements = ["Ele_Neutral", "Ele_Water", "Ele_Earth", "Ele_Fire", "Ele_Wind", "Ele_Poison", "Ele_Holy", "Ele_Dark", "Ele_Ghost", "Ele_Undead"] + if (element >= len(elements)): + return element + return f'"{elements[element]}"' + def convertFile(inFile, itemDb): if inFile != "" and not os.path.exists(inFile): return @@ -186,9 +204,9 @@ def convertFile(inFile, itemDb): endGroup() printField("ViewRange", fields[20]) printField("ChaseRange", fields[21]) - printField("Size", fields[22]) - printField("Race", fields[23]) - print("\tElement: ({0}, {1})".format(int(fields[24]) % 10, int(int(fields[24]) / 20))); + printField("Size", convertToSize(int(fields[22]))) + printField("Race", convertToRace(int(fields[23]))) + print("\tElement: ({0}, {1})".format(convertToElement(int(fields[24]) % 10), int(int(fields[24]) / 20))); mode = int(fields[25], 0) if mode != 0: startGroup("Mode") @@ -277,13 +295,13 @@ def readItemDB(inFile, itemDb): return itemDb if len(sys.argv) != 4 and len(sys.argv) != 3: - printHelp(); + printHelp() exit(1) startPath = sys.argv[2] if len(sys.argv) == 4: sourceFile = sys.argv[3] else: - sourceFile = ""; + sourceFile = "" itemDb = dict() if sys.argv[1] == "re": @@ -293,7 +311,7 @@ elif sys.argv[1] == "pre-re": itemDb = readItemDB(startPath + "/db/pre-re/item_db.conf", itemDb) itemDb = readItemDB(startPath + "/db/item_db2.conf", itemDb) else: - printHelp(); + printHelp() exit(1) convertFile(sourceFile, itemDb) |