In AR1008, I add an entrance so that the player can exit AR1010 directly to the surface. AR1010 is a modified version of AR5506, and the same exit takes the player behind Candlekeep; I didn't want to just have the area dead-end at the map edge so I add a travel trigger to AR1010 (the fact that there is no visible exit in AR1008 doesn't bother me). The player can either go back up through AR1009, or can exit the south edge of the map to go up to AR1008 (if they have the cloak, then they will get transported after Wait()).
AR1008: add entranceName EXIT1010
Location: X 842
Location: Y 307
Orientation SSE (15)
In AR1009, Dezkiel needs to be deleted, the destination area for the Door1010 trigger needs to be set to AR1010, and a new entrance added so the player can get back from AR1010Name EXIT1010
Location: X 697
Location: Y 259
Orientation South (0)
In AR1010, a new trigger needs to be added to allow the player to exit the south edge of the map and return to AR1008Name DOOR1008
Type of point Travel trigger (2)
Bounding box: Left 345
Bounding box: Top 2719
Bounding box: Right 545
Bounding box: Bottom 2815
# vertices 4
First vertex index 4
Cursor frame number 28
Destination area AR1008.ARE
Entrance name EXIT1010
Flag ( Party required(2) )
// For the life of me, I can't figure out what the hell the following two coords do. I just picked a random spot on the map.
Trap location: X 609
Trap location: Y 2643
// Need corresponding vertices
Vertex 0 X: 478,Y: 2719
Vertex 1 X: 545,Y: 2762
Vertex 2 X: 497,Y: 2815
Vertex 3 X: 345,Y: 2815
The TP2 code shouldn't be used as-is (I do *not* code for compatibility), but you should be able to find a CamDawg equivalent on the wiki. Note that I make all the exits in these 3 areas auto-save (I wonder what happens if some party members stay in AR1009 when you have the cloak?); this isn't in the original game and can probably be omitted.
COPY_EXISTING AR1008.ARE OVERRIDE
// make Ar1009 entrance auto-save
READ_LONG 0x5c trigOff
READ_BYTE trigOff + 0x60 flag
WRITE_BYTE trigOff + 0x60 flag | 0x4
// update num entrances
READ_LONG 0x6c numEntr
WRITE_LONG 0x6c numEntr + 0x1
// add entrance (exit from Ar1010), [842.307] @15
READ_LONG 0x68 entrOff
entrOff += numEntr * 0x68
INSERT_BYTES entrOff 0x68
WRITE_ASCII entrOff EXIT1010 // entr name
WRITE_LONG entrOff + 0x20 0x133034a // entr coords
WRITE_SHORT entrOff + 0x24 0xf // face dir
// update offsets
FOR (loc = 0x70; loc < 0xc4; loc = (loc == 0x78) ? 0x7c : (loc == 0x84) ? 0xa0 : (loc == 0xc0) ? 0xbc : loc + 0x8) BEGIN
READ_LONG loc off
WRITE_LONG loc off + 0x68
END
READ_LONG 0x88 varOff
WRITE_LONG 0x88 varOff + 0x68
COPY_EXISTING AR1009.ARE OVERRIDE
// update entr offset while I'm here
READ_LONG 0x68 entrOff
WRITE_LONG 0x68 entrOff - 0x110
// update num entrance
READ_LONG 0x6c numEntr
WRITE_LONG 0x6c numEntr + 0x1
// add entrance (exit from Ar1010), [697.259] @0
entrOff += numEntr * 0x68
INSERT_BYTES entrOff 0x68
WRITE_ASCII entrOff EXIT1010 // entr name
WRITE_LONG entrOff + 0x20 0x10302b9 // entr loc
// update trigger offset while I'm here
READ_LONG 0x5c trigOff
WRITE_LONG 0x5c trigOff - 0x110
// set Door1010 and Door1008 trans to auto-save
READ_BYTE trigOff + 0x60 flag
WRITE_BYTE trigOff + 0x60 flag | 0x4
READ_BYTE trigOff + 0x124 flag
WRITE_BYTE trigOff + 0x124 flag | 0x4
// change Door1010 (trigger 0) to point to AR1010 (was AR1008)
WRITE_ASCII trigOff + 0x38 AR1010 #8
// bye bye Dezkiel
DELETE_BYTES 0x110c 0x110
// decr num actors
READ_SHORT 0x58 numAct
WRITE_SHORT 0x58 numAct - 0x1
// update offsets
FOR (loc = 0x70; loc < 0xc4; loc = (loc == 0x78) ? 0x7c : (loc == 0x84) ? 0xa0 : (loc == 0xc0) ? 0xbc : loc + 0x8) BEGIN
READ_LONG loc off
WRITE_LONG loc off - 0xa8
END
READ_LONG 0x60 spawnOff
WRITE_LONG 0x60 spawnOff - 0x110
READ_LONG 0x88 varOff
WRITE_LONG 0x88 varOff - 0xa8
COPY_EXISTING AR1010.ARE OVERRIDE
// update num vertex
READ_SHORT 0x80 numVert
WRITE_SHORT 0x80 numVert + 0x4
// add new vertices for new trigger
READ_LONG 0x7c vertOff
vertOff += numVert * 0x4
INSERT_BYTES vertOff 0x10
WRITE_LONG vertOff 0xa9f01de // x.y 0
WRITE_LONG vertOff + 0x4 0xaca0221 // x.y 1
WRITE_LONG vertOff + 0x8 0xaff01f1 // x.y 2
WRITE_LONG vertOff + 0xc 0xaff0159 // x.y 3
// update num triggers
READ_SHORT 0x5a numTrig
WRITE_SHORT 0x5a numTrig + 0x1
// make exit to Ar1009 auto-save
READ_LONG 0x5c trigOff
READ_BYTE trigOff + 0x60 flag
WRITE_BYTE trigOff + 0x60 flag | 0x4
// add new travel trigger for exit to Ar1008
trigOff += numTrig * 0xc4
INSERT_BYTES trigOff 0xc4
WRITE_ASCII trigOff DOOR1008 // trig name
WRITE_ASCII trigOff + 0x38 AR1008 // trig dest
WRITE_ASCII trigOff + 0x40 EXIT1010 // trig dest pt name
WRITE_LONG trigOff + 0x20 0x1590002 // trig type, left coord
WRITE_LONG trigOff + 0x24 0x2210a9f // top coord, right coord
WRITE_LONG trigOff + 0x28 0x40aff // num vert, bottom coord
WRITE_LONG trigOff + 0x2c 0x4 // vertex index
WRITE_LONG trigOff + 0x34 0x1c // cursor
WRITE_LONG trigOff + 0x60 0x4 // flags: auto-save
WRITE_LONG trigOff + 0x70 0xa530261 // what the hell are these coords?
// update offsets
FOR (loc = 0x60; loc < 0xbc; loc = ((loc == 0x78) || (loc == 0x84)) ? loc + 0x4 : (loc == 0x88) ? 0xa8 : (loc == 0xa8) ? 0xb8 : loc + 0x8) BEGIN
READ_LONG loc off
WRITE_LONG loc off + 0xc4
END
READ_LONG 0xa0 regnOff
WRITE_LONG 0xa0 regnOff + 0xd4
READ_LONG 0xb0 animOff
WRITE_LONG 0xb0 animOff + 0xd4
READ_LONG 0xbc musOff
WRITE_LONG 0xbc musOff + 0xd4
READ_LONG 0xc0 restOff
WRITE_LONG 0xc0 restOff + 0xd4