Hey there~ I've decided to setup a Flyff server locally, mainly for testing exploits and/or finding them. But as you can imagine, it get's boring somewhen, so I started to create some source functions which could, or maybe could not improve your Server.
From time to time I might release more Snippet's if people seem to find them useful. If you dont feel like needing it, or got even a better System for this Tasks, you're welcome to leave straight, instead of letting this end in a mess of Flame.
I've could not see anything like this yet released, so, for the Leecher's it might be cool:
Feature: Hold CTRL+ALT and Rightclick your unwanted mails to delete them without Yes/No Prompt.
(Feel free to change the Keys to your prefers and/or add/remove some^^)
Given checks:
- Checks if Inventory has enough Space for Items
- Checks if User has enough Space for the Penya amount
- Gives MessageBoxes if not/interupts Deletition
- If all checks passes, no Message is given, for faster re-use after deletiotion of the mail
Project: Neuz:
Inside of the class:
Code:
class CWndPostReceive : public CWndNeuz
inside of the
Insert the following code:
Code:
#ifdef __RIGHTCLICK_DELETEMAIL
virtual void OnRButtonUp(UINT nFlags, CPoint point);
#endif //__RIGHTCLICK_DELETEMAIL
Above this function:
Code:
void CWndPostReceive::OnLButtonUp(UINT nFlags, CPoint point)
{
}
Insert the following code:
Code:
#ifdef __RIGHTCLICK_DELETEMAIL
BOOL CanAdd(DWORD dwGold, int nPlus)
{
if (nPlus <= 0) // ´õÇÏ·Á´Â °ªÀÌ 0ÀÌÇÏÀÌ¸é ³Í¼¾½º
return FALSE;
int nGold = dwGold;
ASSERT(nGold >= 0);
return ((nGold + nPlus) > nGold); // ´õÇÑ °ªÀÌ overflowÀÌ¸é ¸·¾Æ¾ßÇÑ´Ù.
}
void CWndPostReceive::OnRButtonUp(UINT nFlags, CPoint point)
{
if (GetAsyncKeyState(VK_CONTROL) && GetAsyncKeyState(VK_MENU))
{
if (m_nMax <= 0)
return;
int nSelect = GetSelectIndex(point);
if (nSelect == -1)
return;
m_nSelect = nSelect;
CMailBox* pMailBox = CMailBox::GetInstance();
CMailBox& mailbox = *pMailBox;
if (mailbox[m_nSelect] == NULL)
return;
CMail* pMail = mailbox[m_nSelect];
if (pMail)
{
// Get Items if available
if (pMail->m_pItemElem)
{
if (g_pPlayer->m_Inventory.GetEmptyCount() < 1)
{
g_WndMng.OpenMessageBox(prj.GetText(TID_GAME_LACKSPACE));
return;
}
g_DPlay.SendQueryGetMailItem(pMail->m_nMail);
}
// Get Gold if available
if (pMail->m_nMail > 0 && pMail->m_nGold > 0 && (CanAdd(g_pPlayer->GetGold(), pMail->m_nGold)))
g_DPlay.SendQueryGetMailGold(pMail->m_nMail);
else
{
g_WndMng.OpenMessageBox(prj.GetText(TID_GAME_TOOMANYMONEY_USE_PERIN));
return;
}
// Delete
g_DPlay.SendQueryRemoveMail(pMail->m_nMail);
}
}
}
#endif // __RIGHTCLICK_DELETEMAIL
Define:
Code:
#define __RIGHTCLICK_DELETEMAIL`// Hotkeys+Rightclick, no Yes/No Prompt's
Feel free to Leave a comment, suggestions for new small functions, or whatever else you might want to see being released. From time to time I'll start new projects about Flyff and once I'm used to the source a little better, might Release new PvE Systems, Event Systems, or just some other stuff which could be fun, like new GM commands or something.
Credits:
Code: 100% me, netHox
Inspired by: Insanity Flyff's Right-Click on Mail's Menu (Has Get Item and Delete Mail options)