Jump to content

Mobs Level - New update gameforge


Recommended Posts

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

  • Premium

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

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 by Denis
  • Love 4
Link to comment
Share on other sites

  • Premium

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 :D

  • Love 1
Link to comment
Share on other sites

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

  • Metin2 Dev 1
Link to comment
Share on other sites

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.

  • Love 1
Link to comment
Share on other sites

  • Premium

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

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 by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 2
Link to comment
Share on other sites

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

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 :P

  • Love 1
Link to comment
Share on other sites

  • Premium

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 by Ocelot2606
Link to comment
Share on other sites

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);

tcwqevQ.png

Regards.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.