Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY! > Extenders
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 08.11.2007, 22:00   #1
Kation
Guest
 
Posts: n/a
Default C5 Glad/Tyrant skills

People say they want to learn, k. Some tips how glad/tyrant c5 skills can be done:

Pointer to current charges (pUser+0xBAC):

Code:

Code:
int *CHARGES = 0;
CHARGES = (int *)GetAddress((DWORD*)pUser, 2988);
Make a hook in assembly and in SendPacket function add to switch(*pBuffer):

Code:

Code:
		//MagicSkillLunched Format: cddddd
	case 0x76:
		{
			int objectID = (int) *GetAddress(pBuffer, 8);
			int skillID = (int) *GetAddress(pBuffer, 16);
			//int skillLVL = (int) *GetAddress(pBuffer, 24);
			//int BadMagic = (int) *GetAddress(pBuffer, 32);
			int targetID = (int) *GetAddress(pBuffer, 40);
			
			ChargeSystem(skillID, objectID);
			break;
		}
example of charge system:

Code:

Code:
void ChargeSystem(int skillID, int objectID)
{
			/*C5Glad/tyrant Charge System:
			TSS : 4 charges
			DSS : 3 charges
			SBlaster/HA: 2 charges
			Blaster : 1 charge
			Sonic/Force-Buster/Storm : 0 charge */
			//Skill to charge Focus/rage Sonic/force 
			if(((skillID==8)||(skillID==345)||(skillID==50)||(skillID==346))&&(ChargeStatus[objectID]<=6))
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]+1; 
			}else
			//Energy Stone (Charges up to 2)
			if((skillID==2165)&&(ChargeStatus[objectID]<2))
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]+1;
			}else
			//TripleSonicSlash : -4 (4 requied- consumes 4?)
			if(skillID==261)
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]-4;
			}else
			//DoubleSonicSlash: -3 (3 requied- consumes 3)
			if(skillID==5)
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]-3;
			}else
			//HurrAsstSonicBlaster: -2 (2 requied - consumes 2?)
			if((skillID==6)||(skillID==284))
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]-2;
			}else
			//Force Blaster: -1 (2 requied - consumes 1?)
			if(skillID==54)
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]-1;
			}else
			//Sonic/Force Buster/Storm: -0 (2 requied - consumes 3 energy stone(Glad))
			if((skillID==9)||(skillID==7)||(skillID==35)||(skillID==17))
			{
				ChargeStatus[objectID]=ChargeStatus[objectID]; //doing nothing
			};
}
If we got own glad/tyrant charge system it's time to overwrite ncsoft system result.

Here we got CSocket::SendV(bla bla bla) hook and void SendPacketV(DWORD *pSocket, DWORD *pBuffer) function ( i wont learn u how to hook), SendV function sends packets directly to player, this mean that the packet which we need to edit (EtcStatusUpdate) will be sent by this function. So, add in switch(*pBuffer):

Code:

Code:
		//EtcStatusUpdate 0xF3 Format: cddddd
		case 0xF3:
		{
			int *status_charges= (int *) GetAddress(pBuffer, 8);
			if (ChargeStatus[pUserInfo->nObjectID]>0)
			if (*status_charges<=ChargeStatus[pUserInfo->nObjectID]) //Edit the packet with new amout of charges
			{
				if (ChargeStatus[pUserInfo->nObjectID]<=7) *CHARGES = ChargeStatus[pUserInfo->nObjectID]; //here we overwrite ncsoft's system result
				else ChargeStatus[pUserInfo->nObjectID]= 0;
				*status_charges = ChargeStatus[pUserInfo->nObjectID];//here we update packet which will be sent to player
			}else ChargeStatus[pUserInfo->nObjectID]=*status_charges;
			break;
		}
p.s

Code:

Code:
hash_map <int, int> ChargeStatus; //ChargeStatus[objectID]=amountOfCharges;
If u use knowledge which u can easily get from other shares, u will get c5 glad/tyrant skills working perfect. Maybe it can be done by just editing asm code, didnt tried i know c++ better than asm so it was easier for me to do that in c++.

Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. В снимке указана только дата, без времени: 9 November 2007. Открыть источник.
 
 


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 17:29.