Jump to content

Recommended Posts

  • VIP

M2 Download Center

Download Here  ( Internal )
Download Here  ( MEGA )
Download Here  ( 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

041932EventBannerFlag.jpg

 

250914GreyInfo.pngHow 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.

  1. Edit @ data/banner/list.txt and extended the file with:
     ___________________
    | VNUM  | NAME      |
    |------ | ----------|    
    | 20138 | ramadan |
     ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

     

  2. Make duplicates of the existing banners.
    1. 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.
       
    2. 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.
       
    3. 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.
       
  3. @ 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.

 

250914GreyInfo.pngHow 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

 

  • Love 10
  • Love 1
  • Good 2
Link to post

This doesnt work for me, the first release (Slot Machine) doesnt work too. :( 

In Slot Machine i get a core crash.. 

 

Edited by Kafa
Link to post
  • VIP
Posted (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:

[[email protected] ~]# cd < Directory were .core is generated >
[[email protected] ~]# gdb
[[email protected] ~]# set gnutarget i386-marcel-freebsd
[[email protected] ~]# file < Name of the core file >
[[email protected] ~]# core < Name of the .core file >
[[email protected] ~]# bt full
[[email protected] ~]# backtrace

Here is an example of how it should look like:

[[email protected] ~]# cd /m2server/game/channel1/core1
[[email protected] ~]# gdb
[[email protected] ~]# set gnutarget i386-marcel-freebsd
[[email protected] ~]# file game
[[email protected] ~]# core game.core
[[email protected] ~]# bt full
[[email protected] ~]# backtrace
 Do you also have errors while compiling? If yes, show us the complete output of the compiler errors.

 

252730RedInfo.pngPlease make sure before posting, you are submitting the issues regarding the post / system to avoid off-topic.


Sincerely,
Owasp.

Edited by Owsap
  • Good 1
Link to post
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:


[[email protected] ~]# cd < Directory were .core is generated >
[[email protected] ~]# gdb
[[email protected] ~]# set gnutarget i386-marcel-freebsd
[[email protected] ~]# file < Name of the core file >
[[email protected] ~]# core < Name of the .core file >
[[email protected] ~]# bt full
[[email protected] ~]# backtrace

Here is an example of how it should look like:


[[email protected] ~]# cd /m2server/game/channel1/core1
[[email protected] ~]# gdb
[[email protected] ~]# set gnutarget i386-marcel-freebsd
[[email protected] ~]# file game
[[email protected] ~]# core game.core
[[email protected] ~]# bt full
[[email protected] ~]# backtrace
 Do you also have errors while compiling? If yes, show us the complete output of the compiler errors.

 

252730RedInfo.pngPlease 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--
    [email protected]: 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 by Kafa
Link to post
  • VIP
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.

Link to post
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 by Kafa
Link to post
  • VIP
2 minutes ago, Kafa 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

 

Link to post
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 post
  • VIP
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.

Link to post
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 post
  • VIP
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.

Link to post

 [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 by memett4545
Link to post
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 post
  • Honorable Member
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://i.imgur.com/nisKAaJ.png

  • Good 2

🌛

Link to post
  • VIP
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>

 

Link to post
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 ❤️

spacer.png

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.