offset 458360
#define
L_framerect_distance = AF
U_framerect_distance = 20
sprite heigth = 10
sprite width = 8
#enddefine
PUSH EBP
MOV EBP,ESP
SUB ESP,34
MOV DWORD PTR SS:[EBP-30],0B0
MOV DWORD PTR SS:[EBP-2C],20
MOV DWORD PTR SS:[EBP-28],0B8
MOV DWORD PTR SS:[EBP-24],30
MOV DWORD PTR SS:[EBP-20],0B8
MOV DWORD PTR SS:[EBP-1C],20
MOV DWORD PTR SS:[EBP-18],0C0
MOV DWORD PTR SS:[EBP-14],30
MOV DWORD PTR SS:[EBP-10],0
MOV DWORD PTR SS:[EBP-0C],0
MOV DWORD PTR SS:[EBP-8],0
MOV DWORD PTR SS:[EBP-4],0
setpointer
MOV edx, npc.scriptstate
CMP EDX,0
JE :jump_A
CMP EDX,1
JE :jump_B
CMP EDX, A
JE :jump_C
JMP :jump_D
:jump_A
MOV npc.scriptstate, 1
:jump_B
CMP [4BBA30],0
JE :jump_F
MOV npc.scriptstate, 0A
JMP :jump_F
:jump_C
MOV edx, npc.x
CMP edx, [4BBA30]
JGE :jump_E
ADD npc.movex,55
:jump_E
MOV eax, npc.x
CMP eax, [4BBA30]
JLE :jump_F
ADD npc.movex,-55
:jump_F
MOV edx, npc.y
CMP edx, [4BBA28]
JGE :jump_G
ADD npc.movex,55
:jump_G
MOV eax, npc.y
CMP eax, [4BBA28]
JLE :jump_H
ADD npc.movex,-55
:jump_H
CMP npc.movex,400
JLE :jump_I
MOV npc.movex,400
:jump_I
CMP npc.movex,-400
JGE :jump_J
MOV npc.movex,-400
:jump_J
CMP npc.movey,400
JLE :jump_K
MOV npc.movey,400
:jump_K
CMP npc.movey,-400
JGE :jump_L
MOV npc.movey,-400
:jump_L
MOV eax, npc.x
ADD eax, npc.movex
MOV npc.x,eax
MOV edx, npc.y
ADD edx, npc.movey
MOV npc.y,edx
:jump_F
:jump_D
setpointer
inc npc.frametimer
CMP npc.frametimer, 3
JLE :reset_timer_done
MOV npc.frametimer, 0
inc npc.frametimer
:reset_timer_done
CMP npc.framenum, 1
JLE :reset_frame_done
MOV npc.framenum, 0
:reset_frame_done
CMP npc.direction, 0
JNE :jump_O
CMP npc.movex,0
JLE :jump_O
MOV npc.framenum,2
:jump_O
CMP npc.direction,2
JNE :render
CMP npc.movex, 0
JGE :render
MOV npc.framenum,2
:render
mov eax, npc.framenum
imul al, al, sprite width
add eax L_framerect_distance
mov npc.DisplayL,eax
add eax, sprite width
mov npc.displayR,eax
mov eax, U_framerect_distance
mov npc.displayU,eax
add eax, sprite heigth
mov npc.displayD,eax
MOV ESP,EBP
POP EBP
RETN