I would like to change the spell books of every mage in BGTutu. IMHO spell memorization in BGI sucks. Doing it manually results mostly in crashes because some offset isn't correct and so on. So this a very itchy subject. I have accomplished this already trough scripting, but that's kinda bulky. One important issue is that I don't want every mage to have memorized the same spell (variation could be scripted of course).
I don't have much experience in tp2 coding, but would this outline do the trick?:
COPY_EXISTING_REGEXP ~.*\.cre~ ~override~ READ_BYTE 0x234 "level" //problem with dual/multiclassed:what is level1/level2? READ_BYTE 0x273 "class" READ_LONG 0x2a0 "knownSpellsOffset" READ_LONG 0x2a8 "memorizationOffset" READ_LONG 0x2b0 "memorizedSpellsOffset" //Some way to delete all known wizard spells, then rebuild them ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~ IF "%level%"=1 WRITE_SHORT ("%memorizationOffset%" + 48) 1 //72 should be 48 in hex SET "#spellsLvl1"=1 //in this case n is 1 IF "%level%"=2 WRITE_SHORT ("%memorizationOffset%" + 48) 1 SET "#spellsLvl1"=1 //in this case n is 1 WRITE_SHORT ("%memorizationOffset%" + 52) 1 SET "#spellsLvl2"=1 //in this case n is 1 IF "%level%"=3 WRITE_SHORT ("%memorizationOffset%" + 48) 2 WRITE_SHORT ("%memorizationOffset%" + 52) 1 //... and so on. i don't have a list at hand. //Some way to delete all memorized wizard spells, then rebuild them IF "%level%"=1 WRITE_ASCII ("%memorizedSpellsOffset%") ~spwi112~ IF_EVAL ("%class%"=1 OR "%class%"=13 OR "%class%"=14) //trueclass,mage/thief, mage/cleric,...
Also need to do specialist mages...