Jump to content

Leadership Skill Description: Bonus Values Display Fix


Recommended Posts

  • Active+ Member

Required skill level: Begginer

Estimated time of work: 5 min

Hello everyone,

I noticed that the leadership skill spacer.png description isn't showing bonus values correctly, so let's get this fixed!

This is the hidden content, please

Edited by ReFresh
  • Metin2 Dev 115
  • kekw 1
  • Eyes 2
  • Scream 1
  • Lmao 1
  • Good 25
  • Love 2
  • Love 29

I'll be always helpful!  😉

That's not correct, "skillPower" use the value of "player.GetSkillCurrentEfficientPercentage". The real fix is to use "skill.GetSkillPowerByLevel" as the server side do.

 

	## uiTooltip.py
  	def AppendPartySkillData(self, skillGrade, skillLevel):
		# @fixme008 BEGIN
		def comma_fix(vl):
			return vl.replace("%,0f", "%.0f")
		# @fixme008 END

		if 1 == skillGrade:
			skillLevel += 19
		elif 2 == skillGrade:
			skillLevel += 29
		elif 3 == skillGrade:
			skillLevel =  40

		if skillLevel <= 0:
			return

		skillIndex = player.SKILL_INDEX_TONGSOL
		slotIndex = player.GetSkillSlotIndex(skillIndex)
		skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
		if localeInfo.IsBRAZIL():
			k = skillPower
		else:
			# k = player.GetSkillLevel(skillIndex) / 100.0
			k = float( skill.GetSkillPowerByLevel(skillLevel) ) /100
		self.AppendSpace(5)
		self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
		bonusPercent = 0
		# @fixme008 BEGIN

		if skillLevel>=10:
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % int(10 + 60 * k ) )
			bonusPercent = 5
		if skillLevel>=20:
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER 	% int(1 + 5 * k))
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER 	% int(50 + 1450 * k))
			bonusPercent = 10
		if skillLevel>=25:
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % int(5 + 45 * k ))

		if skillLevel >= 30:
			bonusPercent = 15

		if skillLevel>=35:
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % int(25 + 600 * k ))

		if skillLevel>=40:
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % int( 5 + 30 * k ))

		if bonusPercent > 0:
			self.AppendSpace(5)
			self.AutoAppendTextLine(localeInfo.PARTY_SKILL_LEADER_REFLECT_BONUS % bonusPercent)


		# @fixme008 END

		self.AlignHorizonalCenter()

 

// PythonSkill.cpp
PyObject* skillGetSkillPowerByLevel(PyObject* poSelf, PyObject* poArgs)
{
	int dwSkillLevel;
	if (!PyTuple_GetInteger(poArgs, 0, &dwSkillLevel))
		return Py_BadArgument();

	return Py_BuildValue("i", LocaleService_GetSkillPower(dwSkillLevel));
}



		{ "GetSkillPowerByLevel",			skillGetSkillPowerByLevel,				METH_VARARGS },

 

  • Good 1
  • Active+ Member

@PetePeterYes, if you want to be perfectionist, you can do it like that, but since in source wasn't any function like that, we could simply use the function, which was in source and that was the GetSkillCurrentEfficientPercentage. By using this function, you'll get the same values, because of this:

PythonPlayer.cpp:

float CPythonPlayer::GetSkillCurrentEfficientPercentage(DWORD dwSlotIndex)
{
	if (dwSlotIndex >= SKILL_MAX_NUM)
		return 0;

	return m_playerStatus.aSkill[dwSlotIndex].fcurEfficientPercentage;
}

void CPythonPlayer::SetSkillLevel_(DWORD dwSkillIndex, DWORD dwSkillGrade, DWORD dwSkillLevel)
{
	...
	m_playerStatus.aSkill[dwSlotIndex].fcurEfficientPercentage = LocaleService_GetSkillPower(dwSkillLevel) / 100.0f;
	...
}

But as you said, in server source it's done like that:

Party.cpp:

float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) )/ 100.0f;

You'll get correct values in both ways.

Edited by ReFresh

I'll be always helpful!  😉

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



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.