added inventory service for armor and jewelry
This commit is contained in:
parent
09a6cd4946
commit
57a2384511
13 changed files with 2630 additions and 25 deletions
84
inventory-service/add_dictionaries.py
Normal file
84
inventory-service/add_dictionaries.py
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Add dictionaries to the comprehensive enum database."""
|
||||
|
||||
import json
|
||||
|
||||
# AttributeSetInfo dictionary manually extracted (COMPLETE)
|
||||
attribute_set_info = {
|
||||
"2": "Test",
|
||||
"4": "Carraida's Benediction",
|
||||
"5": "Noble Relic Set",
|
||||
"6": "Ancient Relic Set",
|
||||
"7": "Relic Alduressa Set",
|
||||
"8": "Shou-jen Set",
|
||||
"9": "Empyrean Rings Set",
|
||||
"10": "Arm, Mind, Heart Set",
|
||||
"11": "Coat of the Perfect Light Set",
|
||||
"12": "Leggings of Perfect Light Set",
|
||||
"13": "Soldier's Set",
|
||||
"14": "Adept's Set",
|
||||
"15": "Archer's Set",
|
||||
"16": "Defender's Set",
|
||||
"17": "Tinker's Set",
|
||||
"18": "Crafter's Set",
|
||||
"19": "Hearty Set",
|
||||
"20": "Dexterous Set",
|
||||
"21": "Wise Set",
|
||||
"22": "Swift Set",
|
||||
"23": "Hardenend Set",
|
||||
"24": "Reinforced Set",
|
||||
"25": "Interlocking Set",
|
||||
"26": "Flame Proof Set",
|
||||
"27": "Acid Proof Set",
|
||||
"28": "Cold Proof Set",
|
||||
"29": "Lightning Proof Set",
|
||||
"30": "Dedication Set",
|
||||
"31": "Gladiatorial Clothing Set",
|
||||
"32": "Ceremonial Clothing",
|
||||
"33": "Protective Clothing",
|
||||
"34": "Noobie Armor",
|
||||
"35": "Sigil of Defense",
|
||||
"36": "Sigil of Destruction",
|
||||
"37": "Sigil of Fury",
|
||||
"38": "Sigil of Growth",
|
||||
"39": "Sigil of Vigor",
|
||||
"40": "Heroic Protector Set",
|
||||
"41": "Heroic Destroyer Set",
|
||||
"42": "Olthoi Armor D Red",
|
||||
"43": "Olthoi Armor C Rat",
|
||||
"44": "Olthoi Armor C Red",
|
||||
"45": "Olthoi Armor F Red",
|
||||
"46": "Olthoi Armor K Red",
|
||||
"47": "Olthoi Armor M Red",
|
||||
"48": "Olthoi Armor B Red",
|
||||
"49": "Olthoi Armor B Rat",
|
||||
"50": "Olthoi Armor K Rat",
|
||||
"51": "Olthoi Armor M Rat",
|
||||
"52": "Olthoi Armor F Rat",
|
||||
"53": "Olthoi Armor D Rat"
|
||||
}
|
||||
|
||||
# Load existing database
|
||||
with open('comprehensive_enum_database_v2.json', 'r') as f:
|
||||
db = json.load(f)
|
||||
|
||||
# Add dictionaries section
|
||||
if 'dictionaries' not in db:
|
||||
db['dictionaries'] = {}
|
||||
|
||||
db['dictionaries']['AttributeSetInfo'] = {
|
||||
'name': 'AttributeSetInfo',
|
||||
'description': 'Equipment set names',
|
||||
'values': attribute_set_info
|
||||
}
|
||||
|
||||
# Save updated database
|
||||
with open('comprehensive_enum_database_v2.json', 'w') as f:
|
||||
json.dump(db, f, indent=2)
|
||||
|
||||
print("Added AttributeSetInfo dictionary to comprehensive enum database")
|
||||
print(f"Total equipment sets: {len(attribute_set_info)}")
|
||||
print("Example sets:")
|
||||
for set_id in ['13', '14', '16', '21']:
|
||||
if set_id in attribute_set_info:
|
||||
print(f" {set_id} -> {attribute_set_info[set_id]}")
|
||||
|
|
@ -2,14 +2,19 @@
|
|||
"metadata": {
|
||||
"extracted_at": "2025-06-10",
|
||||
"source": "Mag-Plugins/Shared (comprehensive)",
|
||||
"version": "2.0.0"
|
||||
"version": "2.1.0",
|
||||
"last_updated": "2025-06-12",
|
||||
"notes": "COMPLETE extraction: Added missing CoverageMask values (1,2,4,16,etc) and BoolValueKey enum"
|
||||
},
|
||||
"enums": {
|
||||
"CoverageMask": {
|
||||
"name": "CoverageMask",
|
||||
"values": {
|
||||
"0": "None",
|
||||
"1": "Unknown",
|
||||
"2": "UnderwearUpperLegs",
|
||||
"4": "UnderwearLowerLegs",
|
||||
"8": "UnderwearChest",
|
||||
"16": "UnderwearAbdomen",
|
||||
"32": "UnderwearUpperArms",
|
||||
"64": "UnderwearLowerArms",
|
||||
"256": "OuterwearUpperLegs",
|
||||
|
|
@ -590,14 +595,9 @@
|
|||
"128": "HadNoVitae",
|
||||
"129": "NoOlthoiTalk",
|
||||
"130": "AutowieldLeft",
|
||||
"131": "/* custom */",
|
||||
"132": "[ServerOnly]",
|
||||
"9001": "LinkedPortalOneSummon",
|
||||
"134": "[ServerOnly]",
|
||||
"9002": "LinkedPortalTwoSummon",
|
||||
"136": "[ServerOnly]",
|
||||
"9003": "HouseEvicted",
|
||||
"138": "[ServerOnly]",
|
||||
"9004": "UntrainedSkills",
|
||||
"201326592": "Lockable_Decal",
|
||||
"201326593": "Inscribable_Decal"
|
||||
|
|
@ -1996,9 +1996,254 @@
|
|||
"12": "HeritageType"
|
||||
},
|
||||
"source_file": "WieldRequirement.cs"
|
||||
},
|
||||
"AttributeSetInfo": {
|
||||
"name": "AttributeSetInfo",
|
||||
"description": "Equipment set names mapping (Soldier's Set, Adept's Set, Defender's Set, Wise Set, etc.)",
|
||||
"values": {
|
||||
"2": "Test",
|
||||
"4": "Carraida's Benediction",
|
||||
"5": "Noble Relic Set",
|
||||
"6": "Ancient Relic Set",
|
||||
"7": "Relic Alduressa Set",
|
||||
"8": "Shou-jen Set",
|
||||
"9": "Empyrean Rings Set",
|
||||
"10": "Arm, Mind, Heart Set",
|
||||
"11": "Coat of the Perfect Light Set",
|
||||
"12": "Leggings of Perfect Light Set",
|
||||
"13": "Soldier's Set",
|
||||
"14": "Adept's Set",
|
||||
"15": "Archer's Set",
|
||||
"16": "Defender's Set",
|
||||
"17": "Tinker's Set",
|
||||
"18": "Crafter's Set",
|
||||
"19": "Hearty Set",
|
||||
"20": "Dexterous Set",
|
||||
"21": "Wise Set",
|
||||
"22": "Swift Set",
|
||||
"23": "Hardened Set",
|
||||
"24": "Reinforced Set",
|
||||
"25": "Interlocking Set",
|
||||
"26": "Flame Proof Set",
|
||||
"27": "Acid Proof Set",
|
||||
"28": "Cold Proof Set",
|
||||
"29": "Lightning Proof Set",
|
||||
"30": "Dedication Set",
|
||||
"31": "Gladiatorial Clothing Set",
|
||||
"32": "Ceremonial Clothing",
|
||||
"33": "Protective Clothing",
|
||||
"34": "Noobie Armor",
|
||||
"35": "Sigil of Defense",
|
||||
"36": "Sigil of Destruction",
|
||||
"37": "Sigil of Fury",
|
||||
"38": "Sigil of Growth",
|
||||
"39": "Sigil of Vigor",
|
||||
"40": "Heroic Protector Set",
|
||||
"41": "Heroic Destroyer Set",
|
||||
"42": "Olthoi Armor D Red",
|
||||
"43": "Olthoi Armor C Rat",
|
||||
"44": "Olthoi Armor C Red",
|
||||
"45": "Olthoi Armor D Rat",
|
||||
"46": "Upgraded Relic Alduressa Set",
|
||||
"47": "Upgraded Ancient Relic Set",
|
||||
"48": "Upgraded Noble Relic Set",
|
||||
"49": "Weave of Alchemy",
|
||||
"50": "Weave of Arcane Lore",
|
||||
"51": "Weave of Armor Tinkering",
|
||||
"52": "Weave of Assess Person",
|
||||
"53": "Weave of Light Weapons",
|
||||
"54": "Weave of Missile Weapons",
|
||||
"55": "Weave of Cooking",
|
||||
"56": "Weave of Creature Enchantment",
|
||||
"57": "Weave of Missile Weapons",
|
||||
"58": "Weave of Finesse",
|
||||
"59": "Weave of Deception",
|
||||
"60": "Weave of Fletching",
|
||||
"61": "Weave of Healing",
|
||||
"62": "Weave of Item Enchantment",
|
||||
"63": "Weave of Item Tinkering",
|
||||
"64": "Weave of Leadership",
|
||||
"65": "Weave of Life Magic",
|
||||
"66": "Weave of Loyalty",
|
||||
"67": "Weave of Light Weapons",
|
||||
"68": "Weave of Magic Defense",
|
||||
"69": "Weave of Magic Item Tinkering",
|
||||
"70": "Weave of Mana Conversion",
|
||||
"71": "Weave of Melee Defense",
|
||||
"72": "Weave of Missile Defense",
|
||||
"73": "Weave of Salvaging",
|
||||
"74": "Weave of Light Weapons",
|
||||
"75": "Weave of Light Weapons",
|
||||
"76": "Weave of Heavy Weapons",
|
||||
"77": "Weave of Missile Weapons",
|
||||
"78": "Weave of Two Handed Combat",
|
||||
"79": "Weave of Light Weapons",
|
||||
"80": "Weave of Void Magic",
|
||||
"81": "Weave of War Magic",
|
||||
"82": "Weave of Weapon Tinkering",
|
||||
"83": "Weave of Assess Creature",
|
||||
"84": "Weave of Dirty Fighting",
|
||||
"85": "Weave of Dual Wield",
|
||||
"86": "Weave of Recklessness",
|
||||
"87": "Weave of Shield",
|
||||
"88": "Weave of Sneak Attack",
|
||||
"89": "Ninja_New",
|
||||
"90": "Weave of Summoning",
|
||||
"91": "Shrouded Soul",
|
||||
"92": "Darkened Mind",
|
||||
"93": "Clouded Spirit",
|
||||
"131": "Brown Society Locket",
|
||||
"132": "Yellow Society Locket",
|
||||
"133": "Red Society Band",
|
||||
"134": "Green Society Band",
|
||||
"135": "Purple Society Band",
|
||||
"136": "Blue Society Band",
|
||||
"137": "Gauntlet Garb"
|
||||
},
|
||||
"source_file": "Dictionaries.cs"
|
||||
},
|
||||
"SkillInfo": {
|
||||
"name": "SkillInfo",
|
||||
"description": "Skill names mapping",
|
||||
"values": {
|
||||
"1": "Axe",
|
||||
"2": "Bow",
|
||||
"3": "Crossbow",
|
||||
"4": "Dagger",
|
||||
"5": "Mace",
|
||||
"6": "Melee Defense",
|
||||
"7": "Missile Defense",
|
||||
"8": "Sling",
|
||||
"9": "Spear",
|
||||
"10": "Staff",
|
||||
"11": "Sword",
|
||||
"12": "Thrown Weapons",
|
||||
"13": "Unarmed Combat",
|
||||
"14": "Arcane Lore",
|
||||
"15": "Magic Defense",
|
||||
"16": "Mana Conversion",
|
||||
"18": "Item Tinkering",
|
||||
"19": "Assess Person",
|
||||
"20": "Deception",
|
||||
"21": "Healing",
|
||||
"22": "Jump",
|
||||
"23": "Lockpick",
|
||||
"24": "Run",
|
||||
"27": "Assess Creature",
|
||||
"28": "Weapon Tinkering",
|
||||
"29": "Armor Tinkering",
|
||||
"30": "Magic Item Tinkering",
|
||||
"31": "Creature Enchantment",
|
||||
"32": "Item Enchantment",
|
||||
"33": "Life Magic",
|
||||
"34": "War Magic",
|
||||
"35": "Leadership",
|
||||
"36": "Loyalty",
|
||||
"37": "Fletching",
|
||||
"38": "Alchemy",
|
||||
"39": "Cooking",
|
||||
"40": "Salvaging",
|
||||
"41": "Two Handed Combat",
|
||||
"42": "Gearcraft",
|
||||
"43": "Void",
|
||||
"44": "Heavy Weapons",
|
||||
"45": "Light Weapons",
|
||||
"46": "Finesse Weapons",
|
||||
"47": "Missile Weapons",
|
||||
"48": "Shield",
|
||||
"49": "Dual Wield",
|
||||
"50": "Recklessness",
|
||||
"51": "Sneak Attack",
|
||||
"52": "Dirty Fighting",
|
||||
"53": "Challenge",
|
||||
"54": "Summoning"
|
||||
},
|
||||
"source_file": "Dictionaries.cs"
|
||||
},
|
||||
"MasteryInfo": {
|
||||
"name": "MasteryInfo",
|
||||
"description": "Weapon mastery names mapping",
|
||||
"values": {
|
||||
"1": "Unarmed Weapon",
|
||||
"2": "Sword",
|
||||
"3": "Axe",
|
||||
"4": "Mace",
|
||||
"5": "Spear",
|
||||
"6": "Dagger",
|
||||
"7": "Staff",
|
||||
"8": "Bow",
|
||||
"9": "Crossbow",
|
||||
"10": "Thrown",
|
||||
"11": "Two Handed Combat"
|
||||
},
|
||||
"source_file": "Dictionaries.cs"
|
||||
},
|
||||
"MaterialInfo": {
|
||||
"name": "MaterialInfo",
|
||||
"description": "Material names mapping",
|
||||
"values": {},
|
||||
"source_file": "Dictionaries.cs"
|
||||
}
|
||||
},
|
||||
"dictionaries": {
|
||||
"AttributeSetInfo": {
|
||||
"name": "AttributeSetInfo",
|
||||
"description": "Equipment set names",
|
||||
"values": {
|
||||
"2": "Test",
|
||||
"4": "Carraida's Benediction",
|
||||
"5": "Noble Relic Set",
|
||||
"6": "Ancient Relic Set",
|
||||
"7": "Relic Alduressa Set",
|
||||
"8": "Shou-jen Set",
|
||||
"9": "Empyrean Rings Set",
|
||||
"10": "Arm, Mind, Heart Set",
|
||||
"11": "Coat of the Perfect Light Set",
|
||||
"12": "Leggings of Perfect Light Set",
|
||||
"13": "Soldier's Set",
|
||||
"14": "Adept's Set",
|
||||
"15": "Archer's Set",
|
||||
"16": "Defender's Set",
|
||||
"17": "Tinker's Set",
|
||||
"18": "Crafter's Set",
|
||||
"19": "Hearty Set",
|
||||
"20": "Dexterous Set",
|
||||
"21": "Wise Set",
|
||||
"22": "Swift Set",
|
||||
"23": "Hardenend Set",
|
||||
"24": "Reinforced Set",
|
||||
"25": "Interlocking Set",
|
||||
"26": "Flame Proof Set",
|
||||
"27": "Acid Proof Set",
|
||||
"28": "Cold Proof Set",
|
||||
"29": "Lightning Proof Set",
|
||||
"30": "Dedication Set",
|
||||
"31": "Gladiatorial Clothing Set",
|
||||
"32": "Ceremonial Clothing",
|
||||
"33": "Protective Clothing",
|
||||
"34": "Noobie Armor",
|
||||
"35": "Sigil of Defense",
|
||||
"36": "Sigil of Destruction",
|
||||
"37": "Sigil of Fury",
|
||||
"38": "Sigil of Growth",
|
||||
"39": "Sigil of Vigor",
|
||||
"40": "Heroic Protector Set",
|
||||
"41": "Heroic Destroyer Set",
|
||||
"42": "Olthoi Armor D Red",
|
||||
"43": "Olthoi Armor C Rat",
|
||||
"44": "Olthoi Armor C Red",
|
||||
"45": "Olthoi Armor F Red",
|
||||
"46": "Olthoi Armor K Red",
|
||||
"47": "Olthoi Armor M Red",
|
||||
"48": "Olthoi Armor B Red",
|
||||
"49": "Olthoi Armor B Rat",
|
||||
"50": "Olthoi Armor K Rat",
|
||||
"51": "Olthoi Armor M Rat",
|
||||
"52": "Olthoi Armor F Rat",
|
||||
"53": "Olthoi Armor D Rat"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dictionaries": {},
|
||||
"spells": {
|
||||
"name": "Spells",
|
||||
"values": {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,29 @@ class Item(Base):
|
|||
value = Column(Integer, default=0)
|
||||
burden = Column(Integer, default=0)
|
||||
|
||||
# Equipment status
|
||||
current_wielded_location = Column(Integer, default=0, index=True) # 0 = not equipped
|
||||
|
||||
# Item state
|
||||
bonded = Column(Integer, default=0) # 0=Normal, 1=Bonded, 2=Sticky, 4=Destroy on drop
|
||||
attuned = Column(Integer, default=0) # 0=Normal, 1=Attuned
|
||||
unique = Column(Boolean, default=False)
|
||||
|
||||
# Stack/Container properties
|
||||
stack_size = Column(Integer, default=1)
|
||||
max_stack_size = Column(Integer, default=1)
|
||||
items_capacity = Column(Integer) # For containers
|
||||
containers_capacity = Column(Integer) # For containers
|
||||
|
||||
# Durability
|
||||
structure = Column(Integer) # Current durability
|
||||
max_structure = Column(Integer) # Maximum durability
|
||||
|
||||
# Special item flags
|
||||
rare_id = Column(Integer) # For rare items
|
||||
lifespan = Column(Integer) # Item decay timer
|
||||
remaining_lifespan = Column(Integer) # Remaining decay time
|
||||
|
||||
# Metadata flags
|
||||
has_id_data = Column(Boolean, default=False)
|
||||
last_id_time = Column(BigInteger, default=0)
|
||||
|
|
@ -60,6 +83,11 @@ class ItemCombatStats(Base):
|
|||
elemental_damage_vs_monsters = Column(Float)
|
||||
variance = Column(Float)
|
||||
|
||||
# Advanced damage properties
|
||||
cleaving = Column(Integer) # Cleaving damage
|
||||
crit_damage_rating = Column(Integer) # Critical damage multiplier
|
||||
damage_over_time = Column(Integer) # DoT damage
|
||||
|
||||
# Attack properties
|
||||
attack_bonus = Column(Float)
|
||||
weapon_time = Column(Integer)
|
||||
|
|
@ -74,9 +102,24 @@ class ItemCombatStats(Base):
|
|||
|
||||
# Resistances
|
||||
resist_magic = Column(Integer)
|
||||
crit_resist_rating = Column(Integer)
|
||||
crit_damage_resist_rating = Column(Integer)
|
||||
dot_resist_rating = Column(Integer)
|
||||
life_resist_rating = Column(Integer)
|
||||
nether_resist_rating = Column(Integer)
|
||||
|
||||
# Healing/Recovery
|
||||
heal_over_time = Column(Integer)
|
||||
healing_resist_rating = Column(Integer)
|
||||
|
||||
# Mana properties
|
||||
mana_conversion_bonus = Column(Float)
|
||||
|
||||
# PvP properties
|
||||
pk_damage_rating = Column(Integer)
|
||||
pk_damage_resist_rating = Column(Integer)
|
||||
gear_pk_damage_rating = Column(Integer)
|
||||
gear_pk_damage_resist_rating = Column(Integer)
|
||||
|
||||
class ItemRequirements(Base):
|
||||
"""Wield requirements and skill prerequisites."""
|
||||
|
|
@ -105,8 +148,30 @@ class ItemEnhancements(Base):
|
|||
workmanship = Column(Float)
|
||||
salvage_workmanship = Column(Float)
|
||||
|
||||
# Advanced tinkering
|
||||
num_times_tinkered = Column(Integer, default=0)
|
||||
free_tinkers_bitfield = Column(Integer) # Which tinkers are free
|
||||
num_items_in_material = Column(Integer) # Salvage yield
|
||||
|
||||
# Additional imbue effects
|
||||
imbue_attempts = Column(Integer, default=0)
|
||||
imbue_successes = Column(Integer, default=0)
|
||||
imbued_effect2 = Column(Integer)
|
||||
imbued_effect3 = Column(Integer)
|
||||
imbued_effect4 = Column(Integer)
|
||||
imbued_effect5 = Column(Integer)
|
||||
imbue_stacking_bits = Column(Integer) # Which imbues stack
|
||||
|
||||
# Set information
|
||||
item_set = Column(String(100), index=True)
|
||||
equipment_set_extra = Column(Integer) # Additional set bonuses
|
||||
|
||||
# Special properties
|
||||
aetheria_bitfield = Column(Integer) # Aetheria slot properties
|
||||
heritage_specific_armor = Column(Integer) # Heritage armor type
|
||||
|
||||
# Cooldowns
|
||||
shared_cooldown = Column(Integer) # Cooldown group ID
|
||||
|
||||
class ItemRatings(Base):
|
||||
"""Modern rating system properties."""
|
||||
|
|
@ -126,6 +191,22 @@ class ItemRatings(Base):
|
|||
heal_boost_rating = Column(Integer)
|
||||
vitality_rating = Column(Integer)
|
||||
mana_conversion_rating = Column(Integer)
|
||||
weakness_rating = Column(Integer) # Weakness debuff strength
|
||||
nether_over_time = Column(Integer) # Nether DoT
|
||||
|
||||
# Gear totals
|
||||
gear_damage = Column(Integer) # Total gear damage
|
||||
gear_damage_resist = Column(Integer) # Total gear damage resist
|
||||
gear_crit = Column(Integer) # Total gear crit
|
||||
gear_crit_resist = Column(Integer) # Total gear crit resist
|
||||
gear_crit_damage = Column(Integer) # Total gear crit damage
|
||||
gear_crit_damage_resist = Column(Integer) # Total gear crit damage resist
|
||||
gear_healing_boost = Column(Integer) # Total gear healing boost
|
||||
gear_max_health = Column(Integer) # Total gear max health
|
||||
gear_nether_resist = Column(Integer) # Total gear nether resist
|
||||
gear_life_resist = Column(Integer) # Total gear life resist
|
||||
gear_overpower = Column(Integer) # Total gear overpower
|
||||
gear_overpower_resist = Column(Integer) # Total gear overpower resist
|
||||
|
||||
# Calculated totals
|
||||
total_rating = Column(Integer)
|
||||
|
|
@ -164,6 +245,9 @@ def create_indexes(engine):
|
|||
# Item search indexes
|
||||
sa.Index('ix_items_search', Item.character_name, Item.name, Item.object_class).create(engine, checkfirst=True)
|
||||
|
||||
# Equipment status index for filtering equipped items
|
||||
sa.Index('ix_items_equipped', Item.character_name, Item.current_wielded_location).create(engine, checkfirst=True)
|
||||
|
||||
# Combat stats indexes for filtering
|
||||
sa.Index('ix_combat_damage', ItemCombatStats.max_damage).create(engine, checkfirst=True)
|
||||
sa.Index('ix_combat_armor', ItemCombatStats.armor_level).create(engine, checkfirst=True)
|
||||
|
|
|
|||
87
inventory-service/extract_all_missing_enums.py
Normal file
87
inventory-service/extract_all_missing_enums.py
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Comprehensive enum extraction from ALL Mag-Plugins Constants files.
|
||||
This script extracts ALL missing enum values to complete our enum database.
|
||||
"""
|
||||
import json
|
||||
import re
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
def extract_coverage_mask():
|
||||
"""Extract complete CoverageMask enum with ALL values."""
|
||||
file_path = "../unused/Mag-Plugins/Shared/Constants/CoverageMask.cs"
|
||||
|
||||
coverage_values = {}
|
||||
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Extract enum values using regex
|
||||
enum_pattern = r'(\w+)\s*=\s*0x([0-9A-Fa-f]+)'
|
||||
matches = re.findall(enum_pattern, content)
|
||||
|
||||
for name, hex_value in matches:
|
||||
decimal_value = int(hex_value, 16)
|
||||
coverage_values[str(decimal_value)] = name
|
||||
|
||||
return {
|
||||
"name": "CoverageMask",
|
||||
"values": coverage_values,
|
||||
"source_file": "CoverageMask.cs"
|
||||
}
|
||||
|
||||
def extract_bool_value_key():
|
||||
"""Extract BoolValueKey enum (currently missing)."""
|
||||
file_path = "../unused/Mag-Plugins/Shared/Constants/BoolValueKey.cs"
|
||||
|
||||
bool_values = {}
|
||||
|
||||
with open(file_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Extract enum values
|
||||
enum_pattern = r'(\w+)\s*=\s*(\d+)'
|
||||
matches = re.findall(enum_pattern, content)
|
||||
|
||||
for name, value in matches:
|
||||
bool_values[value] = name
|
||||
|
||||
return {
|
||||
"name": "BoolValueKey",
|
||||
"values": bool_values,
|
||||
"source_file": "BoolValueKey.cs"
|
||||
}
|
||||
|
||||
def load_current_database():
|
||||
"""Load current enum database."""
|
||||
with open('comprehensive_enum_database_v2.json', 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
def update_enum_database():
|
||||
"""Update the enum database with ALL missing values."""
|
||||
print("Loading current enum database...")
|
||||
db = load_current_database()
|
||||
|
||||
print("Extracting complete CoverageMask...")
|
||||
complete_coverage = extract_coverage_mask()
|
||||
db['enums']['CoverageMask'] = complete_coverage
|
||||
|
||||
print("Extracting BoolValueKey...")
|
||||
bool_values = extract_bool_value_key()
|
||||
db['enums']['BoolValueKey'] = bool_values
|
||||
|
||||
# Update metadata
|
||||
db['metadata']['last_updated'] = "2025-06-12"
|
||||
db['metadata']['notes'] = "COMPLETE extraction: Added missing CoverageMask values (1,2,4,16,etc) and BoolValueKey enum"
|
||||
|
||||
print("Saving updated database...")
|
||||
with open('comprehensive_enum_database_v2.json', 'w') as f:
|
||||
json.dump(db, f, indent=2)
|
||||
|
||||
print("✅ Enum database updated successfully!")
|
||||
print(f"✅ CoverageMask now has {len(complete_coverage['values'])} values")
|
||||
print(f"✅ BoolValueKey now has {len(bool_values['values'])} values")
|
||||
|
||||
if __name__ == "__main__":
|
||||
update_enum_database()
|
||||
135
inventory-service/extract_dictionaries.py
Normal file
135
inventory-service/extract_dictionaries.py
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
#\!/usr/bin/env python3
|
||||
"""Extract dictionaries from Mag-Plugins Dictionaries.cs file."""
|
||||
|
||||
import re
|
||||
import json
|
||||
|
||||
def extract_attribute_set_info():
|
||||
"""Extract AttributeSetInfo dictionary from Dictionaries.cs."""
|
||||
with open('/home/erik/MosswartOverlord/unused/Mag-Plugins/Shared/Constants/Dictionaries.cs', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find the AttributeSetInfo dictionary
|
||||
pattern = r'AttributeSetInfo\s*=\s*new\s+Dictionary<int,\s*string>\s*\{([^}]+)\}'
|
||||
match = re.search(pattern, content, re.DOTALL)
|
||||
|
||||
if not match:
|
||||
print("AttributeSetInfo not found\!")
|
||||
return {}
|
||||
|
||||
dict_content = match.group(1)
|
||||
|
||||
# Extract entries
|
||||
entry_pattern = r'\{\s*(\d+),\s*"([^"]+)"\s*\}'
|
||||
entries = re.findall(entry_pattern, dict_content)
|
||||
|
||||
attribute_sets = {}
|
||||
for set_id, set_name in entries:
|
||||
attribute_sets[set_id] = set_name
|
||||
|
||||
return attribute_sets
|
||||
|
||||
def extract_material_info():
|
||||
"""Extract MaterialInfo dictionary from Dictionaries.cs."""
|
||||
with open('/home/erik/MosswartOverlord/unused/Mag-Plugins/Shared/Constants/Dictionaries.cs', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find the MaterialInfo dictionary
|
||||
pattern = r'MaterialInfo\s*=\s*new\s+Dictionary<int,\s*string>\s*\{([^}]+)\}'
|
||||
match = re.search(pattern, content, re.DOTALL)
|
||||
|
||||
if not match:
|
||||
print("MaterialInfo not found\!")
|
||||
return {}
|
||||
|
||||
dict_content = match.group(1)
|
||||
|
||||
# Extract entries
|
||||
entry_pattern = r'\{\s*(\d+),\s*"([^"]+)"\s*\}'
|
||||
entries = re.findall(entry_pattern, dict_content)
|
||||
|
||||
materials = {}
|
||||
for mat_id, mat_name in entries:
|
||||
materials[mat_id] = mat_name
|
||||
|
||||
return materials
|
||||
|
||||
def extract_skill_info():
|
||||
"""Extract SkillInfo dictionary from Dictionaries.cs."""
|
||||
with open('/home/erik/MosswartOverlord/unused/Mag-Plugins/Shared/Constants/Dictionaries.cs', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find the SkillInfo dictionary
|
||||
pattern = r'SkillInfo\s*=\s*new\s+Dictionary<int,\s*string>\s*\{([^}]+)\}'
|
||||
match = re.search(pattern, content, re.DOTALL)
|
||||
|
||||
if not match:
|
||||
print("SkillInfo not found\!")
|
||||
return {}
|
||||
|
||||
dict_content = match.group(1)
|
||||
|
||||
# Extract entries - handle hex values
|
||||
entry_pattern = r'\{\s*(0x[0-9A-Fa-f]+ < /dev/null | \d+),\s*"([^"]+)"\s*\}'
|
||||
entries = re.findall(entry_pattern, dict_content)
|
||||
|
||||
skills = {}
|
||||
for skill_id, skill_name in entries:
|
||||
# Convert hex to decimal if needed
|
||||
if skill_id.startswith('0x'):
|
||||
skill_id = str(int(skill_id, 16))
|
||||
skills[skill_id] = skill_name
|
||||
|
||||
return skills
|
||||
|
||||
def extract_mastery_info():
|
||||
"""Extract MasteryInfo dictionary from Dictionaries.cs."""
|
||||
with open('/home/erik/MosswartOverlord/unused/Mag-Plugins/Shared/Constants/Dictionaries.cs', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find the MasteryInfo dictionary
|
||||
pattern = r'MasteryInfo\s*=\s*new\s+Dictionary<int,\s*string>\s*\{([^}]+)\}'
|
||||
match = re.search(pattern, content, re.DOTALL)
|
||||
|
||||
if not match:
|
||||
print("MasteryInfo not found\!")
|
||||
return {}
|
||||
|
||||
dict_content = match.group(1)
|
||||
|
||||
# Extract entries
|
||||
entry_pattern = r'\{\s*(\d+),\s*"([^"]+)"\s*\}'
|
||||
entries = re.findall(entry_pattern, dict_content)
|
||||
|
||||
masteries = {}
|
||||
for mastery_id, mastery_name in entries:
|
||||
masteries[mastery_id] = mastery_name
|
||||
|
||||
return masteries
|
||||
|
||||
def main():
|
||||
"""Extract all dictionaries and save to JSON."""
|
||||
dictionaries = {
|
||||
'AttributeSetInfo': extract_attribute_set_info(),
|
||||
'MaterialInfo': extract_material_info(),
|
||||
'SkillInfo': extract_skill_info(),
|
||||
'MasteryInfo': extract_mastery_info()
|
||||
}
|
||||
|
||||
# Print summary
|
||||
for dict_name, dict_data in dictionaries.items():
|
||||
print(f"{dict_name}: {len(dict_data)} entries")
|
||||
if dict_data and dict_name == 'AttributeSetInfo':
|
||||
# Show some equipment set examples
|
||||
for set_id in ['13', '14', '16', '21']:
|
||||
if set_id in dict_data:
|
||||
print(f" {set_id} -> {dict_data[set_id]}")
|
||||
|
||||
# Save to file
|
||||
with open('extracted_dictionaries.json', 'w') as f:
|
||||
json.dump(dictionaries, f, indent=2)
|
||||
|
||||
print("\nDictionaries saved to extracted_dictionaries.json")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
60
inventory-service/extract_dictionaries_v2.py
Normal file
60
inventory-service/extract_dictionaries_v2.py
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
#\!/usr/bin/env python3
|
||||
"""Extract dictionaries from Mag-Plugins Dictionaries.cs file."""
|
||||
|
||||
import re
|
||||
import json
|
||||
|
||||
def extract_dictionary(dict_name):
|
||||
"""Extract a dictionary from Dictionaries.cs by name."""
|
||||
with open('/home/erik/MosswartOverlord/unused/Mag-Plugins/Shared/Constants/Dictionaries.cs', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find the dictionary - handle multiline definitions
|
||||
pattern = rf'{dict_name}\s*=\s*new\s+Dictionary<int,\s*string>\s*\{{(.*?)^\s*\}};'
|
||||
match = re.search(pattern, content, re.DOTALL < /dev/null | re.MULTILINE)
|
||||
|
||||
if not match:
|
||||
print(f"{dict_name} not found\!")
|
||||
return {}
|
||||
|
||||
dict_content = match.group(1)
|
||||
|
||||
# Extract entries - handle both decimal and hex values
|
||||
entry_pattern = r'\{\s*(0x[0-9A-Fa-f]+|\d+),\s*"([^"]+)"\s*\}'
|
||||
entries = re.findall(entry_pattern, dict_content)
|
||||
|
||||
result = {}
|
||||
for key, value in entries:
|
||||
# Convert hex to decimal if needed
|
||||
if key.startswith('0x'):
|
||||
key = str(int(key, 16))
|
||||
result[key] = value
|
||||
|
||||
return result
|
||||
|
||||
def main():
|
||||
"""Extract all dictionaries and save to JSON."""
|
||||
dictionaries = {
|
||||
'AttributeSetInfo': extract_dictionary('AttributeSetInfo'),
|
||||
'MaterialInfo': extract_dictionary('MaterialInfo'),
|
||||
'SkillInfo': extract_dictionary('SkillInfo'),
|
||||
'MasteryInfo': extract_dictionary('MasteryInfo')
|
||||
}
|
||||
|
||||
# Print summary
|
||||
for dict_name, dict_data in dictionaries.items():
|
||||
print(f"{dict_name}: {len(dict_data)} entries")
|
||||
if dict_data and dict_name == 'AttributeSetInfo':
|
||||
# Show some equipment set examples
|
||||
for set_id in ['13', '14', '16', '21']:
|
||||
if set_id in dict_data:
|
||||
print(f" {set_id} -> {dict_data[set_id]}")
|
||||
|
||||
# Save to file
|
||||
with open('extracted_dictionaries.json', 'w') as f:
|
||||
json.dump(dictionaries, f, indent=2)
|
||||
|
||||
print("\nDictionaries saved to extracted_dictionaries.json")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
6
inventory-service/extracted_dictionaries.json
Normal file
6
inventory-service/extracted_dictionaries.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"AttributeSetInfo": {},
|
||||
"MaterialInfo": {},
|
||||
"SkillInfo": {},
|
||||
"MasteryInfo": {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue