igi Posted September 10, 2004 Share Posted September 10, 2004 Lo folks, Another tp2 code request: I want to add an extension header to a series of items I want to add 1 feature block to the new extension header. I want to set the resource of the new feature block to the itm filename. A single extension header already exists on all the items. The existing extension header may or may not contain effects. The items may or may not have a number of equipping effects. If someone could produce some magic tp2 code to do this, I would be very grateful. Link to comment
igi Posted September 11, 2004 Author Share Posted September 11, 2004 I was pointed to code within the G3Tweak pack, and so I've ended up with this: COPY ~Bleh/blah~ ~tmp/~ READ_LONG 0x64 "abilitiesoffset" READ_LONG 0x6a "effectsoffset" READ_SHORT 0x68 "#abilities" READ_SHORT 0x70 "#globaleffects" INSERT_BYTES "%effectsoffset%" 0x38 WRITE_BYTE "%effectsoffset%" 3 WRITE_BYTE ("%effectsoffset%" + 0x01) 0 WRITE_SHORT ("%effectsoffset%" + 0x02) 3 WRITE_ASCII ("%effectsoffset%" + 0x04) ~ISW2H01~ WRITE_SHORT ("%effectsoffset%" + 0x0c) 5 WRITE_SHORT ("%effectsoffset%" + 0x0e) 1 WRITE_SHORT ("%effectsoffset%" + 0x1e) 1 WRITE_SHORT ("%effectsoffset%" + 0x22) 0 WRITE_BYTE ("%effectsoffset%" + 0x24) 0 WRITE_SHORT ("%effectsoffset%" + 0x2a) 1 WRITE_SHORT 0x68 ("%#abilities%" + 1) SET "#abilities" = ("%#abilities%" + 1) WRITE_LONG 0x6a ("%effectsoffset%" + 0x38) SET "effectsoffset" = ("%effectsoffset%" + 0x38) SET "ability#" = 0 SET "total#effects" = "%#globaleffects%" WHILE ("%ability#%" < "%#abilities%") BEGIN READ_SHORT ("%abilitiesoffset%" + "%ability#%" * 0x38 + 0x1e) "#effects" WRITE_SHORT ("%abilitiesoffset%" + "%ability#%" * 0x38 + 0x20) "%total#effects%" SET "total#effects" = ("%total#effects%" + "%#effects%") SET "ability#" = ("%ability#%" + 1) END SET "neweffect" = ("%effectsoffset%" + ("%total#effects%" - "%#effects%") * 0x30) INSERT_BYTES "%neweffect%" 0x30 WRITE_SHORT "%neweffect%" 82 WRITE_BYTE ("%neweffect%" + 0x02) 1 WRITE_LONG ("%neweffect%" + 0x08) 2 WRITE_BYTE ("%neweffect%" + 0x0c) 1 WRITE_BYTE ("%neweffect%" + 0x12) 100 WRITE_EVALUATED_ASCII ("%neweffect%" + 0x14) ~%SOURCE_FILE%~ WRITE_BYTE ("%neweffect%" + 0x1B) 0 WRITE_LONG ("%neweffect%" + 0x1C) 0x00000000 WRITE_SHORT ("%neweffect%" + 0x20) 0x0000 Does 99% of what I want, and I can manage the rest myself, so, thanks Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.