Bot Metin2 Dev 4873 Posted April 13, 2018 Bot Share Posted April 13, 2018 Hello community, I was wondering if it is possible to block Enchant Item and Reinforce Item in weapons by vnum. For example, if I do not want bonus to be added to the Sword + 9 Thanks in advance for your answers. Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19658 Posted April 13, 2018 Honorable Member Share Posted April 13, 2018 Via antiflag. 1 Link to comment Share on other sites More sharing options...
Active+ Member Solution Abel(Tiger) 1195 Posted April 13, 2018 Active+ Member Solution Share Posted April 13, 2018 The official servers already did that for begginers weapons with antiflag. Spoiler /* 1. item_lenght.h <==> This step you need to repeat for ItemData.h (GameLib) */ // 1.1. Search: ITEM_ANTIFLAG_WOLFMAN = (1 << 18), // 1.1. Add after: ITEM_ANTIFLAG_REINFORCE = (1 << 19), ITEM_ANTIFLAG_ENCHANT = (1 << 20), /* 2. char_item.cpp */ // 2.1. Search: case USE_CHANGE_ATTRIBUTE : // 2.1. Add after: < if(item2->GetAttributeSetIndex() == -1) > if (IS_SET(item2->GetAntiFlag(), ITEM_ANTIFLAG_ENCHANT)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't change a bonus in this item.")); return false; } // 2.2. Search: case USE_ADD_ATTRIBUTE : // 2.2. Add after: < if (item2->GetAttributeSetIndex() == -1) > if (IS_SET(item2->GetAntiFlag(), ITEM_ANTIFLAG_REINFORCE)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't add a bonus in this item.")); return false; } /* 3. ProtoReader.cpp <==> This step you need to repeat for ItemCSVReader.cpp (Dump Proto) */ // 3.1. Search: "ANTI_WOLFMAN", // 3.1. Add after: "ANTI_REINFORCE", "ANTI_ENCHANT" /* 4. PythonItemModule.cpp */ // 4.1. Search: PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_WOLFMAN", CItemData::ITEM_ANTIFLAG_WOLFMAN); // 4.1. Add after: PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_REINFORCE", CItemData::ITEM_ANTIFLAG_REINFORCE); PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_ENCHANT", CItemData::ITEM_ANTIFLAG_ENCHANT); 6 Link to comment Share on other sites More sharing options...
Mareq 0 Posted April 13, 2018 Share Posted April 13, 2018 17 minutes ago, Abel(Tiger) said: The official servers already did that for begginers weapons with antiflag. If i have time i will make a tutorial and edit this post. thank you very much really. I hope you can have time, regards. Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4873 Posted April 13, 2018 Author Bot Share Posted April 13, 2018 4 hours ago, Abel(Tiger) said: The official servers already did that for begginers weapons with antiflag. Reveal hidden contents /* 1. item_lenght.h <==> This step you need to repeat for ItemData.h (GameLib) */ // 1.1. Search: ITEM_ANTIFLAG_WOLFMAN = (1 << 18), // 1.1. Add after: ITEM_ANTIFLAG_REINFORCE = (1 << 19), ITEM_ANTIFLAG_ENCHANT = (1 << 20), /* 2. char_item.cpp */ // 2.1. Search: case USE_CHANGE_ATTRIBUTE : // 2.1. Add after: < if(item2->GetAttributeSetIndex() == -1) > if (IS_SET(item2->GetAntiFlag(), ITEM_ANTIFLAG_ENCHANT)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't change a bonus in this item.")); return false; } // 2.2. Search: case USE_ADD_ATTRIBUTE : // 2.2. Add after: < if (item2->GetAttributeSetIndex() == -1) > if (IS_SET(item2->GetAntiFlag(), ITEM_ANTIFLAG_REINFORCE)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't add a bonus in this item.")); return false; } /* 3. ProtoReader.cpp <==> This step you need to repeat for ItemCSVReader.cpp (Dump Proto) */ // 3.1. Search: "ANTI_WOLFMAN", // 3.1. Add after: "ANTI_REINFORCE", "ANTI_ENCHANT" /* 4. PythonItemModule.cpp */ // 4.1. Search: PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_WOLFMAN", CItemData::ITEM_ANTIFLAG_WOLFMAN); // 4.1. Add after: PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_REINFORCE", CItemData::ITEM_ANTIFLAG_REINFORCE); PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_ENCHANT", CItemData::ITEM_ANTIFLAG_ENCHANT); It works perfectly. Thank you very much for the help. 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