Here is my recently written RequestEvaluate() function. This one is better than any other that have been shared before. I do give props to Torune for sharing a decent one to start with a while ago, but I couldn't use a lot of his so I wrote the entire thing in my style anyways

Plus I added lots of stuff he was missing, like the client messages for giving and receiving recommendations, etc.
GetParameter() grabs the value of something at an address.
GetAddress() just gets an address (a pointer).
Here are their prototypes:
Code:
// Returns a value from an address + a given offset
//
// Parameters:
// DWORD * pData - the address of the data to use
// DWORD byteOffset - how many bytes to offset the address
//
DWORD GetParameter(DWORD * pData, DWORD byteOffset);
Code:
// Returns a pointer to an address + a given offset
//
// Parameters:
// DWORD * pAddress - the address of the data to use
// DWORD byteOffset - how many bytes to offset the address
//
DWORD * GetAddress(DWORD * pAddress, DWORD byteOffset);
GetUser() and GetUserData() get a pointer directly to the start of the CUser struct, and also to the CSharedData struct. One is for users, and one is shared by ALL NPCs in the L2Server.
The parameters like AI_LEVEL and USER_SOCKET are const byte offsets (just numbers) that make it easier to grab variables without always looking at a variable offset chart, and makes the code easier to understand.
Sure, it's possible to make a CUser and CSharedData struct yourself and typecast the ones in the L2Server to yours, but yours will be so incomplete, I found making a struct with 50 unknown variables was pointless, ugly, and bad coding style. Also, why copy an ENTIRE L2Server struct when you only need 1 value? Waste..of...cpu..time
Here is the function I originally said I would share:
Code:
void RequestEvaluate(DWORD * pSocket, DWORD targetID)
{
if(pSocket != NULL)
{
DWORD * pUser = GetUser(pSocket);
if(pUser != NULL)
{
ExUser * tempExUser = GetExUser(pUser);
DWORD * pUserData = GetUserData(pUser);
DWORD objectID = GetParameter(pUser, OBJECT_ID);
DWORD * pTargetUser = CCreature::GetCreature(targetID);
if( GetParameter(pUserData, AI_LEVEL) < 10 )
{
CSocket::Send(pSocket, FORMAT_SYS_MSG, 0x64, 898, 0); //YOU_ARE_NOT_LEVEL_10
}
else if(tempExUser->EvalLeft == 0)
{
CSocket::Send(pSocket, FORMAT_SYS_MSG, 0x64, 833, 0); //YOU_HAVE_NO_RECOMMENDS_LEFT
}
else if(targetID == objectID)
{
CSocket::Send(pSocket, FORMAT_SYS_MSG, 0x64, 829, 0); //YOU_CANT_RECOMMEND_YOURSELF
}
else if(pTargetUser == NULL)
{
CSocket::Send(pSocket, FORMAT_SYS_MSG, 0x64, 144, 0); //TARGET_IS_INCORRECT
}
else
{
DWORD * pTargetSocket = (DWORD *)GetParameter(pTargetUser, USER_SOCKET);
ExUser * targetExUser = GetExUser(pTargetUser);
if(targetExUser->EvalScore == 255)
{
//YOU_CAN_NO_LONGER_RECEIVE_RECOMMENDATIONS
CSocket::Send(pSocket, FORMAT_SYS_MSG, 0x64, 1188, 0);
}
else
{
WCHAR * charName = (WCHAR *)GetAddress(pUserData, AI_NAME);
WCHAR * targetName = (WCHAR *)GetAddress( GetUserData(pTargetUser), AI_NAME);
tempExUser->EvalLeft--;
//YOU_HAVE_RECOMMENDED_S1_AND_HAVE_S2_RECOMMENDS_LEFT
CSocket::Send(pSocket, FORMAT_RECOMMEND2, 0x64, 830, 2, 0, targetName, 1, tempExUser->EvalLeft);
targetExUser->EvalScore++;
//YOU_HAVE_BEEN_RECOMMENDED_BY_S1
CSocket::Send(pTargetSocket, FORMAT_RECOMMEND, 0x64, 831, 1, 0, charName);
//Send new UserInfo to both players so their stats update
SendUserInfo(pUser, 0);
SendCharInfo(pTargetUser, 0);
//TODO: SQL saving
}
}
}
}
}
This sends all messages the client would expect, as well as properly updates your EvalScore and Eval left in the client. That's why UserInfo and CharInfo are sent right after this update, otherwise you would recommend and it would look like nothing happened.
If you use this, please give me credit

Good luck coders of PP :P