handle act 1/3/5 mercs (#5)

This commit is contained in:
Héctor Giménez
2023-10-24 22:29:49 +09:00
committed by GitHub
parent cebb05a0df
commit 8ae0eb55c2
3 changed files with 25 additions and 22 deletions

View File

@@ -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
} }

View File

@@ -22,7 +22,6 @@ 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)
@@ -50,6 +49,8 @@ func (gd *GameReader) Monsters(playerPosition data.Position, hover data.HoverDat
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,

View File

@@ -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)