Jump to content
metin2dev
Metin2International
Wahmon

[RELEASE] VIP System from SRC

Recommended Posts

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.

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:

NEW LINK - FIXED

In game will be like that:

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

Sorry for my bad english..:(

  • Like 14

Share this post


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

Share this post


Link to post
Share on other sites
6 minutes ago, Aurora said:

Do you have src for VIP Channel?

No but is easy to do this with a quest:

Verify if player is on vip ch when login and if is and is not a vip kick him..

Share this post


Link to post
Share on other sites
3 minutes ago, DasSchwarzeT said:

Well if you do it like this tutorial, VIP players can't be attacked because of PK_PROTECTED.

 

Yes, i know...

This is a VIP Feature...is easy to remove this feature -_-

 

Share this post


Link to post
Share on other sites

 

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

  - delete

For remove  PK_PROTECTED .

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
2 minutes ago, Wahmon said:

I edited the post already..

Is ok anyway..

Are you serious? xD

void CInstanceBase::__AttachEmpireEffect(DWORD eEmpire) 

 
	if (IsVIP())
	        return;    

 

Share this post


Link to post
Share on other sites
1 minute ago, VegaS said:

Are you serious? xD

 


void CInstanceBase::__AttachEmpireEffect(DWORD eEmpire) 


 

    


if (IsVIP())

	        return;    


 

 

What`s wrong with that ?

Share this post


Link to post
Share on other sites
1 minute ago, VegaS said:

Are you serious? xD


void CInstanceBase::__AttachEmpireEffect(DWORD eEmpire) 


 

	if (IsVIP())
	        return;    


 

Well if you are from another kingdom and VIP there would be two effects and this won't look good. I guess that's why he did this.

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites

I can't atack a VIP person on FREE,I have this function dezactivated with // "  //m_bPKMode = PK_MODE_PROTECT; //delete '//' if you want GM protection for VIP.  "

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   1 member

×