Earlier I was playing 1.27 and discovered that preach really DOES sometimes cause the game to exit without saving... and that still gives you the no-save penalty for non-Advancing mode. So I hopped on Cheat Engine, found my current stamina by Rubbing my pets and searching, then entered memory view around that location to find my current karma (The bytes will be ?? FF FF FF and the first one will be 256-your negative karma) and set them back to my regular karma. I wasn't planning on cheating at all on this playthrough but I won't accept a -100 karma penalty for a game error like that.
For finding/changing item stats, start by dropping an item on an empty floor tile. Search the quantity of that item. Pick it up, search 0. Drop a different quantity of items on the ground, search that quantity. Repeat until there's only one option left. Right click and browse memory from that value (I'll call it Q for quantity). From then on you can:
--- Improve equipment! Drop the item you want to improve on the ground (make sure the tile is empty, then drop). Q+10 shows the quality (from poor to special, 1-6) of the item, Q+20 shows the level of identification (0 unidentified, 1 partially identified, 2 fully identified) Q+28 on will go in order of #dice, dice sides, damage bonus, hit bonus, DV, PV every four bytes. Q+44 is cursed blessed (-2 doomed, -1 cursed, 0 normal, 1 blessed) Q+100 onward will have the fun stuff, special abilities added by the weapon. You'll have to remember that you need two 4-byte values for each of these. The first one determines what kind of ability, and the second one determines the strength (the second value can be negative).
But what are these values? Between 21 and 62 will be most passive or random abilities, including "increased crit chance" "sucks blood", "prevents teleportation". Setting the wrong strength values on these is most likely to break the game. 10010-10019 increases stats from strength to luck and 60010-60019 maintains those stats. 20050-20061 will give element resists and 70050-70061 will deal elemental damage. 30150-30190 will increase (or decrease) various skills. 80000-80027 will grant various spell procs.
Remember: each separate attribute needs *8 bytes*: 4 for the type of attribute, and 4 for the strength. And there's a maximum number of attributes you can add to an item.
--- Getting allies! If you have a monster ball, Q+5C is the value you want to edit for what kind of monster/NPC is inside. There are roughly 650 monsters, using the same values as those on the map editor. So if you want a dozen Lulwys following you around, knock yourself out!
A warning, however: Some of the NPCs will have bad AI for being pets, and a number of creatures will have skills removed. ... Heck, even if they're not... Would you rather have Ehekatl with Mewmewmew! or without?
It's been a while since I used cheat engine for Elona so I forget any other things I've done when messing around.
Thanks for the cool tips! That drop-item-find-quality trick is quite useful; I've gotten some pretty neat tricks out of it before (like, picking stuff up, even if the game treats it as 'not yours'). Nowadays I tend to use addresses to inventory items. Found them easier to get pointers for.
Cool that you mention the monster ball trick! Getting pets this way is very handy, especially when cycling through many of 'em in a short time.
Another useful address is Q+4C, the item usage modifier. Handy when you need a bunch of non-wishable hearts for pet evolution (58), but all you have are monster balls (33).
'Q' is the quantity of the item you want to modify. Q+whatever means the offset from Q's address in Cheat Engine (CE).
Finding Q is easy, if you have 3-4 items of the same kind in your inventory. Just drop/pick up some, search for the changed quantity values in CE. Once you have this address, make offset copies (copy/paste in CE, fill in the "adjust address by" field).
Concrete example. I have six empty monster balls, search for 6 in CE. Drop four, search for 2. Pick up one, search for 3. Eventually I'll end with only one address on the list (say, 05E207E0). This is my 'Q'. I copy and paste 05E207E0, and enter 5C in the "adjust address by" field. This results in a new address, 05E2082C, which is the item usage modifier. Changing the VALUE of this address allows me to put any monster into the ball (say, 444 = mimic).
16: Has charges. Note that removing this from an item which has charges will just result in charges not being displayed, and the item not being elligable for being recharged, but otherwise changes nothing.