handle act 1/3/5 mercs (#5)
This commit is contained in:
@@ -119,7 +119,7 @@ func (m Monster) IsImmune(resist stat.Resist) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m Monster) IsMerc() bool {
|
func (m Monster) IsMerc() bool {
|
||||||
if m.Name == npc.Guard {
|
if m.Name == npc.Guard || m.Name == npc.Act5Hireling1Hand || m.Name == npc.Act5Hireling2Hand || m.Name == npc.IronWolf || m.Name == npc.Rogue2 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,34 +22,35 @@ func (gd *GameReader) Monsters(playerPosition data.Position, hover data.HoverDat
|
|||||||
|
|
||||||
//monsterType := ReadUIntFromBuffer(monsterDataBuffer, 0x00, Uint32)
|
//monsterType := ReadUIntFromBuffer(monsterDataBuffer, 0x00, Uint32)
|
||||||
txtFileNo := ReadUIntFromBuffer(monsterDataBuffer, 0x04, Uint32)
|
txtFileNo := ReadUIntFromBuffer(monsterDataBuffer, 0x04, Uint32)
|
||||||
if !gd.shouldBeIgnored(txtFileNo) {
|
unitID := ReadUIntFromBuffer(monsterDataBuffer, 0x08, Uint32)
|
||||||
unitID := ReadUIntFromBuffer(monsterDataBuffer, 0x08, Uint32)
|
|
||||||
|
|
||||||
//mode := ReadUIntFromBuffer(monsterDataBuffer, 0x0C, Uint32)
|
//mode := ReadUIntFromBuffer(monsterDataBuffer, 0x0C, Uint32)
|
||||||
|
|
||||||
unitDataPtr := uintptr(ReadUIntFromBuffer(monsterDataBuffer, 0x10, Uint64))
|
unitDataPtr := uintptr(ReadUIntFromBuffer(monsterDataBuffer, 0x10, Uint64))
|
||||||
//isUnique := gd.Process.ReadUInt(unitDataPtr+0x18, Uint16)
|
//isUnique := gd.Process.ReadUInt(unitDataPtr+0x18, Uint16)
|
||||||
flag := gd.Process.ReadBytesFromMemory(unitDataPtr+0x1A, Uint8)[0]
|
flag := gd.Process.ReadBytesFromMemory(unitDataPtr+0x1A, Uint8)[0]
|
||||||
isCorpse := gd.Process.ReadUInt(monsterUnitPtr+0x1A6, Uint8)
|
isCorpse := gd.Process.ReadUInt(monsterUnitPtr+0x1A6, Uint8)
|
||||||
|
|
||||||
//unitDataBuffer := gd.Process.ReadBytesFromMemory(unitDataPtr, 144)
|
//unitDataBuffer := gd.Process.ReadBytesFromMemory(unitDataPtr, 144)
|
||||||
|
|
||||||
// Coordinates (X, Y)
|
// Coordinates (X, Y)
|
||||||
pathPtr := uintptr(gd.Process.ReadUInt(monsterUnitPtr+0x38, Uint64))
|
pathPtr := uintptr(gd.Process.ReadUInt(monsterUnitPtr+0x38, Uint64))
|
||||||
posX := gd.Process.ReadUInt(pathPtr+0x02, Uint16)
|
posX := gd.Process.ReadUInt(pathPtr+0x02, Uint16)
|
||||||
posY := gd.Process.ReadUInt(pathPtr+0x06, Uint16)
|
posY := gd.Process.ReadUInt(pathPtr+0x06, Uint16)
|
||||||
|
|
||||||
hovered := false
|
hovered := false
|
||||||
if hover.IsHovered && hover.UnitType == 1 && hover.UnitID == data.UnitID(unitID) {
|
if hover.IsHovered && hover.UnitType == 1 && hover.UnitID == data.UnitID(unitID) {
|
||||||
hovered = true
|
hovered = true
|
||||||
}
|
}
|
||||||
|
|
||||||
statsListExPtr := uintptr(ReadUIntFromBuffer(monsterDataBuffer, 0x88, Uint64))
|
statsListExPtr := uintptr(ReadUIntFromBuffer(monsterDataBuffer, 0x88, Uint64))
|
||||||
statPtr := uintptr(gd.Process.ReadUInt(statsListExPtr+0x30, Uint64))
|
statPtr := uintptr(gd.Process.ReadUInt(statsListExPtr+0x30, Uint64))
|
||||||
statCount := gd.Process.ReadUInt(statsListExPtr+0x38, Uint64)
|
statCount := gd.Process.ReadUInt(statsListExPtr+0x38, Uint64)
|
||||||
|
|
||||||
stats := gd.getMonsterStats(statCount, statPtr)
|
stats := gd.getMonsterStats(statCount, statPtr)
|
||||||
|
|
||||||
|
// This excludes good NPCs but includes Mercs
|
||||||
|
if !gd.shouldBeIgnored(txtFileNo) || stats[stat.Experience] > 0 {
|
||||||
m := data.Monster{
|
m := data.Monster{
|
||||||
UnitID: data.UnitID(unitID),
|
UnitID: data.UnitID(unitID),
|
||||||
Name: npc.ID(int(txtFileNo)),
|
Name: npc.ID(int(txtFileNo)),
|
||||||
@@ -156,7 +157,7 @@ func (gd *GameReader) shouldBeIgnored(txtNo uint) bool {
|
|||||||
npc.PoisonCloudTrap,
|
npc.PoisonCloudTrap,
|
||||||
npc.LightningTrap,
|
npc.LightningTrap,
|
||||||
npc.InvisoSpawner,
|
npc.InvisoSpawner,
|
||||||
//338, //Guard
|
npc.Guard,
|
||||||
npc.MiniSper,
|
npc.MiniSper,
|
||||||
npc.BoneWall,
|
npc.BoneWall,
|
||||||
npc.Hydra,
|
npc.Hydra,
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import "math"
|
|||||||
|
|
||||||
const mapHashDivisor = 1 << 16
|
const mapHashDivisor = 1 << 16
|
||||||
|
|
||||||
|
// Logic stolen from MapAssist, credits to them
|
||||||
|
|
||||||
func GetMapSeed(initHashSeed, endHashSeed uint) (uint, bool) {
|
func GetMapSeed(initHashSeed, endHashSeed uint) (uint, bool) {
|
||||||
var gameSeedXor uint = 0
|
var gameSeedXor uint = 0
|
||||||
seed, found := reverseMapSeedHash(endHashSeed)
|
seed, found := reverseMapSeedHash(endHashSeed)
|
||||||
|
|||||||
Reference in New Issue
Block a user