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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

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