Sneaky 2 Posted September 15, 2019 Share Posted September 15, 2019 (edited) Peace! The following question: Is it possible to rewrite the Attr Change / Add function so that the Switcher only switches the values and not equal to Type and Values? If the maximum attribute you can have on a weapon (etc), the particular attribute wanted to be able to change only the values through a "switcher". My problem is that the general problem of the function is that the types & values are set to (0) and calculated by "int i = 0; i <cnt; ++". I would like to let the guys on it so that only the values are changed. But if I remove the query, IG does not happen anymore. For level 1 through 5, ask which bonus level can be used, just "(rand ()% 4) + 1" for random generation. My snippet currently looks like this. Maybe one of the Big Brains has an idea. I thank you in advance !! sorry for my bad English.. xP Greetings. Spoiler Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Johnny69 365 Posted September 16, 2019 Share Posted September 16, 2019 (edited) You mean like this ? https://metin2.download/picture/3FQ9Vt90Yoc5FsYF8oL7mfXOAkjs7C7n/.gif Or just one at a time ? Edited August 27, 2022 by Metin2 Dev Core X - External 2 Internal 3 Link to comment Share on other sites More sharing options...
Sneaky 2 Posted September 16, 2019 Author Share Posted September 16, 2019 (edited) vor 6 Stunden schrieb Johnny69: You mean like this ? https://metin2.download/picture/3FQ9Vt90Yoc5FsYF8oL7mfXOAkjs7C7n/.gif Or just one at a time ? Yes, I'm looking for it. Would you tell me? I would be very grateful! Edited August 27, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Johnny69 365 Posted September 16, 2019 Share Posted September 16, 2019 // Add this function prototype to public in item.h void ChangeAttributeValue(); // Add this function in item_attribute.cpp or item.cpp void CItem::ChangeAttributeValue() { int attrCount = GetAttributeCount(); if(attrCount == 0) return; int iAttributeSet = GetAttributeSetIndex(); if (iAttributeSet < 0) return; for(int k = 0; k < attrCount; k++) { int attr_idx = GetAttributeType(k); const TItemAttrTable & r = g_map_itemAttr[attr_idx]; int nLevel = number(1, r.bMaxLevelBySet[iAttributeSet]); long lVal = r.lValues[MIN(4, nLevel - 1)]; if (lVal) SetAttribute(k, attr_idx, lVal); } } // In char_item.cpp just go to the item you want to be the changer and replace: item2->ChangeAttribute // With item2->ChangeAttributeValue(); 1 Link to comment Share on other sites More sharing options...
Sneaky 2 Posted September 17, 2019 Author Share Posted September 17, 2019 vor 21 Stunden schrieb Johnny69: // Add this function prototype to public in item.h void ChangeAttributeValue(); // Add this function in item_attribute.cpp or item.cpp void CItem::ChangeAttributeValue() { int attrCount = GetAttributeCount(); if(attrCount == 0) return; int iAttributeSet = GetAttributeSetIndex(); if (iAttributeSet < 0) return; for(int k = 0; k < attrCount; k++) { int attr_idx = GetAttributeType(k); const TItemAttrTable & r = g_map_itemAttr[attr_idx]; int nLevel = number(1, r.bMaxLevelBySet[iAttributeSet]); long lVal = r.lValues[MIN(4, nLevel - 1)]; if (lVal) SetAttribute(k, attr_idx, lVal); } } // In char_item.cpp just go to the item you want to be the changer and replace: item2->ChangeAttribute // With item2->ChangeAttributeValue(); Thanks duded Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now