Jump to content

[C++]Level en los mobs


Dragonslayer

Recommended Posts

Antes de nada. Todo el merito es de Dennis(metin2dev). Yo solo publico como lo tengo.

 

Screensho_wswwawx.png

 

InstanceBase.cpp

Cambiar: m_dwLevel = c_rkCreateData.m_dwLevel

 

Por:

BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace);

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

 

Si no tenies incluido PythonNonPlayer.h lo poneis.

 

 

PythonNonPlayer.h

Lo dejais como yo

d239daefd5f125d59dea4f9f41467a66.png

 

std::map<DWORD, BYTE> LevelByVnum;

 

BYTE GetMobLevel(DWORD dwVnum);

 

PythonNonPlayer.cpp

Lo dejais como yo

a9fe91b48aaed67d5c23997d9dfae657.png

 

LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel; //edit

 

Y añadis esto por el final.

 

6577ccc758e76b13c2bba904f9bda9d1.png

 

BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum) //edit
{
map<DWORD, BYTE>::iterator it;
it = LevelByVnum.find(dwVnum);
if (it != LevelByVnum.end()) {
return it->second;
}
return 0;
}

 

Eso es todo, los creditos de Dennis

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...