Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

MasterReset Table? MuEmu

Junior Spellweaver
Joined
Mar 16, 2011
Messages
123
Reaction score
8
Hello! I need help setting up a MasterReset table.

How it works?
Well, for example, with each Reset I get 100 points. I would like to do something that after I make 1 MasterReset, I earn 200 points at each Reset.

Is there any way to do this system in MUEMU Season 6? Thank you!
 
Junior Spellweaver
Joined
Mar 16, 2011
Messages
123
Reaction score
8
How?
there is the ResetTable.cpp code:

// ResetTable.cpp: implementation of the CResetTable class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ResetTable.h"
#include "MemScript.h"
#include "ServerInfo.h"
#include "Util.h"

CResetTable gResetTable;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CResetTable::CResetTable() // OK
{
this->m_ResetTableInfo.clear();
}

CResetTable::~CResetTable() // OK
{

}

void CResetTable::Load(char* path) // OK
{
CMemScript* lpMemScript = new CMemScript;

if(lpMemScript == 0)
{
ErrorMessageBox(MEM_SCRIPT_ALLOC_ERROR,path);
return;
}

if(lpMemScript->SetBuffer(path) == 0)
{
ErrorMessageBox(lpMemScript->GetLastError());
delete lpMemScript;
return;
}

this->m_ResetTableInfo.clear();

try
{
while(true)
{
if(lpMemScript->GetToken() == TOKEN_END)
{
break;
}

if(strcmp("end",lpMemScript->GetString()) == 0)
{
break;
}

RESET_TABLE_INFO info;

info.MinReset = lpMemScript->GetNumber();

info.MaxReset = lpMemScript->GetAsNumber();

info.MinMasterReset = lpMemScript->GetAsNumber();

info.MaxMasterReset = lpMemScript->GetAsNumber();

info.Level[0] = lpMemScript->GetAsNumber();

info.Level[1] = lpMemScript->GetAsNumber();

info.Level[2] = lpMemScript->GetAsNumber();

info.Level[3] = lpMemScript->GetAsNumber();

info.Money[0] = lpMemScript->GetAsNumber();

info.Money[1] = lpMemScript->GetAsNumber();

info.Money[2] = lpMemScript->GetAsNumber();

info.Money[3] = lpMemScript->GetAsNumber();

info.Point[0] = lpMemScript->GetAsNumber();

info.Point[1] = lpMemScript->GetAsNumber();

info.Point[2] = lpMemScript->GetAsNumber();

info.Point[3] = lpMemScript->GetAsNumber();

this->m_ResetTableInfo.push_back(info);
}
}
catch(...)
{
ErrorMessageBox(lpMemScript->GetLastError());
}

delete lpMemScript;
}

int CResetTable::GetResetLevel(LPOBJ lpObj) // OK
{
for(std::vector<RESET_TABLE_INFO>::iterator it=this->m_ResetTableInfo.begin();it != this->m_ResetTableInfo.end();it++)
{
if((lpObj->Reset+1) >= it->MinReset && (lpObj->Reset+1) <= it->MaxReset)
{
if(it->Level[lpObj->AccountLevel] == -1)
{
return gServerInfo.m_CommandResetLevel[lpObj->AccountLevel];
}
else
{
return it->Level[lpObj->AccountLevel];
}
}
}

return gServerInfo.m_CommandResetLevel[lpObj->AccountLevel];
}

int CResetTable::GetResetMoney(LPOBJ lpObj) // OK
{
for(std::vector<RESET_TABLE_INFO>::iterator it=this->m_ResetTableInfo.begin();it != this->m_ResetTableInfo.end();it++)
{
if((lpObj->Reset+1) >= it->MinReset && (lpObj->Reset+1) <= it->MaxReset)
{
if(it->Money[lpObj->AccountLevel] == -1)
{
return gServerInfo.m_CommandResetMoney[lpObj->AccountLevel];
}
else
{
return it->Money[lpObj->AccountLevel];
}
}
}

return gServerInfo.m_CommandResetMoney[lpObj->AccountLevel];
}



int CResetTable::GetResetPoint(LPOBJ lpObj) // OK
{
int point = 0;

for(int n=1;n <= lpObj->Reset;n++)
{
int AddPoint = gServerInfo.m_CommandResetPoint[lpObj->AccountLevel];
int mreset = lpObj->MasterReset;
for(std::vector<RESET_TABLE_INFO>::iterator it=this->m_ResetTableInfo.begin();it != this->m_ResetTableInfo.end();it++)
{
if(n >= it->MinReset && n <= it->MaxReset)
{

if(it->Point[lpObj->AccountLevel] == -1)
{

AddPoint = gServerInfo.m_CommandResetPoint[lpObj->AccountLevel];
break;

}
else
{
AddPoint = it->Point[lpObj->AccountLevel];
break;

}

}
}

point += AddPoint;
}

return point;
}
 
Upvote 0
Back
Top