Honorable Member xP3NG3Rx 19773 Posted March 10, 2015 Honorable Member Share Posted March 10, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hello everyone, It is a nice day to release my modifications to sell items from dragon soul inventory too So let's go. Serverside: 1) Open input_main.cpp 2.1) Search(CTRL+F) this: case SHOP_SUBHEADER_CG_SELL2: 2.2) Replace that whole case with this: case SHOP_SUBHEADER_CG_SELL2: { if (uiBytes < sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE)) return -1; const WORD wPos = *reinterpret_cast<const WORD*>(c_pData); const BYTE bCount = *(c_pData + sizeof(WORD)); const BYTE bType = *(c_pData + sizeof(WORD) + sizeof(BYTE)); sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName()); CShopManager::instance().Sell(ch, wPos, bCount, bType); return sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE); } 3) Save and close it, now open shop_manager.h 3.1) And replace this: void Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount = 0); 3.2) With this: void Sell(LPCHARACTER ch, WORD wCell, BYTE bCount = 0, BYTE bType = 0); 4) Save it and close it. 4.1) Next step; open shop_manager.cpp and search this function: void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount) 4.2) Replace the parameters/arguments only with this: LPCHARACTER ch, WORD wCell, BYTE bCount, BYTE bType 4.3) Search this line: LPITEM item = ch->GetInventoryItem(bCell); 4.4) And replace it with this: LPITEM item = ch->GetItem(TItemPos(bType, wCell)); 4.5-Choosable) I added a log function too into the antiflag_sell check against hackers 4.5.1) Replace this: if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL)) return; 4.5.2) With this(as I said, this is choosable, not important change): if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL)) { // In clientside the sell is blocked by python if a player arrive here he's a hacker, maybe. ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sell this item.")); sys_err("[HACKER] Force sell-script used by name [%u]%s.", ch->GetPlayerID(), ch->GetName()); return; } 5) Save and close the file, now you are ready to build your game. Clientside-BIN: 1) Open PythonNetworkStream.h 1.1) Search this: bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount); 1.2) Replace it with this: bool SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType); 2) Save it, close it. Open PythonNetworkStreamPhaseGameItem.cpp 2.1) Search this function: bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, BYTE byCount) 2.2) Replace the whole function with this: bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType) { if (!__CanActMainInstance()) return true; TPacketCGShop PacketShop; PacketShop.header = HEADER_CG_SHOP; PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2; if (!Send(sizeof(TPacketCGShop), &PacketShop)) { Tracef("SendShopSellPacket Errorn"); return false; } if (!Send(sizeof(WORD), &wSlot)) { Tracef("SendShopAddSellPacket Errorn"); return false; } if (!Send(sizeof(BYTE), &byCount)) { Tracef("SendShopAddSellPacket Errorn"); return false; } if (!Send(sizeof(BYTE), &byType)) { Tracef("SendShopAddSellPacket Errorn"); return false; } Tracef(" SendShopSellPacketNew(wSlot=%d, byCount=%d, byType=%d)n", wSlot, byCount, byType); return SendSequence(); } 3) Save and close. Open PythonNetworkStreamModule.cpp 3.1) Search this function: PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs) 3.2) And replace it with this: PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs) { int iSlotNumber; if (!PyTuple_GetInteger(poArgs, 0, &iSlotNumber)) return Py_BuildException(); int iCount; if (!PyTuple_GetInteger(poArgs, 1, &iCount)) return Py_BuildException(); int iType; if (!PyTuple_GetInteger(poArgs, 2, &iType)) return Py_BuildException(); CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendShopSellPacketNew(iSlotNumber, iCount, iType); return Py_BuildNone(); } 4) Save, close and build Clientside-Python: Here you have to do it by yourself. The new function of the m2net/net module are called by 3 files uiInventory.py uiDragonSoul.py uiShop.py You have to edit these files if your files are not containing these updates, but thanks to [sA]Con for the newer root package from his release ^^ Here you can download the "new" root package which is containing every changes for this and for wolfman. I do not recomment to replace or overwrite your files with those files! Use a comparer tool like Notepad++ Compare plugin to check the differences at "sell" keyword. Tested and works, but if you found bug/mistake/error please write into this thread a detailed post. So not like this: Quote *nerdface* This is not working for me, help! *endofnerdface* ps.: I hope you understand everything, and sorry for my poor english:3 ps2: In the official bin this message " SendShopSellPacketNew(bySlot=%d, byCount=%d, byType=%d)" can be found, but I renamed the variable too, hehe :-D. With Regards, P3NG3R 18 2 2 5 18 Link to comment Share on other sites More sharing options...
Former Staff Shisui 493 Posted March 10, 2015 Former Staff Share Posted March 10, 2015 I'm sorry but I couldn't understand what's this for. Could you explain more please? Link to comment Share on other sites More sharing options...
Ken 905 Posted March 10, 2015 Share Posted March 10, 2015 You can say something is from ellie about your root file. What ever thanks for share us. Kind Regards Ken 1 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19773 Posted March 10, 2015 Author Honorable Member Share Posted March 10, 2015 I'm sorry but I couldn't understand what's this for. Could you explain more please? Can you sell your dragon stones in npc-shop? You can say something is from ellie about your root file. What ever thanks for share us. Kind Regards Ken That root is containing your wolf modifications? I did not know. Link to comment Share on other sites More sharing options...
Ken 905 Posted March 10, 2015 Share Posted March 10, 2015 I'm sorry but I couldn't understand what's this for. Could you explain more please? Can you sell your dragon stones in npc-shop? You can say something is from ellie about your root file. What ever thanks for share us. Kind Regards Ken That root is containing your wolf modifications? I did not know. Only leaked files. I think many people like to use my root file. What ever congrulations again. Kind Regards Ken Do not be sorry, be better. Link to comment Share on other sites More sharing options...
gummyantifi 2 Posted December 29, 2015 Share Posted December 29, 2015 Nice ! How configure exchange player v player? Link to comment Share on other sites More sharing options...
Cian 0 Posted December 29, 2015 Share Posted December 29, 2015 Thanks ~Cian Link to comment Share on other sites More sharing options...
Krusty 33 Posted March 14, 2017 Share Posted March 14, 2017 On 10.3.2015 at 19:54, xP3NG3Rx said: Hello everyone, It is a nice day to release my modifications to sell items from dragon soul inventory too So let's go. Serverside: 1) Open input_main.cpp 2.1) Search(CTRL+F) this: case SHOP_SUBHEADER_CG_SELL2: 2.2) Replace that whole case with this: case SHOP_SUBHEADER_CG_SELL2: { if (uiBytes < sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE)) return -1; const WORD wPos = *reinterpret_cast<const WORD*>(c_pData); const BYTE bCount = *(c_pData + sizeof(WORD)); const BYTE bType = *(c_pData + sizeof(WORD) + sizeof(BYTE)); sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName()); CShopManager::instance().Sell(ch, wPos, bCount, bType); return sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE); } 3) Save and close it, now open shop_manager.h 3.1) And replace this: void Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount = 0); 3.2) With this: void Sell(LPCHARACTER ch, WORD wCell, BYTE bCount = 0, BYTE bType = 0); 4) Save it and close it. 4.1) Next step; open shop_manager.cpp and search this function: void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount) 4.2) Replace the parameters/arguments only with this: LPCHARACTER ch, WORD wCell, BYTE bCount, BYTE bType 4.3) Search this line: LPITEM item = ch->GetInventoryItem(bCell); 4.4) And replace it with this: LPITEM item = ch->GetItem(TItemPos(bType, wCell)); 4.5-Choosable) I added a log function too into the antiflag_sell check against hackers 4.5.1) Replace this: if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL)) return; 4.5.2) With this(as I said, this is choosable, not important change): if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL)) { // In clientside the sell is blocked by python if a player arrive here he's a hacker, maybe. ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sell this item.")); sys_err("[HACKER] Force sell-script used by name [%u]%s.", ch->GetPlayerID(), ch->GetName()); return; } 5) Save and close the file, now you are ready to build your game. Clientside-BIN: 1) Open PythonNetworkStream.h 1.1) Search this: bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount); 1.2) Replace it with this: bool SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType); 2) Save it, close it. Open PythonNetworkStreamPhaseGameItem.cpp 2.1) Search this function: bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, BYTE byCount) 2.2) Replace the whole function with this: bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType) { if (!__CanActMainInstance()) return true; TPacketCGShop PacketShop; PacketShop.header = HEADER_CG_SHOP; PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2; if (!Send(sizeof(TPacketCGShop), &PacketShop)) { Tracef("SendShopSellPacket Errorn"); return false; } if (!Send(sizeof(WORD), &wSlot)) { Tracef("SendShopAddSellPacket Errorn"); return false; } if (!Send(sizeof(BYTE), &byCount)) { Tracef("SendShopAddSellPacket Errorn"); return false; } if (!Send(sizeof(BYTE), &byType)) { Tracef("SendShopAddSellPacket Errorn"); return false; } Tracef(" SendShopSellPacketNew(wSlot=%d, byCount=%d, byType=%d)n", wSlot, byCount, byType); return SendSequence(); } 3) Save and close. Open PythonNetworkStreamModule.cpp 3.1) Search this function: PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs) 3.2) And replace it with this: PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs) { int iSlotNumber; if (!PyTuple_GetInteger(poArgs, 0, &iSlotNumber)) return Py_BuildException(); int iCount; if (!PyTuple_GetInteger(poArgs, 1, &iCount)) return Py_BuildException(); int iType; if (!PyTuple_GetInteger(poArgs, 2, &iType)) return Py_BuildException(); CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendShopSellPacketNew(iSlotNumber, iCount, iType); return Py_BuildNone(); } 4) Save, close and build Clientside-Python: Here you have to do it by yourself. The new function of the m2net/net module are called by 3 files uiInventory.py uiDragonSoul.py uiShop.py You have to edit these files if your files are not containing these updates, but thanks to [sA]Con for the newer root package from his release ^^ This is the hidden content, please Sign In or Sign Up the "new" root package which is containing every changes for this and for wolfman.I do not recomment to replace or overwrite your files with those files! Use a comparer tool like Notepad++ Compare plugin to check the differences at "sell" keyword. Tested and works, but if you found bug/mistake/error please write into this thread a detailed post. So not like this: ps.: I hope you understand everything, and sorry for my poor english:3 ps2: In the official bin this message " SendShopSellPacketNew(bySlot=%d, byCount=%d, byType=%d)" can be found, but I renamed the variable too, hehe :-D.With Regards,P3NG3R I dont know, but there is a bug for all. If you click in shop on sell the name of the item is right, but if you put the item to shop to sell it. You got the wrong name of item(you get the name of the first weapon). Do you have a solution for this? Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19773 Posted April 1, 2017 Author Honorable Member Share Posted April 1, 2017 This isn't because of this, but If I remember as well it's a global problem, I don't know how do I fixed it already. Link to comment Share on other sites More sharing options...
Krusty 33 Posted April 10, 2017 Share Posted April 10, 2017 Am 1.4.2017 um 14:31 schrieb xP3NG3Rx: This isn't because of this, but If I remember as well it's a global problem, I don't know how do I fixed it already. And you doesnt know the fix anymore? Link to comment Share on other sites More sharing options...
Honorable Member Mali 42458 Posted May 24, 2017 Honorable Member Share Posted May 24, 2017 Link to comment Share on other sites More sharing options...
asterix2 350 Posted May 17, 2020 Share Posted May 17, 2020 reupload pls. Link to comment Share on other sites More sharing options...
kolamajszu 1 Posted November 18, 2020 Share Posted November 18, 2020 Reupload laci pls 1 Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2526 Posted November 18, 2020 Forum Moderator Share Posted November 18, 2020 On 5/17/2020 at 9:34 PM, asterix2 said: reupload pls. 15 minutes ago, kolamajszu said: Reupload laci pls 1 1 Gurgarath coming soon Link to comment Share on other sites More sharing options...
kolamajszu 1 Posted November 19, 2020 Share Posted November 19, 2020 (edited) On 3/10/2015 at 7:54 PM, xP3NG3Rx said: Hello everyone, It is a nice day to release my modifications to sell items from dragon soul inventory too So let's go. Serverside: 1) Open input_main.cpp 2.1) Search(CTRL+F) this: case SHOP_SUBHEADER_CG_SELL2: 2.2) Replace that whole case with this: case SHOP_SUBHEADER_CG_SELL2: { if (uiBytes < sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE)) return -1; const WORD wPos = *reinterpret_cast<const WORD*>(c_pData); const BYTE bCount = *(c_pData + sizeof(WORD)); const BYTE bType = *(c_pData + sizeof(WORD) + sizeof(BYTE)); sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName()); CShopManager::instance().Sell(ch, wPos, bCount, bType); return sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE); } 3) Save and close it, now open shop_manager.h 3.1) And replace this: void Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount = 0); 3.2) With this: void Sell(LPCHARACTER ch, WORD wCell, BYTE bCount = 0, BYTE bType = 0); 4) Save it and close it. 4.1) Next step; open shop_manager.cpp and search this function: void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount) 4.2) Replace the parameters/arguments only with this: LPCHARACTER ch, WORD wCell, BYTE bCount, BYTE bType 4.3) Search this line: LPITEM item = ch->GetInventoryItem(bCell); 4.4) And replace it with this: LPITEM item = ch->GetItem(TItemPos(bType, wCell)); 4.5-Choosable) I added a log function too into the antiflag_sell check against hackers 4.5.1) Replace this: if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL)) return; 4.5.2) With this(as I said, this is choosable, not important change): if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL)) { // In clientside the sell is blocked by python if a player arrive here he's a hacker, maybe. ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sell this item.")); sys_err("[HACKER] Force sell-script used by name [%u]%s.", ch->GetPlayerID(), ch->GetName()); return; } 5) Save and close the file, now you are ready to build your game. Clientside-BIN: 1) Open PythonNetworkStream.h 1.1) Search this: bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount); 1.2) Replace it with this: bool SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType); 2) Save it, close it. Open PythonNetworkStreamPhaseGameItem.cpp 2.1) Search this function: bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, BYTE byCount) 2.2) Replace the whole function with this: bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType) { if (!__CanActMainInstance()) return true; TPacketCGShop PacketShop; PacketShop.header = HEADER_CG_SHOP; PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2; if (!Send(sizeof(TPacketCGShop), &PacketShop)) { Tracef("SendShopSellPacket Errorn"); return false; } if (!Send(sizeof(WORD), &wSlot)) { Tracef("SendShopAddSellPacket Errorn"); return false; } if (!Send(sizeof(BYTE), &byCount)) { Tracef("SendShopAddSellPacket Errorn"); return false; } if (!Send(sizeof(BYTE), &byType)) { Tracef("SendShopAddSellPacket Errorn"); return false; } Tracef(" SendShopSellPacketNew(wSlot=%d, byCount=%d, byType=%d)n", wSlot, byCount, byType); return SendSequence(); } 3) Save and close. Open PythonNetworkStreamModule.cpp 3.1) Search this function: PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs) 3.2) And replace it with this: PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs) { int iSlotNumber; if (!PyTuple_GetInteger(poArgs, 0, &iSlotNumber)) return Py_BuildException(); int iCount; if (!PyTuple_GetInteger(poArgs, 1, &iCount)) return Py_BuildException(); int iType; if (!PyTuple_GetInteger(poArgs, 2, &iType)) return Py_BuildException(); CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendShopSellPacketNew(iSlotNumber, iCount, iType); return Py_BuildNone(); } 4) Save, close and build Clientside-Python: Here you have to do it by yourself. The new function of the m2net/net module are called by 3 files uiInventory.py uiDragonSoul.py uiShop.py You have to edit these files if your files are not containing these updates, but thanks to [sA]Con for the newer root package from his release ^^ This is the hidden content, please Sign In or Sign Up the "new" root package which is containing every changes for this and for wolfman. I do not recomment to replace or overwrite your files with those files! Use a comparer tool like Notepad++ Compare plugin to check the differences at "sell" keyword. Tested and works, but if you found bug/mistake/error please write into this thread a detailed post. So not like this: ps.: I hope you understand everything, and sorry for my poor english:3 ps2: In the official bin this message " SendShopSellPacketNew(bySlot=%d, byCount=%d, byType=%d)" can be found, but I renamed the variable too, hehe :-D. With Regards P3NG3R Clientside-Python: Here you have to do it by yourself. The new function of the m2net/net module are called by 3 files uiInventory.py uiDragonSoul.py uiShop.py It has a tutorial for this files? Because i don't want to change the files randomly. Please anybody help me Edited November 19, 2020 by kolamajszu . Link to comment Share on other sites More sharing options...
Recommended Posts