Skip to content

Commit

Permalink
working state
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Dec 1, 2022
1 parent cd4a480 commit f70bbc0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
19 changes: 10 additions & 9 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,31 +1171,32 @@ def fill(self, **kwds: object) -> str:
$characters_row
$achievements
$actions
$glyphs
INSERT INTO `character_homebind` (`guid`, `mapId`, `zoneId`, `posX`, `posY`, `posZ`) VALUES ('$char_guid', '$start_map', '3703', '$pos_x', '$pos_y', '$pos_z');
INSERT INTO `character_inventory` (`guid`, `bag`, `slot`, `item`) VALUES ('$char_guid', '0', '19', '217'); -- Large Bag
INSERT INTO `character_inventory` (`guid`, `bag`, `slot`, `item`) VALUES ('$char_guid', '0', '22', '218'); -- Large Bag
INSERT INTO `character_inventory` (`guid`, `bag`, `slot`, `item`) VALUES ('$char_guid', '0', '21', '219'); -- Large Bag
INSERT INTO `character_inventory` (`guid`, `bag`, `slot`, `item`) VALUES ('$char_guid', '0', '20', '220'); -- Large Bag
$inventory_list$pet_list
$factions
$skills
$spells
$talents
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('184', '$bag_id', '$char_guid', '6948', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('217', '$bag_id', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('218', '$bag_id', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('219', '$bag_id', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('220', '$bag_id', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('217', '$bag_id', '$char_guid', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('218', '$bag_id', '$char_guid', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('219', '$bag_id', '$char_guid', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
INSERT INTO `item_instance` (`guid`, `itemEntry`, `owner_guid`, `creatorGuid`, `giftCreatorGuid`, `count`, `duration`, `charges`, `flags`, `enchantments`, `randomPropertyId`, `durability`, `playedTime`, `text`) VALUES ('220', '$bag_id', '$char_guid', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0', '');
$instance_list
$actions
$factions
"""
)

instanceEnchantTemplate = Template("$main_enchant 0 0 0 0 0 $gem1 0 0 $gem2 0 0 $gem3 0 0 $socket_bonus 0 0 $enchant_1 0 0 $enchant_2 0 0 $enchant_3 0 0 0 0 0 0 0 0 0 0 0 ")

charactersTemplateAcore = Template("INSERT INTO `characters` (`guid`, `account`, `name`, `race`, `class`, `gender`, `level`, `money`, `position_x`, `position_y`, `position_z`, `map`, `cinematic`, `arenaPoints`, `totalHonorPoints`, `health`,) VALUES('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '300000000', '$pos_x', '$pos_y', '$pos_z', '$start_map', '1', '5000', '75000', '100');")

#charactersTemplateAcore = Template("INSERT INTO `characters` (`guid`, `account`, `name`, `race`, `class`, `gender`, `level`, `money`, `position_x`, `position_y`, `position_z`, `map`, `cinematic`, `arenaPoints`, `totalHonorPoints`, `health`)
# VALUES ('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '300000000', '$pos_x', '$pos_y', '$pos_z', '$start_map', '1', '5000', '75000', '100');")
charactersTemplateAcore = Template("INSERT INTO `characters` (`guid`, `account`, `name`, `race`, `class`, `gender`, `level`, `xp`, `money`, `skin`, `face`, `hairStyle`, `hairColor`, `facialStyle`, `bankSlots`, `restState`, `playerFlags`, `position_x`, `position_y`, `position_z`, `map`, `instance_id`, `instance_mode_mask`, `orientation`, `taximask`, `online`, `cinematic`, `totaltime`, `leveltime`, `logout_time`, `is_logout_resting`, `rest_bonus`, `resettalents_cost`, `resettalents_time`, `trans_x`, `trans_y`, `trans_z`, `trans_o`, `transguid`, `extra_flags`, `stable_slots`, `at_login`, `zone`, `death_expire_time`, `taxi_path`, `arenaPoints`, `totalHonorPoints`, `todayHonorPoints`, `yesterdayHonorPoints`, `totalKills`, `todayKills`, `yesterdayKills`, `chosenTitle`, `knownCurrencies`, `watchedFaction`, `drunk`, `health`, `power1`, `power2`, `power3`, `power4`, `power5`, `power6`, `power7`, `latency`, `talentGroupsCount`, `activeTalentGroup`, `exploredZones`, `equipmentCache`, `ammoId`, `knownTitles`, `actionBars`, `grantableLevels`, `order`, `creation_date`, `deleteInfos_Account`, `deleteInfos_Name`, `deleteDate`, `innTriggerId`) VALUES ('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '0', '300000000', '0', '0', '0', '0', '0', '0', '0', '0', '$pos_x', '$pos_y', '$pos_z', '$start_map', '0', '0', '4.54661', '32 0 0 8 0 0 1048576 0 0 0 0 0 0 0 ', '1', '1', '109', '109', '1665606973', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '876', '0', 'NULL', '0', '0', '0', '0', '0', '0', '0', '0', '0', '4294967295', '0', '14206', '15246', '0', '0', '100', '0', '0', '0', '89', '2', '0', '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ', '37684 3820 40680 0 37673 3810 0 0 39497 3832 40696 0 37854 3719 44202 3826 37361 2332 39500 3246 37694 0 43253 0 40682 0 37873 0 41610 3831 37360 3854 0 0 37177 0 0 0 23162 0 23162 0 23162 0 23162 0 ', '0', '0 0 0 0 0 0 ', '0', '0', 'NULL', '2022-10-12 22:34:21', 'NULL', 'NULL', 'NULL', '0');")
#"""
skillsTemplate = Template(
"""INSERT INTO `character_skills` (`guid`, `skill`, `value`, `max`) VALUES ('$char_guid', '$skill_id', '$current_skill', '$max_skill');
"""
Expand Down
12 changes: 6 additions & 6 deletions src/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ def parse_spells(all_items):
for index in range(len(talentArray)):
talent = talentArray[index]
if int(talent["r0"]) == spell:
talents+=talentTemplate.fill(talent_id=talent["id"],current_rank=0)
talents+=talentTemplate.fill(talent_id=spell,current_rank=0)
elif int(talent["r1"]) == spell:
talents+=talentTemplate.fill(talent_id=talent["id"],current_rank=1)
talents+=talentTemplate.fill(talent_id=spell,current_rank=1)
elif int(talent["r2"]) == spell:
talents+=talentTemplate.fill(talent_id=talent["id"],current_rank=2)
talents+=talentTemplate.fill(talent_id=spell,current_rank=2)
elif int(talent["r3"]) == spell:
talents+=talentTemplate.fill(talent_id=talent["id"],current_rank=3)
talents+=talentTemplate.fill(talent_id=spell,current_rank=3)
elif int(talent["r4"]) == spell:
talents+=talentTemplate.fill(talent_id=talent["id"],current_rank=4)
talents+=talentTemplate.fill(talent_id=spell,current_rank=4)

professions_spells = [
int(e) for e in all_items["spells"][3] if int(e) in all_prof_skill_ids
Expand Down Expand Up @@ -378,7 +378,7 @@ def parse_achievements():
day = int(achievement.split(",")[3])
date_time = datetime.datetime(year+2000, month, day, 0, 0)
timestamp = time.mktime(date_time.timetuple())
achievements += achievementTemplate.fill(achievement_id=achId,timestamp=timestamp)
achievements += achievementTemplate.fill(achievement_id=achId,timestamp=int(timestamp))

def write_pdump(char_info):
startPos = startPosMap[exp][factions[clean(f[5].split("=")[1])]]
Expand Down

0 comments on commit f70bbc0

Please sign in to comment.