zTeam source + fixes STABLE

Hi. I am not a pro and just learning. I am having an issue with Master Level zen drop. Zen drops ok only from level 360-399, and when I reach level 400 it drops max 1k. I was trying to modify the values in user.cpp and Mastersystem.cpp but no luck. Could you please suggest where I can fix this issue?
 
To fix unpacked soul bug isn`t better to delete soul pack and give back to user soul difference?
I did it DeleteSoulCount function
Code:
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;
}
//===================
//Later edit

I don`t know if someone already fixed darkside manabug but here is the way i fixed it

-> fix annoying message on gameserver log
on "protocol.cpp" in "CGMagicAttack" function add next code right after "WORD MagicNumber = MAKE_NUMBERW(lpMsg->MagicNumberH, lpMsg->MagicNumberL); //loc5" line
Code:
if(usernumber == OBJMAX && (MagicNumber == 263 || MagicNumber == 559 || MagicNumber == 563))
	{
		return;
	}

-> fix no mana usage bug on Dark Side skill
on "protocol.cpp" in "GCMonkMagicAttack" function remove this if statement "if( MagicNumber == 263 || MagicNumber == 559 )" and add next one
Code:
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;
	}

This fixes might not be best solutions...But they works
 
Last edited:
Anyone knows how to fix this error?
ftewegw1 - zTeam source + fixes STABLE - RaGEZONE Forums
 
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?

 

Attachments

  • broCPdU - zTeam source + fixes STABLE - RaGEZONE Forums
    broCPdU.webp
    74.3 KB · Views: 47
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?


Да уже была мысль забиндовать кнопку "О" под настройки (как в eX700 и т.д.), думаю так и сделаю:)

Yeah already had an idea to bind the "O" button for custom settings (as in eX700 etc.), so I will made it :)
 

Attachments

  • broCPdU - zTeam source + fixes STABLE - RaGEZONE Forums
    broCPdU.webp
    74.3 KB · Views: 43
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 is
Hugs

does this support windows server 2003?



How to set muhelper level use to 1 ? can't find this in cpp
 
Last edited:
confuse about zTeam S6 files there are more post but no 1 know what is latest or better to use :D....

any want to share his/her Updated source with fixes that posted in different thread of zTeam season 6?

suggestion? ^^

thanks :)
 
Last edited:
Yes. I use it in windows Server 2003.


i compiled it on windows 7 with studio 2012, try to run it on win2003 server
framework 4.0
redistable 2012

where is the problem?
 

Attachments

  • 32 - zTeam source + fixes STABLE - RaGEZONE Forums
    32.webp
    6.9 KB · Views: 81
Hi there, im trying to add vip bonus for npc reset..

I make this in joinserver:

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);

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
lpUser->LevelUpPoint = 500 * (lpUser->Reset + 1);

if( lpUser->IsVip > 0 )
{
lpUser->LevelUpPoint = 1000 * (lpUser->Reset + 1);
}

user.h
struct OBJECTSTRUCT{
int IsVip;

SProtocol.h
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
};

SProtocol.cpp
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;


I hope someone can teach me, cuz im newbie in this things..
 
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?
 
how to disable level 80 for mu helper start ?
 
Back