Jump to content

Recommended Posts

  • Developer

M2 Download Center

This is the hidden content, please
( Internal )

Hello everyone, today I`m going to show to how to make a VIP system from SRC.

 

You need Launcher SRC, Server SRC.

So, let`s begin.

 

Spoiler

191414kTKlbja.jpg.ef0c831bbbb908d35e8a67

 

1.Launcher:

Go to UserInterface/InstanceBase.h and search 

Spoiler

AFFECT_CHINA_FIREWORK,            // 38

After that add:

Spoiler

AFFECT_VIP = 39,

Search

Spoiler

BOOL                    IsGameMaster();

After that add: 

Spoiler

BOOL                    IsVIP();

1.2 Go to InstanceBase.cpp and search

Spoiler

BOOL CInstanceBase::IsGameMaster()
{
    if (m_kAffectFlagContainer.IsSet(AFFECT_YMIR))
        return true;
    return false;
}

After that add: 

Spoiler

BOOL CInstanceBase::IsVIP()
{
    if (m_kAffectFlagContainer.IsSet(AFFECT_VIP))
        return true;
    return false;
}

In same file search:

Spoiler

if (IsGameMaster())
        return TRUE;

And after that add: 

Spoiler

if (IsVIP())
        return TRUE;

//if you got bugs don`t add this line.

Search: 

Spoiler

if (rkInstDst.IsGameMaster())
        return TRUE;

After that add:

Spoiler

if (rkInstDst.IsVIP())
        return TRUE;

1.3: In file InstanceBaseEffect.cpp search

Spoiler

if (pkInstMain->IsGameMaster())
    {
    }

After that add:

Spoiler

else if (pkInstMain->IsVIP())
    {
    }

Search: 

Spoiler

if (IsGameMaster())
        return;

After that add:

Spoiler

if (IsVIP())
        return;

Search:

Spoiler

case AFFECT_YMIR:
            if (IsAffect(AFFECT_INVISIBILITY))
                return;
            break;

After that add:

Spoiler

case AFFECT_VIP:
            if (IsAffect(AFFECT_INVISIBILITY))
                return;
            break;
