Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Source code of Reset NPC

Junior Spellweaver
Joined
Jul 24, 2007
Messages
139
Reaction score
30
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.

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 :D.

Coded by H
 
Last edited:
Junior Spellweaver
Joined
May 16, 2007
Messages
112
Reaction score
0
Wow very nice man :D :poster_ss u r great :flag_schw
 
Newbie Spellweaver
Joined
Oct 16, 2007
Messages
10
Reaction score
0
ownage. auto reset from mssql goes byebye. no more loading ur cpu for nothing. u rock dude
 
Newbie Spellweaver
Joined
Jul 15, 2004
Messages
27
Reaction score
17
Som1 Can make a guild how to use that code?
i know assmble but i never try to convent my projects to dlls
so som1 can make a simple guild how to convent OBJ to DLL?
and what u meaning when u write
"00405AF6 $ /E9 75541400 JMP gameserv.NPCDeviasGuard"?
 
Newbie Spellweaver
Joined
Jun 6, 2007
Messages
7
Reaction score
0
Som1 Can make a guild how to use that code?
i know assmble but i never try to convent my projects to dlls
so som1 can make a simple guild how to convent OBJ to DLL?

Well, first here is the compiled DLL.
View attachment GReset.zip

If u want compile it with ur modifications: Do the changes in Lvl, Required Zen,.... after that

*.- First u need have installed MASM32
*.- then open command ( Start->Run->cmd ) then...

Assembling the DLL code is identical to a normal EXE file and it is done as normal with the following line:
\masm32\bin\ml /c /coff GReset.asm

This line will create a file named: GReset.obj


Linking the DLL:

\masm32\bin\Link /SUBSYSTEM:WINDOWS /DLL GReset.obj


This line will create the final file: GReset.dll

To HOOK the DLL in the GS:Hooking a DLL

and what u meaning when u write
"00405AF6 $ /E9 75541400 JMP gameserv.NPCDeviasGuard"?

this is the offset where u need to put a jump to the DLL hook, remeber , make a jump to the orignal address at the end
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Mar 20, 2007
Messages
5
Reaction score
0
and whats from that? it just reduce money, nothing else coded ; ], but thanks
 
Newbie Spellweaver
Joined
Jun 26, 2006
Messages
47
Reaction score
19
ok ^^ i got some critics on this code:
1. ->
Code:
Mov Edx, DWord Ptr Ds:[Eax + 0A0H]
Cmp Edx, 15EH
ok you are checking the lvl but where is the
Code:
Mov DWord Ptr Ds:[Eax + 0A0H],1
?

2. -> where is the reward of the reset ? =)
3. -> if you will make the reward then how you can see how many resets player alredy got ^^ ?
4. -> want it or not but you will need to work with mssql if you want to replace the web reset
 
Junior Spellweaver
Joined
Jul 24, 2007
Messages
139
Reaction score
30
There is no reward, but you are true this code doesn
 
Newbie Spellweaver
Joined
Dec 24, 2004
Messages
11
Reaction score
1
Good .. But the big problem is that some of the files used luciano aibar which of course has protected the gameserver.Dll or things are mine ..

The good idea is that we are just some of this new compilation and assamblar


The problem is that the guide is wrong fenix not seen either one of the images and this in English by my fate: S bueh Maverick if it is not too much to ask if we can pass aver a guide by you? For a well learn a little ... And what programs are needed for example I have visual c + + 2005 and Masm

I seems a good project! So we have no problems that users complain that they can not enter wing web reset or something so ...

Sorry for my bad English
 
Newbie Spellweaver
Joined
May 5, 2005
Messages
18
Reaction score
0
Nice one .. but it better remain unfinished .. if you are not informed or don't know .. when making a reset ( in DB) without disconecting from the server it generates a bug ... in DB the stats are changed in game remains the same ... the changes take affect after reloging .. well if you dont you can reset 100000000 times for 1 count .. and i dont think you can pass this bug .. since mu was made like this from the start .. youl have to code both Server and Main from the start ... and still the only thing yoou will get is big lags .. and make new holes .. IM NOT TRYING TO FLAME.. im just being resonable .. you should better try your skils in useful development ( like fixing this damn visual bug ) .. and leave this reset thing to web coders .. to me it seems the only way .....

Sry for bad English
 
Newbie Spellweaver
Joined
Oct 19, 2006
Messages
39
Reaction score
0
Thanks a lot Holy,

But would you mind sharing us C++ code if possible? I don't have any idea about asm.

Thanks again!
 
Newbie Spellweaver
Joined
Jan 13, 2008
Messages
9
Reaction score
0
And work in old version's ... ? Or only in new version's ... ?
 
Back
Top