- void CItem::AddNewAttr(BYTE index, BYTE bApply, BYTE bLevel)
- {
- if (HasApply(bApply))
- return;
- if (bLevel <= 0)
- return;
- int iAttributeSet = GetAttributeSetIndex();
- const TItemAttrTable & r = g_map_itemAttr[bApply];
- if (!r.bMaxLevelBySet[iAttributeSet])
- return;
- int i = GetAttributeCount();
- const TItemAttrTable & r = g_map_itemAttr[bApply];
- long lVal = r.lValues[MIN(4, bLevel - 1)];
- if (lVal)
- SetAttribute(index, bApply, lVal);
- }