After this codes:
Code: Select all
// Portal Confirm Dialog
m_stDialogBoxInfo[42].sX = 193;
m_stDialogBoxInfo[42].sY = 271;
m_stDialogBoxInfo[42].sSizeX = 263;
m_stDialogBoxInfo[42].sSizeY = 100;
Code: Select all
// Mail Inbox Dialog
m_stDialogBoxInfo[43].sX = 350;
m_stDialogBoxInfo[43].sY = 55;
m_stDialogBoxInfo[43].sSizeX = 257;
m_stDialogBoxInfo[43].sSizeY = 339;
// Send Mail Dialog
m_stDialogBoxInfo[44].sX = 35;
m_stDialogBoxInfo[44].sY = 55;
m_stDialogBoxInfo[44].sSizeX = 257;
m_stDialogBoxInfo[44].sSizeY = 339;
// View Mail Dialog
m_stDialogBoxInfo[45].sX = 35;
m_stDialogBoxInfo[45].sY = 55;
m_stDialogBoxInfo[45].sSizeX = 257;
m_stDialogBoxInfo[45].sSizeY = 339;
After the hole codes of this case :
Code: Select all
case DEF_DYNAMICOBJECT_MINERAL7:
Code: Select all
case DEF_DYNAMICOBJECT_ARESDENMAILBOX:
m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->PutShadowSprite(ix, iy, 7, dwTime);
m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->PutSpriteFast(ix, iy, 7, dwTime);
if ((m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.top != -1) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.top < msY) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.bottom > msY) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.left < msX) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.right > msX)) {
m_sMCX = indexX;
m_sMCY = indexY;
iFocusStatus = NULL;
ZeroMemory(cFocusName, sizeof(cFocusName));
ZeroMemory(m_cMCName, sizeof(m_cMCName));
if ((cRB != 0) &&
(m_bIsDialogEnabled[43] == FALSE)) {
EnableDialogBox(43, NULL, NULL, NULL);
PlaySound('E', 14, 5);
bSendCommand(MSGID_COMMAND_COMMON, DEF_COMMONTYPE_REQUEST_MAILLIST, NULL, NULL, NULL, NULL, NULL);
}
}
break;
case DEF_DYNAMICOBJECT_ELVINEMAILBOX:
m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->PutShadowSprite(ix, iy, 8, dwTime);
m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->PutSpriteFast(ix, iy, 8, dwTime);
if ((m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.top != -1) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.top < msY) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.bottom > msY) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.left < msX) &&
(m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->m_rcBound.right > msX)) {
m_sMCX = indexX;
m_sMCY = indexY;
iFocusStatus = NULL;
ZeroMemory(cFocusName, sizeof(cFocusName));
ZeroMemory(m_cMCName, sizeof(m_cMCName));
if (cRB != 0) {
EnableDialogBox(43, NULL, NULL, NULL);
PlaySound('E', 14, 5);
}
}
break;
After this Pakfile:
[CODE]m_hPakFile = CreateFile("sprites\\interface.pak", GENERIC_READ, NULL, NULL, OPEN_EXISTING, NULL, NULL);
Code: Select all
m_hPakFile = CreateFile("sprites\\MailDialog.pak", GENERIC_READ, NULL, NULL, OPEN_EXISTING, NULL, NULL);
if (m_hPakFile != INVALID_HANDLE_VALUE) {
m_pSprite[DEF_SPRID_INTERFACE_MAIL1] = new class CSprite(m_hPakFile, &m_DDraw, "MailDialog", 0, FALSE);
m_pSprite[DEF_SPRID_INTERFACE_MAIL2] = new class CSprite(m_hPakFile, &m_DDraw, "MailDialog", 1, FALSE);
m_pSprite[DEF_SPRID_INTERFACE_MAIL3] = new class CSprite(m_hPakFile, &m_DDraw, "MailDialog", 2, FALSE);
CloseHandle(m_hPakFile);
}
Code: Select all
case 42:
DlgBoxClick_PortalConfirm(msX, msY);
break;
Code: Select all
case 43:
DlgBoxClick_MailInbox(msX, msY);
break;
case 44:
DlgBoxClick_SendMail(msX, msY);
break;
case 45:
DlgBoxClick_ViewMail(msX, msY);
break;
}
return TRUE;
}
}
}
return FALSE;
}
void CGame::ClearContents_OnCreateNewAccount() {
Add this:
Code: Select all
void CGame::ClearContents_SendMail() {
ZeroMemory(m_cSendMailTo, sizeof(m_cSendMailTo));
ZeroMemory(m_cSendMailSubject, sizeof(m_cSendMailSubject));
ZeroMemory(m_cSendMailBody, sizeof(m_cSendMailBody));
}
After this:
Code: Select all
case 42:
DrawDialogBox_PortalConfirm(msX, msY);
break;
Code: Select all
case 43:
DrawDialogBox_MailInbox(msX, msY);
break;
case 44:
DrawDialogBox_SendMail(msX, msY);
break;
case 45:
DrawDialogBox_ViewMail(msX, msY);
break;
}
}
}
After this code:
Code: Select all
case 39:
if (m_bIsDialogEnabled[iBoxID] == FALSE) {
m_stDialogBoxInfo[iBoxID].cMode = 0;
}
break;
Code: Select all
case 41:
case 43: // Mail Inbox
case 44: // Send Mail
if (m_bIsDialogEnabled[iBoxID] == FALSE) {
m_stDialogBoxInfo[iBoxID].cMode = 0;
m_stDialogBoxInfo[iBoxID].sView = 0;
m_stDialogBoxInfo[iBoxID].sV1 = 0;
}
break;
case 45: // View Mail
if (m_bIsDialogEnabled[iBoxID] == FALSE) {
m_stDialogBoxInfo[iBoxID].cMode = 0;
m_stDialogBoxInfo[iBoxID].sView = 0;
m_stDialogBoxInfo[iBoxID].sV1 = sV1;
m_stDialogBoxInfo[iBoxID].sV2 = 0;
}
break;
Code: Select all
void CGame::ShowReceivedString(BOOL bIsHide) {
Code: Select all
void CGame::ShowReceivedMailString() {
ZeroMemory(G_cTxt, sizeof(G_cTxt));
strcpy(G_cTxt, m_pMailInputBuffer);
if (strlen(m_pMailInputBuffer) <= m_cInputMaxLen) {
strcpy(G_cTxt, m_pMailInputBuffer);
}
if ((G_dwGlobalTime % 400) < 210) G_cTxt[strlen(G_cTxt)] = '_';
PutString(m_iMailInputX + 1, m_iMailInputY + 1, G_cTxt, RGB(0, 0, 0));
PutString(m_iMailInputX, m_iMailInputY + 1, G_cTxt, RGB(0, 0, 0));
PutString(m_iMailInputX + 1, m_iMailInputY, G_cTxt, RGB(0, 0, 0));
PutString(m_iMailInputX, m_iMailInputY, G_cTxt, RGB(255, 255, 255));
}
After this void codes:
Code: Select all
void CGame::ClearInputString() {
Code: Select all
void CGame::StartMailInputString(int sX, int sY, unsigned char iLen, char *pBuffer, BOOL bIsHide) {
m_bMailInputStatus = TRUE;
m_iMailInputX = sX;
m_iMailInputY = sY;
m_pMailInputBuffer = pBuffer;
ZeroMemory(m_pMailInputBuffer, sizeof(m_pMailInputBuffer));
m_cMailInputMaxLen = iLen;
}
After this void add :
Code: Select all
void CGame::EndInputString() {
Code: Select all
void CGame::EndMailInputString() {
m_bMailInputStatus = FALSE;
}
After this code:
Code: Select all
if (m_bIsCombatMode) {
Add this:
Code: Select all
if (m_bUnreadMail == TRUE) {
if ((G_dwGlobalTime % 400) < 270) {
m_pSprite[DEF_SPRID_ITEMDYNAMIC_PIVOTPOINT + 1]->PutSpriteFast((640 / 2) - 5, 5, 9, dwTime);
}
Code: Select all
wp = (WORD *)(pData + DEF_INDEX2_MSGTYPE);
Code: Select all
case DEF_NOTIFY_MAILLIST:
AddEventList("Viewing mail inbox...", 10);
if (m_stDialogBoxInfo[43].sV1 == 0) {
for (i = 0; i < 7; i++) {
if (m_pMailList[i] != NULL) {
try {
delete m_pMailList[i];
} catch (...) { }
m_pMailList[i] = NULL;
}
}
}
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
ip = (int *)cp;
m_stDialogBoxInfo[43].sV1 = (short)*ip; // Mail count
cp += 4;
if (m_stDialogBoxInfo[43].sV1 == 0) {
AddEventList("You have no mail in your inbox!", 10);
m_bUnreadMail = FALSE;
return;
}
After this:
Code: Select all
if (m_stDialogBoxInfo[43].sV1 == 0) {
Code: Select all
// Mail limitation (just for now).
for (i = 0; ((i < m_stDialogBoxInfo[43].sV1) && (i < 7)); i++) {
m_pMailList[i] = new CMail();
ip = (int *)cp;
m_pMailList[i]->m_iMailId = (int)*ip;
cp += 4;
memcpy(m_pMailList[i]->m_cFrom, cp, 10);
cp += 10;
memcpy(m_pMailList[i]->m_cSubject, cp, DEF_MAXMAILSUBJECTSIZE);
cp += DEF_MAXMAILSUBJECTSIZE;
m_pMailList[i]->m_bIsRead = (BOOL)*cp;
cp++;
}
break;
case DEF_NOTIFY_MAILBODY:
case DEF_NOTIFY_SENDMAIL_SUCCESS:
break;
case DEF_NOTIFY_SENDMAIL_FAILED:
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
break;
case DEF_NOTIFY_UNREADMAIL:
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
if (*cp != 0) {
if (m_bUnreadMail == FALSE) {
AddEventList("You have unread mail!", 10);
}
m_bUnreadMail = TRUE;
} else {
m_bUnreadMail = FALSE;
}
cp++;
break;
After this:
Code: Select all
if (((m_bIsDialogEnabled[7] == TRUE) && (m_stDialogBoxInfo[7].cMode == 1)) ||
Code: Select all
if (iUpdateRet != 0) {
if (m_bMailInputStatus) {
ShowReceivedMailString();
}
}
void CGame::DlgBoxClick_PortalConfirm(short msX, short msY) {
Add all of this voids:
Code: Select all
void CGame::DrawDialogBox_MailInbox(short msX, short msY) {
register int i, j;
short sX, sY;
DWORD dwTime;
sX = m_stDialogBoxInfo[43].sX;
sY = m_stDialogBoxInfo[43].sY;
dwTime = timeGetTime();
DrawNewDialogBox(DEF_SPRID_INTERFACE_MAIL1, sX, sY, 0);
if ((msX >= sX + 99) && (msX <= sX + 170) && (msY >= sY + 300) && (msY <= sY + 315)) {
PutString_SprFont(sX + 99, sY + 300, "Send Mail", 16, 16, 30);
} else {
PutString_SprFont(sX + 99, sY + 300, "Send Mail", 6, 6, 20);
}
j = 0;
if (m_stDialogBoxInfo[43].sV1 != 0) {
for (i = 0; i < 7; i++) {
if (m_pMailList[i] != NULL) {
if ((msX >= (sX + 16)) && (msX <= (sX + 240)) && (msY >= (sY + 33 + (j * 38))) && (msY <= (sY + 70 + (j * 38)))) {
m_DDraw.DrawShadowBox(sX + 16, sY + 33 + (j * 38), sX + 240, sY + 70 + (j * 38));
}
if (m_pMailList[i]->m_bIsRead == TRUE) {
m_pSprite[DEF_SPRID_INTERFACE_MAIL1]->PutSpriteFastNoColorKey(sX + 24, sY + 37 + (j * 38), 2, dwTime);
} else {
m_pSprite[DEF_SPRID_INTERFACE_MAIL1]->PutSpriteFastNoColorKey(sX + 24, sY + 37 + (j * 38), 1, dwTime);
}
PutString(sX + 62, sY + 40 + (j * 38), m_pMailList[i]->m_cSubject, RGB(255, 255, 255), FALSE, 1);
PutString(sX + 195, sY + 47 + (j * 38), "X days", RGB(150, 150, 150), FALSE, 1);
ZeroMemory(G_cTxt, sizeof(G_cTxt));
wsprintf(G_cTxt, "From: %s", m_pMailList[i]->m_cFrom);
PutString(sX + 62, sY + 52 + (j * 38), G_cTxt, RGB(150, 150, 150), FALSE, 1);
j++;
}
}
}
}
void CGame::DrawDialogBox_SendMail(short msX, short msY) {
short sX, sY;
sX = m_stDialogBoxInfo[44].sX;
sY = m_stDialogBoxInfo[44].sY;
PutString2(sX + 10, sY + 10, m_cSendMailTo, 255, 255, 255);
PutString2(sX + 10, sY + 40, m_cSendMailSubject, 255, 255, 255);
DrawNewDialogBox(DEF_SPRID_INTERFACE_MAIL2, sX, sY, 0);
}
void CGame::DlgBoxClick_SendMail(short msX, short msY) {
short sX, sY;
sX = m_stDialogBoxInfo[44].sX;
sY = m_stDialogBoxInfo[44].sY;
}
void CGame::DrawDialogBox_ViewMail(short msX, short msY) {
// You need to select a valid mail in the inbox first.
if (m_stDialogBoxInfo[45].sV1 == 0) return;
register int i;
short sX, sY;
i = m_stDialogBoxInfo[45].sV1 - 1;
sX = m_stDialogBoxInfo[45].sX;
sY = m_stDialogBoxInfo[45].sY;
DrawNewDialogBox(DEF_SPRID_INTERFACE_MAIL3, sX, sY, 0);
// The mail that was selected must exist.
if (m_pMailList[i] != NULL) {
PutString(sX + 78, sY + 44, m_pMailList[i]->m_cFrom, RGB(255, 255, 255), FALSE, 1);
PutString(sX + 78, sY + 60, m_pMailList[i]->m_cSubject, RGB(255, 255, 255), FALSE, 1);
// Only print the body if it has been received.
if (m_stDialogBoxInfo[45].sV2 > 0) {
// 30, 87 body
}
}
}
void CGame::DlgBoxClick_ViewMail(short msX, short msY) {
if (m_stDialogBoxInfo[45].sV1 == 0) return;
short sX, sY;
sX = m_stDialogBoxInfo[45].sX;
sY = m_stDialogBoxInfo[45].sY;
}
void CGame::DrawDialogBox_GuildMenu(short msX, short msY)
{
short sX, sY, szX;
int iAdjX, iAdjY;
sX = m_stDialogBoxInfo[7].sX;
sY = m_stDialogBoxInfo[7].sY;
szX = m_stDialogBoxInfo[7].sSizeX;
iAdjX = - 13;
iAdjY = 30;
DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_GAME2, sX, sY, 2);
DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_TEXT, sX, sY, 19);
}