Posted by: cmorgan
« on: June 03, 2006, 08:49:30 PM »Hey, that actually is good news for me... I'm stuck still trying to track down BG1NPC stuff. Perhaps we coordinate mid July?
COPY_EXISTING AR0224.ARE OVERRIDE
PATCH_IF (SOURCE_SIZE > 0xd4) BEGIN
READ_LONG 0x70 contOff // Offset to containers
READ_LONG 0x78 itmOff // Offset to item list
FOR (READ_SHORT 0x74 numCont; numCont; numCont -= 0x1) BEGIN
READ_ASCII contOff contName (11) // Container name
READ_SHORT contOff + 0x20 contXloc // Container X location
READ_SHORT contOff + 0x22 contYloc // Container Y location
// Check by name and location, in case name is modified by FotD
PATCH_IF (!("%contName%" STRING_COMPARE_CASE "CONTAINER 1") ||
((contXloc == 1924) && (contYloc == 1888))) BEGIN
READ_LONG contOff + 0x40 itmIdx // Index of first item in list
myItmOff = itmOff + (itmIdx * 0x14)
FOR (READ_LONG contOff + 0x44 itmCnt; itmCnt; itmCnt -= 0x1) BEGIN
READ_ASCII myItmOff itmRef // Item resource reference
PATCH_IF !("%itmRef%" STRING_COMPARE_CASE "MISC80") BEGIN
WRITE_ASCII myItmOff MISC79 #8 // Female body
END
myItmOff += 0x14
END
END
contOff += 0xc0
END
END
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING AR0226.ARE OVERRIDE
PATCH_IF (SOURCE_SIZE > 0xd4) BEGIN
READ_LONG 0x70 contOff // Offset to containers
READ_LONG 0x78 itmOff // Offset to item list
FOR (READ_SHORT 0x74 numCont; numCont; numCont -= 0x1) BEGIN
READ_ASCII contOff contName (11) // Container name
READ_SHORT contOff + 0x20 contXloc // Container X location
READ_SHORT contOff + 0x22 contYloc // Container Y location
// Check by name and location, in case name is modified by FotD
PATCH_IF (!("%contName%" STRING_COMPARE_CASE "CONTAINER 1") ||
((contXloc == 827) && (contYloc == 1509))) BEGIN
READ_LONG contOff + 0x40 itmIdx // Index of first item in list
myItmOff = itmOff + (itmIdx * 0x14)
FOR (READ_LONG contOff + 0x44 itmCnt; itmCnt; itmCnt -= 0x1) BEGIN
READ_ASCII myItmOff itmRef // Item resource reference
PATCH_IF !("%itmRef%" STRING_COMPARE_CASE "MISC80") BEGIN
WRITE_ASCII myItmOff UBFEBODY
END
myItmOff += 0x14
END
END ELSE
PATCH_IF (!("%contName%" STRING_COMPARE_CASE "CONTAINER 4") ||
((contXloc == 398) && (contYloc == 1414))) BEGIN
READ_LONG contOff + 0x40 itmIdx // Index of first item in list
READ_LONG contOff + 0x44 itmCnt // Number of items
READ_SHORT 0x76 numItm // Total number of items
myItmOff = itmOff + (itmIdx * 0x14)
PATCH_RANDOM_SEED myItmOff << (numItm / itmCnt)
bodyCount = 0x0
// Make sure there's more than one body before deciding which to replace
FOR (i = itmCnt; i; i -= 0x1) BEGIN
READ_ASCII myItmOff itmRef // Item resource reference
PATCH_IF !("%itmRef%" STRING_COMPARE_CASE "MISC80") BEGIN
bodyCount += 0x1 // Count those bodies!
END
myItmOff += 0x14
END
PATCH_IF (bodyCount) BEGIN
PATCH_IF (bodyCount > 1) BEGIN
theBody = RANDOM(1 bodyCount) // Random body replacement
END ELSE theBody = 0x1
myItmOff = itmOff + (itmIdx * 0x14)
bodyCount = 0x1
FOR (i = itmCnt; i; i -= 0x1) BEGIN
READ_ASCII myItmOff itmRef // Item resource reference
PATCH_IF !("%itmRef%" STRING_COMPARE_CASE "MISC80") BEGIN
PATCH_IF (bodyCount == theBody) BEGIN
WRITE_ASCII myItmOff MISC79 #8 // Female body
END
bodyCount += 0x1
END
myItmOff += 0x14
END
END
END
contOff += 0xc0
END
END
BUT_ONLY_IF_IT_CHANGES
Need to recode this (Scar component)Code: [Select]COPY_EXISTING AR0224.ARE OVERRIDE // Sewers
WRITE_ASCII 0x28c0 ~MISC79~ // Replace Male Body with Female Body in Container 1
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING AR0226.ARE OVERRIDE // Sewers
WRITE_ASCII 0x239c ~UBFEBODY~ // Replace Male Body with the Sashenstar's daughter in Container 1 (with ruby ring)
WRITE_ASCII 0x2450 ~MISC79~ // Replace Male Body with Female Body in Container 4
BUT_ONLY_IF_IT_CHANGESCode: [Select]COPY_EXISTING FW0224.ARE OVERRIDE // Sewers
WRITE_ASCII 0x28c0 ~_MISC79~ // Replace Male Body with Female Body in Container 1
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING FW0226.ARE OVERRIDE // Sewers
WRITE_ASCII 0x239c ~UBFEBODY~ // Replace Male Body with the Sashenstar's daughter in Container 1 (with ruby ring)
WRITE_ASCII 0x2450 ~_MISC79~ // Replace Male Body with Female Body in Container 4
BUT_ONLY_IF_IT_CHANGES
COPY_EXISTING FW0224.ARE OVERRIDE // Sewers
PATCH_IF (SOURCE_SIZE > 0x11c) BEGIN
READ_LONG 0x54 actOff
FOR (READ_SHORT 0x58 numAct; numAct; numAct -= 0x1) BEGIN
READ_ASCII actOff + 0x80 actor
READ_SHORT actOff + 0x20 xPos
PATCH_IF (((xPos == 547) || (xPos == 1293)) &&
!("%actor%" STRING_COMPARE_CASE "_READ3")) BEGIN
WRITE_ASCII actOff + 0x80 _READ4 #8
END
actOff += 0x110
END
END
BUT_ONLY_IF_IT_CHANGES
and alter appropriately, but it's not going to work. Ideas?