Jump to content
×
×
  • Create New...
  • 0

Mobs Level - New update gameforge


M&M

Question

22 answers to this question

Recommended Posts

  • 0

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
  • 0
  • 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
  • 0

Change IsPet() to IsMonster() finish <.<

 

Greatz

 IsMonster() doesn't work.

pack.bType must be > 0

if (t->bType == CHAR_TYPE_NPC || t->bType == CHAR_TYPE_WARP || t->bType == CHAR_TYPE_GOTO)

CHAR_TYPE_NPC - work but CHAR_TYPE_MONSTER doesn't work.

 

Link to comment
  • 0

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
  • 0
  • 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
  • 0

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
  • 0

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
  • 0
  • 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
  • 0

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: http://postimg.org/image/fh8igv6n7/

  • Metin2 Dev 1
  • Love 2
Link to comment
  • 0

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
  • 0

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
  • 0
  • 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
  • 0

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.

  • Love 2
Link to comment

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


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.