Skip to content

Commit eab3d2d

Browse files
committed
Quests: Add support for quest completion
1 parent 777528d commit eab3d2d

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

QEGearImporter/questionablyepic_enhanced.lua

+16
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,22 @@ function scanGear()
251251
factionIndex = factionIndex + 1
252252
end
253253

254+
addPrint("")
255+
addPrint("### QUESTS ###")
256+
257+
local maxQuests = 9665
258+
259+
if (expansion == 1) then
260+
maxQuests = 12515
261+
if (expansion == 2) then
262+
maxQuests = 26034
263+
264+
for i = 1, maxQuests do
265+
if (C_QuestLog.IsQuestFlaggedCompleted(i)) then
266+
addPrint(i)
267+
end
268+
end
269+
254270
local expansion = GetExpansionLevel()
255271

256272
if (expansion == 2) then

src/constants.py

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def fill(self, **kwds: object) -> str:
2626
cskills = ""
2727
spells = ""
2828
talents = ""
29+
quests = ""
2930
glyphs = ""
3031
achievements = ""
3132
inventory_list = ""
@@ -3367,6 +3368,7 @@ def fill(self, **kwds: object) -> str:
33673368
$achievements
33683369
$glyphs
33693370
INSERT INTO `character_homebind` VALUES ('$char_guid', '$start_map', '3703', '$pos_x', '$pos_y', '$pos_z');
3371+
$quests
33703372
$inventory_list$pet_list
33713373
$skills
33723374
$spells
@@ -3435,6 +3437,14 @@ def fill(self, **kwds: object) -> str:
34353437
"INSERT INTO `character_reputation` VALUES ('$char_guid', '$faction_id', '$faction_standing', '1');\n"
34363438
)
34373439

3440+
questTemplate = Template(
3441+
"INSERT INTO `character_queststatus` VALUES ('$char_guid', '$quest_id', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');\n"
3442+
)
3443+
3444+
questTemplateWotLK = Template(
3445+
"INSERT INTO `character_queststatus` VALUES ('$char_guid', '$quest_id', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');\n"
3446+
)
3447+
34383448
glyphTemplate = Template(
34393449
"INSERT INTO `character_glyphs` VALUES ('$char_guid', '0', '$glyph_slot', '$glyph_id');\n"
34403450
)

src/parser.py

+12
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ def get_all_items():
252252
macros=["MACROS", 0, 0, []],
253253
spells=["SPELLS", 0, 0, []],
254254
factions=["FACTIONS", 0, 0, []],
255+
quests=["QUESTS", 0, 0, []],
255256
glyphs=["GLYPHS", 0, 0, []],
256257
achievements=["ACHIEVEMENTS", 0, 0, []],
257258
cskills=["SKILLS", 0, len(f), []],
@@ -435,6 +436,15 @@ def parse_macros():
435436
macroBodies += actualBody
436437
write_macros(macroBodies)
437438

439+
def parse_quests():
440+
global quests
441+
for quest in all_items["quests"][3]:
442+
quest_id = int(quest)
443+
if exp > 1:
444+
quests += questTemplateWotLK.fill(quest_id=quest_id)
445+
else:
446+
quests += questTemplate.fill(quest_id=quest_id)
447+
438448
def parse_glyphs():
439449
global glyphs
440450
for glyph in all_items["glyphs"][3]:
@@ -523,6 +533,7 @@ def write_pdump(char_info):
523533
start_map=startPos[3],
524534
skills=cskills,
525535
actions=action_list,
536+
quests=quests,
526537
inventory_list=inventory_list,
527538
pet_list=pet_list,
528539
spells=spells,
@@ -551,6 +562,7 @@ def write_macros(macro_file):
551562
parse_bag(all_items)
552563
parse_spells(all_items)
553564
parse_macros()
565+
parse_quests()
554566
parse_glyphs()
555567
parse_achievements()
556568
parse_skills()

0 commit comments

Comments
 (0)