diff --git a/pkg/data/data.go b/pkg/data/data.go index 621411e..e9c87f1 100644 --- a/pkg/data/data.go +++ b/pkg/data/data.go @@ -104,7 +104,17 @@ type Level struct { CanInteract bool } -type Class string +type Class uint + +const ( + Amazon Class = iota + Sorceress + Necromancer + Paladin + Barbarian + Druid + Assassin +) type Corpse struct { Found bool @@ -124,6 +134,7 @@ type PlayerUnit struct { Stats map[stat.ID]int Skills map[skill.Skill]int States state.States + Class Class } func (pu PlayerUnit) MaxGold() int { @@ -205,4 +216,6 @@ type OpenMenus struct { Stash bool Waypoint bool MapShown bool + SkillTree bool + Character bool } diff --git a/pkg/memory/game_reader.go b/pkg/memory/game_reader.go index 0ca920a..3cd2cbe 100644 --- a/pkg/memory/game_reader.go +++ b/pkg/memory/game_reader.go @@ -69,6 +69,8 @@ func (gd *GameReader) openMenus() data.OpenMenus { Stash: buffer[0x18] != 0, Waypoint: buffer[0x13] != 0, MapShown: isMapShown != 0, + SkillTree: buffer[0x04] != 0, + Character: buffer[0x02] != 0, } } diff --git a/pkg/memory/player.go b/pkg/memory/player.go index ffa0695..42ebcf4 100644 --- a/pkg/memory/player.go +++ b/pkg/memory/player.go @@ -116,6 +116,9 @@ func (gd *GameReader) GetPlayerUnit(playerUnit uintptr) data.PlayerUnit { // Skills skills := gd.getSkills(playerUnit + 0x100) + // Class + class := data.Class(gd.Process.ReadUInt(playerUnit+0x174, Uint32)) + // Level number pathPtr := uintptr(gd.Process.ReadUInt(playerUnit+0x38, Uint64)) room1Ptr := uintptr(gd.Process.ReadUInt(pathPtr+0x20, Uint64)) @@ -133,6 +136,7 @@ func (gd *GameReader) GetPlayerUnit(playerUnit uintptr) data.PlayerUnit { Stats: stats, Skills: skills, States: states, + Class: class, } }