BITS 32
ORG 0h
;/* Parameter Count */
DB 5

;/* External Functions */
xf_STRCAT equ 4
xf_STRCMP equ 8
xf_STRFORMAT equ 12
xf_STR equ 224
xf_INSTR equ 280
xf_VAL equ 376
xf_RANDOM equ 16
xf_ABS equ 232
xf_SQR equ 236
xf_FINDPLAYER equ 372
xf_GETPLAYERIP equ 384
xf_GETPLAYERACCESS equ 20
xf_GETPLAYERMAP equ 24
xf_GETPLAYERX equ 28
xf_GETPLAYERY equ 32
xf_GETPLAYERSPRITE equ 36
xf_GETPLAYERCLASS equ 40
xf_GETPLAYERGENDER equ 44
xf_GETPLAYERHP equ 48
xf_GETPLAYERENERGY equ 52
xf_GETPLAYERMANA equ 56
xf_GETPLAYERMAXHP equ 60
xf_GETPLAYERMAXENERGY equ 64
xf_GETPLAYERMAXMANA equ 68
xf_GETPLAYERSTRENGTH equ 72
xf_GETPLAYERENDURANCE equ 76
xf_GETPLAYERINTELLIGENCE equ 80
xf_GETPLAYERAGILITY equ 84
xf_GETPLAYERBANK equ 88
xf_GETPLAYEREXPERIENCE equ 92
xf_GETPLAYERMAXEXP equ 472
xf_GETPLAYERLEVEL equ 96
xf_GETPLAYERSTATUS equ 100
xf_SETPLAYERSTATUS equ 396
xf_GETPLAYERGUILD equ 104
xf_GETPLAYERINVOBJECT equ 108
xf_GETPLAYERINVVALUE equ 112
xf_GETPLAYEREQUIPPED equ 116
xf_GETPLAYERDIRECTION equ 460
xf_SETPLAYERDIRECTION equ 468
xf_GIVEPLAYEREXP equ 400
xf_GETPLAYERARMOR equ 436
xf_GETPLAYERNAME equ 120
xf_GETPLAYERUSER equ 124
xf_GETPLAYERDESC equ 128
xf_HASOBJ equ 184
xf_TAKEOBJ equ 188
xf_GIVEOBJ equ 192
xf_ISPLAYING equ 244
xf_CANATTACKPLAYER equ 240
xf_CANATTACKMONSTER equ 256
xf_ATTACKPLAYER equ 248
xf_ATTACKMONSTER equ 252
xf_MONSTERATTACK equ 492
xf_SETPLAYERHP equ 132
xf_SETPLAYERENERGY equ 136
xf_SETPLAYERMANA equ 140
xf_SETPLAYERFROZEN equ 496
xf_SETPLAYERDEAD equ 500
xf_SETPLAYERMAXHP equ 476
xf_SETPLAYERMAXENERGY equ 480
xf_SETPLAYERMAXMANA equ 484
xf_SETPLAYERACCESS equ 328
xf_SETPLAYERSPRITE equ 228
xf_SETPLAYERGUILD equ 304
xf_SETPLAYERNAME equ 360
xf_SETPLAYERBANK equ 364
xf_BOOTPLAYER equ 352
xf_BANPLAYER equ 356
xf_PLAYERMESSAGE equ 144
xf_PLAYERWARP equ 148
xf_GETPLAYERFLAG equ 316
xf_SETPLAYERFLAG equ 320
xf_RESETPLAYERFLAG equ 324
xf_GETGUILDHALL equ 160
xf_GETGUILDBANK equ 164
xf_GETGUILDMEMBERCOUNT equ 168
xf_GETGUILDNAME equ 172
xf_GETGUILDSPRITE equ 296
xf_SETGUILDBANK equ 368
xf_GETMAPPLAYERCOUNT equ 176
xf_OPENDOOR equ 220
xf_MAPMESSAGEALLBUT equ 180
xf_MAPMESSAGE equ 152
xf_NPCSAY equ 288
xf_NPCTELL equ 292
xf_SPAWNMONSTER equ 392
xf_SPAWNOBJECT equ 284
xf_DESTROYOBJECT equ 348
xf_GETOBJX equ 332
xf_GETOBJY equ 336
xf_GETOBJNUM equ 340
xf_GETOBJVAL equ 344
xf_GETOBJECTNAME equ 412
xf_GETOBJECTDATA equ 416
xf_GETOBJECTTYPE equ 420
xf_DISPLAYOBJDUR equ 424
xf_SETINVOBJECTVAL equ 428
xf_GETMONSTERTYPE equ 260
xf_GETMONSTERX equ 264
xf_GETMONSTERY equ 268
xf_GETMONSTERTARGET equ 272
xf_SETMONSTERTARGET equ 276
xf_GETFLAG equ 308
xf_SETFLAG equ 312
xf_GLOBALMESSAGE equ 156
xf_GETTIME equ 196
xf_GETMAXUSERS equ 200
xf_MAPRESET equ 464
xf_RUNSCRIPT0 equ 204
xf_RUNSCRIPT1 equ 208
xf_RUNSCRIPT2 equ 212
xf_RUNSCRIPT3 equ 216
xf_RUNSCRIPT4 equ 388
xf_GETTILEATT equ 380
xf_PLAYCUSTOMWAV equ 432
xf_TIMER equ 300
xf_PRINTTOFILE equ 456
xf_CREATETILEEFFECT equ 440
xf_CREATECHARACTEREFFECT equ 444
xf_CREATEMONSTEREFFECT equ 448
xf_CREATEPLAYEREFFECT equ 452
xf_CREATEMONSTERPROJECTILE equ 488

