adjustment

This commit is contained in:
guiyomu-dev
2026-02-13 12:34:48 +01:00
parent 52f9079ba1
commit 828db2029f
12 changed files with 226 additions and 97 deletions

View File

@@ -20,6 +20,7 @@ type GameReader struct {
monstersLastUpdate time.Time
inventoryLastUpdate time.Time
objectsLastUpdate time.Time
ExpChar uint16
cachedMonsters data.Monsters
cachedInventory data.Inventory

View File

@@ -14,6 +14,7 @@ import (
)
func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverData) data.Inventory {
item.SetExpChar(gd.ExpChar)
mainPlayer := rawPlayerUnits.GetMainPlayer()
baseAddr := gd.Process.moduleBaseAddressPtr + gd.offset.UnitTable + (4 * 1024)
unitTableBuffer := gd.Process.ReadBytesFromMemory(baseAddr, 128*8)
@@ -355,7 +356,7 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
if location == item.LocationSocket {
if itm.Desc().Code == "jew" {
// Base requirement for jewels
itm.LevelReq = item.Desc[itm.ID].RequiredLevel
itm.LevelReq = itm.Desc().RequiredLevel
// For magic/rare jewels, check affixes
if itm.Quality == item.QualityMagic || itm.Quality == item.QualityRare {
@@ -371,7 +372,7 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
}
} else {
// Normal socketed items (runes,gems) just use base requirement
itm.LevelReq = item.Desc[itm.ID].RequiredLevel
itm.LevelReq = itm.Desc().RequiredLevel
}
itemExtraData := uintptr(gd.Process.ReadUInt(unitDataPtr+0xA0, Uint64))
if itemExtraData != 0 {
@@ -442,7 +443,7 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
// Build final inventory
inventory.AllItems = make([]data.Item, len(allItems))
for i, itm := range allItems {
baseDesc := item.Desc[itm.ID]
baseDesc := itm.Desc()
maxReq := calculateItemLevelReq(itm, baseDesc)
// Check magic/rare affixes
@@ -452,7 +453,7 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
// Check socketed items
for _, socketItem := range itm.Sockets {
socketBaseDesc := item.Desc[socketItem.ID]
socketBaseDesc := socketItem.Desc()
socketReq := calculateItemLevelReq(&socketItem, socketBaseDesc)
if socketReq > maxReq {

View File

@@ -12,6 +12,7 @@ func (gd *GameReader) GetKeyBindings() data.KeyBindings {
blobSkills := gd.ReadBytesFromMemory(gd.moduleBaseAddressPtr+gd.offset.KeyBindingsSkillsOffset, 0x500)
skillsKB := [16]data.SkillBinding{}
// Skills 0-6: slots 14-20
for i := 0; i < 7; i++ {
skillsKB[i] = data.SkillBinding{
SkillID: skill.ID(binary.LittleEndian.Uint32(blobSkills[i*0x1c : i*0x1c+4])),
@@ -21,8 +22,20 @@ func (gd *GameReader) GetKeyBindings() data.KeyBindings {
},
}
}
for i := 0; i < 9; i++ {
// Skills 7-13: slots 26-32
for i := 0; i < 7; i++ {
skillIdx := i + 7
skillsKB[skillIdx] = data.SkillBinding{
SkillID: skill.ID(binary.LittleEndian.Uint32(blobSkills[skillIdx*0x1c : skillIdx*0x1c+4])),
KeyBinding: data.KeyBinding{
Key1: [2]byte{blob[0x208+(i*0x14)], blob[0x209+(i*0x14)]},
Key2: [2]byte{blob[0x212+(i*0x14)], blob[0x213+(i*0x14)]},
},
}
}
// Skills 14-15: slots 45-46
for i := 0; i < 2; i++ {
skillIdx := i + 14
skillsKB[skillIdx] = data.SkillBinding{
SkillID: skill.ID(binary.LittleEndian.Uint32(blobSkills[skillIdx*0x1c : skillIdx*0x1c+4])),
KeyBinding: data.KeyBinding{

View File

@@ -26,61 +26,61 @@ type Offset struct {
func calculateOffsets(_ *Process) Offset {
// UnitTable
unitTableOffset := uintptr(0x1D95AF0)
unitTableOffset := uintptr(0x1E9B350)
// UI
uiOffsetPtr := uintptr(0x1DA57DA)
uiOffsetPtr := uintptr(0x1EAB042)
// Hover
hoverOffset := uintptr(0x1CE8400)
hoverOffset := uintptr(0x1DEF000)
// Expansion
expOffset := uintptr(0x1CE78D0)
expOffset := uintptr(0x1DEE468)
// Party members offset
rosterOffset := uintptr(0x1DABD60)
rosterOffset := uintptr(0x1EB1660)
// PanelManagerContainer
panelManagerContainerOffset := uintptr(0x1D00968)
panelManagerContainerOffset := uintptr(0x1E05DC0)
// WidgetStates
WidgetStatesOffset := uintptr(0x1DCDD40)
WidgetStatesOffset := uintptr(0x1ED3678)
// Waypoints
WaypointTableOffset := uintptr(0x1C468B0)
WaypointTableOffset := uintptr(0x1D4D3C0)
// FPS
fpsOffset := uintptr(0x1C46894)
fpsOffset := uintptr(0x1D4D394)
// KeyBindings
keyBindingsOffset := uintptr(0x18C2894)
keyBindingsOffset := uintptr(0x19C65B4)
// KeyBindings Skills
keyBindingsSkillsOffset := uintptr(0x1CE8510)
keyBindingsSkillsOffset := uintptr(0x1DEF110)
// QuestInfo
questInfoOffset := uintptr(0x1DB23D8)
questInfoOffset := uintptr(0x1EB7CD8)
// Terror Zones
tzOffset := uintptr(0x248D430)
tzOffset := uintptr(0x25A5AB0)
// Ping
pingOffset := uintptr(0x1CE78D0)
pingOffset := uintptr(0x1DEE468)
// LegacyGraphics
legacyGfxOffset := uintptr(0x1DB263E)
legacyGfxOffset := uintptr(0x1EB7E7E)
// CharData
charDataOffset := uintptr(0x1CED5E8)
charDataOffset := uintptr(0x1DF25F8)
// Selected Char Name
selectedCharNameOffset := uintptr(0x1C3D694)
selectedCharNameOffset := uintptr(0x1D44195)
// Last Game Name
lastGameNameOffset := uintptr(0x24D5A90)
lastGameNameOffset := uintptr(0x25EE370)
// Last Game Password
lastGamePasswordOffset := uintptr(0x24D5AE8)
lastGamePasswordOffset := uintptr(0x25EE3C8)
return Offset{
UnitTable: unitTableOffset,

View File

@@ -38,8 +38,9 @@ func (gd *GameReader) GetRawPlayerUnits() RawPlayerUnits {
expCharPtr := uintptr(gd.Process.ReadUInt(gd.moduleBaseAddressPtr+gd.offset.Expansion, Uint64))
expChar := gd.Process.ReadUInt(expCharPtr+0x5C, Uint16)
gd.ExpChar = uint16(expChar)
isMainPlayer := gd.Process.ReadUInt(inventoryAddr+0x30, Uint16)
if expChar > 0 {
if expChar >= 2 {
isMainPlayer = gd.Process.ReadUInt(inventoryAddr+0x70, Uint16)
}
isCorpse := gd.Process.ReadUInt(playerUnit+0x1AE, Uint8)