JarajTo 40 Posted August 25, 2015 Share Posted August 25, 2015 (edited) Hi guys,how to block establishment 2 items with type 33 on the new ring slots?? https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif special_item_group not work,but I may need special id? Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
Berke58 97 Posted August 25, 2015 Share Posted August 25, 2015 open ur locale > inventorywindow.py {"index":item.EQUIPMENT_RING1, "x":2, "y":106, "width":32, "height":32}, {"index":item.EQUIPMENT_RING2, "x":75, "y":106, "width":32, "height":32}, ## Equipment Slot { "name" : "Equipment_Base", "type" : "image", "x" : 10, "y" : 33, "image" : "d:/ymir work/ui/equipment_bg_with_ring.tga", Link to comment Share on other sites More sharing options...
JarajTo 40 Posted August 25, 2015 Author Share Posted August 25, 2015 Man, i have it added. The problem is that it can assume two identical objects. Link to comment Share on other sites More sharing options...
AndrewSkc 3 Posted August 25, 2015 Share Posted August 25, 2015 Add this items to the special_item_group Link to comment Share on other sites More sharing options...
JarajTo 40 Posted August 25, 2015 Author Share Posted August 25, 2015 Add this items to the special_item_group Look at first post. It`s not work. Link to comment Share on other sites More sharing options...
Seby. 6 Posted August 25, 2015 Share Posted August 25, 2015 https://metin2dev.org/board/index.php?/topic/7728-bug-for-the-rings/ Look here. Link to comment Share on other sites More sharing options...
JarajTo 40 Posted August 25, 2015 Author Share Posted August 25, 2015 https://metin2dev.org/board/index.php?/topic/7728-bug-for-the-rings/ Look here. already I check Link to comment Share on other sites More sharing options...
AlexxD 123 Posted August 25, 2015 Share Posted August 25, 2015 1. Open char_item.cpp and after if (item->GetWearFlag() & WEARABLE_UNIQUE) { if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item))) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 종류의 유니크 아이템 두 개를 동시에 장착할 수 없습니다.")); return false; } if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) && !marriage::CManager::instance().IsMarried(GetPlayerID())) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("결혼하지 않은 상태에서 예물을 착용할 수 없습니다.")); return false; } } put this: if (item->GetType() & ITEM_RING) { if ((GetWear(WEAR_RING1) && GetWear(WEAR_RING1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_RING2) && GetWear(WEAR_RING2)->IsSameSpecialGroup(item))) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time.")); return false; } } Try it. "Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch" Link to comment Share on other sites More sharing options...
Veneno 6 Posted November 29, 2015 Share Posted November 29, 2015 On 25/8/2015, 9:20:23, AlexxD said: 1. Open char_item.cpp and after if (item->GetWearFlag() & WEARABLE_UNIQUE) { if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item))) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 종류의 유니크 아이템 두 개를 동시에 장착할 수 없습니다.")); return false; } if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) && !marriage::CManager::instance().IsMarried(GetPlayerID())) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("결혼하지 않은 상태에서 예물을 착용할 수 없습니다.")); return false; } } put this: if (item->GetType() & ITEM_RING) { if ((GetWear(WEAR_RING1) && GetWear(WEAR_RING1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_RING2) && GetWear(WEAR_RING2)->IsSameSpecialGroup(item))) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time.")); return false; } } Try it. Thanks you just saved me... Do you have any tips about making the remaining time visible at the ITEM_RING like the ITEM_UNIQUE? EDIT: Talked too soon Your function blocks 2 items of the same type not the same vnum. Can you give a function that works for 2 same vnums please? Link to comment Share on other sites More sharing options...
AlexxD 123 Posted November 30, 2015 Share Posted November 30, 2015 8 hours ago, Veneno said: Thanks you just saved me... Do you have any tips about making the remaining time visible at the ITEM_RING like the ITEM_UNIQUE? EDIT: Talked too soon Your function blocks 2 items of the same type not the same vnum. Can you give a function that works for 2 same vnums please? I'll edit this function, first I saw that people need to block 2 items for the same type, and after I saw in client that 2 same vnums doesn't works. "Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch" Link to comment Share on other sites More sharing options...
Premium r00t 123 Posted November 30, 2015 Premium Share Posted November 30, 2015 48 minutes ago, AlexxD said: I'll edit this function, first I saw that people need to block 2 items for the same type, and after I saw in client that 2 same vnums doesn't works. Go open special_item_group in your server and try to find a vnum of your item. What i mean is that you need to find this: Group 스폐셜 { Vnum 10050 type special 1 71148 100000 1 2 71149 100001 1 3 71158 100002 1 4 71135 100003 1 5 71136 100003 1 6 71143 100004 1 7 71145 100005 1 } All item in this group can't be used in same time... and if you want change bonus that this item give, you need to find, by third value, the group. For example... i want edit bonus of item 71148, Ring of Will Power... if we look in above group... 1 71148 100000 1 Now you need to find group with vnum 100000...voilà Group 속성 { Vnum 100000 type ATTR 1 66 30 2 78 20 3 79 20 4 63 30 5 69 10 6 70 10 effect "d:\ymir work\effect\etc\buff\buff_item5.mse" } Here you can see all bonus of this ring... 30% bonus exp, 20% def warrior, 20% def ninja, 30% strong vs monster, 10% max hp, 10% max mp (in official server this item have also 20% def lycan... i have remove this bonus now because i don't know if you have it). Let me know if you solved Link to comment Share on other sites More sharing options...
Veneno 6 Posted November 30, 2015 Share Posted November 30, 2015 Hey thanks but special_item_group.txt isn't just for the boxes and what they have inside? Btw I already have these groups and still before alex's function nothing was happening buf thanks for trying Link to comment Share on other sites More sharing options...
Cyxer 140 Posted November 30, 2015 Share Posted November 30, 2015 On 25/8/2015, 9:20:23, AlexxD said: 1. Open char_item.cpp and after if (item->GetWearFlag() & WEARABLE_UNIQUE) { if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item))) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 종류의 유니크 아이템 두 개를 동시에 장착할 수 없습니다.")); return false; } if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) && !marriage::CManager::instance().IsMarried(GetPlayerID())) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("결혼하지 않은 상태에서 예물을 착용할 수 없습니다.")); return false; } } put this: if (item->GetType() & ITEM_RING) { if ((GetWear(WEAR_RING1) && GetWear(WEAR_RING1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_RING2) && GetWear(WEAR_RING2)->IsSameSpecialGroup(item))) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time.")); return false; } } Try it. change this: ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time.")); to this: [code] ch->ChatPacket(CHAT_TYPE_INFO, "You can't put two same items in the same time"); 1 Link to comment Share on other sites More sharing options...
alper40s 1 Posted October 1, 2018 Share Posted October 1, 2018 On 11/30/2015 at 7:26 PM, Cyxer said: ch->ChatPacket(CHAT_TYPE_INFO, "You can't put two same items in the same time"); char_item.cpp ch-> no need to use Link to comment Share on other sites More sharing options...
dattg1337 2 Posted December 19, 2020 Share Posted December 19, 2020 its too late but if someone need here is 100% works chat_item.cpp Quote if (item->GetType() == ITEM_RING) { LPITEM ringItems[2] = { GetWear(WEAR_RING1), GetWear(WEAR_RING2) }; for (int i = 0; i < 2; i++) { if (ringItems[i]) { if (ringItems[i]->GetVnum() == item->GetVnum()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("YOUR TEXT HERE")); return false; } } } } 1 Link to comment Share on other sites More sharing options...
Grzyb 10 Posted June 1, 2023 Share Posted June 1, 2023 (edited) My new fix 100% work: if (item->GetType() == ITEM_RING) { std::vector<LPITEM> FixByMuchomor = { GetWear(WEAR_RING1), GetWear(WEAR_RING2) }; const int FixByMuchomorSize = FixByMuchomor.size(); for (int i = 0; i < FixByMuchomorSize; i++) { if (FixByMuchomor[i]) { if (FixByMuchomor[i]->GetVnum() == item->GetVnum() || FixByMuchomor[i]->GetSubType() == item->GetSubType()) { ChatPacket(CHAT_TYPE_INFO, "Nie możesz założyć tego przedmiotu dwa razy!"); return false; } } } } Edited June 1, 2023 by Grzyb 1 1 Grzyb.ovh 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