Jump to content

Intel

Premium
  • Posts

    200
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    0%

Everything posted by Intel

  1. Ok, why can't I edit my own topic? I found a bug in the mob_drop_item infos. If you don't know, with the type "kill", you drop only one of the items you put in the list, so the info drop, well, will show only one, and then another, and another one, every time you reopen it. To fix this issue, go to item_manager.h and search for: const SMobItemGroupInfo& GetOne() const { return m_vecItems[GetOneIndex()]; } Add after: std::vector<std::pair<int,int>> GetVector() { std::vector<std::pair<int,int>> item_list; for(auto &x : m_vecItems) item_list.emplace_back(std::make_pair(x.dwItemVnum,x.iCount)); return item_list; } then, in item_manager.cpp, instead of: if (pGroup && !pGroup->IsEmpty()) { const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne(); vec_item.push_back(std::make_pair(info.dwItemVnum, info.iCount)); } replace it with: if (pGroup && !pGroup->IsEmpty()) { auto vec_items = pGroup->GetVector(); for(auto &x : vec_items) vec_item.push_back(std::make_pair(x.first,x.second)); }
  2. That.. is definitely not a problem I may have caused. In the TargetInfoLoad or w/e in input_main.cpp you gotta check first if it's a monster or stone: //here is checking if the target is a monster or a stone if ((m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone() /*|| m_pkChrTarget->IsBoss()) //stuff of my server*/&& ITEM_MANAGER::instance().CreateDropItemVector(m_pkChrTarget, ch, s_vec_item)) { for(auto x : s_vec_item) { pInfo.dwVID = m_pkChrTarget->GetVID(); pInfo.race = m_pkChrTarget->GetRaceNum(); //I use a tuple because I also send the rarity, doesn't matter to the problem you showed. pInfo.dwVnum = std::get<0>(x); pInfo.count = std::get<1>(x); pInfo.rarity = std::get<2>(x); buf.write(&pInfo, sizeof(pInfo)); ch->GetDesc()->BufferedPacket(&pInfo, sizeof(TPacketGCTargetInfo)); ch->GetDesc()->Packet(buf.read_peek(), buf.size()); } } and in game.py there is: if app.ENABLE_SEND_TARGET_INFO: def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount, rarity): if not raceNum in uiTarget.MONSTER_INFO_DATA: ##no way here you send infos for the racenum of the lycan uiTarget.MONSTER_INFO_DATA.update({raceNum : {}}) uiTarget.MONSTER_INFO_DATA[raceNum].update({"items" : []}) curList = uiTarget.MONSTER_INFO_DATA[raceNum]["items"] [...] plus, in uitarget.py def __LoadInformation_Drops(self, race): self.AppendSeperator() if race in MONSTER_INFO_DATA: ##this might be different, since I don't store the data in constinfo ##and still, race, aka lycan aka wtf it is, is it 8? It's impossible to be in the list because it's neither a monster or a stone if len(MONSTER_INFO_DATA[race]["items"]) == 0:
  3. add -std=c++14 in your CXXFLAGS in the MAKEFILE
  4. Create a new function where you pass the item and copy the sockets of the item, and in the sorting function, check if the item is an autorecovery potion and use your new autogiveitem function. I had to do it even for other stackable items where knowing what the sockets are is important (don't mind the name's function, I started with the blend items and then I realized the other bugs): and then in the function, you take care of the stacking and shit: Obviously it's gonna be different in your files server. This is because the AutoGiveItem function doesn't know your item's sockets, so it's gonna create a new one, and the auto recovery potions are stackable. Another option, if you don't wanna deal with it, in the sorting option, exclude the unique or sockets dependent stackable items in the first if, or directly checking the sockets in the sorting functions if you don't have anything special.
  5. If you don't have AddPointToNumberString in localeInfo (check if you have the function but with another name): def AddPointToNumberString(n): return "%s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ])) Also, I would remove: dlgPickItem = uiPickItem.PickItemDialog() dlgPickItem.LoadDialog() self.dlgPickItem = dlgPickItem to put it in UnselectItemSlot or w/e is your function where you select the item to buy: if app.IsPressed(app.DIK_LCONTROL): itemIndex = shop.GetItemID(selectedSlotPos) item.SelectItem(itemIndex) itemName = item.GetItemName() dlgPickItem = uiPickItem.PickItemDialog() dlgPickItem.LoadDialog() self.dlgPickItem = dlgPickItem self.dlgPickItem.SetTitleName(itemName) self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem)) self.dlgPickItem.Open(1) self.dlgPickItem.SetMax(2000) self.dlgPickItem.itemGlobalSlotIndex = selectedSlotPos else: net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos)) and I would add in Close and Destroy: if self.dlgPickItem: self.dlgPickItem.Destroy() self.dlgPickItem = None Another thing, what is this? Aren't we passing, like this, moneyValue with self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))? At least, that's what happened with me, therefore I just: if not text.isdigit(): text = 1 if text: if self.eventAccept: self.eventAccept(text) Or am I missing something and I am too tired to notice? Also, be wary of putting more than one stack in the shops..
  6. I honestly haven't found any weird behavior, I even managed to fix the double step sound bug (DWORD dwFPS = 250 in Type.cpp->void NSound::DataToInstance) but.. is it worth it? Definitely not. First of all, the FPS counter in game says 223 while RivaTuner indicates 63, or 147, or w/e else, but never the same. Plus, I think I can render Crysis better than Metin, and this says it all (on how shitty this game is optimized and trying to is definitely not worth the struggle). Other than that, it's fun to experience Metin in 144/240hz for a few minutes but then you'll just realize that Right Click->Discard afterwards and revert every edit for this, is the best option.
  7. I don't know if this bug ever existed or generated from all the changes I've made, but I noticed that, when mounting a horse, basically, it would update your HT/IQ points, but they won't affect your HP/SP/Stamina. To fix this I edited void CHARACTER::ComputePoints() and brought the if (GetMountVnum()) check in the first if (IsPC()): if (IsPC()) { if (GetMountVnum()) { if (GetHorseST() > GetPoint(POINT_ST)) PointChange(POINT_ST, GetHorseST() - GetPoint(POINT_ST)); if (GetHorseDX() > GetPoint(POINT_DX)) PointChange(POINT_DX, GetHorseDX() - GetPoint(POINT_DX)); if (GetHorseHT() > GetPoint(POINT_HT)) PointChange(POINT_HT, GetHorseHT() - GetPoint(POINT_HT)); if (GetHorseIQ() > GetPoint(POINT_IQ)) PointChange(POINT_IQ, GetHorseIQ() - GetPoint(POINT_IQ)); } iMaxHP = JobInitialPoints[GetJob()].max_hp + m_points.iRandomHP + GetPoint(POINT_HT) * JobInitialPoints[GetJob()].hp_per_ht; iMaxSP = JobInitialPoints[GetJob()].max_sp + m_points.iRandomSP + GetPoint(POINT_IQ) * JobInitialPoints[GetJob()].sp_per_iq; iMaxStamina = JobInitialPoints[GetJob()].max_stamina + GetPoint(POINT_HT) * JobInitialPoints[GetJob()].stamina_per_con; The code would look something like that
  8. sorry for late reply, but yeah, 0 or false are ok. I forgot I changed it to a boolean. P.S. Why on earth can I not modify my own old message? W/e..
  9. That is an openssl related error. Since FreeBSD 12 openSSL has been updated and you'd need major changes to the code in libserverkey to compile it. You actually don't need libserverkey though (and many other stuff):
  10. @Tallywa Ok, so, for the drop with db, I think in char_battle.cpp, if you find: if (ITEM_MANAGER::instance().CreateDropItem(this, pkAttacker, s_vec_item)) I would just change it with if(MOB_DROP_MANAGER::instance().MakeDropItems(thus, pkAttacker, s_vec_item) change the function in bool, return the vector size but also you should make some changes to know if GetDropPct returns you true or false, but w/e, it's not the point of the target info system, we don't need to know if we can drop the item but what are the items that we can drop. So, what function do we wanna change? void MOB_DROP_MANAGER::MakeDropInfoItems(LPCHARACTER pkChar, LPCHARACTER pkKiller, std::vector<LPITEM>& items? ([Hidden Content] (if installed targetInfo)/game/mob_drop_manager.cpp) bool MOB_DROP_MANAGER::MakeDropInfoItems(LPCHARACTER pkChar, LPCHARACTER pkKiller, std::vector<std::pair<int,int> > & vec_item) { if(!pkChar || !pkKiller) return; LPITEM item = NULL; ITEM_MANAGER& rItemManager = ITEM_MANAGER::instance(); DWORD dwMobVnum = pkChar->GetRaceNum(); //common drop { BYTE bRank = pkChar->GetMobRank(); COMMON_DROP_MAP::iterator it = m_commonDropMap.find(bRank); if (it != m_commonDropMap.end()) { COMMON_DROP_VEC& rVec = it->second; COMMON_DROP_VEC::iterator itVec = rVec.begin(); for ( ; itVec != rVec.end() ; itVec++) { CommonDropInfo& rDropInfo = *itVec; if (rDropInfo.iLevelStart > pkKiller->GetLevel()) continue; if (rDropInfo.iLevelEnd < pkKiller->GetLevel()) continue; TItemTable * table = rItemManager.GetTable(rDropInfo.dwItemVnum); if (!table) continue; if (rDropInfo.dwItemVnum) { if (rDropInfo.dwItemVnum > 70103 && rDropInfo.dwItemVnum < 70108) { if (rDropInfo.dwItemVnum != pkChr->GetPolymorphItemVnum()) { continue; } } vec_item.push_back(std::make_pair(rDropInfo.dwItemVnum, 1)); } } } } //default drop { DEFAULT_DROP_MAP::iterator it = m_defaultDropMap.find(dwMobVnum); if (it != m_defaultDropMap.end()) { DEFAULT_DROP_VEC& rVec = it->second; DEFAULT_DROP_VEC::iterator itVec = rVec.begin(); for (; itVec != rVec.end(); itVec++) { DefaultDropInfo& rDropInfo = *itVec; vec_item.push_back(std::make_pair(rDropInfo.dwItemVnum, rDropInfo.iCount)); } } } //mob drop kill { MOB_DROP_GROUP_KILL_MAP_VNUM::iterator it = m_dropGroupKillMap.find(dwMobVnum); if (it != m_dropGroupKillMap.end()) { MOB_DROP_GROUP_KILL_MAP_ID& rGroupMap = it->second; MOB_DROP_GROUP_KILL_MAP_ID::iterator itGroup = rGroupMap.begin(); for (; itGroup != rGroupMap.end(); itGroup++) { MobDropKillGroupInfo& rGroupInfo = itGroup->second; if(rGroupInfo.IsEmpty()) continue; for (size_t i = 0; i < rGroupInfo.itemVector.size(); i++) { MobDropKillInfo& rDropInfo = rGroupInfo.itemVector[i]; if (rDropInfo.dwItemVnum) { vec_item.push_back(std::make_pair(rDropInfo.dwItemVnum, rDropInfo.iCount)); } } } } } //mob drop level { MOB_DROP_GROUP_LEVEL_MAP_VNUM::iterator it = m_dropGroupLevelMap.find(dwMobVnum); if (it != m_dropGroupLevelMap.end()) { MOB_DROP_LEVEL_ID_MAP& rMapID = it->second; MOB_DROP_LEVEL_ID_MAP::iterator itID = rMapID.begin(); for (; itID!=rMapID.end(); itID++) { MobDropLevelGroupInfo& rGroupInfo = itID->second; if(pkKiller->GetLevel() < rGroupInfo.iLevelStart) continue; if(pkKiller->GetLevel() > rGroupInfo.iLevelEnd) continue; MOB_DROP_LEVEL_INFO_VEC& rDropVec = rGroupInfo.itemVector; MOB_DROP_LEVEL_INFO_VEC::iterator itDrop = rDropVec.begin(); for(; itDrop!=rDropVec.end();itDrop++) { MobDropLevelInfo& rDropInfo = *itDrop; if (rDropInfo.dwItemVnum) { vec_item.push_back(std::make_pair(rDropInfo.dwItemVnum, rDropInfo.iCount)); } } } } } std::sort(vec_item.begin(), vec_item.end(), std::less<std::pair<int,int> >()); return vec_item.size(); } As you can see, I've done the same exact shit I've done for CreateItemVector function. Now, you need to change the parameters in the declaration and the type of this function: bool MOB_DROP_MANAGER::MakeDropInfoItems(LPCHARACTER pkChar, LPCHARACTER pkKiller, std::vector<std::pair<int,int> > & vec_item) in mob_drop_manager.h And now, in input_main.cpp, the line: if ((m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone()) && ITEM_MANAGER::instance().CreateDropItemVector(m_pkChrTarget, ch, s_vec_item)) needs to be changed with our new function: if ((m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone()) && MOB_DROP_MANAGER::instance().MakeDropInfoItems(m_pkChrTarget, ch, s_vec_item)) and I think that's it.
  11. If originally the target system info wasn't compatible, this won't be either. I just changed how the infos are sent to the client (vector of pairs(int,int) instead of creating a new LPITEM object). But, in a few seconds checking: [Hidden Content] (if installed targetInfo)/game/mob_drop_manager.cpp Ikarus recalls this instance. Basically what you might wanna do is: #ifdef ENABLE_DROP_FROM_TABLE //MOB_DROP_MANAGER::instance().MakeDropInfoItems(pkChr, pkKiller, vec_item); //old drop info MOB_DROP_MANAGER::instance().NewMakeDropInfoItems(pkChr, pkKiller, vec_item); //NEW FUNCTION #endif and in mob_drop_manager.cpp the new function would be very similar (obviously you need to change the parameters), but, instead of creating an item, you use rDropInfo.dwItemVnum and rDropInfo.iCount like, common drop would be: //common drop { BYTE bRank = pkChar->GetMobRank(); COMMON_DROP_MAP::iterator it = m_commonDropMap.find(bRank); if (it != m_commonDropMap.end()) { COMMON_DROP_VEC& rVec = it->second; COMMON_DROP_VEC::iterator itVec = rVec.begin(); for ( ; itVec != rVec.end() ; itVec++) { CommonDropInfo& rDropInfo = *itVec; if (rDropInfo.iLevelStart > pkKiller->GetLevel()) continue; if (rDropInfo.iLevelEnd < pkKiller->GetLevel()) continue; TItemTable * table = rItemManager.GetTable(rDropInfo.dwItemVnum); if (!table) continue; if(rDropInfo.dwItemVnum > 70103 && rDropInfo.dwItemVnum < 70108)//your polymorph marbles vnums { if (rDropInfo.dwItemVnum != pkChr->GetPolymorphItemVnum()) continue; } vec_item.push_back(std::make_pair(rDropInfo.dwItemVnum, 1)); } } } When I have more time I can give you the full edited code (with a different define and bla bla bla). If you understand a bit what I did though, you can try changing it by yourself. EDIT: Ah, actually there's a small difference, because in item_manager he creates the vector from the maps in the server source, but then he does the same shit again in mob_drop_manager.cpp.. I must be missing something for sure (or German is destroying my brain). Imo, in this case, just use the CreateItemDropVector function in item_manager.cpp, edit it accordingly (parameters, some if statements and what gets pushed back into the vector, aka a pair of integers) and that's it (and I mean even the one already in the original system) . You are already doing the checks you need in item_manager.cpp. I understand why it is done for the normal drop (maybe can be avoided, but that's not the point here), but in item_manager.cpp you can already access the infos you need, aka: vnum, count and level limits. If this way doesn't work, then you might wanna do the changes in item_manager.cpp and do similar changes to the function in mob_manager.cpp I'll try to give you both, when I can.
  12. Literally: FUCKY_FUNCTION(ARGUMENTS I DONT CARE ABOUT) { [Creating vector of pair(item vnum/quantity)] std::sort(vec_item.begin(), vec_item.end(), std::less<std::pair<int,int> >()); //here my sort or w/e initial sort you wanna use std::sort(vec_item.begin(), vec_item.end(), [](const std::pair<int, int>& f, const std::pair<int, int>& s) { return ITEM_MANAGER::instance().IsItemMetin(f.first) > ITEM_MANAGER::instance().IsItemMetin(s.first); }); //this the metins first sort return vec_item.size(); } Though, I am pretty sure the python part of the system already handles this with metin stones.
  13. So, compiling cryptopp7.0 still gets some problems, therefore I downloaded the VM by blackdragonx, which uses FBSD 9.2 64bit with files who compile with c++17, gcc7 and cryptopp7.0. I found the only difference is GetBlockSize(); instead of GetIVLength(); (:199 & :204) in cipher.cpp and #include <cryptopp/cryptoppLibLink.h> in cipher.h which, funnily enough doesn't exist in cryptopp7.0 source code (or any version of it for that matter this stupid header is only in the metin2 extern files) So, first thing, I compiled cryptopp 5.6.2 (gcc base aka 4.2) and tried to compile my files with gcc49 and..it worked. Good! Then, I compiled cryptopp 5.6.2 with gcc7 (needs to change static int to static unsigned int in wake.cpp:34) but this didn't work at all, geez. Ok then, tried the distraught's solution and put the compilation of libcryptopp into the Makefile after libthecore, changed the game makefile #CRYPTOPP INCDIR += -L../../libcryptopp/src LIBDIR += -L../../libcryptopp/src LIBS += -l:libcryptopp.a and now it f works, with crypto 5.6.2 and honestly, I cba with cryptopp7.0. Though, it compiled crypto with g++ (4.2) (despite changing CXX into GNUMakefile of libcryptopp)
  14. the .h files are already into extern/include (or usr/local/include/cryptopp) but the funny thing is, I tried a VM with the same version of FreeBSD of my test server, using gcc49 and I had the same problem, but I fixed it compiling the cryptopp version in the ports (5.6.2 so I was also installing the wrong one trying to use the older version, congratulations me) with make CXX=g++49 install, so I guess now the next step is trying with cryptopp7.0
  15. It may be, but even including the extern cryptopp folder (5.6.5) or the FreeBSD one (without having the new one installed) it still gives me linking problems. And I know it's the older one 'cause: In file included from desc.h:8:0, from desc_client.h:4, from cmd_general.cpp:11: cipher.h:7:17: error: 'CryptoPP::byte' has not been declared using CryptoPP::byte; ^~~~ but also started giving me errors on: encoder_->ProcessData((byte*)buffer, (const byte*)buffer, length); and similia, which can be fixed using CryptoPP::byte and adding: namespace CryptoPP { using byte = unsigned char; } to cipher.h But nothing anyway. Maybe conflict with the FreeBSD Version? I set back: INCDIR += -I/usr/local/include/gtest/ -I/usr/local/include/cryptopp/ LIBDIR += -L/usr/local/lib/gtest/ -L/usr/local/lib/cryptopp/ > pkg remove cryptopp > pkg install cryptopp-5.6.5.txz cryptopp 5.6.5 took from FreeBSD archive I rebuild the dependences and I try to recompile game. Still, undefined references, but way less at least. Maybe I am close! (Kappa) Allright, let's bruteforce it. Fetching include/local/lib/libcryptopp.so.5.6.5 e usr/local/include/cryptopp from the 9.3 server where it definitely works and let's compile again. Nope, totally the same. Maybe using the lib in the extern folder? -I../../../extern/include/cryptopp/ -L../../../extern/lib/cryptopp/ -l:libcryptopp.a -lgtest /usr/local/bin/ld: ../../build/obj/game/cipher.o: in function `DH2KeyAgreement::Prepare(void*, unsigned int*)': /sources/intel/game/src/cipher.cpp:315: undefined reference to `CryptoPP::Integer::Integer(char const*, CryptoPP::ByteOrder)' /usr/local/bin/ld: /sources/intel/game/src/cipher.cpp:322: undefined reference to `CryptoPP::Integer::Integer(char const*, CryptoPP::ByteOrder)' /usr/local/bin/ld: /sources/intel/game/src/cipher.cpp:324: undefined reference to `CryptoPP::Integer::Integer(char const*, CryptoPP::ByteOrder)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3TEA3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3TEA3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Blowfish4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Blowfish4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC53EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC53EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4SEED4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4SEED4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Camellia4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Camellia4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): more undefined references to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' follow /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP20AutoSeededRandomPoolE[_ZTVN8CryptoPP20AutoSeededRandomPoolE]+0x30): undefined reference to `CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' collect2: error: ld returned 1 exit status I mean, way less undefined references but still.. EDIT: cat /usr/local/lib/libcryptopp.so.5.6.5 | grep -a CryptoPP::Integer::Integer finds nothing cat /sources/extern/lib/libcryptopp.a | grep -a CryptoPP::Integer::Integer finds something Maybe I should just remove cryptopp from the server, but since it still wants the include from usr/local/include, I copied all the files from extern and, the undefined references get shorter. Wow! /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3TEA3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3TEA3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Blowfish4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Blowfish4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC53EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC53EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4SEED4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4SEED4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Camellia4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Camellia4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x15c): more undefined references to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' follow /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP20AutoSeededRandomPoolE[_ZTVN8CryptoPP20AutoSeededRandomPoolE]+0x34): undefined reference to `CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' collect2: error: ld returned 1 exit status Which is bs, it's totally in the library.
  16. I am using a VM (to not destroy the test server) with FreeBSD 11.3 i386 I installed all the packages needed: devil makedepend gmake mysql python27 cryptopp boost-all pkg install lang/gcc7 LINK Makefile LINK Cipher.cpp LINK Cipher.h Crypto source files directly from the git repo And.. /usr/local/bin/ld: ../../build/obj/game/cipher.o: in function `DH2KeyAgreement::Prepare(void*, unsigned int*)': /sources/intel/game/src/cipher.cpp:315: undefined reference to `CryptoPP::Integer::Integer(char const*, CryptoPP::ByteOrder)' /usr/local/bin/ld: /sources/intel/game/src/cipher.cpp:322: undefined reference to `CryptoPP::Integer::Integer(char const*, CryptoPP::ByteOrder)' /usr/local/bin/ld: /sources/intel/game/src/cipher.cpp:324: undefined reference to `CryptoPP::Integer::Integer(char const*, CryptoPP::ByteOrder)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0xd4): undefined reference to `CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char*, unsigned int, unsigned char const*, unsigned int)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x118): undefined reference to `non-virtual thunk to CryptoPP::CTR_ModePolicy::OperateKeystream(CryptoPP::KeystreamOperation, unsigned char*, unsigned char const*, unsigned int)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x120): undefined reference to `non-virtual thunk to CryptoPP::CTR_ModePolicy::CipherResynchronize(unsigned char*, unsigned char const*, unsigned int)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x128): undefined reference to `non-virtual thunk to CryptoPP::CTR_ModePolicy::SeekToIteration(unsigned long long)' /usr/local/bin/ld: ../../build/obj/game/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x158): undefined reference to `non-virtual thunk to CryptoPP::AdditiveCipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::AdditiveCipherAbstractPolicy, CryptoPP::CTR_ModePolicy> >::GenerateBlock(unsigned char*, unsigned int)' [...] collect2: error: ld returned 1 exit status I tried using the older version of cryptopp (5.6.6 if I am not mistaken, or 5.6.2) using FreeBSD include files and the Extern include files, with and without the lib I already have from the other machine where it compiles (with gcc49 though). It compiles without errors, but can't seem to link to the cryptolib at all. Nothing seems to work.
  17. It would but, you could also state that creating an item in the first place, is pointless (if you wanna be hyper-conscious about constant CPU/RAM usage). At the end we just want to send "vnum" and "count". Or you can just create a script that creates the dictionary and just not use this at all (I use this method for the chests drop), but needs "more" maintenance.
  18. Premise: I don't know whether you have this system from a free release elsewhere or you bought it and I have no idea if they are the same or not (even though the same version can be found in the first server files of Rubinum). There are two issues I was concerned with: -creating an item when you request the infos -putting the mob data dictionary in constinfo The first is if you have, in CreateDropItemVector function something like this: if (item) vec_item.push_back(item); So, we create an item and we do nothing with it, staying in memory for no purpose. Instead, we can use a vector of pairs. Open item_manager.h Replace bool CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item); with: bool CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<std::pair<int,int> > & vec_item); Now, open item_manager.cpp Replace bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item) With bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<std::pair<int,int> > & vec_item) and remove LPITEM item = NULL; and edit the function accordingly. EX for common_drop_item, replace: std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin(); while (it != g_vec_pkCommonDropItem[bRank].end()) { const CItemDropInfo & c_rInfo = *(it++); if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd) continue; TItemTable * table = GetTable(c_rInfo.m_dwVnum); if (!table) continue; item = NULL; if (table->bType == ITEM_POLYMORPH) { if (c_rInfo.m_dwVnum == pkChr->GetPolymorphItemVnum()) { item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true); if (item) item->SetSocket(0, pkChr->GetRaceNum()); } } else item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true); if (item) vec_item.push_back(item); } with std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin(); while (it != g_vec_pkCommonDropItem[bRank].end()) { const CItemDropInfo & c_rInfo = *(it++); if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd) continue; TItemTable * table = GetTable(c_rInfo.m_dwVnum); if (!table) continue; if(c_rInfo.m_dwVnum > 70103 && c_rInfo.m_dwVnum < 70108) { if (c_rInfo.m_dwVnum != pkChr->GetPolymorphItemVnum()) { continue; } } vec_item.push_back(std::make_pair(c_rInfo.m_dwVnum, 1)); } (edit 70103 and 70108 accordingly with your Polymorph Marble vnums The whole function should look like this: bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<std::pair<int,int> > & vec_item) { if (pkChr->IsPolymorphed() || pkChr->IsPC()) { return false; } int iLevel = pkKiller->GetLevel(); BYTE bRank = pkChr->GetMobRank(); std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin(); while (it != g_vec_pkCommonDropItem[bRank].end()) { const CItemDropInfo & c_rInfo = *(it++); if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd) continue; TItemTable * table = GetTable(c_rInfo.m_dwVnum); if (!table) continue; if(c_rInfo.m_dwVnum > 70103 && c_rInfo.m_dwVnum < 70108) { if (c_rInfo.m_dwVnum != pkChr->GetPolymorphItemVnum()) { continue; } } vec_item.push_back(std::make_pair(c_rInfo.m_dwVnum, 1)); } // Drop Item Group { itertype(m_map_pkDropItemGroup) it; it = m_map_pkDropItemGroup.find(pkChr->GetRaceNum()); if (it != m_map_pkDropItemGroup.end()) { typeof(it->second->GetVector()) v = it->second->GetVector(); for (DWORD i = 0; i < v.size(); ++i) { vec_item.push_back(std::make_pair(v[i].dwVnum, v[i].iCount)); } } } // MobDropItem Group { itertype(m_map_pkMobItemGroup) it; it = m_map_pkMobItemGroup.find(pkChr->GetRaceNum()); if ( it != m_map_pkMobItemGroup.end() ) { CMobItemGroup* pGroup = it->second; if (pGroup && !pGroup->IsEmpty()) { const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne(); vec_item.push_back(std::make_pair(info.dwItemVnum, info.iCount)); } } } // Level Item Group { itertype(m_map_pkLevelItemGroup) it; it = m_map_pkLevelItemGroup.find(pkChr->GetRaceNum()); if ( it != m_map_pkLevelItemGroup.end() ) { if ( it->second->IsInLevelRange((DWORD)iLevel) ) { typeof(it->second->GetVector()) v = it->second->GetVector(); for ( DWORD i=0; i < v.size(); i++ ) { DWORD dwVnum = v[i].dwVNum; vec_item.push_back(std::make_pair(dwVnum, v[i].iCount)); } } } } // ETC DropItem if (pkChr->GetMobDropItemVnum()) { itertype(m_map_dwEtcItemDropProb) it = m_map_dwEtcItemDropProb.find(pkChr->GetMobDropItemVnum()); if (it != m_map_dwEtcItemDropProb.end()) { vec_item.push_back(std::make_pair(pkChr->GetMobDropItemVnum(), 1)); } } //Metin if (pkChr->IsStone()) { if (pkChr->GetDropMetinStoneVnum()) { vec_item.push_back(std::make_pair(pkChr->GetDropMetinStoneVnum(), 1)); } } return vec_item.size(); } Note: level item group and drop item group might be different because in my files i have a level_limit_max token and, for drop_item_group, I don't expect to put a Polymorph Marble. Also it's missing the buyertheifgloves item group, but you can clearly see the pattern and modify accordingly. Edit : I found a bug in the mob_drop_item infos. If you don't know, with the type "kill", you drop only one of the items you put in the list, so the info drop, well, will show only one, and then another, and another one, every time you reopen it. To fix this issue, go to item_manager.h and search for: const SMobItemGroupInfo& GetOne() const { return m_vecItems[GetOneIndex()]; } Add after: std::vector<std::pair<int,int>> GetVector() { std::vector<std::pair<int,int>> item_list; for(auto &x : m_vecItems) item_list.emplace_back(std::make_pair(x.dwItemVnum,x.iCount)); return item_list; } then, in item_manager.cpp, instead of: if (pGroup && !pGroup->IsEmpty()) { const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne(); vec_item.push_back(std::make_pair(info.dwItemVnum, info.iCount)); } replace it with: if (pGroup && !pGroup->IsEmpty()) { auto vec_items = pGroup->GetVector(); for(auto &x : vec_items) vec_item.push_back(std::make_pair(x.first,x.second)); } Side Note (how to add drop of the Stones from Metins server side): Before return vec_item.size(); you can also organize the vector as you want or create another one with a certain structure, like, first the common drop items, then the advance items or whatever, you can also clear it for what I care. Me, for example, I sort it to have all the vnums from the smallest to the largest. You can do that by: std::sort(vec_item.begin(), vec_item.end(), std::less<std::pair<int,int> >()); Now, let's go to input_main.cpp Remove: LPITEM pkInfoItem; We don't use an item anymore, remember? So now replace: static std::vector<LPITEM> s_vec_item; with: static std::vector<std::pair<int,int> > s_vec_item; Then replace: if (ITEM_MANAGER::instance().CreateDropItemVector(m_pkChrTarget, ch, s_vec_item) && (m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone())) with: if ((m_pkChrTarget->IsMonster() || m_pkChrTarget->IsStone()) && ITEM_MANAGER::instance().CreateDropItemVector(m_pkChrTarget, ch, s_vec_item)) This way also, if you target a player or a NPC, it will not trigger the CreateDropItemVector function. Remove everything inside the function if (s_vec_item.size() == 0); //this is useless else if (s_vec_item.size() == 1) //even more useless Just put: for(std::vector<std::pair<int,int> >::const_iterator iter = s_vec_item.begin(); iter != s_vec_item.end();++iter) { pInfo.dwVID = m_pkChrTarget->GetVID(); pInfo.race = m_pkChrTarget->GetRaceNum(); pInfo.dwVnum = iter->first; pInfo.count = iter->second; ch->GetDesc()->Packet(&pInfo, sizeof(TPacketGCTargetInfo)); } That's it. Now the constinfo issue. So, open constinfo.py and remove: import app if app.ENABLE_SEND_TARGET_INFO: MONSTER_INFO_DATA = {} Open uitarget.py and after the imports add: MONSTER_INFO_DATA = {} and replace whatever declaration with constinfo.MONSTER_INFO_DATA with just MONSTER_INFO_DATA Now open game.py. Even here, replace constinfo.MONSTER_INFO_DATA with uiTarget.MONSTER_INFO_DATA Last little fix, open intrologin.py Search for: self.stream.SetLoginInfo(id, pwd) the one in: def __OnClickLoginButton(self): add before uiTarget.MONSTER_INFO_DATA.clear() This should fix the issue when you don't close the client and, if you change the drop, you still see the older drop. Now you may ask, why all the other servers who may have this have never crashed or imploded? To be fair, I don't know and I don't care. Just know, if your system is similar to this, be aware of the issues and that this is one but definitely not the only fix possible.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.