SelfVar

Changes the function of event-page-conditions to read two private switches and a variable beyond ID #5000, similar to the four self-switches. This works with up to 1000 events per map only, not above. Changing their values on the other hand is very complicated.

Originally made and first released by bugmenot.

RPG2000
1.00UNKNOWN2000-05-072000-06-192000-07-112000-11-132000-11-152000-12-27
1.07
2001-05-05
1.10
2003-03-27
1.50
2003-06-25
1.51/1.52
2015-07-05
1.60
2015-09-15
1.61
2017-09-14
1.62
RPG2003
1.00UNKNOWN1UNKNOWN21.0.2.1
1.0.2.1
1.0.3.0
1.0.4.0
1.0.5.0
1.0.5.0
1.0.6.0
1.0.6.0
1.0.7.0
1.0.7.0
1.0.8.0
1.0.8.0
1.0.9.1
1.0.9.1
1.101.111.12mp210414

Segment 1/10

Offsets

RPG2000
2000-12-27
1.07
004865D5h
000859D5h
RPG2003
1.0.8.0
1.0.8.0
004ACFB5h
000AC3B5h

Sourcecode

			MOV EDX, [ESP+18h]
			JMP [LIST__004865E0h+EAX*4]
LIST__004865E0h:
			dd CASE__004865F8h
			dd CASE__0048661Eh
			dd CASE__00486624h
			dd CASE__00486629h
			dd CASE__00486637h
			dd CASE__0048663Fh
CASE__004865F8h:
			MOV ESI, [EDX+10h]
			MOV ECX, [EDX+04h]
			CMP ECX, 0
			JE __0048661Ch
			MOV EAX, [0049AD6Ch]
			MOV EAX, [EAX]
			MOV ESI, [EAX+10h]
			MOV EAX, EDI
			INC EDX
			MOV EAX, [0049ABA4h]
			MOV EAX, [EAX]
			CALL PROC__00469EF8h
__0048661Ch:
			JMP __00486647h
CASE__0048661Eh:
			MOV ESI, [EDX+14h]
			NOP
			JMP __00486647h
CASE__00486624h:
			MOV ESI, [EDX+18h]
			JMP __00486647h
CASE__00486629h:
			XCHG EAX, EDX
			MOVZX EAX, BYTE PTR [EAX+1Dh]
			MOV ESI, [LIST__0049A908h+EAX*4]
			JMP __00486647h
CASE__00486637h:
			XCHG EAX, EDX
			CALL PROC__00490080h
			JMP __00486645h
CASE__0048663Fh:
			XCHG EAX, EDX
			CALL PROC__0049015Ch
__00486645h:
			MOV ESI, EAX
__00486647h:
			JMP __00486871h
			MOV EDX, [ESP+18h]
			JMP [LIST__004ACFC0h+EAX*4]
LIST__004ACFC0h:
			dd CASE__004ACFD8h
			dd CASE__004ACFF4h
			dd CASE__004ACFF9h
			dd CASE__004AD001h
			dd CASE__004AD012h
			dd CASE__004AD01Fh
CASE__004ACFD8h:
			MOV ESI, [EDX+10h]
			MOV ECX, [EDX+04h]
			CMP ECX, 0
			JE __004ACFF2h
			MOV EDX, EDI
			INC EDX
			MOV EAX, [004CDC7Ch]
			MOV EAX, [EAX]
			CALL PROC__0048B3B0h
__004ACFF2h:
			JMP __004AD027h
CASE__004ACFF4h:
			MOV ESI, [EDX+14h]
			JMP __004AD027h
CASE__004ACFF9h:
			MOV ESI, [EDX+18h]
			JMP __004AD027h
CASE__004AD001h:
			XCHG EAX, EDX
			MOVZX EAX, BYTE PTR [EAX+1Dh]
			MOV ESI, [LIST__004CD9F4h+EAX*4]
			JMP __004AD027h
CASE__004AD012h:
			XCHG EAX, EDX
			CALL PROC__004C46E8h
			MOV ESI, EAX
			JMP __004AD027h
CASE__004AD01Fh:
			XCHG EAX, EDX
			CALL PROC__004C47C4h
			MOV ESI, EAX
__004AD027h:
			JMP __004AD264h

Bytes

8B542418 FF2485
E0654800 F8654800 1E664800 24664800 29664800 37664800 3F664800

