BITS 32
ORG 0h

;/* Parameter Count */
DB 1

;/* External Functions */
xf_STRCAT equ 4
xf_STRCMP equ 8
xf_STRFORMAT equ 12
xf_STR equ 224
xf_STRLEN equ 696
xf_INSTR equ 280
xf_VAL equ 376
xf_RANDOM equ 16
xf_ABS equ 232
xf_SQR equ 236
xf_DIVIDE equ 700
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_GETPLAYERBANK equ 88
xf_GETPLAYEREXPERIENCE equ 92
xf_GETPLAYERLEVEL equ 96
xf_GETPLAYERSTATUS equ 100
xf_GETPLAYERGUILD equ 104
xf_GETPLAYERINVOBJECT equ 108
xf_GETPLAYERINVVALUE equ 112
xf_GETPLAYEREQUIPPED equ 116
xf_GETPLAYERDIRECTION equ 404
xf_GETPLAYERARMOR equ 436
xf_GETPLAYERMAGICARMOR equ 456
xf_GETPLAYERDAMAGE equ 504
xf_GETPLAYERNAME equ 120
xf_GETPLAYERUSER equ 124
xf_GETPLAYERDESC equ 128
xf_GETPLAYERGUILDRANK equ 480
xf_GETPLAYERISDEAD equ 492
xf_GIVEPLAYEREXP equ 400
xf_GIVEPLAYERELITEEXP equ 780
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_MAGICATTACKPLAYER equ 460
xf_ATTACKMONSTER equ 252
xf_MAGICATTACKMONSTER equ 464
xf_SETPLAYERCLASS equ 668
xf_SETPLAYERSPRITE equ 228
xf_SETPLAYERSTATUS equ 396
xf_SETPLAYERGUILD equ 304
xf_SETPLAYERISDEAD equ 496
xf_SETPLAYERDIRECTION equ 672
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_GETGUILDHALL equ 160
xf_GETGUILDBANK equ 164
xf_GETGUILDMEMBERCOUNT equ 168
xf_GETGUILDNAME equ 172
xf_GETGUILDSPRITE equ 296
xf_SETGUILDBANK equ 368
xf_GETMAPNAME equ 692
xf_GETMAPPLAYERCOUNT equ 176
xf_GETMAPISFRIENDLY equ 720
xf_GETMAPISPK equ 724
xf_GETMAPISARENA equ 728
xf_GETMAPOBJVAL equ 732
xf_GETBOOTLOCATIONMAP equ 756
xf_GETBOOTLOCATIONX equ 760
xf_GETBOOTLOCATIONY equ 764
xf_SETMAPOBJVAL equ 736
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_DESPAWNMONSTER equ 776
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_GETMONSTERHP equ 704
xf_GETMONSTERDIRECTION equ 500
xf_GETMONSTERTARGET equ 272
xf_SETMONSTERTARGET equ 276
xf_SETMONSTERHP equ 708
xf_MONSTERATTACKPLAYER equ 712
xf_MONSTERMAGICATTACKPLAYER equ 716
xf_CREATEMAPFLOATTEXT equ 472
xf_CREATEPLAYERFLOATTEXT equ 476
xf_CREATEMAPSTATICTEXT equ 676
xf_GETFLAG equ 308
xf_SETFLAG equ 312
xf_GLOBALMESSAGE equ 156
xf_GETTIME equ 196
xf_GETMAXUSERS equ 200
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_GETTILEATT2 equ 680
xf_GETTILEISVACANT equ 684
xf_GETTILENODIRECTIONALWALLS equ 688
xf_PLAYCUSTOMWAV equ 432
xf_TIMER equ 300
xf_RESETMAP equ 468
xf_CREATETILEEFFECT equ 440
xf_CREATECHARACTEREFFECT equ 444
xf_CREATEMONSTEREFFECT equ 448
xf_CREATEPLAYEREFFECT equ 452
xf_CREATEPLAYERPROJECTILE equ 484
xf_CREATEPLAYERMAGICPROJECTILE equ 488
xf_SETITEMSUFFIX equ 508
xf_GETITEMSUFFIX equ 512
xf_SETEQUIPPEDITEMSUFFIX equ 516
xf_GETEQUIPPEDITEMSUFFIX equ 520
xf_SETITEMPREFIX equ 524
xf_GETITEMPREFIX equ 528
xf_SETEQUIPPEDITEMPREFIX equ 532
xf_GETEQUIPPEDITEMPREFIX equ 536
xf_GETPREFIXNAME equ 540
xf_GETSUFFIXNAME equ 544
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_SETPLAYERHP equ 132
xf_SETPLAYERENERGY equ 136
xf_SETPLAYERMANA equ 140
xf_SETPLAYERMAXHP equ 548
xf_SETPLAYERMAXENERGY equ 552
xf_SETPLAYERMAXMANA equ 556
xf_GETPLAYERSTRENGTH equ 72
xf_GETPLAYERENDURANCE equ 76
xf_GETPLAYERINTELLIGENCE equ 80
xf_GETPLAYERAGILITY equ 84
xf_GETPLAYERCONCENTRATION equ 560
xf_GETPLAYERCONSTITUTION equ 564
xf_GETPLAYERSTAMINA equ 568
xf_GETPLAYERWISDOM equ 572
xf_GETPLAYERBASESTRENGTH equ 576
xf_GETPLAYERBASEENDURANCE equ 580
xf_GETPLAYERBASEINTELLIGENCE equ 584
xf_GETPLAYERBASEAGILITY equ 588
xf_GETPLAYERBASECONCENTRATION equ 592
xf_GETPLAYERBASECONSTITUTION equ 596
xf_GETPLAYERBASESTAMINA equ 600
xf_GETPLAYERBASEWISDOM equ 604
xf_SETPLAYERSTRENGTH equ 608
xf_SETPLAYERENDURANCE equ 612
xf_SETPLAYERINTELLIGENCE equ 616
xf_SETPLAYERAGILITY equ 620
xf_SETPLAYERCONCENTRATION equ 624
xf_SETPLAYERCONSTITUTION equ 628
xf_SETPLAYERSTAMINA equ 632
xf_SETPLAYERWISDOM equ 636
xf_GETPLAYERSKILLLEVEL equ 740
xf_GIVEPLAYERSKILLEXP equ 744
xf_SETPLAYERSKILLLEVEL equ 768
xf_GETPLAYERMAGICLEVEL equ 748
xf_GIVEPLAYERMAGICEXP equ 752
xf_SETPLAYERMAGICLEVEL equ 772
xf_CALCULATESTATS equ 640
xf_READINIINT equ 644
xf_READINISTR equ 648
xf_WRITEINISTR equ 652
xf_SETOUTDOORLIGHT equ 656
pv_PLAYER@MAIN equ -8

