Code: Select all
void CGame::GetDkSet(int iClientH) //by drajwer
{
class CItem * pItem;
int dkM[]={706,707,708,710};
int dkW[]={724,725,726,728};
int dmM[]={711,712,713,913};
int dmW[]={729,730,731,914};
int weapon, iItemID, i, iEraseReq;
if(m_pClientList[iClientH] == NULL) return;
if(m_pClientList[iClientH]->m_iLevel < 180) return;
for (i = 0; i <= 4; i++)
{
pItem = new class CItem;
iItemID=-1;
if (m_pClientList[iClientH]->m_cSex == 1)
{
if (m_pClientList[iClientH]->m_iStr > 100)
{
iItemID=dkM[i];
}
else
{
iItemID=dmM[i];
}
}
else
{
if (m_pClientList[iClientH]->m_iStr > 100)
{
iItemID=dkW[i];
}
else
{
iItemID=dmW[i];
}
}
if (i == 4)
{
if (m_pClientList[iClientH]->m_iStr > m_pClientList[iClientH]->m_iInt)
{
weapon=709;
}
else
{
weapon=714;
}
iItemID = weapon;
}
if (iItemID != -1) //if any error occures, dont crash character
{
_bInitItemAttr(pItem, iItemID);
pItem->m_sTouchEffectType = DEF_ITET_UNIQUE_OWNER;
pItem->m_sTouchEffectValue1 = m_pClientList[iClientH]->m_sCharIDnum1;
pItem->m_sTouchEffectValue2 = m_pClientList[iClientH]->m_sCharIDnum2;
pItem->m_sTouchEffectValue3 = m_pClientList[iClientH]->m_sCharIDnum3;
_bAddClientItemList(iClientH, pItem, &iEraseReq);
SendItemNotifyMsg(iClientH, DEF_NOTIFY_ITEMOBTAINED, pItem, NULL);
}
}
}