Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 20.06.2006, 06:12   #1
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default [share]L2Extend source code

final words from me:
due to personal issue, i am out of this community, so good luck on dev/cracking/hacking guys
i will share certain features that directly rip from my dll.
havent decided if i should put complete project out, or maybe some of you can buy my source * *, but at least you guys will get something.
i dont use asm code for most of my features, and i wont give out any struct code, but its not really hard to get your own, just time consuming

RequestChangePartyLeader
Code:
bool __cdecl isInParty(BYTE * pParty, DWORD dwTargetID)
{
	BYTE *pUser;
	int nPartySize, i;
	DWORD dwObjectID;

	PARTY aParty;
	aParty.pFirst = NULL;
	aParty.pLast = NULL;
	MakeParty(pParty, &aParty);
	nPartySize = ((DWORD)aParty.pLast - (DWORD)aParty.pFirst) / 4;

	i = 0;
	while(i < nPartySize)
	{
		pUser = (unsigned char*)(*(unsigned int*)(aParty.pFirst + i * 4));
		dwObjectID = *(unsigned int*)(pUser + 0x18);
		if (dwObjectID == dwTargetID) return true;
		++i;
	}
	return false;
}

void __cdecl AnnounceNewPartyLeader(BYTE * pParty, wchar_t *ptarget_name)
{
	BYTE *pUser, *pSocket;
	int nPartySize, i;

	PARTY aParty;
	aParty.pFirst = NULL;
	aParty.pLast = NULL;
	MakeParty(pParty, &aParty);
	nPartySize = ((DWORD)aParty.pLast - (DWORD)aParty.pFirst) / 4;

	i = 0;
	while(i < nPartySize)
	{
		pUser = (unsigned char*)(*(unsigned int*)(aParty.pFirst + i * 4));
		pSocket = (unsigned char*)(*(unsigned int*)(pUser + 0x19B8));
		Lin2Send(pSocket, "cdddS", 0x7A, 1384, 1, 0, ptarget_name);
		++i;
	}
}

void __cdecl RequestChangePartyLeader(BYTE * pData, BYTE* pUser, BYTE * pSocket)
{
	BYTE *pBuffer, *pParty, *pTargetUser;
	wchar_t *ptarget_name;
	DWORD dwLeaderID, dwObjectID, dwTargetID;

	pBuffer = pData;

	if (pUser!=NULL)
	{
		ptarget_name = (wchar_t*)pBuffer;
		pParty = GetParty(pUser);
		if (pParty == NULL)
		{
			Lin2Send(pSocket, "cd", 0x7A, 1403);
			return;
		}
		dwLeaderID = *(unsigned int*)(*(unsigned int*)(pParty +0x28) + 0x70);
		dwObjectID = *(unsigned int*)(pUser +0x18);

		if (dwObjectID != dwLeaderID)
		{
			Lin2Send(pSocket, "cd", 0x7A, 1399);
			return;
		}
		pTargetUser = wchar2pUser(pBuffer);
		if (pTargetUser == NULL)	return;
		dwTargetID = *(unsigned int*)(pTargetUser +0x18);

		if (dwTargetID == dwObjectID) 
		{
			Lin2Send(pSocket, "cd", 0x7A, 1401);
			return;
		}
		if (isInParty(pParty, dwTargetID))
		{
			*(unsigned int*)(*(unsigned int*)(pParty +0x28) + 0x70) = dwTargetID;
			AnnounceNewPartyLeader(pParty,ptarget_name);
		}
		else
		{
			Lin2Send(pSocket, "cd", 0x7A, 1402);
		}
	}
}
torune is offline  
Old 20.06.2006, 06:15   #2
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

