ShoppingShortcut

Replaces the event-command to call shop-screen with setting some switches and variables instead. Also, including cases for player having bought/sold something will stop to work for obvious reasons.

Originally made and first released by KotatsuAkira.

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

Segment 1/1

Offsets

RPG2000
2017-09-14
1.62
0048E488h
0008D888h

Sourcecode

PROC__EvCmdCallShop:
				PUSH EBX
				PUSH ESI
				PUSH EDI
				MOV ESI, ECX
				MOV EBX, EAX
				XOR EDX, EDX			; Parameter #0 (ShopType: 0=Choice, 1=Buy, 2=Sell)
				MOV EAX, ESI
				CALL PROC__00463E08h		; TLcfEventScriptLine.GetParameter
				XCHG EAX, ECX
				MOV EAX, [004A0B8Ch]		; TLcfgSystem
				MOV EAX, [EAX]
				PUSH EAX
				PUSH ECX
				MOV EDX, 1015			; Switch to be ON if Normal or BuyOnly
				CMP ECX, 2
				SETNE CL
				CALL PROC__0046F770h		; TLcfgSystem.SetSwitch
				POP ECX
				POP EAX				; TLcfgSystem
				PUSH EAX
				MOV EDX, 1016			; Switch to be ON if Normal or SellOnly
				CMP ECX, 1
				SETNE CL
				CALL PROC__0046F770h		; TLcfgSystem.SetSwitch
				PUSH 1
				POP EDX				; Parameter #1 (TextType: 0=A, 1=B, 2=C)
				MOV EAX, ESI
				CALL PROC__00463E08h		; TLcfEventScriptLine.GetParameter
				XCHG EAX, ECX
				POP EAX				; TLcfgSystem
				PUSH EAX
				MOV EDX, 3409			; Variable to receive TextType
				CALL PROC__0046F7E4h		; TLcfgSystem.SetVariable
				MOV EBX, [ESI+10h]
				SUB EBX, 4
				POP EAX				; TLcfgSystem
				MOV EDX, 3410			; Variable to receive ItemListSize
				MOV ECX, EBX
				CALL PROC__0046F7E4h		; TLcfgSystem.SetVariable
				DEC EBX
				TEST EBX, EBX
				JL __SkipItems
				INC EBX
				XOR EDI, EDI
__LoopItems:
				LEA EDX, [EDI+04h]		; Parameter at ItemIndex + 4
				MOV EAX, ESI
				CALL PROC__00463E08h		; TLcfEventScriptLine.GetParameter
				XCHG EAX, ECX
				MOV EAX, [004A0B8Ch]		; TLcfgSystem
				MOV EAX, [EAX]
				LEA EDX, [EDI+5001]		; #5001 and above will receive ItemIDs
				CALL PROC__0046F7E4h		; TLcfgSystem.SetVariable
				INC EDI
				DEC EBX
				JNZ __LoopItems
__SkipItems:
				POP EDI
				POP ESI
				POP EBX
				RET
				28 NOPs

Bytes

53 56 57 89CE 89C3 31D2 89F0 E87059FDFF
91 A18C0B4A00 8B00 50 51 BAF7030000 83F902 0F95C1 E8BE12FEFF
59 58 50 BAF8030000 83F901 0F95C1 E8AB12FEFF
6A01 5A 89F0 E83959FDFF
91 58 50 BA510D0000 E80813FEFF
8B5E10 83EB04 58 BA520D0000 89D9 E8F512FEFF
4B 85DB 7C24
43 31FF 8D5704 89F0 E80759FDFF
91 A18C0B4A00 8B00 8D9789130000 E8D012FEFF
47 4B 75DF
5F 5E 5B C3
90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
90 90 90 90 90 90 90 90 90 90 90 90