-
Source Code of a Little New NPC
Hi guys i am a bit worried here at 0:24 AM so i want to release this simply code xD.
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
gObjTeleport DD 004F6230H
.Data?
.Code
DllEntry Proc hInstDLL:HINSTANCE, reason:DWord, reserved1:DWord
Mov Eax, TRUE
Ret
DllEntry EndP
NewNPC Proc
Local PlayerID:DWord
Local Map:DWord
Local X:DWord
Local Y:DWord
Mov Eax, DWord Ptr Ss:[Ebp + 8]
Mov Edx, DWord Ptr Ds:[Eax]
Mov PlayerID, Edx
Mov Map, 0
Mov X, 98H
Mov Y, 34H
Mov Eax, Y
Push Eax
Mov Ecx, X
Push Ecx
Mov Edx, Map
Push Edx
Mov Eax, PlayerID
Push Eax
Call gObjTeleport
Ret
NewNPC EndP
End DllEntry
And you need to hook there:
Code:
00405AF6 $ /E9 75541400 JMP gameserv.NPCDeviasGuard
If you compile the DLL and hook in the correct place when you click on the NPCGuard you will get Teleported to Lorencia(152,52). Simply and cool :D.
You need to be sure to put the NPC in your MonsterSetBase:
Well guys Good Luck to all and Happy Coding. :technolog
PS: Good Night to all too xD.
//EDIT
This works 100% Perfect for any of the 1.00.16 Version Like Endi
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Aha this is great! So much that can be done here, thanks!
-
Re: [Release] Source Code of a Little New NPC
Very interesting.
Well can U make some code for clck into a NPC and reset any char?
or something like that?
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
^^ reminds me of penix's silent map teleport.
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Great work can use this code for teleport a silent as peni'x server files
-
Re: [Release] Source Code of a Little New NPC
Yes, you can make it move anymap if you simply change coords and map number.
-
Re: [Release] Source Code of a Little New NPC
Nice code man !
Any way you can port this for flat assembler ? (flat assembler)
I have some problems with the commands.
I am not familiar with masm32 :/
-
Re: [Release] Source Code of a Little New NPC
best if using masm32, icz tuts help you learn it.
-
Re: [Release] Source Code of a Little New NPC
i build the damn obj file in masm32, now what :P
Can someone make a simple guide how to make the obj to dll in masm32 ? I couldnt find any info in their site or forum. I think it will help people here also...not just me :P
-
Re: [Release] Source Code of a Little New NPC
Very nice job, i need Learn masm32 ^^. Is a god Opportunity.
Thx
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Looks similar with fenix npc teleport from 99.62
-
Re: [Release] Source Code of a Little New NPC
gj Holy!
nice one :P
and tip, change X, Y, Map value in the gObj offsets too :)...
btw...
here is short edition of it :P
Code:
NewNPC Proc
Push 034H
Push 098H
Push 0
Mov Eax, DWord Ptr Ss:[Ebp + 8]
Mov Eax, DWord Ptr Ds:[Eax]
Push Eax
Call gObjTeleport
Ret
NewNPC EndP
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
you can code asm in visual c( # and ++ ) you just need to know how :))
-
Re: [Release] Source Code of a Little New NPC
Yes i know, but i dont like C++ i prefer full ASM. :D
-
Re: [Release] Source Code of a Little New NPC
But with C++ u can code more things in less lines :)
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
nice NPC, good job ! :jester:
-
Re: [Release] Source Code of a Little New NPC
[QUOTE=BoneDragoN;2829950]hello,H
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Sorry for newbie questions, I'm not a programmer, but...
How hard would it be to inject some kind of scripting capability into a new npc like this, so that it can access a server settings file (say, newnpc.ini) which contains variables like action (0=send text only, 1=teleport, 2=give item, 3=take item, etc) and parameters (for text it'd be treated as a string, for teleport it would be coords, for items it would be a hex string or similar...)
Just trying to think of something that could start off pretty basic, basic functionality, but then with the work of other creative people (not necessarily programmers), it could add a lot more to the server (new quests to some degree)
I know there are limitations on what you can have as customizable but do you understand my meaning? :)
-
Re: [Release] Source Code of a Little New NPC
PLiz Help me!!!
(Есть ктото русский чтобы обьяснить как добавить этого NPC на сервер)
Plizzzz
-
Re: [Release] Source Code of a Little New NPC
You mean a NPC that have only 1 function?
(0=send text only, 1=teleport, 2=give item, 3=take item, etc).
And you can chose what function do you want in that npc, in a newnpc.ini no? With his parameters.
Then yes its possible to do, easy.
Look this is an example how the code must be.
Code:
Ini1 DB "NewNPC", 0
Ini2 DB "Function", 0
IniPath DB "./NewNPC.ini", 0
NewNPC Proc
Invoke GetPrivateProfileInt, Addr Ini1, Addr Ini2, NULL, Addr IniPath
Cmp eax, 0
Je DisplayText
Cmp eax, 1
Je DoTeleport
Cmp eax, 2
Je GiveItem
Cmp eax, 3
Je TakeIitem
...
DisplayText:
(There the code of the text to show)
Jmp TheEnd
DoTeleport:
(There the code of the teleport)
Jmp TheEnd
...
TheEnd:
Ret.
And with this example code you can code a NewNPC where you can chose and change his function in the newnpc.ini :basketball:
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Yeah that was I was trying to say xD. Not exactly see.
It is best to not use the same parameters for all the actions.
For example. This is the .ini file:
Code:
[NewNPC]
Action = 0 // 0=send text only, 1=teleport, 2=give item, 3=take item
[Text]
Text1 = Blablablabla
Text2 = Blablabla...
[Teleport]
Map = 0 // 0 = lorencia, 1=...,etc
X = 125 //Coordinates
Y = 125 //Coordinates
[Take Item]
Item = AB //The ID of the item in HEX.
Zen = 100000
Something like this no? ^^ Its better to separate them in section because if not they will mix and will create many bugs :S.
Well for create quests is not hard as you think xD, its easy only needs hook in the NPC, the msgs of required zen, item...,etc , and finaly the prize for done the quest ^^.
The worst thing is that for create quests like the originals one from Marlon, Devin, etc with his menus you need to code in main side and main side is not easy xD.
Go to sleep I slept only 5 hours as you :P.
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
couldnt you do this & copy existing NPC to "fix" the 3rd character quest in luciano's releases?
-
Re: [Release] Source Code of a Little New NPC
Quote:
Originally Posted by
Xeron
couldnt you do this & copy existing NPC to "fix" the 3rd character quest in luciano's releases?
No, with this you cant fix the S3 Quest.
The S3 Quest is a problem of packets.
-
Re: [Release] Source Code of a Little New NPC
Quote:
Originally Posted by
NOTARIUS B.I.G
PLiz Help me!!!
(Есть ктото русский чтобы обьяснить как добавить этого NPC на сервер)
Plizzzz
Use ASM compiler, compile file, and hook it in GS
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Quote:
Originally Posted by
DaRcAntiX
Well.... much can be done in 'bluetext' instead.. but even for something like 3rd evo quest, isn;'t there an internal routine or command in server to send dialog trigger to client? So as soon as you know all the right dialog IDs, you can make the evo3 dialogs come up in client at the right times.. of course if you want it to work 100% then it'll take more work, but at least it would seem like you have most of it working ;)
Another quick thought... you know how things like DS ticket give you information sent by the server when you right click on them, like 'XX minutes to enter'... maybe you can take over a dialog like this, and insert a string instead of numerical value, therefore you could send custom text from server in a dialog.. or if you can manage to edit/commandeer just one existing dialog which has a variable in the client display as well as yes/no buttons (or accept/cancel etc - trade dialog would be one example; it includes trader's nick, but of course we kinda need to keep that one lol) then you could code the triggering of that dialog as a routine in a dll or in an edited GS, and modders can call that with all the required parameters when they want to use a custom confirm dialog in new quests etc..
I hope I've been clear enough, sorry if some of the coding terms I used are not correct, I'm no programmer just an advanced noob :laugh:
Yes that Dialogs like the one from DS are easy to code, the only one problem is that S3 Quest doesnt work with that Dialogs S3 Quest works with packets more harder than the simples dialogs xD.
[quote=ScanX;2954417]H
-
Re: [Release] Source Code of a Little New NPC
Right or wrong?
00405AF6 $ /E9 75541400 JMP gameserv.230
-------------------------------------------------------------
230 1 "Alex" 2 50 0 15 30
I am very confused, sorry :(
-
Re: [Release] Source Code of a Little New NPC
Wrong xD that doesnt mean anything. That offset will always be the NPC Guard not
another :P
-
Re: [Release] Source Code of a Little New NPC
thats how we coded golden archer and pkclear guard ;)
(well.. thats a bit more complicated tho)
Anyway, nice job ;)
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Well better xD go here:
Code:
0054A306 |> \FF15 71A35B00 CALL DWORD PTR DS:[5BA371]
0054A30C |. 90 NOP
0054A30D |. 90 NOP
0054A30E |. 90 NOP
0054A30F |. 90 NOP
0054A310 |. 90 NOP
0054A311 |. 90 NOP
0054A312 |. 90 NOP
0054A313 |. 83C4 08 ADD ESP,8
0054A316 |. 83F8 01 CMP EAX,1
Here you need to call to your NPC proc, as you seen i delete all the lines from there and I put
a Call ;)
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
gr8 job like allways holy =) keep on going :D
greez,
ET
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
yup..
nice NPC..
but though, how do u hook it up? cuz some dll need to be hooked in a expecific "place",
Thanks...
again nice job..
-
Re: [Release] Source Code of a Little New NPC
Someone can give me hint as arrumo the programs or to change the names of them. Dll?
-
Re: [Release] Source Code of a Little New NPC
-
Re: [Release] Source Code of a Little New NPC
Please help me
Give links for download programs witch i compile and hook dll in GameServer
-
Re: [Release] Source Code of a Little New NPC
I can't belive
NOBODY help me??
-
Re: [Release] Source Code of a Little New NPC
Search in google such progs as MASM32 and OllyDbg. I used this progs.
-
Re: [Release] Source Code of a Little New NPC
Quote:
0054A306 |> \FF15 71A35B00 CALL DWORD PTR DS:[5BA371]
0054A30C |. 90 NOP
0054A30D |. 90 NOP
0054A30E |. 90 NOP
0054A30F |. 90 NOP
0054A310 |. 90 NOP
0054A311 |. 90 NOP
0054A312 |. 90 NOP
0054A313 |. 83C4 08 ADD ESP,8
0054A316 |. 83F8 01 CMP EAX,1
How did you find it?
P.s - I need for Gs 1.00.18
-
Re: [Release] Source Code of a Little New NPC