;/* Function MAIN Variable Definitions */
RETURN@MAIN equ 4
lv_PLAYER@MAIN equ -8
lv_COMMAND@MAIN equ -12
lv_PARM1@MAIN equ -16
lv_PARM2@MAIN equ -20
lv_PARM3@MAIN equ -24

;/* Function MAIN */
f_MAIN:
ENTER 4,0
PUSH DWORD [EBP-lv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERACCESS]
CMP EAX,0
JG misc1
XOR EAX,EAX
JMP misc2
misc1:
MOV EAX,-1
misc2:
PUSH EAX
LEA EAX,[ESI+string0]
PUSH EAX
PUSH DWORD [EBP-lv_COMMAND@MAIN]
CALL [EDI+xf_STRCMP]
POP EBX
AND EAX,EBX
TEST EAX,EAX
JNZ if1
LEA EAX,[ESI+endif1]
JMP EAX
if1:
PUSH DWORD [EBP-lv_PARM3@MAIN]
CALL [EDI+xf_VAL]
PUSH EAX
PUSH DWORD [EBP-lv_PARM2@MAIN]
CALL [EDI+xf_VAL]
PUSH EAX
PUSH DWORD [EBP-lv_PARM1@MAIN]
CALL [EDI+xf_VAL]
PUSH EAX
PUSH DWORD [EBP-lv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERWARP]
endif1:
PUSH DWORD [EBP-lv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERACCESS]
CMP EAX,0
JG misc3
XOR EAX,EAX
JMP misc4
misc3:
MOV EAX,-1
misc4:
PUSH EAX
LEA EAX,[ESI+string1]
PUSH EAX
PUSH DWORD [EBP-lv_COMMAND@MAIN]
CALL [EDI+xf_STRCMP]
POP EBX
AND EAX,EBX
TEST EAX,EAX
JNZ if2
LEA EAX,[ESI+endif2]
JMP EAX
if2:
PUSH DWORD [EBP-lv_PARM1@MAIN]
CALL [EDI+xf_VAL]
PUSH EAX
PUSH DWORD [EBP-lv_PLAYER@MAIN]
CALL [EDI+xf_SETPLAYERSTATUS]
endif2:
PUSH DWORD [EBP-lv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERACCESS]
CMP EAX,0
JG misc5
XOR EAX,EAX
JMP misc6
misc5:
MOV EAX,-1
misc6:
PUSH EAX
LEA EAX,[ESI+string2]
PUSH EAX
PUSH DWORD [EBP-lv_COMMAND@MAIN]
CALL [EDI+xf_STRCMP]
POP EBX
AND EAX,EBX
TEST EAX,EAX
JNZ if3
LEA EAX,[ESI+endif3]
JMP EAX
if3:
PUSH DWORD [EBP-lv_PARM2@MAIN]
CALL [EDI+xf_VAL]
PUSH EAX
PUSH DWORD [EBP-lv_PARM1@MAIN]
CALL [EDI+xf_FINDPLAYER]
PUSH EAX
CALL [EDI+xf_SETPLAYERSTATUS]
endif3:
MOV EAX,[EBP-RETURN@MAIN]
LEAVE
RET 20

;/* Global Variables */

;/* String Data */
DD 4
string0:
DB "warp"
DD 9
string1:
DB "setstatus"
DD 15
string2:
DB "setplayerstatus"
