Jump to content

Leadership skill description fix


Recommended Posts

  • Active Member

Hey guys,

I just noticed that the description of leadership skill spacer.png is not displaying party group bonuses values correctly.

This is the hidden content, please

And you're done. Now you can go into the game and check, if the bonuses values in the leadership skill description are displayed correctly.

Good luck!

Edited by ReFresh
  • Metin2 Dev 87
  • kekw 1
  • Eyes 1
  • Scream 1
  • Lmao 1
  • Good 21
  • Love 1
  • Love 13

I'll be always helpful! 👊 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 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! 👊 

Link to comment
Share on other sites

Announcements



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