fetch static data from txt files and properly get all the item stats... maybe?

This commit is contained in:
Héctor Giménez
2024-05-08 21:31:40 +09:00
parent c03c40d385
commit aa2a1aaeb3
34 changed files with 3539 additions and 96663 deletions

View File

@@ -1,107 +1,106 @@
package nip
var typeAliases = map[string]int{
"shield": 2,
"armor": 3,
"gold": 4,
"bowquiver": 5,
"crossbowquiver": 6,
"playerbodypart": 7,
"herb": 8,
"potion": 9,
"ring": 10,
"elixir": 11,
"amulet": 12,
"charm": 13,
"notused1": 14,
"boots": 15,
"gloves": 16,
"notused2": 17,
"book": 18,
"belt": 19,
"gem": 20,
"torch": 21,
"scroll": 22,
"notused3": 23,
"scepter": 24,
"wand": 25,
"staff": 26,
"bow": 27,
"axe": 28,
"club": 29,
"sword": 30,
"hammer": 31,
"knife": 32,
"spear": 33,
"polearm": 34,
"crossbow": 35,
"mace": 36,
"helm": 37,
"missilepotion": 38,
"quest": 39,
"bodypart": 40,
"key": 41,
"throwingknife": 42,
"throwingaxe": 43,
"javelin": 44,
"weapon": 45,
"meleeweapon": 46,
"missileweapon": 47,
"thrownweapon": 48,
"comboweapon": 49,
"anyarmor": 50,
"anyshield": 51,
"miscellaneous": 52,
"socketfiller": 53,
"secondhand": 54,
"stavesandrods": 55,
"missile": 56,
"blunt": 57,
"jewel": 58,
"classspecific": 59,
"amazonitem": 60,
"barbarianitem": 61,
"necromanceritem": 62,
"paladinitem": 63,
"sorceressitem": 64,
"assassinitem": 65,
"druiditem": 66,
"handtohand": 67,
"orb": 68,
"voodooheads": 69,
"auricshields": 70,
"primalhelm": 71,
"pelt": 72,
"cloak": 73,
"rune": 74,
"circlet": 75,
"healingpotion": 76,
"manapotion": 77,
"rejuvpotion": 78,
"staminapotion": 79,
"antidotepotion": 80,
"thawingpotion": 81,
"smallcharm": 82,
"mediumcharm": 83,
"largecharm": 84,
"amazonbow": 85,
"amazonspear": 86,
"amazonjavelin": 87,
"assassinclaw": 88,
"magicbowquiv": 89,
"magicxbowquiv": 90,
"chippedgem": 91,
"flawedgem": 92,
"standardgem": 93,
"flawlessgem": 94,
"perfectgem": 95,
"amethyst": 96,
"diamond": 97,
"emerald": 98,
"ruby": 99,
"sapphire": 100,
"topaz": 101,
"skull": 102,
import "github.com/hectorgimenez/d2go/pkg/data/item"
var typeAliases = map[string]string{
"shield": item.TypeShield,
"armor": item.TypeArmor,
"gold": item.TypeGold,
"bowquiver": item.TypeBowQuiver,
"crossbowquiver": item.TypeCrossbowQuiver,
"playerbodypart": item.TypePlayerBodyPart,
"herb": item.TypeHerb,
"potion": item.TypePotion,
"ring": item.TypeRing,
"elixir": item.TypeElixir,
"amulet": item.TypeAmulet,
"charm": item.TypeCharm,
"boots": item.TypeBoots,
"gloves": item.TypeGloves,
"book": item.TypeBook,
"belt": item.TypeBelt,
"gem": item.TypeGem,
"torch": item.TypeTorch,
"scroll": item.TypeScroll,
"scepter": item.TypeScepter,
"wand": item.TypeWand,
"staff": item.TypeStaff,
"bow": item.TypeBow,
"axe": item.TypeAxe,
"club": item.TypeClub,
"sword": item.TypeSword,
"hammer": item.TypeHammer,
"knife": item.TypeKnife,
"spear": item.TypeSpear,
"polearm": item.TypePolearm,
"crossbow": item.TypeCrossbow,
"mace": item.TypeMace,
"helm": item.TypeHelm,
"missilepotion": item.TypeMissilePotion,
"quest": item.TypeQuest,
"bodypart": item.TypeBodyPart,
"key": item.TypeKey,
"throwingknife": item.TypeThrowingKnife,
"throwingaxe": item.TypeThrowingAxe,
"javelin": item.TypeJavelin,
"weapon": item.TypeWeapon,
"meleeweapon": item.TypeMeleeWeapon,
"missileweapon": item.TypeMissileWeapon,
"thrownweapon": item.TypeThrownWeapon,
"comboweapon": item.TypeComboWeapon,
"anyarmor": item.TypeAnyArmor,
"anyshield": item.TypeAnyShield,
"miscellaneous": item.TypeMiscellaneous,
"socketfiller": item.TypeSocketFiller,
"secondhand": item.TypeSecondHand,
"stavesandrods": item.TypeStavesAndRods,
"missile": item.TypeMissile,
"blunt": item.TypeBlunt,
"jewel": item.TypeJewel,
"classspecific": item.TypeClassSpecific,
"amazonitem": item.TypeAmazonItem,
"barbarianitem": item.TypeBarbarianItem,
"necromanceritem": item.TypeNecromancerItem,
"paladinitem": item.TypePaladinItem,
"sorceressitem": item.TypeSorceressItem,
"assassinitem": item.TypeAssassinItem,
"druiditem": item.TypeDruidItem,
"handtohand": item.TypeHandtoHand,
"orb": item.TypeOrb,
"voodooheads": item.TypeVoodooHeads,
"auricshields": item.TypeAuricShields,
"primalhelm": item.TypePrimalHelm,
"pelt": item.TypePelt,
"cloak": item.TypeCloak,
"rune": item.TypeRune,
"circlet": item.TypeCirclet,
"healingpotion": item.TypeHealingPotion,
"manapotion": item.TypeManaPotion,
"rejuvpotion": item.TypeRejuvPotion,
"staminapotion": item.TypeStaminaPotion,
"antidotepotion": item.TypeAntidotePotion,
"thawingpotion": item.TypeThawingPotion,
"smallcharm": item.TypeSmallCharm,
"mediumcharm": item.TypeMediumCharm,
"largecharm": item.TypeLargeCharm,
"amazonbow": item.TypeAmazonBow,
"amazonspear": item.TypeAmazonSpear,
"amazonjavelin": item.TypeAmazonJavelin,
"assassinclaw": item.TypeHandtoHand2,
"magicbowquiv": item.TypeMagicBowQuiv,
"magicxbowquiv": item.TypeMagicXbowQuiv,
"chippedgem": item.TypeChippedGem,
"flawedgem": item.TypeFlawedGem,
"standardgem": item.TypeStandardGem,
"flawlessgem": item.TypeFlawlessGem,
"perfectgem": item.TypePerfectGem,
"amethyst": item.TypeAmethyst,
"diamond": item.TypeDiamond,
"emerald": item.TypeEmerald,
"ruby": item.TypeRuby,
"sapphire": item.TypeSapphire,
"topaz": item.TypeTopaz,
"skull": item.TypeSkull,
}
var qualityAliases = map[string]int{
@@ -575,7 +574,7 @@ var statAliases = map[string][]int{
"unused184": {184},
"unused185": {185},
"unused186": {186},
"unused187": {187},
"itempiercecoldimmunity": {187},
"itemaddskilltab": {188},
"itemaddbowandcrossbowskilltab": {188, 0}, "bowandcrossbowskilltab": {188, 0},
@@ -600,12 +599,12 @@ var statAliases = map[string][]int{
"itemaddshadowdisciplinesskilltab": {188, 49}, "shadowdisciplinesskilltab": {188, 49},
"itemaddmartialartsskilltab": {188, 50}, "martialartsskilltab": {188, 50},
"unused189": {189},
"unused190": {190},
"unused191": {191},
"unused192": {192},
"unused193": {193},
"itemnumsockets": {194}, "sockets": {194},
"itempiercefireimmunity": {189},
"itempiercelightimmunity": {190},
"itempiercepoisonimmunity": {191},
"itempiercedamageimmunity": {192},
"itempiercemagicimmunity": {193},
"itemnumsockets": {194}, "sockets": {194},
"itemskillonattack": {195, 1},
"itemskillonattacklevel": {195, 2},
"itemskillonkill": {196, 1},
@@ -783,6 +782,8 @@ var statAliases = map[string][]int{
"questitemdifficulty": {356},
"passivemagmastery": {357},
"passivemagpierce": {358},
"skillcooldown": {359},
"skillmissiledamagescale": {360},
// Doesnt really exists, but is calculated in getStatEx
"allres": {555},