[CODE] Addition to full character slot

#1
HelShot20180406_201407_000.jpg


Client Game.h (Find):

Code: Select all

class CGame
{
public:

Add below:

Code: Select all

void UpdateScreen_OnFullCharacterSlot(); // sleeq - addition to full character slot

Client Game.h (Find):

Code: Select all

#define DEF_GAMEMODE_ONCREATENEWACCOUNT		20

Add below:

Code: Select all

#define DEF_GAMEMODE_CHARACTERSLOTFULL		21 // sleeq - addition to full character slot

Client Game.cpp (Find):

Code: Select all

case 6:
			if (m_iTotalChar < 4)
			{	_InitOnCreateNewCharacter();
				ChangeGameMode(DEF_GAMEMODE_ONCREATENEWCHARACTER);
				delete pMI;
				return;
			}
			break;

Replace with this:

Code: Select all

case 6: // sleeq - addition to full character slot
			if (m_iTotalChar < 4) {
				_InitOnCreateNewCharacter();
				ChangeGameMode(DEF_GAMEMODE_ONCREATENEWCHARACTER);
			} else ChangeGameMode(DEF_GAMEMODE_CHARACTERSLOTFULL);
			delete pMI;
			break;

Client Game.cpp (Find):

Code: Select all

case DEF_GAMEMODE_ONCHANGEPASSWORD:
		UpdateScreen_OnChangePassword();
		break;

Add below:

Code: Select all

case DEF_GAMEMODE_CHARACTERSLOTFULL: // sleeq - addition to full character slot
		UpdateScreen_OnFullCharacterSlot();
		break;

Client Game.cpp (Add this function):

Code: Select all

void CGame::UpdateScreen_OnFullCharacterSlot() // sleeq - addition to full character slot
{
 short msX, msY, msZ;
 char cLB, cRB;
 char cMIresult;
 int  iMIbuttonNum;

 static class CMouseInterface * pMI;
 static DWORD dwCTime;
 DWORD dwTime = timeGetTime();

	if (m_cGameModeCount == 0) {
		pMI = new class CMouseInterface;
		pMI->AddRect(370, 240, 370 + DEF_BTNSZX, 240 + DEF_BTNSZY);
		m_bEnterPressed = FALSE;
		m_cArrowPressed = 0;
		dwCTime = timeGetTime();
		PlaySound('E', 25, 0);
	}

	m_cGameModeCount++;
	if (m_cGameModeCount > 100) m_cGameModeCount = 100;

	if (m_bEscPressed == TRUE || m_bEnterPressed) {
		ChangeGameMode(DEF_GAMEMODE_ONSELECTCHARACTER);
		delete pMI;
		m_bEscPressed = FALSE;
		m_bEnterPressed = FALSE;
		return;
	}

	m_DInput.UpdateMouseState(&msX, &msY, &msZ, &cLB, &cRB);
	UpdateScreen_OnSelectCharacter(0, 0, 500, 70);
	if ((m_cGameModeCount >= 0) && (m_cGameModeCount < 6))
	{	m_DDraw.DrawShadowBox(0,0,639,479);
	}else if (m_cGameModeCount >= 6)
	{	m_DDraw.DrawShadowBox(0,0,639,479);
		m_DDraw.DrawShadowBox(0,0,639,479);
	}

	m_DDraw.DrawShadowBox(0,0,639,479);

	DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_GAME4, 162,125,2);

	PutString_SprFont(186 + 57, 165, "Character slot is full!", 7,0,0);
	PutAlignedString(190, 453, 195, "Cannot create new character because the slot");
	PutAlignedString(190, 453, 210, "is already full. Please delete one character to proceed.");

	if ((msX >= 370) && (msX <= 370 + DEF_BTNSZX) && (msY >= 244) && (msY <= 244 + DEF_BTNSZY))
		 DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_BUTTON, 370, 244, 1);
	else DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_BUTTON, 370, 244, 0);

	if ((dwTime - dwCTime) > 100)
	{	m_cMenuFrame++;
		dwCTime = dwTime;
	}
	if (m_cMenuFrame >= 8)
	{	m_cMenuDirCnt++;
		if (m_cMenuDirCnt > 8)
		{	m_cMenuDir++;
			m_cMenuDirCnt = 1;
		}
		m_cMenuFrame = 0;
	}
	if (m_cMenuDir > 8) m_cMenuDir = 1;

	iMIbuttonNum = pMI->iGetStatus(msX, msY, cLB, &cMIresult);
	if (cMIresult == DEF_MIRESULT_CLICK)
	{	PlaySound('E', 14, 5);
		switch (iMIbuttonNum) {
		case 1:
			ChangeGameMode(DEF_GAMEMODE_ONSELECTCHARACTER);
			delete pMI;
			break;
	}	}

	DrawVersion();
	m_pSprite[DEF_SPRID_MOUSECURSOR]->PutSpriteFast(msX, msY, 0, dwTime);
	if (m_DDraw.iFlip() == DDERR_SURFACELOST) RestoreSprites();
}
You do not have the required permissions to view the files attached to this post.
https://www.youtube.com/channel/UCre_Jw ... -k6CHUsWAw
More videos: http://fb.com/helbreath/videos/
My github: https://github.com/sleeqeels/Helbreath-800x600

Who is online

Users browsing this forum: No registered users and 1 guest

cron