8B7210 8B4A04 83F900 7419
A16CAD4900 8B00 8B7010 8BD7 42 A1A4AB4900 8B00 E8DC38FEFF
EB29
8B7214 90 EB23
8B7218 EB1E
92 0FB6401D 8B348508A94900 EB10
92 E8439A0000
EB06
92 E8179B0000
8BF0 E925020000
8B542418 FF2485C0CF4A00
D8CF4A00 F4CF4A00 F9CF4A00 01D04A00 12D04A00 1FD04A00

8B7210 8B4A04 83F900 740F
8BD7 42 A17CDC4C00 8B00 E8BEE3FDFF
EB33
8B7214 EB2E
8B7218 E926000000
92 0FB6401D 8B3485F4D94C00 E915000000
92 E8D0760100
8BF0 E908000000
92 E89F770100
8BF0 E938020000

Segment 2/10

Offsets

RPG2000
2000-12-27
1.07
0048BB04h
0008AF04h
RPG2003
1.0.8.0
1.0.8.0
004AACBCh
000AA0BCh

Sourcecode

			dd PROC__0048BFCAh
			dd PROC__004AB242h

Bytes

CABF4800
42B24A00

Segment 3/10

Offsets

RPG2000
2000-12-27
1.07
---
---
RPG2003
1.0.8.0
1.0.8.0
004AACCCh
000AA0CCh

Sourcecode

