Jump to content

How do I change the chance of reading a skill book?


Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted (edited)

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      QuickSell in SpecialInventory Problem

    2. 12

      Legendary items effect

    3. 0

      M2Project Research | Teamler - Beta Tester

    4. 5

      How To Directx9 Device Creation with Multiple Thread Support

    5. 25

      Increase Safebox / Warehouse

    6. 25

      Increase Safebox / Warehouse

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.