| offset npc216 ;replaces Debug cat
|
| push ebp ;This starts the code
| mov ebp, esp ;You must always do this. Or die!
| ;And also note that ALL NUMBER ARE IN HEX (unless otherwise stated)
| ;[arg-1] = [EBP+8] for referance
|
| ;============================
| ;=====<///FRAMARECTS\\\>=====
| ;============================
|
| SUB ESP,10 ;10 represents the total ammount of framarects. (must match ths highest EBP-___)
| MOV DWORD PTR SS:[EBP-10],100 ;framarects are ordered Left...
| MOV DWORD PTR SS:[EBP-C],0C0 ;UP
| MOV DWORD PTR SS:[EBP-8],110 ;RIGHT
| MOV DWORD PTR SS:[EBP-4],0D8 ;DOWN (notice that you MUST count by four's [in hex] for your framarects).
|
| ;this gives us a sprite (4 borders)
|
| ;================================
| ;=====<///BEHAVIOUR CODE\\\>=====
| ;================================
|
|
|
| ;----RECTS----
|
| MOV EAX,DWORD PTR SS:[EBP+8] ;"+8" puts object pointet in EDX. NEVER FORGET TO DO THIS!
| ADD EAX,54 ;holds 54 in the EAX
|
| MOV ECX,[EBP-10] ;takes EBP-10 (framarect 1) and stores the value of ECX into it.
| MOV [EAX],ECX ;takes the 54 from the EAX and adds it to the argument and runs "+54" aka Frame_L to
;recognize that it is the left side on the NPC.
|
| MOV EDX,[EBP-C] ;takes EBP-C (framarect 2) and stores the value of EDX into it.
| MOV [EAX+4],EDX ;adds 4 to make "+58" aka Frame_U to recognize up side of NPC
|
| MOV EDX,[EBP-8] ;takes EBP-8 (framarect 3) and stores the value of EDX into it.
| MOV [EAX+8],ECX ;adds 4 to make "+5c" aka Frame_R to recognize right side of NPC
|
| MOV EDX,[EBP-4] ;takes EBP-4 (framarect 4) and stores the value of EDX into it.
| MOV [EAX+0C],EDX ;adds 4 to make "+60" aka Frame_D to recognize down side of NPC
|
| ;==============================
| ;======<///END OF CODE=========
| ;==============================
| mov esp, ebp
| pop ebp
| retn