![]() |
|
|
#1 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
Introduction:
I know that the original C1 modded servers are pretty much dead when compared to the C4 servers, but I have included the entire source code for this project (an extender DLL for those who don't know). I want to give thanks to Alien003, testdude, RipperX, Annatar, Nevyn, and the support of many other people who supported me the 6 weeks or so I worked on this project, and those who contributed code. This was my first ever DLL hack, and my first ever major assembly job. I must say I amazed even myself that I was able to learn all of this in such a short amount of time. The original thread about the beginnings of this project, as well as real old skeleton code, is here: https://postpacific.mmorpg-game.onli...ead.php?t=4833 About the Source: All of this code is unchanged. It works. There is one bug with the CP damage, however. The damage won't register as it is written now, but if you take out the check for pAttacker being a Player Character you can see mobs and people attack you and take your CP. The problem lies in the pAttacker variable of CombatPointsDamageHandler(). It is ALWAYS NULL whenever I pass it, so I must assume I accidentally passed the wrong variable when I was moving the code. I would fix it, but I've moved on to the C4 platform and playing with that. The night I got this version done I had to leave, then later move 100 miles, then live with my parents for a while before I went back to my University town. I will be moving again in a few days. You can say I've been busy. One last thing about the source is that ReportInterface and ODBCInterface are NOT my classes. I was given them during the time I was working on this project. I know the original author of the ODBC class was someone named Maya (or similar) who worked on a DLL project long, long ago. ReportInterface might be tontor's since it works almost the same way as his patch does. I made a few changes in those files, trying to get debug output, but you can always take the changes out and uncomment the original lines. It's pretty easy to see what I changed. Some Files I Can't Share Hairslots was working on my test server through a DLL I was provided. I know how to do them, but at the time my goal was to catch up feature wise to other DLLs, so I wasn't going to recode something I could hex or attach a small DLL for. That's why not everything is in the code. Some fixes are in my EXE file. Hairslots was in a DLL I was given. How to Make a Test Server If you wish to use this to create a test server that people can play on, simply get the C4 Hex Fixes Pack (and maybe the C3 Fixes pack) provided by HF and use the fixes you need (Warehouses, Private Stores, etc.). You can attach the compiled DLL to the server EXE using Stud_PE or many other PE import adder programs. I would provide my EXE with all the hexes and the DLL as well, but the DLL is not mine to give out. If I get permission from someone, maybe I'll share it along with the EXE. Conclusion: I attached the L2EP 'Elhaym' v0.8c source code and project below. As long as this code is NOT used to make profit in any way, you're free to use it for learning or on an actual server. I make no warranty, so if your house explodes, too bad ;P Hope some people can learn about how a project like this works, make progress on some C4 -> C5 changes, and if you have any comments, leave a reply here. I'll try to answer questions people might have. Disclaimer: This DLL will NOT work for the retail C4 server files. This is only for the older C1 -> C4 modded files. Вложения из исходного сообщения (сами файлы в копии отсутствуют): L2ExtensionProject_v0.8c.rar — 1810122 байт |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Apr 2005
Posts: 555
|
Wow, I know this will help lots of people understand how to hook into the l2 server process etc.
Sadly I do not have the skills to utilize this share, but I do understand how big!! it is. Kudos to you for sharing the work, allowing others to learn from it and hopefully advance the community more! |
|
|
|
|
#3 |
|
Архивный участник
Join Date: Sep 2005
Posts: 731
|
Thank u mcrabben this is a good base to learn !
It's an awfull big project i see and i want to say you did a splendid job ! |
|
|
|
|
#4 |
|
Архивный участник
Join Date: Jun 2005
Posts: 258
|
This right here is the best thing ever to come out of PP ... It not only applies to Lineage 2, but to real life as well. The greatest thing that one could ever want to achieve from PP is to further their knowledge of computers through their love of Lineage 2. It never ceases to amaze me, that when humans are presented with a difficult problem, people rise to the challenge and further the advancement of society. The skills learned through analysis of this code have so much value to those who can harness them, and if you have never taken in interest in what you can do with programming, this is a great way to learn. Thanks for taking the time to release this to everyone Mcrabben .. u rock
/rant off |
|
|
|
|
#5 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
I guess now that C4 is out most people don't care about source code for an older DLL project. Oh well. I hope those of you that learn something from it go on to use it in the future.
@HongK: Thanks for the encouraging and supportive words. I know that you're someone who really understands what something like this is. Even though my project never got far enough, soon enough, to be really appreciated, at least someone will get use out of it. @Sakumi and TheOrder: thanks to you two for your support as well. There are others who supported me, of course. Maybe PP is just not as active as it used to be, heh. I might work on a small feature set for a C4.dll, but since Cypher is doing well patching up exploits I won't do any of that. If I make something, I'll see about releasing it. |
|
|
|
|
#6 |
|
Архивный участник
Join Date: Oct 2005
Posts: 18
|
Thanks mcrabben7, i've been using your project a bit as a guide for myself as well when trying to dig in l2server's code.
But yea the leaked C4 killed many projects heh. Useless? No way, ... heck bet peeps will want C5 features sooner or later :3 |
|
|
|
|
#7 |
|
Архивный участник
Join Date: Jul 2006
Posts: 50
|
i'd like the teleport marriage rings in c4 ^^ hint hint
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Jan 2006
Posts: 363
|
i heard c5 SE is out on 99nets... just wait for the first crack
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Oct 2005
Posts: 330
|
SE stands for ?
|
|
|
|
|
#10 |
|
Архивный участник
Join Date: Nov 2005
Posts: 504
|
kinda sad... 8 replies for this topic... /sigh
|
|
|
|
|
#11 |
|
Архивный участник
Join Date: Apr 2005
Posts: 555
|
That'd be a great addition! I, however, do see how demodivating it would be to have worked so hard and it be nullified by the leaking of newer files. If he chooses to not work on anything in the future I would totaly understand.
Still VERY much props and respect for releasing this. I think you have helped more than you realize. I've kept the files in a safe place for my future reference as well. This beer's for you m8 |
|
|
|
|
#12 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
Well, wouldn't be TOO hard. Make it check for x item in the inventory of the user...then if they have it AND they send a command, "/teleport" for example, you could just change the x, y, and z inside the CSharedData class for that user. But, that might crash since it's a dirty method...probably would have to call a teleport GM command and send them that way.
The only thing you'd have to learn how to do is catch a user / user2 command packet and look for the teleport string. I've seen people add new commands before, just never got that far with it. BTW, here are some useful little files for you developers to learn along side with. See if they help you understand more. Вложения из исходного сообщения (сами файлы в копии отсутствуют): AVE_Hex_Values.txt — 112 байт aie_creature_names.txt — 1122 байт opcodes.zip — 78355 байт 1737 L2Server Functions.rar — 20877 байт |
|
|
|
|
#13 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
Well I am going to share a small little learning addition to this project. You can use this when working on ANY sort of DLL project, but this one is for the L2Server in particular. This style of code I am about to show you can be used on retail C4 DLLs as well, just change the order of the variables. Anyways, here it is.
Class User: Code:
#include "Shared.h"
#include "CSharedData.h"
#ifndef _USER_
#define _USER_
class User
{
public:
//Class Functions
//User();
//CParty * GetParty();
typedef CParty * (__thiscall *USER_GET_PARTY) ();
USER_GET_PARTY GetParty = (USER_GET_PARTY)0x004417E0;
//Not sure if the next 3 functions are __cdecl or __stdcall
//void SendUserInfo(User * pUser, bool GMUserInfo);
typedef void (__stdcall *USER_SEND_USER_INFO) (User * pUser, bool GMUserInfo);
USER_SEND_USER_INFO SendUserInfo = (USER_SEND_USER_INFO)0x004FE0E0;
//void SendCharInfo(User * pUser, bool NPCCharInfo);
typedef void (__stdcall *USER_SEND_CHAR_INFO) (User * pUser, bool NPCCharInfo);
USER_SEND_CHAR_INFO SendCharInfo = (USER_SEND_CHAR_INFO)0x004FEDD0;
//void UseItem(User * pUser, CItem * pItem);
typedef void (__stdcall *USER_USE_ITEM) (User * pUser, CItem * pItem);
USER_USE_ITEM UseItem = (USER_USE_ITEM)0x004EDF70;
//~User();
protected:
//Class Variables
DWORD _unknown[5];
DWORD CHAR_ID; // = 20; //0x14
DWORD OBJECT_ID; // = 24; //0x18
DWORD _unknown2[634];
DWORD INFECTED_SKILLS; // = 2564; //0xA04 //Unconfirmed
DWORD _unknown3[342];
DWORD NPC_INDEX; // = 3936; //0xF60
DWORD _unknown4[268];
CSharedData * SHARED_DATA; // = 5012 //0x1394
DWORD _unknown5[392];
CSocket * USER_SOCKET; // = 6584; //0x19B8
}
#endif // _USER_
Code:
#include "Shared.h"
#ifndef _CSHAREDDATA_
#define _CSHAREDDATA_
class CSharedData
{
public:
//Class Functions
//no functions?
protected:
//Class Variables
DWORD _unknown; // = 0;
DWORD _unknown2; // = 4;
double X_LOC; // = 8; //0x08
double Y_LOC; // = 16; //0x10
double Z_LOC; // = 24; //0x18
DWORD _unknown3[4]; // = 28;
DWORD NPC_INDEX; // = 44; //0x2C
DWORD _unknown4[15]; // = 48
DWORD IS_PLAYER; // = 108; //0x6C
DWORD IS_ALIVE; // = 112; //0x70
DWORD _unknown5[8]; // = 116;
DWORD RACE; // = 148; //0x94
DWORD CLASS_ID; // = 152; //0x98
DWORD _unknown6; // = 156
DWORD NAME; // = 160; //0xA0
DWORD _unknown7[8];
//If needed, we can use this to link to the ExUser for this User
//ExUser can even be made into a class later, as well as the other files.
ExUser * EX_USER; // = 196; //0xC4
DWORD _unknown8[12];
DWORD SP; // = 248; //0x
DWORD _unknown9[17];
DWORD INT; // = 320; //0x140
DWORD STR; // = 324; //0x144
DWORD CON; // = 328; //0x148
DWORD MEN; // = 332; //0x14C
DWORD DEX; // = 336; //0x150
DWORD WIT; // = 340; //0x154
double HP; // = 344; //0x158
DWORD _unknown10; // = 348;
double MP; // = 352; //0x15C
DWORD _unknown11[2]; // = 356;
DWORD MOVE_TYPE; // = 364; //0x (0; // = Walk, 1; // = Run)
DWORD STAND_TYPE; // = 368; //0x (0; // = Sitting, 1; // = Standing, 2; // = PrivateStore)
DWORD _unknown12[3]; // = 372;
DWORD TARGET_INDEX; // = 384; //0x
DWORD TARGET_ID; // = 388; //0x Target's objectID
DWORD _unknown13[5]; // = 392;
DWORD KARMA; // = 412; //0x
DWORD _unknown14[62]; // = 416;
DWORD PLEDGE_ID; // = 664; //0x
DWORD _unknown15; // = 668;
DWORD IS_PLEDGE_MASTER; // = 672; //0x
DWORD _unknown16[18]; // = 676;
DWORD MOUNT; // = 748; //0x (0; // = None, 1; // = Strider, 2; // = Wyvern)
DWORD _unknown17[34]; // = 752;
DWORD LEVEL; // = 888; //0x
DWORD _unknown18[27]; // = 892;
double MAX_HP; // = 1000; //0x
DWORD _unknown19[155]; // = 1004;
DWORD WEIGHT_POINT; // = 1624; //0x
}
#endif // _CSHAREDDATA_
Code:
/*Example usage:
void AutoSS::RefreshAutoSS(User * pUser, WORD itemID)
{
//CCrashLog::AddLog("void AutoSS::RefreshAutoSS(User * pUser, WORD itemID)");
//if the item passed is a valid ID
if( itemID != 0 )
{
if(pUser != NULL)
{
if( !pUser->bPrivateStore && !pUser->bActiveRequest && pUser->bIsAlive )
{
//Find the item in the player's inventory
CItem * pItem = CInventory::FindFirstItemByClassID(pUser->pInventory, itemID);
if(pItem != NULL)
{
//Use the requested item so their SS is charged
User::UseItem(pItem);
}
}
}
}
}
*/
![]() Hope the classes example is helpful to some people. BTW, I didn't compile or test these at all, but they should be ok...assuming you do all the other code changes you'd have to do *laughs* Вложения из исходного сообщения (сами файлы в копии отсутствуют): L2ServerClasses.rar — 2492 байт |
|
|
|
|
#14 |
|
Архивный участник
Join Date: Oct 2005
Posts: 166
|
Nice job man. Just handle with care those "DWORD" pointer-type members and also the __stdcall is quite obsolete (everything is __fastcall anyway).
Cheers |
|
|
|
|
#15 |
|
Архивный участник
Join Date: Sep 2006
Posts: 5
|
I've seen his project grow, and work, and I must admit I have been amazed all the way. Really nice job elay, and no worries it has been more than usefull through your own use of it, and then through the knowledge you acquired and now share with the others!
Good luck with your next projects, take care. |
|
|
|
|
#16 |
|
Архивный участник
Join Date: Feb 2006
Posts: 80
|
nice project mcrabben7
![]() Good luck! |
|
|
|
|
#17 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
Bumping with a L2Server pack with all the hexes already added, as well as the fabled, legendary 'socketfix' DLL that I wasn't going to share before. Really have no way of finding who made it, so apologies to whomever made it but I doubt you care anymore
![]() patch.dll is Tontor's latest patch version. socketfix.dll fixes the dreaded socket leak in C1 modded servers, as well as does hairslots. Anyone is free to disassemble the L2Server.exe, and the socketfix.dll is packed but the right people won't let that stop them. This pack should work out of the box, just add l2server.ini and go. L2EP Server Pack @ FileFront |
|
|
|
|
#18 |
|
Архивный участник
Join Date: Aug 2006
Posts: 30
|
Can you reshare the pack plz?. Thx a lot
Plz... nobody could reshare L2EP Server Pack??? Plz, smd... thx all |
|
|
|
|
#19 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
|
|
|
|
|
#20 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
Attached to the forum as well...
Вложения из исходного сообщения (сами файлы в копии отсутствуют): L2EP_v0.8c_L2ServerPack.rar — 834535 байт |
|
|
|
|
#21 |
|
Архивный участник
Join Date: Feb 2006
Posts: 453
|
not bad... not bad...
past good times.... %) below is my old autoSS recharge func... =) it still have better than even C4PTS autoSS logic =) Code:
CItem* CCreature::FindFirstItemByClassID(int nItemID)
{
if (nItemID==0) return NULL;
return Inventory.FindFirstItemByClassID(nItemID);
}
CItem* CCreature::FindNextItemByClassID(CItem* pPrevItem)
{
if (pPrevItem==NULL) return NULL;
if (pPrevItem->pData==NULL) return NULL;
return Inventory.FindNextItemByClassID(pPrevItem->pData->nInventoryIndex);
}
#define ASS_ON 1
#define ASS_OFF 0
void CCreature::RechargeAutoSS()
{
CItem *pShot;
CItemInfo *pWeaponInfo;
if (pUserSocket == NULL) return;
if (Data->bIsPC == false) return;
//recharge SS
if (bSoulShotOn == false && Data->nAutoSS != 0)
{
pWeaponInfo = GetEquippedWeaponInfo();
pShot = FindFirstItemByClassID(Data->nAutoSS);
if (pWeaponInfo==NULL || pShot==NULL)
{
SP_SM_TEXT(pUserSocket,SM_CANT_USE_SS);
SP_AUTOSS(pUserSocket,Data->nAutoSS,ASS_OFF);
Data->nAutoSS = 0;
}
else if (pWeaponInfo->nGrade != pShot->pInfo->nGrade)
{
SP_SM_TEXT(pUserSocket,SM_SS_NOT_MATCH_WEAPON);
SP_SM_TEXT_ITEM(pUserSocket,SM_USE_S1_CANCELED,Data->nAutoSS);
SP_AUTOSS(pUserSocket,Data->nAutoSS,ASS_OFF);
Data->nAutoSS = 0;
}
else if (pWeaponInfo->nConsumeSS > pShot->pData->nCount)
{
SP_SM_TEXT(pUserSocket,SM_NOT_ENOUGH_SS);
SP_AUTOSS(pUserSocket,Data->nAutoSS,ASS_OFF);
Data->nAutoSS = 0;
}
else
{
UseItemAsCreature(pShot);
}
}
//recharge SpS
if (bSpiritShotOn == false && Data->nAutoSpS != 0)
{
pWeaponInfo = GetEquippedWeaponInfo();
pShot = FindFirstItemByClassID(Data->nAutoSpS);
if (pWeaponInfo==NULL || pShot==NULL)
{
SP_SM_TEXT(pUserSocket,SM_CANT_USE_SPS);
SP_AUTOSS(pUserSocket,Data->nAutoSpS,ASS_OFF);
Data->nAutoSpS = 0;
}
else if (pWeaponInfo->nGrade != pShot->pInfo->nGrade)
{
SP_SM_TEXT(pUserSocket,SM_SS_NOT_MATCH_WEAPON);
SP_SM_TEXT_ITEM(pUserSocket,SM_USE_S1_CANCELED,Data->nAutoSpS);
SP_AUTOSS(pUserSocket,Data->nAutoSpS,ASS_OFF);
Data->nAutoSpS = 0;
}
else if (pWeaponInfo->nConsumeSS > pShot->pData->nCount)
{
SP_SM_TEXT(pUserSocket,SM_NOT_ENOUGH_SPS);
SP_AUTOSS(pUserSocket,Data->nAutoSpS,ASS_OFF);
Data->nAutoSpS = 0;
}
else
{
UseItemAsCreature(pShot);
}
}
}
|
|
|
|
|
#22 |
|
Архивный участник
Join Date: Aug 2006
Posts: 30
|
Nice, Thx a lot man, a LOT
|
|
|
|
|
#23 | |
|
Архивный участник
Join Date: Jun 2006
Posts: 39
|
Quote:
|
|
|
|
|
|
#24 |
|
Архивный участник
Join Date: Nov 2005
Posts: 504
|
|
|
|
|
|
#25 |
|
Архивный участник
Join Date: Oct 2006
Posts: 14
|
he is just a poor guy who wants to learn
|
|
|
|
|