From 01762542057919e0a4dbd2f1e2fbe44a091bbb9e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 27 Jun 2016 02:13:45 +0300 Subject: hercules: add some fixes into converter for support tmw-ufb. --- hercules/code/server/tmw/consts.py | 3 ++- hercules/code/server/tmw/itemdb.py | 1 + hercules/code/server/tmw/mobdb.py | 8 +++++++- hercules/code/server/tmw/npcs.py | 25 +++++++++++++++++++++++-- 4 files changed, 33 insertions(+), 4 deletions(-) (limited to 'hercules') diff --git a/hercules/code/server/tmw/consts.py b/hercules/code/server/tmw/consts.py index c1137a1..c3ca848 100644 --- a/hercules/code/server/tmw/consts.py +++ b/hercules/code/server/tmw/consts.py @@ -71,7 +71,8 @@ def convertConsts(quests, npcIds): ("MF_LEAVES", "mf_leaves"), ("MF_TOWN", "mf_town"), ("sc_poison", "SC_POISON"), - ("sc_slowpoison", "SC_SLOWPOISON") + ("sc_slowpoison", "SC_SLOWPOISON"), + ("sc_adrenaline", "SC_ADRENALINE"), ] with open(dstFile, "w") as w: tpl = readFile("templates/constants.tpl") diff --git a/hercules/code/server/tmw/itemdb.py b/hercules/code/server/tmw/itemdb.py index 851f36d..0729fc3 100644 --- a/hercules/code/server/tmw/itemdb.py +++ b/hercules/code/server/tmw/itemdb.py @@ -131,6 +131,7 @@ def replaceStr(line): ("LanternaJack", "LanternaJackItem"), # fix at same time usage with same name function and variable ("\"DailyQuestPoints\"", "\"DailyQuestPointsFunc\""), + ("sc_adrenaline", "SC_ADRENALINE"), ]; for val in vals: diff --git a/hercules/code/server/tmw/mobdb.py b/hercules/code/server/tmw/mobdb.py index ea4b4e7..652a203 100644 --- a/hercules/code/server/tmw/mobdb.py +++ b/hercules/code/server/tmw/mobdb.py @@ -19,6 +19,12 @@ def replaceStr(line): vals = [ ("lanternaJack", "LanternaJack"), ("foice", "Foice"), + ("BlueFairy", "BlueFairyMob"), + ("RedFairy", "RedFairyMob"), + ("GreenFairy", "GreenFairyMob"), + ("Scorpion", "ScorpionMob"), + ("Tritan", "TritanMob"), + ("Ukar", "UkarMob"), ]; for val in vals: @@ -35,7 +41,7 @@ def convertMobDb(items): for srcFile in getMobDbFile(srcDir): with open(srcDir + srcFile, "r") as r: for line in r: - if len(line) < 2 or line[:2] == "//": + if len(line) < 2 or line[:2] == "//" or line[:1] == "#": w.write(line) continue line = replaceStr(line) diff --git a/hercules/code/server/tmw/npcs.py b/hercules/code/server/tmw/npcs.py index 7f0c513..dc73d75 100644 --- a/hercules/code/server/tmw/npcs.py +++ b/hercules/code/server/tmw/npcs.py @@ -29,7 +29,7 @@ shopRe = re.compile("^(?P[^/](.+)),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ "(?P[\d-]+),(?P(.+))$") shopRe2 = re.compile("^(?P[^/](.+))[.]gat,([ ]*)(?P[\d]+),([ ]*)(?P[\d]+),([ ]*)(?P[\d]+)" + - "[\t](?Pshop)[\t](?P[\w#'\\[\\] ]+)[\t]" + "[\t](?Pshop)[\t](?P[^\t]+)[\t]" "(?P[\d]+),(?P(.+))$") mapFlagRe = re.compile("^(?P[^/](.+))" + @@ -437,7 +437,7 @@ def processStrReplace(tracker): ("L_no_ash", "L_No_Ash"), ("L_No_water", "L_No_Water"), ("L_cave", "L_Cave"), - ("L_farewell", "L_Farewell"), + ("L_farewell", "L_Farewell2"), ("@Q_forestbow_", "@Q_Forestbow_"), ("L_game", "L_Game"), ("L_good", "L_Good"), @@ -834,6 +834,27 @@ def processStrReplace(tracker): ("lanternaJack", "LanternaJack"), ("0), set @preco, ", "0) set @preco, "), ("255), set @preco, ", "255) set @preco, "), + ("L_pass", "L_Pass"), + ("Quest_threepwood1", "QUEST_threepwood1"), + ("L_no", "L_No"), + ("L_askHelp", "L_AskHelp"), + ("L_ask", "L_Ask"), + ("L_notEnough", "L_NotEnough"), + ("L_done", "L_Done"), + ("L_toomany", "L_TooMany"), + ("L_not_enough_money", "L_Not_enough_money"), + ("L_island", "L_Island"), + ("if @colorID == 2 ", "if (@colorID == 2) "), + ("L_help", "L_Help"), + ("L_yes", "L_Yes"), + ("if @opacityID == 2 ", "if (@opacityID == 2) "), + ("L_NohMask_Accuse_Respond", "L_NohMask_AResp"), + ("if @opacityID > 4 ", "if (@opacityID > 4) "), + ("if @tmpHairStyle > 0 ", "if (@tmpHairStyle > 0) "), + ("if @colorID > 6 ", "if (@colorID > 6) "), + ("if @opacityID < 0 ", "if (@opacityID < 0) "), + ("if countitem(\"MaggotSlime\") >= 10 goto", "if (countitem(\"MaggotSlime\") >= 10) goto"), + ("if @colorID < 0 set", "if (@colorID < 0) set"), ]; for val in vals: -- cgit v1.2.3-60-g2f50