;/* Function MAIN */
f_MAIN:
ENTER 0,0
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERLEVEL]
CMP EAX,20
JLE misc1
XOR EAX,EAX
JMP misc2
misc1:
MOV EAX,-1
misc2:
TEST EAX,EAX
JNZ if1
LEA EAX,[ESI+else1]
JMP EAX
if1:
PUSH DWORD 5
PUSH DWORD 5
PUSH DWORD 1
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERWARP]
else1:
LEA EAX,[ESI+string0]
PUSH DWORD EAX
CALL [EDI+xf_RUNSCRIPT0]
PUSH DWORD 10
LEA EAX,[ESI+string1]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERMESSAGE]
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERLEVEL]
CMP EAX,1
JE misc3
XOR EAX,EAX
JMP misc4
misc3:
MOV EAX,-1
misc4:
TEST EAX,EAX
JNZ if2
LEA EAX,[ESI+else2]
JMP EAX
if2:
PUSH DWORD 1
PUSH DWORD 1
PUSH DWORD 1
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERWARP]
PUSH DWORD 1
LEA EAX,[ESI+string2]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERMESSAGE]
PUSH DWORD 15
LEA EAX,[ESI+string3]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERMESSAGE]
else2:
LEA EAX,[ESI+string4]
PUSH EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERUSER]
POP EBX
PUSH EAX
PUSH DWORD EBX
CALL [EDI+xf_STRCMP]
TEST EAX,EAX
JNZ if3
LEA EAX,[ESI+else3]
JMP EAX
if3:
PUSH DWORD 0
PUSH DWORD 41
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_SETPLAYERFLAG]
else3:
LEA EAX,[ESI+string5]
PUSH EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERIP]
POP EBX
PUSH EAX
PUSH DWORD EBX
CALL [EDI+xf_STRCMP]
TEST EAX,EAX
JNZ if4
LEA EAX,[ESI+else4]
JMP EAX
if4:
LEA EAX,[ESI+string6]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_BOOTPLAYER]
else4:
LEA EAX,[ESI+string7]
PUSH EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERIP]
POP EBX
PUSH EAX
PUSH DWORD EBX
CALL [EDI+xf_STRCMP]
TEST EAX,EAX
JNZ if5
LEA EAX,[ESI+else5]
JMP EAX
if5:
LEA EAX,[ESI+string6]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_BOOTPLAYER]
else5:
LEA EAX,[ESI+string8]
PUSH EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERIP]
POP EBX
PUSH EAX
PUSH DWORD EBX
CALL [EDI+xf_STRCMP]
TEST EAX,EAX
JNZ if6
LEA EAX,[ESI+else6]
JMP EAX
if6:
LEA EAX,[ESI+string6]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_BOOTPLAYER]
else6:
PUSH DWORD 7
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_SETPLAYERENDURANCE]
PUSH DWORD 0
PUSH DWORD 7
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_SETPLAYERFLAG]
PUSH DWORD 0
PUSH DWORD 18
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_SETPLAYERFLAG]
LEA EAX,[ESI+string9]
PUSH DWORD EAX
CALL [EDI+xf_RUNSCRIPT0]
PUSH DWORD 14
LEA EAX,[ESI+string10]
PUSH EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_GETPLAYERNAME]
POP EBX
PUSH DWORD EBX
PUSH EAX
CALL [EDI+xf_STRCAT]
PUSH DWORD EAX
CALL [EDI+xf_GLOBALMESSAGE]
PUSH DWORD 11
LEA EAX,[ESI+string11]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERMESSAGE]
PUSH DWORD 10
LEA EAX,[ESI+string12]
PUSH DWORD EAX
PUSH DWORD [EBP-pv_PLAYER@MAIN]
CALL [EDI+xf_PLAYERMESSAGE]
LEAVE
RET 4

;/* Temporary Variables */

;/* String Data */
DD 10
string0:
DB "ResetFlags"
DD 101
string1:
DB "You can now use the /UNGLITCH command to attempt to boot your characters that are stuck online! - Jay"
DD 104
string2:
DB "Welcome To Ancient PK!! Training and Questing are very easy, we want you to get to the pk level quickly."
DD 31
string3:
DB "Any questions feel free to ask."
DD 11
string4:
DB "jamie175313"
DD 15
string5:
DB "108.200.241.119"
DD 12
string6:
DB "Blacklisted."
DD 13
string7:
DB "70.126.30.215"
DD 13
string8:
DB "72.207.74.109"
DD 5
string9:
DB "Perma"
DD 16
string10:
DB " is ready to PK!"
DD 90
string11:
DB "Champion Writs are obtained by killing another person, type /Champion for more info.-Bubba"
DD 436
string12:
DB "Equipment and spells have been balanced to close the huge gaps on equipment. The damage gap has been narrowed down significantly. This balance should make guild battles a lot more enjoyable and fun because you will no longer die in 4 to 5 hits. Spells and monsters have been changed according to this balance. Mages were changed around to fit the new balance, they are played differently, and require equipment to be successful! - Bubba"
