- Joined
- Sep 20, 2012
- Messages
- 289
- Reaction score
- 75
yes, MAX_IDSTRING + x is VERY different from changing the define like you said.
yes you're right, i forgot about the end char
but it was not my point
yes, MAX_IDSTRING + x is VERY different from changing the define like you said.
bool OfflineTrade::DeleteSoulCount(int UserIndex, int SoulCount)
{
LogAddTD("[OffTrade][DeBug] SoulCount: %d",SoulCount);
if( !OBJMAX_RANGE(UserIndex) )
{
return false;
}
// ----
if( this->GetSoulCount(UserIndex) < SoulCount )
{
return false;
}
// ----
int DeletedItem = 0;
LPOBJ lpUser = &gObj[UserIndex];
// ----
while(true)
{
int ItemDiff = SoulCount - DeletedItem;
// ----
if( ItemDiff <= 0 )
{
break;
}
// ----
if( ItemDiff >= 30 && this->CheckItem(UserIndex, ITEMGET(12, 31), 2) != -1 )
{
int ItemPos = this->CheckItem(UserIndex, ITEMGET(12, 31), 2);
gObjInventoryDeleteItem(lpUser->m_Index, ItemPos);
GCInventoryItemDeleteSend(lpUser->m_Index, ItemPos, 1);
DeletedItem += 30;
}
else if( ItemDiff >= 20 && this->CheckItem(UserIndex, ITEMGET(12, 31), 1) != -1 )
{
int ItemPos = this->CheckItem(UserIndex, ITEMGET(12, 31), 1);
gObjInventoryDeleteItem(lpUser->m_Index, ItemPos);
GCInventoryItemDeleteSend(lpUser->m_Index, ItemPos, 1);
DeletedItem += 20;
}
else if( ItemDiff >= 10 && this->CheckItem(UserIndex, ITEMGET(12, 31), 0) != -1 )
{
int ItemPos = this->CheckItem(UserIndex, ITEMGET(12, 31), 0);
gObjInventoryDeleteItem(lpUser->m_Index, ItemPos);
GCInventoryItemDeleteSend(lpUser->m_Index, ItemPos, 1);
DeletedItem += 10;
}
else if( this->CheckItem(UserIndex, ITEMGET(14, 14), 0) != -1 )
{
int ItemPos = this->CheckItem(UserIndex, ITEMGET(14, 14), 0);
gObjInventoryDeleteItem(lpUser->m_Index, ItemPos);
GCInventoryItemDeleteSend(lpUser->m_Index, ItemPos, 1);
DeletedItem++;
}else{
int ItemPos = this->CheckItem(UserIndex, ITEMGET(12, 31), 0);
int ItemLevel = 0;
if(ItemPos == -1)
{
ItemPos = this->CheckItem(UserIndex, ITEMGET(12, 31), 1);
ItemLevel = 1;
if(ItemPos == -1)
{
ItemPos = this->CheckItem(UserIndex, ITEMGET(12, 31), 2);
ItemLevel = 2;
}
}
gObjInventoryDeleteItem(lpUser->m_Index, ItemPos);
GCInventoryItemDeleteSend(lpUser->m_Index, ItemPos, 1);
this->AddedSoul(lpUser ,(ItemLevel+1)*10-ItemDiff);
DeletedItem+=ItemDiff;
}
}
// ----
LogAddTD("[OfflineTrade] [%s] [%s] Deleted %d Jewels Of Soul",lpUser->AccountID, lpUser->Name);
// ----
return true;
}
if(usernumber == OBJMAX && (MagicNumber == 263 || MagicNumber == 559 || MagicNumber == 563))
{
return;
}
if( MagicNumber == 263 || MagicNumber == 559 || MagicNumber == 563)
{
lpObj = &gObj[aIndex];
if ( lpObj->Type == OBJ_USER )
{
lpMagic = gObjGetMagicSearch(lpObj, MagicNumber);
}else{
lpMagic = gObjGetMagic(lpObj, MagicNumber);
}
if ( lpMagic == NULL )
{
return;
}
int usemana = gObjUseSkill.GetUseMana(aIndex,lpMagic);
if(usemana >= 0)
{
lpObj->Mana = usemana;
GCManaSend(aIndex,lpObj->Mana,0xFF,0,lpObj->BP);
GCMonkMagicAttackNumberSend(&gObj[aIndex],MagicNumber,gObj[aIndex].m_wDarkSideTargetList[0],TRUE);
}
return;
}
Maybe someone know, how to fix this?
P.S. Bad ENG, i know it, sorry;D
Maybe someone know, how to fix this?
P.S. Bad ENG, i know it, sorry;D
Rus: Без понятия как исправить эту проблему, но скажу так. На первой кнопке кастомной нет этой проблемы, так почему бы не оставить там одну кнопку которая например будет вызывать кастомное окно со всеми кастомными функциями?
Eng: No idea how to fix this problem, but I will say this. On the first button of Custom not have this problem, so why not leave it like a button that will call a custom window with all the Custom functions?
I would mount a server for me, but I gave up.
The all the time I keep the code from my github based zteam server.
I'm posting the link here for anyone.
If they want me to correct something too, just open an issue in the repository that'll fix it.
The link isTo view the content, you need to sign in or register
Hugs
does this support windows server 2003?
How to set muhelper level use to 1 ? can't find this in cpp
Yes. I use it in windows Server 2003.
if (Result == ACC_REQ_SUCCESS) {
gDataBase.ExecFormat("SELECT DATEDIFF(day,getdate(),out__days) as datevip FROM MEMB_INFO WHERE memb___id=LOWER('%s')", szAccountID);
OutDays = gDataBase.GetInt("datevip");
if (BlocCode > 0)
{
Result = ACC_REQ_ACC_BANNED;
}
else
{
UserNumber = gJoinServer_Manager.AddUser(aIndex, szAccountID, szIp, lpMsg->Number, DBNumber);
if (UserNumber == -1)
{
Result = ACC_REQ_20000;
}
}
}
}
else
{
LogAddC(eError, "[Error] Account [%s] does not exits", szAccountID);
Result = ACC_REQ_WRONG_ID;
}
}
else
{
LogAddC(eError, "[Error] Failed ExecFormat [%s]", szAccountID);
Result = ACC_REQ_TEMP_BLOCK;
}
gDataBase.Clear();
}
else
{
LogAddC(eError, "[Error] Account [%s] already connected", szAccountID);
Result = ACC_REQ_ALREADY_CONNECT;
}
}
else
{
LogAddC(eError, "[Error] Account [%s] antihack check fail", szAccountID);
Result = ACC_REQ_TEMP_BLOCK;
}
JOIN_SERVER_ACC_REQ_RESULT Msg = { 0 };
Msg.h.Set(0x01, sizeof(JOIN_SERVER_ACC_REQ_RESULT));
Msg.Result = Result;
Msg.aIndex = Number;
Msg.UserNumber = UserNumber;
Msg.DBNumber = DBNumber;
Msg.IsVip = OutDays;
Msg.Magumsa = 0;
Msg.m_iPCRoom = 1;
memcpy(Msg.AccountID, szAccountID, sizeof(Msg.AccountID));
memcpy(Msg.JoominNumber, JoominNumber, sizeof(Msg.JoominNumber));
gJoinServer_Manager.DataSend(aIndex, (LPBYTE)&Msg, Msg.h.Size);
lpUser->LevelUpPoint = 500 * (lpUser->Reset + 1);
if( lpUser->IsVip > 0 )
{
lpUser->LevelUpPoint = 1000 * (lpUser->Reset + 1);
}
struct OBJECTSTRUCT{
int IsVip;
struct SDHP_IDPASSRESULT
{
PBMSG_HEAD h;
unsigned char result; // 3
short Number; // 4
char Id[10]; // 6
int UserNumber;
int DBNumber;
char JoominNumber[13];
int ukn_30;//NEW
int IsVip;
BYTE PcBangRoom;//NEW
};
void JGPAccountRequest(SDHP_IDPASSRESULT * lpMsg)
{
char szId[11];
int aIndex;
char szJN[14]="";
memset(szId, 0, sizeof(szId));
memcpy(szId, lpMsg->Id , sizeof(lpMsg->Id));
memcpy(szJN, lpMsg->JoominNumber , sizeof(lpMsg->JoominNumber));
aIndex = lpMsg->Number;
IsVip = lpMsg->IsVip;
Hi there, im trying to add vip bonus for npc reset..
I make this in joinserver:
But now im not sure how to get this from gameserver.. when i compile the gameserver, not show any error, but it always give me "0" as vip status (instead of 30 vip days for example)...
ResetSystem.cpp
user.h
SProtocol.h
SProtocol.cpp
I hope someone can teach me, cuz im newbie in this things..
Can you release joinserver source?
Here you can download: http://forum.ragezone.com/f508/cougaremu-emulate-world-1037477/.