Fix broken negative stats, update some stat description (#79)

* Fix broken negative stats, update some stat description

* ###

* #2

* curses is necro, frw on armor is velocity percent ( unused)

* Update rules to accept negative value

fix a bug with unique grand charm tz

[name] == grandcharm && [quality] == unique # ([fireresist] + [coldresist] + [lightresist]) >= -75

Single stat rules like [coldresist] >= -75 require the stat to exist

expressions like ([fireresist] + [coldresist] + [lightresist]) >= -75 treat missing stats as 0

Unidentified items with any stat requirements need identification first

* LevelReq + identifiedName added for all Crafted items

* Fix issue with rule.go

* Update stat throw damage and basename: GrandCharm -- Grand Charm

* Adjusting rule for ItemLevelReq  = 0

* update rule again
This commit is contained in:
elb
2025-02-21 11:11:27 -05:00
committed by GitHub
parent 438f80b911
commit 5455fd9772
5 changed files with 147 additions and 45 deletions

View File

@@ -20,6 +20,13 @@ type Process struct {
moduleBaseSize uint32
}
const (
Int8 = 1 // signed 8-bit integer
Int16 = 2 // signed 16-bit integer
Int32 = 4 // signed 32-bit integer
Int64 = 8 // signed 64-bit integer
)
func NewProcess() (Process, error) {
module, err := getGameModule()
if err != nil {
@@ -144,6 +151,22 @@ func bytesToUint(bytes []byte, size IntType) uint {
return 0
}
func ReadIntFromBuffer(bytes []byte, offset uint, size IntType) int {
return bytesToInt(bytes[offset:offset+uint(size)], size)
}
func bytesToInt(bytes []byte, size IntType) int {
switch size {
case Int8:
return int(int8(bytes[0]))
case Int16:
return int(int16(binary.LittleEndian.Uint16(bytes)))
case Int32:
return int(int32(binary.LittleEndian.Uint32(bytes)))
case Int64:
return int(int64(binary.LittleEndian.Uint64(bytes)))
}
return 0
}
func (p Process) ReadStringFromMemory(address uintptr, size uint) string {
if size == 0 {