void RequestEvaluate()
Code:
void RequestEvaluate(BYTE *pData, BYTE *pUser, BYTE *pSocket)
{
	DWORD dwTarget, dwLevel;
	BYTE *pBuffer;
	BYTE *pUserTarget, *pSocketTarget;
	
	LPTSHAREDDATA TSharedData, TargetSharedData;

	if(pUser == NULL) return;
		
	TSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUser + 0xF54));
	dwLevel = TSharedData->LEVEL;
	pBuffer = pData;
	dwTarget = *(unsigned int*)pBuffer;
	pBuffer += sizeof(unsigned int);
	pUserTarget = GetCreature(dwTarget);
	
	if(dwLevel < 10)
	{
		Lin2Send(pSocket, "cd", 0x7A, 898);
	}
	else if(TSharedData->RecomLeft <= 0)
	{
		Lin2Send(pSocket, "cd", 0x7A, 833);
	}
	else if(pUserTarget == pUser)
	{
		Lin2Send(pSocket, "cd", 0x7A, 829);
	}
	else if(pUserTarget == NULL)
	{
		Lin2Send(pSocket, "cd", 0x7A, 144);
	}
	else
	{
		
		pSocketTarget = (unsigned char*)(*(unsigned int*)(pUserTarget + 0x19B8));
		TargetSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUserTarget + 0xF54));

		if(TargetSharedData->RecomHave >= 255)
		{
			Lin2Send(pSocketTarget, "cd", 0x7A, 1188);
		}
		else
		{
			TSharedData->RecomLeft--;
			TargetSharedData->RecomHave++;	
			
			CDBSend(0x1720CB90, "cdddddd", 0xe7, *(unsigned int*)(pUser + 0x18), *(unsigned int*)(pUser + 0x14), TSharedData->RecomLeft, *(unsigned int*)(pUserTarget + 0x18), *(unsigned int*)(pUserTarget + 0x14), TargetSharedData->RecomHave);
		}
	}
}
torune is offline  
Old 20.06.2006, 06:16   #3
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

void RequestUserCommand()
Code:
void __cdecl ShowLocPacket(BYTE* pUser,BYTE * pSocket)
{
	LPTSHAREDDATA TSharedData;
	int tileX,tileY;
	int nRegion,nLocaltion;
	int x,y,z;

	TSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUser + 0xF54));
	x = (int)TSharedData->x;
	y = (int)TSharedData->y;
	z = (int)TSharedData->z;
	tileX = (( x >> 15 ) + 4 )& 0x1F;
	tileY = (( y >> 15 ) + 10)& 0x1F;
	nRegion = _regions[tileY][tileX];
	if (nRegion > 15)	nLocaltion = 924;
	else	nLocaltion = _LOC_MSG[nRegion];

	Lin2Send(pSocket, "cdddddddd", 0x7A, nLocaltion, 3, 1, x, 1, y, 1, z);
}

void __cdecl ShowTimePacket(BYTE* pUser,BYTE * pSocket)
{
	SYSTEMTIME st;
	GetLocalTime(&st);
	if (st.wHour<12)
	{
		Lin2Send(pSocket, "cdddddd", 0x7A, 927, 2, 1, st.wHour, 1, st.wMinute);
	}
	else
		Lin2Send(pSocket, "cdddddd", 0x7A, 928, 2, 1, st.wHour, 1, st.wMinute);
}

void __cdecl ShowPartyInfoPacket(BYTE* pUser,BYTE * pSocket)
{
	BYTE *pParty;
	DWORD dwLoot;
	pParty = GetParty(pUser);
	if (pParty == NULL)		return;
	dwLoot = *(unsigned int*)(pParty +0x44);
	Lin2Send(pSocket, "cd", 0x7A, 1030);
	switch (dwLoot) {
		case 0:	Lin2Send(pSocket, "cd", 0x7A, 1031);	break;
    	case 1:	Lin2Send(pSocket, "cd", 0x7A, 1032);    break;
    	case 2:	Lin2Send(pSocket, "cd", 0x7A, 1033);    break;
    	case 3:	Lin2Send(pSocket, "cd", 0x7A, 1034);    break;
    	case 4:	Lin2Send(pSocket, "cd", 0x7A, 1035);    break;
	}
}

void __cdecl RequestUserCommand(BYTE * pData, BYTE* pUser, BYTE * pSocket)
{
	DWORD dwCommand;
	BYTE* pBuffer;
	pBuffer = pData;
	if (pUser!=NULL)
	{
		dwCommand = *(unsigned int*)pBuffer;
		switch(dwCommand)
		{
			case 0:		ShowLocPacket(pUser,pSocket); break;
			case 77:	ShowTimePacket(pUser,pSocket); break;
			case 81:	ShowPartyInfoPacket(pUser,pSocket); break;
		}
	}
}
torune is offline  
Old 20.06.2006, 06:19   #4
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

void partysmallwindow()

