示例#1
0
void CCrywolf::GiveRewardExp(int iUserIndex, int iRewardExp)
{
	if ( !gObjIsConnected(iUserIndex))
		return;

	if ( iRewardExp <= -1 )
		return;

	int iRET_EXP = 0;
	int iCAL_EXP = iRewardExp;
	int iMAX_LEVCOUNT = 0;

	if ( !gObjIsConnected(iUserIndex))
		return;

	iRET_EXP = iCAL_EXP;

	if ( gObj[iUserIndex].Type == OBJ_USER )
	{
		while ( iCAL_EXP > 0 )
		{
			if ( iCAL_EXP > 0 )
			{
				iCAL_EXP = UTIL.CrywolfMVPLevelUp(iUserIndex, iCAL_EXP);
			}

			iMAX_LEVCOUNT++;

			if ( iMAX_LEVCOUNT > 5 )
			{
				LogAdd("[ Crywolf ][GiveRewardExp] LevelUp Error [%s][%s]",
					gObj[iUserIndex].AccountID, gObj[iUserIndex].Name);

				break;
			}
		}

		PMSG_KILLPLAYER_EXT pMsg;

		PHeadSetBE((LPBYTE)&pMsg, 0x9C, sizeof(pMsg));
		pMsg.NumberH = -1;
		pMsg.NumberL = -1;
		pMsg.ExpH = SET_NUMBERHW(iRewardExp);
		pMsg.ExpL = SET_NUMBERLW(iRewardExp);
		pMsg.DamageH = 0;
		pMsg.DamageL = 0;

		DataSend(iUserIndex, (LPBYTE)&pMsg, pMsg.h.size);
	}
}
示例#2
0
void CCrywolf::GiveRewardExp(int iUserIndex, int iRewardExp)
{
	if ( !gObjIsConnected(iUserIndex))
		return;

	if ( iRewardExp <= -1 )
		return;

	int iRET_EXP = 0;
	int iCAL_EXP = iRewardExp;
	int iMAX_LEVCOUNT = 0;

	if ( !gObjIsConnected(iUserIndex))
		return;

	iRET_EXP = iCAL_EXP;

	if ( gObj[iUserIndex].Type == OBJ_USER )
	{
		while ( iCAL_EXP > 0 )
		{
			if ( iCAL_EXP > 0 )
			{
				iCAL_EXP = UTIL.CrywolfMVPLevelUp(iUserIndex, iCAL_EXP);
			}

			iMAX_LEVCOUNT++;

			if ( iMAX_LEVCOUNT > 5 )
			{
				LogAddTD("[ Crywolf ][GiveRewardExp] LevelUp Error [%s][%s]",
					gObj[iUserIndex].AccountID, gObj[iUserIndex].Name);

				break;
			}
		}

		if( g_MasterExp.IsEnabled(&gObj[iUserIndex]) == FALSE )
		{
			GCSendExp(iUserIndex,(WORD)-1,iRewardExp,0,0);
		}
	}
}