M&M 22 Posted June 13, 2015 Share Posted June 13, 2015 (edited) How to like this: Probably: addPacket.dwLevel = GetLevel(); Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Tülay 8 Posted June 13, 2015 Share Posted June 13, 2015 I do not think so, but it's certainly from the client source Link to comment Share on other sites More sharing options...
Premium Zeia 2 Posted June 13, 2015 Premium Share Posted June 13, 2015 + Link to comment Share on other sites More sharing options...
Originale 134 Posted June 13, 2015 Share Posted June 13, 2015 Open "char.cpp" Search if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true)) replace if so it looks like this: if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true)) { addPacket.dwLevel = GetLevel(); } else { if(IsPet()){ addPacket.dwLevel = GetLevel(); }else{ addPacket.dwLevel = 0; } } Then open "PetSystem.cpp" and Search m_pkChar->SetPet(); is added below m_pkChar->SetLevel(100); Link to comment Share on other sites More sharing options...
Premium Necro 78 Posted June 13, 2015 Premium Share Posted June 13, 2015 Open "char.cpp" Search if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true)) replace if so it looks like this: if (IsPC() == true && (LC_IsEurope() == true || LC_IsCanada() == true || LC_IsSingapore() == true)) { addPacket.dwLevel = GetLevel(); } else { if(IsPet()){ addPacket.dwLevel = GetLevel(); }else{ addPacket.dwLevel = 0; } } Then open "PetSystem.cpp" and Search m_pkChar->SetPet(); is added below m_pkChar->SetLevel(100); This tutorial is for pet´s.... Link to comment Share on other sites More sharing options...
Benhero 23 Posted June 13, 2015 Share Posted June 13, 2015 Change IsPet() to IsMonster() finish <.< Greatz Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted June 13, 2015 Premium Share Posted June 13, 2015 Hi, new update from gameforge ? Link to comment Share on other sites More sharing options...
M&M 22 Posted June 13, 2015 Author Share Posted June 13, 2015 Change IsPet() to IsMonster() finish <.< Greatz IsMonster() doesn't work. pack.bType must be > 0 if (t->bType == CHAR_TYPE_NPC || t->bType == CHAR_TYPE_WARP || t->bType == CHAR_TYPE_GOTO) CHAR_TYPE_NPC - work but CHAR_TYPE_MONSTER doesn't work. Link to comment Share on other sites More sharing options...
Denis 1474 Posted June 13, 2015 Share Posted June 13, 2015 (edited) At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; After that find: const TMobTable * GetTable(DWORD dwVnum); And add this: BYTE GetMobLevel(DWORD dwVnum); Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work. Edited June 13, 2015 by Denis 4 Link to comment Share on other sites More sharing options...
Premium Necro 78 Posted June 13, 2015 Premium Share Posted June 13, 2015 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work. One more thing -> PythonNonPlayer.h -> difine DWORD GetMobLevel; i hope that is right 1 Link to comment Share on other sites More sharing options...
M&M 22 Posted June 13, 2015 Author Share Posted June 13, 2015 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work. Tons of errors XD http://pastebin.com/MnkrD54x 1 Link to comment Share on other sites More sharing options...
Denis 1474 Posted June 13, 2015 Share Posted June 13, 2015 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work. Tons of errors XD http://pastebin.com/MnkrD54x Upload here the files you edited. 1 Link to comment Share on other sites More sharing options...
M&M 22 Posted June 13, 2015 Author Share Posted June 13, 2015 Edit pls https://mega.co.nz/#!jkBDzDbb!abZpBDh0CXdu2AKuwdX8HGaqtw4BJrme1W56LEh6unM Link to comment Share on other sites More sharing options...
Premium Ocelot2606 140 Posted June 13, 2015 Premium Share Posted June 13, 2015 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; After that find: const TMobTable * GetTable(DWORD dwVnum); And add this: BYTE GetMobLevel(DWORD dwVnum); Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work Dont work Link to comment Share on other sites More sharing options...
Denis 1474 Posted June 13, 2015 Share Posted June 13, 2015 (edited) Edit pls https://mega.co.nz/#!jkBDzDbb!abZpBDh0CXdu2AKuwdX8HGaqtw4BJrme1W56LEh6unM https://mega.co.nz/#!ftIH2JIS!9KOs9tv-wcqKpVDWFKthvh9iMOa5nbepu6VrVuQ_hk0 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; After that find: const TMobTable * GetTable(DWORD dwVnum); And add this: BYTE GetMobLevel(DWORD dwVnum); Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work Dont work I just implemented it and it worked: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/ Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 1 2 Link to comment Share on other sites More sharing options...
Yiv 321 Posted June 13, 2015 Share Posted June 13, 2015 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; After that find: const TMobTable * GetTable(DWORD dwVnum); And add this: BYTE GetMobLevel(DWORD dwVnum); Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work. Why did you add the new map LevelByVnum and not just implemented the CPythonNonPlayer::GetMobLevel(DWORD dwVnum) like this: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum); if (!c_pTable) return 0; return c_pTable->bLevel; } Regards Link to comment Share on other sites More sharing options...
Denis 1474 Posted June 13, 2015 Share Posted June 13, 2015 At client src: Change this(InstanceBase.cpp): m_dwLevel = c_rkCreateData.m_dwLevel To this: BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); Ah and don't forget to include PythonNonPlayer.h After that open PythonNonPlayer.h and add this: std::map<DWORD, BYTE> LevelByVnum; After that find: const TMobTable * GetTable(DWORD dwVnum); And add this: BYTE GetMobLevel(DWORD dwVnum); Next we need to open PythonNonPlayer.cpp: Find this line: m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData)); Under that line add this: LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; And finally add this event: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } It's untested but it will probably work. Why did you add the new map LevelByVnum and not just implemented the CPythonNonPlayer::GetMobLevel(DWORD dwVnum) like this: BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum); if (!c_pTable) return 0; return c_pTable->bLevel; } Regards I don't know, I guess I forgot that I could do it like this 1 Link to comment Share on other sites More sharing options...
M&M 22 Posted June 13, 2015 Author Share Posted June 13, 2015 (edited) Work fine thx @Denis Last question, how to visible level metin stone too: Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Ocelot2606 140 Posted June 13, 2015 Premium Share Posted June 13, 2015 (edited) For me Not i do BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) { map<DWORD, BYTE>::iterator it; it = LevelByVnum.find(dwVnum); if (it != LevelByVnum.end()) { return it->second; } return 0; } under bool CPythonNonPlayer::LoadNonPlayerData(const char * c_szFileName) an insert after bool CPythonNonPlayer::LoadNonPlayerData(const char * c_szFileName) this line LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; I replace m_dwLevel = c_rkCreateData.m_dwLevel; with this BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace); m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); and i icnlude PythonPlayer.h at least i add DWORD GetMobLevel; std::map<DWORD, BYTE> LevelByVnum; under BYTE bType; // Monster, NPC BYTE bRank; // PAWN, KNIGHT, KING BYTE bBattleType; // MELEE, etc.. BYTE bLevel; // Level BYTE bSize; but i cant compile Edited June 13, 2015 by Ocelot2606 Link to comment Share on other sites More sharing options...
ronniwe 2 Posted June 13, 2015 Share Posted June 13, 2015 (edited) Hi, thanks Denis. I add for see lvl in metin stones only replace: m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel); for: m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && (c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY || c_rkCreateData.m_bType == CActorInstance::TYPE_STONE)) ? level_mob : c_rkCreateData.m_dwLevel); Regards. Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
Premium Ocelot2606 140 Posted June 13, 2015 Premium Share Posted June 13, 2015 Finally it works ty Link to comment Share on other sites More sharing options...
Krixius 13 Posted August 14, 2015 Share Posted August 14, 2015 How can i add a option for show / hide the lv of mobs like oficial servers? Regards Link to comment Share on other sites More sharing options...
Cyxer 140 Posted November 23, 2015 Share Posted November 23, 2015 Work ! Thnx @Denis! How i can edit the text Lv? 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