Code:
void __declspec(naked) PartySmallWindowAll() 
{
	__asm{
		mov eax, 0058C3ACh;
		call eax;
		FLD QWORD PTR DS:[ESI+160h];
		push eax;						//MaxMp
		mov eax, 0058C3ACh;
		call eax;
		FLD QWORD PTR DS:[ESI+3E8h];
		push eax;						//CurrentMp
		mov eax, 0058C3ACh;
		call eax;
		FLD QWORD PTR DS:[ESI+158h];
		push eax;						//MaxHp		
		mov eax, 0058C3ACh;
		call eax;
		push eax;						//CurrentHp
		push [esi]TSHAREDDATA.MaxCp;
		push [esi]TSHAREDDATA.CurrentCp;
		ADD ESI,0A0h;
		PUSH ESI;
		PUSH EDI;
		MOV EAX,2000h;
		PUSH sFormat_5;						//dSdddddddddd
		SUB EAX,EBX;
		PUSH EAX;
		LEA ECX,DWORD PTR SS:[EBP+EBX-2030h];
		PUSH ECX;
		mov eax, 0053AFA0h;
		CALL eax;
		ADD ESP,3Ch;
		mov edx, 004B5562h
		jmp edx;
	}
}

void __declspec(naked) PartySmallWindowAllLeaderPatch() 
{
	__asm{
		MOV EDX,DWORD PTR SS:[EBP-14h];
		LEA ECX,DWORD PTR SS:[EBP-2030h];
		PUSH ECX;
		PUSH EBX;
		PUSH EDX;
		
		mov eax, DWORD PTR SS:[EBP+8];
		mov ecx, eax;
		CALL fGetParty;		
		push [eax+44h];		//loot type
		mov eax, [eax+28h];
		push [eax+70h];		//leader object id

		push 63h;
		PUSH sFormat_4;
		MOV ECX,DWORD PTR SS:[EBP+8];
		MOV EAX,DWORD PTR DS:[ECX+19B8h];
		mov edx, 004B5592h;
		jmp edx;
	}
}
void __declspec(naked) PartySmallWindowUpdate() 
{
	__asm{
		MOV ECX,DWORD PTR SS:[EBP-24h];
		MOV EDX,DWORD PTR SS:[EBP-28h];
		MOV ESI,DWORD PTR SS:[EBP-2Ch];
		MOV EAX,DWORD PTR DS:[EDI+19B8h];

		push ecx;							//ClassId
		PUSH EDX;							//level
		MOV ECX,DWORD PTR SS:[EBP-18h];
		MOV EDX,DWORD PTR SS:[EBP-1Ch];
		PUSH ECX;							//MaxMp
		PUSH EDX;							//CurrentMp
		MOV ECX,DWORD PTR SS:[EBP-14h];
		MOV EDX,DWORD PTR SS:[EBP-30h];
		PUSH ECX;							//MaxHp
		PUSH ESI;							//CurrentHp

		mov esi, [EBP+8];
		mov esi, [esi+0f54h];
		push [esi]TSHAREDDATA.MaxCp;
		push [esi]TSHAREDDATA.CurrentCp;

		PUSH EDX;
		PUSH EBX;
		push 67h;
								 
		PUSH sFormat_6;						//cdSdddddddd
		push eax;
		CALL fSendToSinglePlayer;
		MOV EAX, DWORD PTR SS:[EBP+0Ch];
		ADD ESP, 34h;
		mov edx, 004B5267h;
		jmp edx;
	}
}

void __declspec(naked) PartySmallWindowAdd() 
{
	__asm{

		PUSH ECX;							//CurrentMp
		MOV EDX,DWORD PTR SS:[EBP-24h];
		MOV ECX,DWORD PTR SS:[EBP-28h];
		PUSH EDX;							//MaxHp
		PUSH ECX;							//CurrentMp
		MOV EDX,DWORD PTR SS:[EBP-2Ch];
		MOV ECX,DWORD PTR SS:[EBP-30h];
		push edx;


		mov edx, [EBP+8];
		mov edx, [edx+0f54h];
		push [edx]TSHAREDDATA.MaxCp;
		push [edx]TSHAREDDATA.CurrentCp;

		push ecx;
		push ebx;
		PUSH 0;
		push 0;
		push 64h;

		PUSH sFormat_7;				//cdddSdddddddddd
		push eax;
		call fSendToSinglePlayer;
		add esp, 44h;
		mov edx, 004B540dh;
		jmp edx;
	}
}
torune is offline  
Old 20.06.2006, 06:26   #5
Saito
Архивный участник
 
