diff --git a/pkg/data/data.go b/pkg/data/data.go index 5bffa0a..fb7da09 100644 --- a/pkg/data/data.go +++ b/pkg/data/data.go @@ -100,25 +100,6 @@ func (r Room) IsInside(p Position) bool { return false } -func (d Data) MercHPPercent() int { - // for _, m := range d.Monsters { - // if m.IsMerc() { - // // Hacky thing to read merc life properly - // maxLife := m.Stats[stat.MaxLife] >> 8 - // life := float64(m.Stats[stat.Life] >> 8) - // if m.Stats[stat.Life] <= 32768 { - // life = float64(m.Stats[stat.Life]) / 32768.0 * float64(maxLife) - // } - - // return int(life / float64(maxLife) * 100) - // } - // } - if d.Mercenary.Found { - return d.Mercenary.HPPercent - } - return 0 -} - type RosterMember struct { Name string Area area.ID diff --git a/pkg/data/npc.go b/pkg/data/npc.go index 63f8191..b939675 100644 --- a/pkg/data/npc.go +++ b/pkg/data/npc.go @@ -19,6 +19,8 @@ type OwnMercenary struct { Mode mode.NpcMode IsCorpse bool HPPercent int + Strength int + Dexterity int } type NPC struct { diff --git a/pkg/memory/mercenary.go b/pkg/memory/mercenary.go index 87b1ffd..c358c80 100644 --- a/pkg/memory/mercenary.go +++ b/pkg/memory/mercenary.go @@ -77,6 +77,8 @@ func (gd *GameReader) OwnMercenary() (OwnMercenary, bool) { Mode: mode.NpcMode(ReadUIntFromBuffer(monsterDataBuffer, 0x0C, Uint32)), IsCorpse: ReadUIntFromBuffer(monsterDataBuffer, 0x1AE, Uint8) != 0, HPPercent: mercenaryHPPercent(stats), + Strength: stats[stat.Strength], + Dexterity: stats[stat.Dexterity], }) monsterUnitPtr = uintptr(gd.Process.ReadUInt(monsterUnitPtr+0x158, Uint64))