Honorable Member Owsap 8150 Posted April 4, 2021 Honorable Member Share Posted April 4, 2021 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) This is the hidden content, please Sign In or Sign Up ( MEGA ) This is the hidden content, please Sign In or Sign Up ( GitHub ) Hello, this release is nothing special but I hope someone finds it useful for their server. Introduced in the 10th anniversary of Metin2, your city will look more appealing with banner flags describing the on-going event your server is currently running. Spoiler How to add more banners? @ data/banner/list.txt ___________________ | VNUM | NAME | |------ | ----------| | 20142 | halloween | | 20143 | easter | | 20135 | xmas | ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ You can simply add more banner flags following the example above. VNUM is the VNUM / ID of the NPC. NAME is the name of the command and file of the banner. Note: If you want to add for example the Ramadan Banner which VNUM is 20138, this is how you should do it step by step. Edit @ data/banner/list.txt and extended the file with: ___________________ | VNUM | NAME | |------ | ----------| | 20138 | ramadan | ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Make duplicates of the existing banners. Copy data/banner/a/xmas.txt and rename the duplicated file to data/banner/a/ramadan.txt Edit data/banner/a/ramadan.txt and replace the VNUM / ID with the Ramadan Banner 20138. Copy data/banner/b/xmas.txt and rename the duplicated file to data/banner/b/ramadan.txt Edit data/banner/b/ramadan.txt and replace the VNUM / ID with the Ramadan Banner 20138. Copy data/banner/c/xmas.txt and rename the duplicated file to data/banner/c/ramadan.txt Edit data/banner/c/ramadan.txt and replace the VNUM / ID with the Ramadan Banner 20138. @ Source/Client/UserInterface/InstanceBase.cpp Search #if defined(ENABLE_EVENT_BANNER_FLAG) BOOL CInstanceBase::IsBannerFlag() { if (GetRace() >= 20127 && GetRace() <= 20143) return TRUE; return FALSE; } #endif Replace with (If you want it to be more manageable) #if defined(ENABLE_EVENT_BANNER_FLAG) BOOL CInstanceBase::IsBannerFlag() { switch(GetRace()) { case 20127: // Anniversary Banner 1 case 20128: // Anniversary Banner 2 case 20129: // Anniversary Banner 3 case 20130: // Anniversary Banner 4 case 20131: // Anniversary Banner 5 case 20132: // Anniversary Banner 6 case 20133: // Anniversary Banner 7 case 20134: // Solar Banner case 20135: // Christmas Banner case 20138: // Ramadan Banner case 20142: // Halloween Banner case 20143: // Easter Banner return TRUE; } return FALSE; } #endif Don't forget each folder (a / b / c) have different positions so be careful when copying files. How to activiate? In-game, you can use the command: /banner < x > < banner_name > where < x > is the status ( 1 : ON / 0 : OFF ) and < banner_name > is the name of the banner @ data/banner/list.txt 76 1 1 3 2 1 15 1 5 48 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 4, 2021 Share Posted April 4, 2021 (edited) This doesnt work for me, the first release (Slot Machine) doesnt work too. In Slot Machine i get a core crash.. Edited April 4, 2021 by Kafa Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8150 Posted April 4, 2021 Author Honorable Member Share Posted April 4, 2021 (edited) 13 minutes ago, Kafa said: This doesnt work for me, the first release (Slot Machine) doesnt work too. In Slot Machine i get a core crash.. You must show us the problem, what errors are you having? You cannot expect help just by saying that it doesn't work or it crashes. Can you run the debugger (gdb)? First of all, if you don’t have the gdb package run the command: pkg install -y gdb Learn how-to here: In short these are the commands that you need: [root@localhost ~]# cd < Directory were .core is generated > [root@localhost ~]# gdb [root@localhost ~]# set gnutarget i386-marcel-freebsd [root@localhost ~]# file < Name of the core file > [root@localhost ~]# core < Name of the .core file > [root@localhost ~]# bt full [root@localhost ~]# backtrace Here is an example of how it should look like: [root@localhost ~]# cd /m2server/game/channel1/core1 [root@localhost ~]# gdb [root@localhost ~]# set gnutarget i386-marcel-freebsd [root@localhost ~]# file game [root@localhost ~]# core game.core [root@localhost ~]# bt full [root@localhost ~]# backtrace Do you also have errors while compiling? If yes, show us the complete output of the compiler errors. Please make sure before posting, you are submitting the issues regarding the post / system to avoid off-topic. Sincerely, Owasp. Edited April 4, 2021 by Owsap 2 2 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 4, 2021 Share Posted April 4, 2021 (edited) Just now, Owsap said: You must show us the problem, what errors are you having? You cannot expect help just by saying that it doesn't work or it crashes. Can you run the debugger (gdb)? First of all, if you don’t have the gdb package run the command: pkg install -y gdb Learn how-to here: In short these are the commands that you need: [root@localhost ~]# cd < Directory were .core is generated > [root@localhost ~]# gdb [root@localhost ~]# set gnutarget i386-marcel-freebsd [root@localhost ~]# file < Name of the core file > [root@localhost ~]# core < Name of the .core file > [root@localhost ~]# bt full [root@localhost ~]# backtrace Here is an example of how it should look like: [root@localhost ~]# cd /m2server/game/channel1/core1 [root@localhost ~]# gdb [root@localhost ~]# set gnutarget i386-marcel-freebsd [root@localhost ~]# file game [root@localhost ~]# core game.core [root@localhost ~]# bt full [root@localhost ~]# backtrace Do you also have errors while compiling? If yes, show us the complete output of the compiler errors. Please make sure before posting, you are submitting the issues regarding the post / system to avoid off-topic. Sincerely, Owasp. (gdb) bt full #0 CHARACTER::StartSlotMachine (this=0x524429c0, bBet=<optimized out>) at char.cpp:12602 bSlot = <error reading variable bSlot (Cannot access memory at address 0x0)> iPrice = <optimized out> iFound = <optimized out> bJackPot = false iWinnings = 0 GCPacket = <optimized out> iSlotMachineMltiplier = <optimized out> iSlotMachineReels = <optimized out> #1 0x08132759 in CInputMain::SlotMachine (this=<optimized out>, ch=<optimized out>, c_pData=0x2 <error: Cannot access memory at address 0x2>) at input_main.cpp:4088 CGPacket = 0x2 #2 CInputMain::Analyze (this=0x51fd5878, d=0x51fd5800, bHeader=170 '\252', c_pData=0x2b757000 "\252\002\001") at input_main.cpp:4378 ch = <optimized out> iExtraLen = <error reading variable iExtraLen (Cannot access memory at address 0x0)> #3 0x0811b05e in CInputProcessor::Process (this=0x51fd5878, lpDesc=0x51fd5800, c_pvOrig=0x2b757000, iBytes=8, --Type <RET> for more, q to quit, c to continue without paging-- r_iBytesProceed=@0xffbfb764: 0) at input.cpp:117 iExtraPacketSize = <optimized out> bHeader = <optimized out> c_pszName = <optimized out> originalPacketSize = <optimized out> preAnalyzeSeq = <optimized out> c_pData = <optimized out> iPacketLen = <optimized out> #4 0x080f37a8 in DESC::ProcessInput (this=0x51fd5800) at desc.cpp:356 tempbuf = <optimized out> lpBufferDecrypt = <optimized out> iSizeAfter = <optimized out> iBytesProceed = <optimized out> iSizeBuffer = 8 bytes_read = <optimized out> #5 0x08234230 in io_loop (fdw=0x2a5b1480) at main.cpp:1042 iRet = 0 num_events = <optimized out> event_idx = 6 d = 0x51fd5800 #6 0x08233f02 in idle () at main.cpp:928 pta = {tv_sec = 1617551188, tv_usec = 27569} process_time_count = 14 --Type <RET> for more, q to quit, c to continue without paging-- passed_pulses = <optimized out> t = 82627 now = <optimized out> #7 0x08232675 in main (argc=1, argv=0xffbfec6c) at main.cpp:605 sectree_manager = <optimized out> strPackageCryptInfoDir = <optimized out> mini_game = <optimized out> quest_manager = <optimized out> growth_pet_manager = <optimized out> switchbot = <optimized out> TempleOchao_manager = <optimized out> MeleyLair_manager = <optimized out> dsManager = <optimized out> SSManager = <optimized out> groupmatch_manager = <optimized out> dl_manager = <optimized out> threeway_war = <optimized out> spam_mgr = <optimized out> o9r = <optimized out> ba = <optimized out> profiler = <optimized out> polymorph_utils = <optimized out> SkillPowerByLevel = <optimized out> --Type <RET> for more, q to quit, c to continue without paging-- trafficProfiler = <optimized out> desc_manager = <optimized out> zodiac_manager = <optimized out> horsename_manager = <optimized out> Monarch = <optimized out> OXEvent_manager = <optimized out> arena_manager = <optimized out> item_addon_manager = <optimized out> wedding_manager = <optimized out> marriage_manager = <optimized out> target_manager = <optimized out> building_manager = <optimized out> war_map_manager = <optimized out> priv_manager = <optimized out> banword_manager = <optimized out> refine_manager = <optimized out> dungeon_manager = <optimized out> mark_manager = <optimized out> guild_manager = <optimized out> p2p_manager = <optimized out> messenger_manager = <optimized out> log_manager = <optimized out> account_db = <optimized out> --Type <RET> for more, q to quit, c to continue without paging-- db_manager = <optimized out> lzo_manager = <optimized out> pvp_manager = <optimized out> skill_manager = <optimized out> party_manager = <optimized out> motion_manager = <optimized out> mob_manager = <optimized out> shop_manager = <optimized out> item_manager = <optimized out> char_manager = <optimized out> And regarding to this topic. If i type /banner 1 easter nothing really happens, everything is correct.. Edited April 4, 2021 by Kafa Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8150 Posted April 4, 2021 Author Honorable Member Share Posted April 4, 2021 4 minutes ago, Kafa said: And regarding to this topic. If i type /banner 1 easter nothing really happens, everything is correct.. Did you add the data files to your server files? And please show your char_manager.cpp and char_manager.h You can use https://metin2.dev/bin/ to paste your files. 2 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 4, 2021 Share Posted April 4, 2021 (edited) Just now, Owsap said: Did you add the data files to your server files? And please show your char_manager.cpp and char_manager.h You can use https://metin2.dev/bin/ to paste your files. https://metin2.dev/bin/?9843fb5860c1b5e7#AVdfaLjB5Pnxn5nHcwGY8Y1MdPUD4wsENxighLVnQpDD .cpp https://metin2.dev/bin/?6fc610a9d34a3651#862m1UkGgDdd5i7Nm5DL7kqdR6kLJPSQpx8K3aA9EoGg .h And yes bro, i do have data files. Edited April 4, 2021 by Kafa 1 1 Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8150 Posted April 4, 2021 Author Honorable Member Share Posted April 4, 2021 2 minutes ago, Kafa said: https://metin2.dev/bin/?9843fb5860c1b5e7#AVdfaLjB5Pnxn5nHcwGY8Y1MdPUD4wsENxighLVnQpDD .cpp https://metin2.dev/bin/?6fc610a9d34a3651#862m1UkGgDdd5i7Nm5DL7kqdR6kLJPSQpx8K3aA9EoGg .h Do you have the NPC's implemented? 20127 Anniversary Banner 1 20128 Anniversary Banner 2 20129 Anniversary Banner 3 20130 Anniversary Banner 4 20131 Anniversary Banner 5 20132 Anniversary Banner 6 20133 Anniversary Banner 7 20134 Solar Banner 20135 Christmas Banner 20138 Ramadan Banner 20142 Halloween Banner 20143 Easter Banner https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 4, 2021 Share Posted April 4, 2021 Just now, Owsap said: Do you have the NPC's implemented? 20127 Anniversary Banner 1 20128 Anniversary Banner 2 20129 Anniversary Banner 3 20130 Anniversary Banner 4 20131 Anniversary Banner 5 20132 Anniversary Banner 6 20133 Anniversary Banner 7 20134 Solar Banner 20135 Christmas Banner 20138 Ramadan Banner 20142 Halloween Banner 20143 Easter Banner They're all implemented bro. Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8150 Posted April 4, 2021 Author Honorable Member Share Posted April 4, 2021 Just now, Kafa said: They're all implemented bro. Type /e banner 20143, wait 5 - 10 seconds and restart the server and then check if they have appeared. https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 4, 2021 Share Posted April 4, 2021 Just now, Owsap said: Type /e banner 20143, wait 5 - 10 seconds and restart the server and then check if they have appeared. This worked. Thank you Bro do you have a solution for slot machine? I don't think i did something wrong. Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8150 Posted April 4, 2021 Author Honorable Member Share Posted April 4, 2021 15 minutes ago, Kafa said: This worked. Thank you The issue was that the banner list wasn't being initialized with the command if the game event flag wasn't enabled before. So here is what you must change; /// 1. // Search @ CHARACTER_MANAGER::SpawnBanners if (!m_bIsLoadedBanners) return false; // Replace with if (!m_bIsLoadedBanners) InitializeBanners(); Topic: Updated MEGA (Link) & committed an updated to the repository. https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
memett4545 6 Posted April 5, 2021 Share Posted April 5, 2021 (edited) [OK] Compiling: BattleArena.cpp In file included from BattleArena.cpp:6: char_manager.h:127:2: error: 'BannerMapType' does not name a type; did you mean 'EBannerMapIndex'? BannerMapType BannerMap; ^~~~~~~~~~~~~ EBannerMapIndex gmake: *** [Makefile:183: .obj/BattleArena.o] Error 1 char_manager.cpp private: BannerMapType BannerMap; bool m_bIsLoadedBanners; i am getting an error Edited April 5, 2021 by memett4545 Link to comment Share on other sites More sharing options...
Kafa 153 Posted April 5, 2021 Share Posted April 5, 2021 Just now, memett4545 said: [OK] Compiling: BattleArena.cpp In file included from BattleArena.cpp:6: char_manager.h:127:2: error: 'BannerMapType' does not name a type; did you mean 'EBannerMapIndex'? BannerMapType BannerMap; ^~~~~~~~~~~~~ EBannerMapIndex gmake: *** [Makefile:183: .obj/BattleArena.o] Error 1 char_manager.cpp private: BannerMapType BannerMap; bool m_bIsLoadedBanners; i am getting an error You did something wrong. Check Server Source again. Link to comment Share on other sites More sharing options...
memett4545 6 Posted April 5, 2021 Share Posted April 5, 2021 3 hours ago, Kafa said: You did something wrong. Check Server Source again. I don't have this code in my file can you help me char_manager.cpp /// 1. // Search typedef std::map<DWORD, CHARACTER_SET> pkCharRaceSet; https://metin2.dev/bin/?9409a589ed8dfbe6#F8cEAeGv5AM4XkXp1w1CLNb52zd9ac4oh23S5T2VVZVN 2 1 Link to comment Share on other sites More sharing options...
Honorable Member Mali 41745 Posted April 5, 2021 Honorable Member Share Posted April 5, 2021 (edited) 45 minutes ago, memett4545 said: I don't have this code in my file can you help me char_manager.cpp /// 1. // Search typedef std::map<DWORD, CHARACTER_SET> pkCharRaceSet; https://metin2.dev/bin/?9409a589ed8dfbe6#F8cEAeGv5AM4XkXp1w1CLNb52zd9ac4oh23S5T2VVZVN that definition is from here https://metin2.download/picture/z9B6EscgQFTy5Lg54dszffkrqrLKCy2B/.png Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 2 Link to comment Share on other sites More sharing options...
memett4545 6 Posted April 5, 2021 Share Posted April 5, 2021 (edited) 15 minutes ago, Mali61 said: that definition is from here https://metin2.download/picture/z9B6EscgQFTy5Lg54dszffkrqrLKCy2B/.png I did not understand how to solve the problem Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 1 2 Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8150 Posted April 5, 2021 Author Honorable Member Share Posted April 5, 2021 3 hours ago, memett4545 said: I did not understand how to solve the problem Just add it above the class in the char_manager.h file. class CHARACTER_MANAGER : public singleton<CHARACTER_MANAGER> Result #if defined(__EVENT_BANNER_FLAG__) typedef std::map<DWORD, std::string> BannerMapType; #endif class CHARACTER_MANAGER : public singleton<CHARACTER_MANAGER> https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
memett4545 6 Posted April 6, 2021 Share Posted April 6, 2021 (edited) 9 hours ago, Owsap said: Just add it above the class in the char_manager.h file. class CHARACTER_MANAGER : public singleton<CHARACTER_MANAGER> Result #if defined(__EVENT_BANNER_FLAG__) typedef std::map<DWORD, std::string> BannerMapType; #endif class CHARACTER_MANAGER : public singleton<CHARACTER_MANAGER> thank you bro Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
tarantula30 2 Posted September 1, 2021 Share Posted September 1, 2021 thanks Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4871 Posted March 5, 2022 Bot Share Posted March 5, 2022 where are the gr2 models ? Link to comment Share on other sites More sharing options...
Kafa 153 Posted March 5, 2022 Share Posted March 5, 2022 42 minutes ago, Cryptex said: where are the gr2 models ? They're decentralized. 1 Link to comment Share on other sites More sharing options...
Recommended Posts