update merc data
This commit is contained in:
@@ -100,25 +100,6 @@ func (r Room) IsInside(p Position) bool {
|
|||||||
return false
|
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 {
|
type RosterMember struct {
|
||||||
Name string
|
Name string
|
||||||
Area area.ID
|
Area area.ID
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ type OwnMercenary struct {
|
|||||||
Mode mode.NpcMode
|
Mode mode.NpcMode
|
||||||
IsCorpse bool
|
IsCorpse bool
|
||||||
HPPercent int
|
HPPercent int
|
||||||
|
Strength int
|
||||||
|
Dexterity int
|
||||||
}
|
}
|
||||||
|
|
||||||
type NPC struct {
|
type NPC struct {
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ func (gd *GameReader) OwnMercenary() (OwnMercenary, bool) {
|
|||||||
Mode: mode.NpcMode(ReadUIntFromBuffer(monsterDataBuffer, 0x0C, Uint32)),
|
Mode: mode.NpcMode(ReadUIntFromBuffer(monsterDataBuffer, 0x0C, Uint32)),
|
||||||
IsCorpse: ReadUIntFromBuffer(monsterDataBuffer, 0x1AE, Uint8) != 0,
|
IsCorpse: ReadUIntFromBuffer(monsterDataBuffer, 0x1AE, Uint8) != 0,
|
||||||
HPPercent: mercenaryHPPercent(stats),
|
HPPercent: mercenaryHPPercent(stats),
|
||||||
|
Strength: stats[stat.Strength],
|
||||||
|
Dexterity: stats[stat.Dexterity],
|
||||||
})
|
})
|
||||||
|
|
||||||
monsterUnitPtr = uintptr(gd.Process.ReadUInt(monsterUnitPtr+0x158, Uint64))
|
monsterUnitPtr = uintptr(gd.Process.ReadUInt(monsterUnitPtr+0x158, Uint64))
|
||||||
|
|||||||
Reference in New Issue
Block a user