Jump to content

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Active+ Member

Take a look at this function from char_skill.cpp

bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)

It's called by the server whenever you read a standard skill book (VNUM 50300).

Regarding your question: success chance is often retrieved from value0 column belonging to a given skillbook but this isn't always the case so you can use "Find all references" on LearnSkillByBook func to see how it's called.

In case of a standard skill book it seems like there's no bProb argument provided so it's hardcoded to 65%, search for this bit

int need_bookcount = GetSkillLevel(dwSkillVnum) - 20;

and you'll see

				int percent = 65;

				if (FindAffect(AFFECT_SKILL_BOOK_BONUS))
				{
					percent = 0;
					RemoveAffect(AFFECT_SKILL_BOOK_BONUS);
				}

				if (number(1, 100) > percent)
				{
(...)

But like I said before sometimes this function is also sometimes called with the second argument (bProb) provided and this is our success chance. It's often modified by special items and whatnot. 

Grand master skills obviously have a separate routine (LearnGrandMasterSkill) dedicated to chance calculation.

Edited by b6d4a82c15
  • 2 months later...
On 5/5/2024 at 8:08 PM, b6d4a82c15 said:

Take a look at this function from char_skill.cpp

bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)

It's called by the server whenever you read a standard skill book (VNUM 50300).

Regarding your question: success chance is often retrieved from value0 column belonging to a given skillbook but this isn't always the case so you can use "Find all references" on LearnSkillByBook func to see how it's called.

In case of a standard skill book it seems like there's no bProb argument provided so it's hardcoded to 65%, search for this bit

int need_bookcount = GetSkillLevel(dwSkillVnum) - 20;

and you'll see

				int percent = 65;

				if (FindAffect(AFFECT_SKILL_BOOK_BONUS))
				{
					percent = 0;
					RemoveAffect(AFFECT_SKILL_BOOK_BONUS);
				}

				if (number(1, 100) > percent)
				{
(...)

But like I said before sometimes this function is also sometimes called with the second argument (bProb) provided and this is our success chance. It's often modified by special items and whatnot. 

Grand master skills obviously have a separate routine (LearnGrandMasterSkill) dedicated to chance calculation.

the sucess rate is 35%, not 65.
 

 

On 5/5/2024 at 1:27 PM, cyber said:

I want to make reading skill books harder. how can I do that ?

where is 65 on the code highlighted by our friend, u can change by any hate u want, only remember that the code as it is check if the random number is higher then (percent) so, to get harder u should increase the percent number...

  • Active+ Member
20 hours ago, Borr said:

the sucess rate is 35%, not 65.
 

 

where is 65 on the code highlighted by our friend, u can change by any hate u want, only remember that the code as it is check if the random number is higher then (percent) so, to get harder u should increase the percent number...

Oh yeah, you're right it's actually 100-65=35, sorry

  • Love 1

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.