Jump to content

How To Add HP Regen to Target Info System


Recommended Posts

Image: https://imgur.com/a/1XlP7LM

 

 

1. Client Source/UserInterface/PythonNonPlayer.cpp

search:

DWORD CPythonNonPlayer::GetMonsterMaxHP(DWORD dwVnum)

below this function, add:

DWORD CPythonNonPlayer::GetMonsterRegenPercent(DWORD dwVnum)
{
	const CPythonNonPlayer::TMobTable* c_pTable = GetTable(dwVnum);
	if (!c_pTable)
	{
		DWORD bRegenPercent = 0;
		return bRegenPercent;
	}

	return c_pTable->bRegenPercent;
}

DWORD CPythonNonPlayer::GetMonsterRegenRate(DWORD dwVnum)
{
	const CPythonNonPlayer::TMobTable* c_pTable = GetTable(dwVnum);
	if (!c_pTable)
	{
		DWORD bRegenCycle = 0;
		return bRegenCycle;
	}

	return c_pTable->bRegenCycle;
}

PythonNonPlayer.h:

search:

		DWORD				GetMonsterMaxHP(DWORD dwVnum);

below, add:

		DWORD               GetMonsterRegenRate(DWORD dwVnum);
		DWORD               GetMonsterRegenPercent(DWORD dwVnum);

PythonNonPlayerModule.cpp:

search:

PyObject * nonplayerGetMonsterMaxHP(PyObject * poSelf, PyObject * poArgs)

add below:

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

	CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

	return Py_BuildValue("i", rkNonPlayer.GetMonsterRegenRate(race));
}
PyObject * nonplayerGetMonsterRegenPercent(PyObject * poSelf, PyObject * poArgs)
{
	int race;
	if (!PyTuple_GetInteger(poArgs, 0, &race))
		return Py_BuildException();

	CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();

	return Py_BuildValue("i", rkNonPlayer.GetMonsterRegenPercent(race));
}

search:

{ "GetMonsterMaxHP",			nonplayerGetMonsterMaxHP,			METH_VARARGS },

below, add:

		{ "GetMonsterRegenRate",		nonplayerGetMonsterRegenRate,		METH_VARARGS },
		{ "GetMonsterRegenPercent",		nonplayerGetMonsterRegenPercent,	METH_VARARGS },

2. client/pack/root/uitarget.py:

search:

				self.AppendTextLine(localeInfo.TARGET_INFO_EXP % str(iExp))

add below:

				self.AppendTextLine(localeInfo.TARGET_INFO_REGEN % (str(nonplayer.GetMonsterRegenPercent(race)), str(nonplayer.GetMonsterRegenRate(race))))

3. client/pack/locale/locale_game.txt

search:

TARGET_INFO_MAX_HP	Max. HP : %s

add:

TARGET_INFO_REGEN	HP Regen: %s%% every %s seconds

Done!

 

 

Bonus: If you don't want Target Info to show "Damage: 1-5" for Metin stones, in uitarget.py, replace:

self.AppendTextLine(localeInfo.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax)))

with

				if not(nonplayer.IsMonsterStone(race)):
					self.AppendTextLine(localeInfo.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax)))

 

  • Love 4
Link to post
  • 1 month later...
  • ASIKOO changed the title to How To Add HP Regen to Target Info System

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


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