Some notes on enemy flags and randomization (I know tower/ruins stuff doesn’t get used a ton in most hacks, but it might be useful to somebody):
There is a table at $8D2060 which controls which classes map to which “classID”, you could certainly adapt it for non-monster classes if you wanted to take advantage of the random inventory/rare item drops this template allows you to configure. Circles provided some .nmms for these tables here. Just remember to give any units marked with MonsterTemplate an empty inventory (NoItems is EA’s shorthand for that)
Flag 4 is used, but it is almost exclusively combined with flag 1 (MonsterTemplate) in vanilla. (I didn’t find any data on flag 8 while I was researching the LOAD command internals, so that one probably still is unused.)
Flag 4 allows the unit’s starting position to be randomized slightly (respecting the terrain and class movement restrictions). It works in combination with the following instruction:
This event code is almost never called directly, there is a wrapper/helper at $9EE84C which does this for you and all tower/ruins/skirmish maps just call the wrapper. (EA actually does not know how to disassemble the _2B eventcodes properly and won’t output the parameter value, anyway, so disassembling vanilla doesn’t help here)
Here’s how vanilla does it:
SVAL 0xD 0x0 //clear queue size
SVAL 0x1 0x32 //50% randomization chance
SAVETOQUEUE
SVAL 0x1 0x19 //25% randomization chance
SAVETOQUEUE
SVAL 0x1 0xF //15% randomization chance
SAVETOQUEUE
SVAL 0x1 0x5 //5% randomization chance
SAVETOQUEUE
SVAL 0x1 0x5 //5% randomization chance
SAVETOQUEUE
CALL $9EE84C //randomizes positions of enemies based on these queued parameters + the result of a RANDOMNUMBER call
LOAD1 0 UnitsOffset
Also, LOAD4 is also only used within a helper and never called directly (as it usually depends on the skirmish data in WorldMapStruct), but it defaults to loading the first skirmish enemy group for the chapter if called manually, for whatever that’s worth.