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!

Bug fix Archon Armors

Joined
Apr 9, 2012
Messages
2,357
Reaction score
440
this is just my theory (I have no testing machine for now :(: )
the main problem is setitemeffect rely on client to send the packet to turn on or to turned off setitemeff
that was fine if the client ask for setitem to turn on, the server could validate and accept/refuse it, the main problem is if the client did not send the off packet,
that would never turned off the setitemeff in client,

so in theory, my solution would be check current setitemeffect when there's any equipment change

Code:
//rewrite this function
void __cdecl CPlayer::pc_EquipPart(CPlayer *this, _STORAGE_POS_INDIV *pItem)
{
       unsigned a[6];
       char b[6],c[6];
           char count = _this->m_clsSetItem.m_byTotalSetCount;
    for(int i=0;i < count;i++)   {
        a[i]=_this->m_clsSetItem.m_setCount[i].m_dwSetItem; //save current active setitemeff data
        b[i]=_this->m_clsSetItem.m_setCount[i].m_bySetItemNum;//save current active setitemeff data
       c[i]=_this->m_clsSetItem.m_setCount[i].m_bySetEffectNum;//save current active setitemeff data
        pSetItemCheckRequest(_this,a[i],b[i],c[i],false);//turn off the setitemeffect 
   }
    for(int i=0;i < count;i++)
    {
        if(c[i]!=0) 
                pSetItemCheckRequest(_this,a[i],b[i],c[i],true);//turn setitem eff on (will fail to turned on when the player didn't really have the setitem effect, and the setitemeffect won't on)
    }

//don't forget to run the real function here
ppc_EquipPart(_this,pItem)
}

that is just my theory, i didn't test it myself, you may need to rewrite another function such as EmbellishRequest and pc_OffPart? (perhaps)
the above code will not compile just like that, you have to adjust it ^_^
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Oct 19, 2012
Messages
252
Reaction score
3
this is just my theory (I have no testing machine for now :(: )
the main problem is setitemeffect rely on client to send the packet to turn on or to turned off setitemeff
that was fine if the client ask for setitem to turn on, the server could validate and accept/refuse it, the main problem is if the client did not send the off packet,
that would never turned off the setitemeff in client,

so in theory, my solution would be check current setitemeffect when there's any equipment change

Code:
//rewrite this function
void __cdecl CPlayer::pc_EquipPart(CPlayer *this, _STORAGE_POS_INDIV *pItem)
{
       unsigned a[6];
       char b[6],c[6];
           char count = _this->m_clsSetItem.m_byTotalSetCount;
    for(int i=0;i < count;i++)   {
        a[i]=_this->m_clsSetItem.m_setCount[i].m_dwSetItem; //save current active setitemeff data
        b[i]=_this->m_clsSetItem.m_setCount[i].m_bySetItemNum;//save current active setitemeff data
       c[i]=_this->m_clsSetItem.m_setCount[i].m_bySetEffectNum;//save current active setitemeff data
        pSetItemCheckRequest(_this,a[i],b[i],c[i],false);//turn off the setitemeffect 
   }
    for(int i=0;i < count;i++)
    {
        if(c[i]!=0) 
                pSetItemCheckRequest(_this,a[i],b[i],c[i],true);//turn setitem eff on (will fail to turned on when the player didn't really have the setitem effect, and the setitemeffect won't on)
    }

//don't forget to run the real function here
ppc_EquipPart(_this,pItem)
}

that is just my theory, i didn't test it myself, you may need to rewrite another function such as EmbellishRequest and pc_OffPart? (perhaps)
the above code will not compile just like that, you have to adjust it ^_^
Hello, sir.
Please check this again.
Where did it go wrong?
Thank you

PHP:
char __cdecl pc_SetItemCheckRequest(CPlayer *_this, unsigned int dwSetItem, char bySetItemNum, char bySetEffectNum, bool bSet)
{
	char pl_ResetEffectNum;
	char pl_ResetItemNum;
	unsigned int pl_ResetIdx;
	char result;

	char SetEffectNum = bySetEffectNum;
	char SetItemNum = bySetItemNum;
	int set_pos = dwSetItem;
	int check_effect_state;
	CSUItemSystem * SUItemSystem = SUItemSyste__Instance();
	CSetItemType * ItemType = SUItemSyste__GetCSetItemType(SUItemSystem);

	if (ItemType)
	{
		si_interpret * pSI = SetItemType__Getsi_interpret(ItemType, set_pos);
		if (pSI)
		{
		char check_effect_state;
			if (bSet)
			{
				char IsEquipAble = 0;
				char pStrCode = 0;
				CSUItemSystem * SUItemSystem2 = SUItemSyste__Instance();
				int nTableCode = SUItemSystem__GetSetItemTableInfo(SUItemSystem2, set_pos, &pStrCode, 64);
				if (nTableCode > -1)
				{
					char EquipGrade = pl__GetItemEquipGrade(nTableCode, &pStrCode);
					if (IsEquipAbleGrade(_this, EquipGrade))
						IsEquipAble = 1;
				}

				if (IsEquipAble)
				{
					check_effect_state = SetOnEffect(&_this->m_clsSetItem, &_this->m_pUserDB->m_AvatorData, set_pos, SetItemNum, SetEffectNum);
					switch (check_effect_state)
					{
					case 0:
						ApplySetItemEffect(_this, pSI, set_pos, SetItemNum, SetEffectNum, 1);
						break;
					case 8:
						pl_ResetEffectNum = GetResetEffectNum(&_this->m_clsSetItem);
						pl_ResetItemNum = GetResetItemNum(&_this->m_clsSetItem);
						pl_ResetIdx = GetResetIdx(&_this->m_clsSetItem);
						ApplySetItemEffect(_this, pSI, pl_ResetIdx, pl_ResetItemNum, pl_ResetEffectNum, 0);
						ApplySetItemEffect(_this, pSI, set_pos, SetItemNum, SetEffectNum, 1);
						break;
					case 4:
					case 3:
					case 2:
					case 7:
						break;
					default:
						check_effect_state = 9;
						break;
					}
				}
			}
			else
			{
				check_effect_state = SetOffEffect(&_this->m_clsSetItem, set_pos, SetItemNum, SetEffectNum);
				if (check_effect_state == 1)
				ApplySetItemEffect(_this, pSI, set_pos, SetItemNum, SetEffectNum, 0);
			}
			SetItemCheckResult(_this, check_effect_state, set_pos, SetEffectNum);
			result = 1;
		}
		else
		{
			SetItemCheckResult(_this, 2, 0, 0);
			result = 0;
		}
	}
	else
	{
		   SetItemCheckResult(_this, 7, 0, 0);
			result = 0;
	}
	return result;
}
 
Upvote 0
Experienced Elementalist
Joined
Oct 19, 2012
Messages
252
Reaction score
3
the whole thing is all wrong, read my comment, the problem is not the function, but how it's work ._.
what are you trying to do by rewriting all of it?
and is that even compile at all to begin with? :lol:

You are a great man
I know you will help me

 
Last edited:
Upvote 0
Back
Top