/*

1.4 In fine PythonCharacterModule.cpp search:

Spoiler

PyObject * chrIsGameMaster(PyObject* poSelf, PyObject* poArgs)
{
    int iVirtualID;
    if (!PyTuple_GetInteger(poArgs, 0, &iVirtualID))
        return Py_BuildException();

    CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(iVirtualID);
    if (!pInstance)
        return Py_BuildValue("i", 0);

    return Py_BuildValue("i", pInstance->IsGameMaster());
}

And after that add: 

Spoiler

PyObject * chrIsVIP(PyObject* poSelf, PyObject* poArgs)
{
    int iVirtualID;
    if (!PyTuple_GetInteger(poArgs, 0, &iVirtualID))
        return Py_BuildException();

    CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(iVirtualID);
    if (!pInstance)
        return Py_BuildValue("i", 0);

    return Py_BuildValue("i", pInstance->IsVIP());
}

Search: 

Spoiler

{ "IsGameMaster",                chrIsGameMaster,                    METH_VARARGS },

And after that add:

Spoiler

{ "IsVIP",                        chrIsVIP,                            METH_VARARGS },

Launcher part done.

2.SERVER

2.1 In file common/length.h search:

Spoiler

GM_PLAYER,

And after that add: 

Spoiler

GM_VIP,

2.2 In file game/src/affect.h search:

Spoiler

AFF_CHINA_FIREWORK,

And after add: 

Spoiler

AFF_VIP = 39,

2.3 In file game/src/char.cpp search: 

Spoiler

if (GetGMLevel() > GM_LOW_WIZARD)
        {
            m_afAffectFlag.Set(AFF_YMIR);
            m_bPKMode = PK_MODE_PROTECT;
        }

And after add: 

Spoiler

else if (GetGMLevel() == GM_VIP)
        {
            m_afAffectFlag.Set(AFF_VIP);
            //m_bPKMode = PK_MODE_PROTECT; //delete '//' if you want GM protection for VIP.
        

}

Search 

Spoiler

if (GetLevel() < PK_PROTECT_LEVEL)
        m_bPKMode = PK_MODE_PROTECT;

And after that add: 

Spoiler

else if (GetGMLevel() == GM_VIP)
    {
        m_afAffectFlag.Set(AFF_VIP);
        //m_bPKMode = PK_MODE_PROTECT; //delete '//' if you want GM protection for VIP.
    }

2.4 In file game/src/config.cpp search

Spoiler

if (!strcasecmp(levelname, "LOW_WIZARD"))
                level = GM_LOW_WIZARD;

And mofify like that:

Spoiler

if (!strcasecmp(levelname, "VIP"))
                level = GM_VIP;
            
            else if (!strcasecmp(levelname, "LOW_WIZARD"))
                level = GM_LOW_WIZARD;

2.5 In file db/src/ClientManager.cpp search:

Spoiler

else if (!stAuth.compare("WIZARD"))
            Info.m_Authority = GM_WIZARD;

And after that add:

Spoiler

else if (!stAuth.compare("VIP"))
            Info.m_Authority = GM_VIP;

3.MYSQL

3.1 Go to your database->COMMON->RIGHT CLICK ON gmlist->DESIGN TABLE->SELECT mAuthority from Fields TAB->VALUES->ADD VIP AFTER PLAYER.

4.CLIENT

4.1. In file ROOT/PlayerSettingModule.py search 

Spoiler

chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+37, "", "d:/ymir work/effect/etc/guild_war_flag/flag_yellow.mse")

And after that add:

Spoiler

chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+38, "Bip01", "locale/en/effect/vip.mse")

Edit locale/en with your locale : ex locale/ro || locale/de

4.2 In locale go to effect folder(WHERE YOU HAVE GM.MSE) and add THIS FILES:

 

This is the hidden content, please

 


Post any problems/bugs and we will solve them tohether ;)

Sorry for my bad english..:(

  • Metin2 Dev 80
  • Eyes 2
  • Dislove 2
  • Not Good 1
  • Sad 2
  • Cry 1
  • Smile Tear 3
  • Think 3
  • Scream 1
  • Lmao 3
  • Good 44
  • Love 7
  • Love 77

r

Link to comment
Share on other sites

Well I guess doing it using the GM table is not the best solution. When you add a player to the group of VIP you have to write it into the common/gm_list and type /reload a into the chat. That's not the best solution but it shoukd work. I guess via a new quest function (pc.set_vip(true)) or something like this it would be much more comfortable for server admins. 

Link to comment
Share on other sites

  • Developer
1 minute ago, VegaS said:

 


if (GetGMLevel() == GM_VIP)
	    {
	        m_afAffectFlag.Set(AFF_VIP);
	    }


 

else if (GetGMLevel() == GM_VIP)
	        {
	            m_afAffectFlag.Set(AFF_VIP);
	        }


 

For remove  PK_PROTECTED .

I edited the post already..

Is ok anyway..

r

Link to comment
Share on other sites

  • Developer
8 hours ago, ShadowsPR0 said:

Im implementing it now will come back with Edit ^_^

 

My DB doesnt compile X_X can this work without modifying DB ?

Yes you can, but without a new GM level, you can use GOD authority..

Send me a pm with error and i will try to fix it.

r

Link to comment
Share on other sites

  • Developer
1 hour ago, terrorr said:

This one bro :

chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+38, "Bip01", "d:\locale\ro\effect\vip.mse")

Have to be like that:

chrmgr.RegisterEffect(chrmgr.EFFECT_AFFECT+38, "Bip01", "locale/en/effect/vip.mse")

 

Regards.

Ohh, my bad, my client is crypted so.. i`m using with d:\

ThX fot feedback :3

-EDIT- - Skype

Edited by Shisui
Skype ID removed (Read Board Rules)

r

Link to comment
Share on other sites

Announcements



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