Yesterday the user Charles_Ps requested me to code something similar to a NPC for make resets, so i coded it and i left here the code.
This code is a bit more long as you seen, than the other code that i released yesterday. This NPC asks you to be lvl 350 and to have at least 100.000 Zen, and then if you complete the requisites you will be reseted, but you need to relog.
You must hook there if you want, same as the other NPC.
But if you want to put the code on another NPC search for NPCs and make the hooks correctly .
Coded by H
Code:
.386
.Model flat , StdCall
Option CaseMap:none
Include \masm32\include\windows.inc
Include \masm32\include\user32.inc
Include \masm32\include\kernel32.inc
Include \masm32\include\masm32.inc
IncludeLib \masm32\lib\user32.lib
IncludeLib \masm32\lib\kernel32.lib
IncludeLib \masm32\lib\masm32.lib
.Const
.Data
MessageOutPut DD 00500EE0H
NoMoneyMSG DB "You need at least 100.000 Zen for make Reset.", 0
NoLevelMSG DB "You need to be at least lvl 350 for make Reset.", 0
RelogMSG DB "Reset finished, Relog and you will be Reseted.", 0
.Data?
.Code
DllEntry Proc hInstDLL:HINSTANCE, reason:DWord, reserved1:DWord
Mov Eax, TRUE
Ret
DllEntry EndP
ResetNPC Proc
Local PlayerID:DWord
Local lpObj:DWord
Mov Eax, DWord Ptr Ss:[Ebp + 8]
Mov lpObj, Eax
Mov Edx, DWord Ptr Ds:[Eax]
Mov PlayerID, Edx
Mov Eax, lpObj
Mov Edx, DWord Ptr Ds:[Eax + 0A0H]
Cmp Edx, 15EH
Jle NoLevel
Jmp CheckMoney
NoLevel:
Lea Edx, NoLevelMSG
Push Edx
Mov Ecx, PlayerID
Push Ecx
Call MessageOutPut
Jmp Finish
CheckMoney:
Mov Eax, lpObj
Mov Ecx, DWord Ptr Ds:[Eax + 0B4H]
Cmp Ecx, 186A0H
Jle NoMoney
Jmp ReduceMoney
NoMoney:
Lea Eax, NoMoneyMSG
Push Eax
Mov Ecx, PlayerID
Push Ecx
Call MessageOutPut
Jmp Finish
ReduceMoney:
Mov Eax, lpObj
Mov Ecx, DWord Ptr Ds:[Eax + 0B4H]
Sub Ecx, 186A0H
Mov DWord Ptr Ds:[Eax + 0B4H], Ecx
Lea Edx, RelogMSG
Push Edx
Mov Ecx, PlayerID
Push Ecx
Call MessageOutPut
Finish:
Ret
ResetNPC EndP
End DllEntry
This code is a bit more long as you seen, than the other code that i released yesterday. This NPC asks you to be lvl 350 and to have at least 100.000 Zen, and then if you complete the requisites you will be reseted, but you need to relog.
You must hook there if you want, same as the other NPC.
Code:
00405AF6 $ /E9 75541400 JMP gameserv.NPCDeviasGuard
But if you want to put the code on another NPC search for NPCs and make the hooks correctly .
Coded by H
Last edited: