wpList, LoadingScreen, GetSelectedCharacterName

Credits to gogigogi1
This commit is contained in:
elb
2024-12-06 21:25:46 -05:00
committed by Héctor Giménez
parent bd7e8656b8
commit 1cf22f10cd
2 changed files with 5 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ func (gd *GameReader) openMenus() data.OpenMenus {
return data.OpenMenus{ return data.OpenMenus{
Inventory: buffer[0x01] != 0, Inventory: buffer[0x01] != 0,
LoadingScreen: buffer[0x16C] != 0, LoadingScreen: buffer[0x168] != 0,
NPCInteract: buffer[0x08] != 0, NPCInteract: buffer[0x08] != 0,
NPCShop: buffer[0x0B] != 0, NPCShop: buffer[0x0B] != 0,
Stash: buffer[0x18] != 0, Stash: buffer[0x18] != 0,
@@ -175,6 +175,7 @@ func (gd *GameReader) getStatsList(statListPtr uintptr) stat.Stats {
value = int(math.Max(float64(2/statValue), 1)) value = int(math.Max(float64(2/statValue), 1))
case stat.RegenStaminaPerLevel: case stat.RegenStaminaPerLevel:
value = int(statValue) * 10 value = int(statValue) * 10
case stat.LevelRequirePercent: case stat.LevelRequirePercent:
value = int(statValue) * -1 value = int(statValue) * -1
case stat.AttackRatingPerLevel: case stat.AttackRatingPerLevel:
@@ -200,7 +201,7 @@ func (gd *GameReader) InCharacterSelectionScreen() bool {
} }
func (gd *GameReader) GetSelectedCharacterName() string { func (gd *GameReader) GetSelectedCharacterName() string {
return gd.Process.ReadStringFromMemory(gd.Process.moduleBaseAddressPtr+0x222D0A0, 0) return gd.Process.ReadStringFromMemory(gd.Process.moduleBaseAddressPtr+0x222D0A8, 0)
} }
func (gd *GameReader) LegacyGraphics() bool { func (gd *GameReader) LegacyGraphics() bool {

View File

@@ -2,6 +2,7 @@ package memory
import ( import (
"encoding/binary" "encoding/binary"
"github.com/hectorgimenez/d2go/pkg/data/mode" "github.com/hectorgimenez/d2go/pkg/data/mode"
"github.com/hectorgimenez/d2go/pkg/data" "github.com/hectorgimenez/d2go/pkg/data"
@@ -91,7 +92,7 @@ func (gd *GameReader) GetPlayerUnit(mainPlayerUnit RawPlayerUnit) data.PlayerUni
availableWPs := make([]area.ID, 0) availableWPs := make([]area.ID, 0)
// Probably there is a better place to pick up those values, since this seems to be very tied to the UI // Probably there is a better place to pick up those values, since this seems to be very tied to the UI
wpList := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x2140E20, 0x48) wpList := gd.Process.ReadBytesFromMemory(gd.moduleBaseAddressPtr+0x2186420, 0x48)
for i := 0; i < 0x48; i = i + 8 { for i := 0; i < 0x48; i = i + 8 {
a := binary.LittleEndian.Uint32(wpList[i : i+4]) a := binary.LittleEndian.Uint32(wpList[i : i+4])
available := binary.LittleEndian.Uint32(wpList[i+4 : i+8]) available := binary.LittleEndian.Uint32(wpList[i+4 : i+8])