ebp points to the base of the stack. [ebp-stuff] is a local variable, which means it's accessible by this code and not any other (sidenote: [ebp+stuff] is an argument that was pushed before calling this function).
So when the code says
Code:
MOV EDX,DWORD PTR DS:[4A5AE0]
ADD EDX,4
PUSH EDX
CALL 0x421900
ADD ESP,4
MOV DWORD PTR SS:[EBP-0C],EAX
it's taking the first parameter of ITJ ([4a5ae0]+4 = scriptpointer+4 = the first parameter), turning it from ascii to a number (via 421900), and then saving it into the local variable [ebp-c].
Later in the code, when it says
Code:
MOV ECX,DWORD PTR SS:[EBP-0C]
PUSH ECX
CALL 0x401f20
it's taking the local variable (which was previously designated as item number) and then calling 0x401f20 with it.
We can look at the code for more usage stuff:
Code:
PUSH ECX
CALL 0x401f20
ADD ESP,4
TEST EAX,EAX
JZ SHORT 00423A3C
so if flag z is set (if eax == false) it skips over the conditional.
To put this as explicitly as possible:
Code:
push v_itemnumber
[B]A[/B] call 401f20
add esp,4
test eax,eax
jz [b]C[/b]
[B]B[/B] ...
[B]C[/B] ...
would skip over code B and go to code C if you do not have the item v_itemnumber (obviously in hex).
Kapiche?