(Segment doesn't exist in this version.)
			dd PROC__004AB22Ch

Bytes

--
2CB24A00

Segment 4/10

Offsets

RPG2000
2000-12-27
1.07
0048BD5Ch
0008B15Ch
RPG2003
1.0.8.0
1.0.8.0
004AAF94h
000AA394h

Sourcecode

			CALL PROC__0048BF43h
			CALL PROC__004AB1A5h

Bytes

E8E2010000
E80C020000

Segment 5/10

Offsets

RPG2000
2000-12-27
1.07
0048BD79h
0008B179h
RPG2003
1.0.8.0
1.0.8.0
004AAFB1h
000AA3B1h

Sourcecode

			CALL PROC__0048BF48h
			CALL PROC__004AB1AAh

Bytes

E8CA010000
E8F4010000

Segment 6/10

Offsets

RPG2000
2000-12-27
1.07
0048BD92h
0008B192h
RPG2003
1.0.8.0
1.0.8.0
004AAFD2h
000AA3D2h

Sourcecode

			CALL PROC__0048BF76h
			CALL PROC__004AB1D8h

Bytes

E8DF010000
E801020000

Segment 7/10

Offsets

RPG2000
2000-12-27
1.07
0048BE0Fh
0008B20Fh
RPG2003
1.0.8.0
1.0.8.0
004AB071h
000AA471h

Sourcecode

			JLE __0048BFC5h
			JLE __004AB227h

Bytes

0F8EB0010000
0F8EB0010000

Segment 8/10

Offsets

RPG2000
2000-12-27
1.07
0048BE1Eh
0008B21Eh
RPG2003
1.0.8.0
1.0.8.0
004AB080h
000AA480h

Sourcecode

			JE __0048BFC5h
			JE __004AB227h

Bytes

0F84A1010000
0F84A1010000

Segment 9/10

Offsets

RPG2000
2000-12-27
1.07
0048BE4Eh
0008B24Eh
RPG2003
1.0.8.0
1.0.8.0
004AB0B0h
000AA4B0h

Sourcecode

			MOV EDI, [ESI+9Ch]
			MOV EDX, [EDI+1Ch]
			MOV EDI, [ESI+9Ch]
			MOV EDX, [EDI+1Ch]

Bytes

8BBE9C000000 8B571C
8BBE9C000000 8B571C

Segment 10/10

Offsets

RPG2000
2000-12-27
1.07
0048BE5Ch
0008B25Ch
RPG2003
1.0.8.0
1.0.8.0
004AB0BEh
000AA4BEh

Sourcecode

			MOV EAX, [EDI+20h]
			MOV [ESI+70h], EAX
			CMP DWORD PTR [ESI+28h], 0
			JNE __0048BE85h
			TEST EBX, EBX
			JZ __0048BE7Ch
			MOV AL, [EBX+24h]
			CMP AL, [EDI+24h]
			JNE __0048BE7Ch
			MOV EAX, [EBX+28h]
			CMP EAX, [EDI+28h]
			JE __0048BE85h
__0048BE7Ch:
			MOV AL, [EDI+24h]
			MOV [ESI+1Ch], AL
			MOV [ESI+1Dh], AL
__0048BE85h:
			MOV DL, [EDI+37h]
			ADD DL, 252
			SUB DL, 2
			JNC __0048BE96h
			MOV EAX, [EDI+28h]
			MOV [ESI+20h], EAX
__0048BE96h:
			XOR EAX, EAX
			CMP BYTE PTR [EDI+2Ch], 0
			JE __0048BEA0h
			MOV AL, 3
__0048BEA0h:
			MOV [ESI+24h], EAX
			MOV EAX, [EDI+30h]
			MOV [ESI+2Ch], EAX
			MOV AL, [EDI+35h]
			MOV [ESI+34h], AL
			MOV AL, [EDI+36h]
			MOV [ESI+35h], AL
			MOV AL, [EDI+37h]
			MOV [ESI+36h], AL
			ADD AL, 254
			SUB AL, 3
			SETC AL
			MOV [ESI+37h], AL
			CMP BYTE PTR [ESI+37h], 0
			JE __0048BED1h
			MOV AL, [EDI+24h]
			MOV [ESI+1Dh], AL
__0048BED1h:
			MOV EAX, [EDI+38h]
			MOV [ESI+38h], EAX
			MOV AL, [EDI+2Dh]
			CMP AL, 1
			JNE __0048BEFEh
			PUSH 4
			POP EAX
			CALL PROC__00402B40h
			ADD EAX, 3
			MOV EDX, [0049AA00h]
			MOV ECX, [ESI+2Ch]
			IMUL [EDX+ECX*4-04h]
			PUSH 5
			POP ECX
			CDQ
			IDIV ECX
			JMP __0048BF23h
__0048BEFEh:
			CMP AL, 6
			JNE __0048BF17h
			MOV EAX, [0049AA00h]
			MOV EDX, [ESI+2Ch]
			MOV EAX, [EAX+EDX*4-04h]
			SAR EAX, 1
			JNS __0048BF15h
			ADC EAX, 0
__0048BF15h:
			JMP __0048BF23h
__0048BF17h:
			MOV EAX, [0049AA00h]
			MOV EDX, [ESI+2Ch]
			MOV EAX, [EAX+EDX*4-04h]
__0048BF23h:
			MOV [ESI+58h], EAX
			TEST EBX, EBX
			JZ __0048BF39h
			MOV EDX, [EBX+3Ch]
			MOV EAX, [EDI+3Ch]
			CALL PROC__0045DFACh
			TEST AL, AL
			JNZ __0048BF41h
__0048BF39h:
			XOR EAX, EAX
			MOV [ESI+A4h], EAX
__0048BF41h:
			JMP __0048BFB4h
PROC__0048BF43h:
			XOR ECX, ECX
			INC ECX
			JMP __0048BF4Ah
PROC__0048BF48h:
			XOR ECX, ECX
__0048BF4Ah:
			CMP EDX, 1
			JNE __0048BF70h
			CALL PROC__0048BFAAh
			SHL EDX, 1
			ADD EDX, 5000
			SUB EDX, ECX
			XCHG EAX, ECX
			CALL PROC__0048BF9Eh
			IMUL EAX, EAX, 2000
			ADD EDX, EAX
			XCHG EAX, ECX
__0048BF70h:
			CALL PROC__00469E6Ch
			RET
PROC__0048BF76h:
			CMP EDX, 1
			JNE __0048BF98h
			CALL PROC__0048BFAAh
			ADD EDX, 5000
			XCHG EAX, ECX
			CALL PROC__0048BF93h
			IMUL EAX, 1000
			ADD EDX, EAX
			XCHG EAX, ECX
__0048BF98h:
			CALL PROC__00469EE0h
			RET
PROC__0048BF9Eh:
			MOV EAX, [0049AD6Ch]
			MOV EAX, [EAX]
			MOV EAX, [EAX+10h]
			DEC EAX
			RET
PROC__0048BFAAh:
			MOV EDX, [ESI+98h]
			MOV EDX, [EDX+04h]
			RET
__0048BFB4h:
			MOV AL, [ESI+4Ah]
			MOV [ESI+4Ch], AL
			MOV EAX, [ESI+ACh]
			MOV EDX, [EAX]
			CALL [EDX+04h]
__0048BFC5h:
			POP EBP
			POP EDI
			POP ESI
			POP EBX
			RET
PROC__0048BFCAh:
			MOV EDX, [EAX+9Ch]
			TEST EDX, EDX
			JZ __0048BFDFh
			CMP BYTE PTR [EDX+37h], 5
			JE __0048BFDFh
			CALL PROC__0048FCBCh
__0048BFDFh:
			RET
			MOV EAX, [EDI+20h]
			MOV [ESI+70h], EAX
			CMP DWORD PTR [ESI+28h], 0
			JNE __004AB0E7h
			TEST EBX, EBX
			JZ __004AB0DEh
			MOV AL, [EBX+24h]
			CMP AL, [EDI+24h]
			JNE __004AB0DEh
			MOV EAX, [EBX+28h]		; ????????
			MOV EAX, [EDI+28h]		; ????????
			JE __004AB0E7h			; ????????
__004AB0DEh:
			MOV AL, [EDI+24h]
			MOV [ESI+1Ch], AL
			MOV [ESI+1Dh], AL
__004AB0E7h:
			MOV DL, [EDI+37h]
			ADD DL, 252
			SUB DL, 2
			JNC __004AB0F8h
			MOV EAX, [EDI+28h]
			MOV [ESI+20h], EAX
__004AB0F8h:
			XOR EAX, EAX
			CMP BYTE PTR [EDI+2Ch], 0
			JE __004AB102h
			MOV AL, 3
__004AB102h:
			MOV [ESI+24h], EAX
			MOV EAX, [EDI+30h]
			MOV [ESI+2Ch], EAX
			MOV AL, [EDI+35h]
			MOV [ESI+34h], AL
			MOV AL, [EDI+36h]
			MOV [ESI+35h], AL
			MOV AL, [EDI+37h]
			MOV [ESI+36h], AL
			ADD AL, 254
			SUB AL, 3
			SETC AL
			MOV [ESI+37h], AL
			CMP BYTE PTR [ESI+37h], 0
			JE __004AB133h
			MOV AL, [EDI+24h]
			MOV [ESI+1Dh], AL
__004AB133h:
			MOV EAX, [EDI+38h]
			MOV [ESI+38h], EAX
			MOV AL, [EDI+20h]
			CMP AL, 1
			JNE __004AB160h
			PUSH 4
			POP EAX
			CALL PROC__00403054h
			ADD EAX, 3
			MOV EDX, [004CDAE8h]
			MOV ECX, [ESI+2Ch]
			IMUL [EDX+ECX*4-04h]
			PUSH 5
			POP ECX
			CDQ
			IDIV ECX
			JMP __004AB185h
__004AB160h:
			CMP AL, 6
			JNE __004AB179h
			MOV EAX, [004CDAE8h]
			MOV EDX, [ESI+2Ch]
			MOV EAX, [EAX+EDX*4-04h]
			SAR EAX, 1
			JNS __004AB177h
			ADC EAX, 0
__004AB177h:
			JMP __004AB185h
__004AB179h:
			MOV EAX, [004CDAE8h]
			MOV EDX, [ESI+2Ch]
			MOV EAX, [EAX+EDX*4-04h]
__004AB185h:
			MOV [ESI+58h], EAX
			TEST EBX, EBX
			JZ __004AB19Bh
			MOV EDX, [EBX+3Ch]
			MOV EAX, [EDI+3Ch]
			CALL PROC__00479070h
			TEST AL, AL
			JNZ __004AB1A3h
__004AB19Bh:
			XOR EAX, EAX
			MOV [ESI+A4h], EAX
__004AB1A3h:
			JMP __004AB216h
PROC__004AB1A5h:
			XOR ECX, ECX
			INC ECX
			JMP __004AB1ACh
PROC__004AB1AAh:
			XOR ECX, ECX
__004AB1ACh:
			CMP EDX, 1
			JNE __004AB1D2h
			CALL PROC__004AB20Ch
			SHL EDX, 1
			ADD EDX, 5000
			SUB EDX, ECX
			XCHG EAX, ECX
			CALL PROC__004AB200h
			IMUL EAX, EAX, 2000
			ADD EDX, EAX
			XCHG EAX, ECX
__004AB1D2h:
			CALL PROC__0048B324h
			RET
PROC__004AB1D8h:
			CMP EDX, 1
			JNE __004AB1FAh
			CALL PROC__004AB20Ch
			ADD EDX, 5000
			XCHG EAX, ECX
			CALL PROC__004AB200h
			IMUL EAX, 1000
			ADD EDX, EAX
			XCHG EAX, ECX
__004AB1FAh:
			CALL PROC__0048B398h
			RET
PROC__004AB200h:
			MOV EAX, [004CDE54h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+10h]
			DEC EAX
			RET
PROC__004AB20Ch:
			MOV EDX, [ESI+98h]
			MOV EDX, [EDX+04h]
			RET
__004AB216h:
			MOV AL, [ESI+4Ah]
			MOV [ESI+4Ch], AL
			MOV EAX, [ESI+ACh]
			MOV EDX, [EAX]
			CALL [EDX+04h]
__004AB227h:
			POP EBP
			POP EDI
			POP ESI
			POP EBX
			RET
__004AB22Ch:
			MOV EDX, [EAX+9Ch]
			TEST EDX, EDX
			JZ __004AB241h
			CMP BYTE PTR [EDX+37h], 5
			JE __004AB241h
			CALL PROC__004C4324h
__004AB241h:
			RET
__004AB242h:
			PUSH EBX
			MOV EBX, EAX
			(...)

Bytes

8B4720 894670 837E2800 751D
85DB 7410
8A4324 3A4724 7508
8B4328 3B4728 7409
8A4724 88461C 88461D 8A5737 80C2FC 80EA02 7306
8B4728 894620 33C0 807F2C00 7402
B003 894624 8B4730 89462C 8A4735 884634 8A4736 884635 8A4737 884636 04FE 2C03 0F92C0 884637 807E3700 7406
8A4724 88461D 8B4738 894638 8A472D 3C01 7520
6A04 58 E85A6CF7FF
83C003 8B1500AA4900 8B4E2C F76C8AFC 6A05 59 99 F7F9 EB25
3C06 7515
A100AA4900 8B562C 8B4490FC D1F8 7903
83D000 EB0C
A100AA4900 8B562C 8B4490FC 894658 85DB 740F
8B533C 8B473C E81720FDFF
84C0 7508
33C0 8986A4000000 EB71
31C9 41 EB02
31C9 81FA01000000 751E
E853000000
D1E2 81C288130000 29CA 91 E837000000
69 C0 D0 07 00 00 01C2 91 E8F7DEFDFF
C3

81FA01000000 751A
E827000000
81C288130000 91 E80F000000
69C0E8030000 01C2 91 E843DFFDFF
C3

A16CAD4900 8B00 8B4010 48 C3

8B9698000000 8B5204 C3

8A464A 88464C 8B86AC000000 8B10 FF5204
5D 5F 5E 5B C3

8B909C000000 85D2 740B
807A3705 7405
E8DD3C0000
C3
8B4720 894670 837E2800 751D
85DB 7410
8A4324 3A4724 7508
8B4328 8B4728 7409
8A4724 88461C 88461D 8A5737 80C2FC 80EA02 7306
8B4728 894620 33C0 807F2C00 7402
B003 894624 8B4730 89462C 8A4735 884634 8A4736 884635 8A4737 884636 04FE 2C03 0F92C0 884637 807E3700 7406
8A4724 88461D 8B4738 894638 8A472D 3C01 7520
6A04 58 E80C7FF5FF
83C003 8B15E8DA4C00 8B4E2C F76C8AFC 6A05 59 99 F7F9 EB25
3C06 7515
A1E8DA4C00 8B562C 8B4490FC D1F8 7903
83D000 EB0C
A1E8DA4C00 8B562C 8B4490FC 894658 85DB 740F
8B533C 8B473C E8D9DEFCFF
84C0 7508
33C0 8986A4000000 EB71
31C9 41 EB02
31C9 81FA01000000 751E
E853000000
D1E2 81C288130000 29CA 91 E837000000
69C0D0070000 01C2 91 E84D01FEFF
C3

81FA01000000 751A
E827000000
81C288130000 91 E80F000000
69C0E8030000 01C2 91 E89901FEFF
C3

A154DE4C00 8B00 8B4010 48 C3

8B9698000000 8B5204 C3

8A464A 88464C 8B86AC000000 8B10 FF5204
5D 5F 5E 5B C3

8B909C000000 85D2 740B
807A3705 7405
E8E3900100
C3

53 8BD8