Join Date: May 2006
Posts: 39
Default

too bad that you're leaving and thank you soo much for all the efford you have put in the community.

I hope you can resolve your personal issues and come back here
Saito is offline  
Old 20.06.2006, 06:31   #6
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

there is no coming back like last time
torune is offline  
Old 20.06.2006, 06:35   #7
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

btw
livid and stazis if you want my source code, send a message thru icq.
torune is offline  
Old 20.06.2006, 09:25   #8
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

Too bad to see you go Torune. But, good luck in your real life.
mcrabben7 is offline  
Old 20.06.2006, 09:28   #9
tpuNIsher
Архивный участник
 
Join Date: Mar 2006
Posts: 685
Default

I hope this isn't the last we see you here because that would be a great loss to the community. Ah well, hope you come back...
Thanks for these shares, and for the future ones if you do make, what you said you are thinking about..

Respect to you, as a dev. Dunno as a person, but best of luck with whatever you do.

Thank you.


Yours..
-NeosinneR.
tpuNIsher is offline  
Old 20.06.2006, 09:36   #10
TheOrder
Архивный участник
 
Join Date: Sep 2005
Posts: 731
Default

Good luck bro , even if I don't know you very well and all you a great guy and the best dev on this community !!!

Btw bro enter MSN for the last time i need to have a chat with u . Tnx !!! And GL in RL
TheOrder is offline  
Old 20.06.2006, 10:44   #11
montejo1974
Архивный участник
 
Join Date: Aug 2005
Posts: 42
Default

Same as said before

The community lost one of their more important researchers (I prefer that english word than just developer). The community will not be the same without you.

Be lucky.
montejo1974 is offline  
Old 20.06.2006, 11:07   #12
RipperX
Архивный участник
 
Join Date: Dec 2005
Posts: 242
Default

I didn't expect this.. but good luck dude!
btw, if u can give me some help with recipebook i'll be grated ^^

bb and gluck
RipperX is offline  
Old 20.06.2006, 11:38   #13
Aikeleer
Архивный участник
 
Join Date: Jun 2005
Posts: 374
Default

U gonna play WoW now? :P
Aikeleer is offline  
Old 20.06.2006, 11:46   #14
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

i gotta play a good good study student role now.
torune is offline  
Old 20.06.2006, 11:47   #15
torune
Архивный участник
 
Join Date: Jul 2005
Posts: 371
Default

and please, noobs, stop spamming my pm begging for source code.
if you wanna play l33t, try to learn more.
torune is offline  
Old 20.06.2006, 12:02   #16
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Quote:
Originally Posted by torune
and please, noobs, stop spamming my pm begging for source code.
if you wanna play l33t, try to learn more.
Ideas.. Why everyone give the work, only when leave?

Ideas second. Maybe you can share your last good l2extend? Or this not exist? Or it commercial release? I think, that this l2extend has lost a urgency with arrival new l2extender.
HF is offline  
Old 20.06.2006, 12:05   #17
RipperX
Архивный участник
 
Join Date: Dec 2005
Posts: 242
Default

HF, if torune don't want share everything he don't do that, is his source, his property, i guess.
RipperX is offline  
Old 20.06.2006, 12:13   #18
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

well...
maybe you're gonna join my arts community.
i don't even have one atm, but hey you never know what you end up with in life :P
toolpunk is offline  
Old 20.06.2006, 12:19   #19
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Quote:
Originally Posted by toolpunk
...
you never know what you end up with in life :P
your signature image confirms it
HF is offline  
Old 20.06.2006, 12:29   #20
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

yeah, cookies ftw
toolpunk is offline  
Old 20.06.2006, 13:02   #21
smeli
Архивный участник
 
Join Date: Apr 2006
Posts: 181
Default

>....just time consuming

yeah yeah
every man must invent the bicycle on his own, right?
smeli is offline  
Old 20.06.2006, 15:16   #22
Aikeleer
Архивный участник
 
Join Date: Jun 2005
Posts: 374
Default

It's pretty pathetic that people that don't even realise the value of his share start being greedy. I can see why people don't want to share anything on this forum. Shame on you.
Aikeleer is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 21:26.