Advertisement
Guest User

spellbook.c.patch

a guest
Aug 12th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. Index: spellbook.c
  2. ===================================================================
  3. --- spellbook.c (revision 20481)
  4. +++ spellbook.c (working copy)
  5. @@ -125,14 +125,39 @@
  6. return METHOD_OK;
  7. }
  8.  
  9. + /* blessed books are easier to read */
  10. if (QUERY_FLAG(book, FLAG_BLESSED))
  11. read_level += 5;
  12. + /* Literacy hurdle, did not inform the player how close they were to being able to read
  13. + *if (spell->level > (read_level+10)) {
  14. + * draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  15. + * "You are unable to decipher the strange symbols.");
  16. + * return METHOD_OK;
  17. + *}
  18. + */
  19.  
  20. - if (spell->level > (read_level+10)) {
  21. - draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  22. - "You are unable to decipher the strange symbols.");
  23. + /* If the players read level is less than 10 levels lower than the spellbook, they can't read it */
  24. + lev_diff = spell->level - (read_level+10);
  25. + if (!QUERY_FLAG(applier, FLAG_WIZ) && lev_diff > 0) {
  26. + if (lev_diff < 2)
  27. + draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  28. + "This book is just barely beyond your comprehension.");
  29. + else if (lev_diff < 3)
  30. + draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  31. + "This book is slightly beyond your comprehension.");
  32. + else if (lev_diff < 5)
  33. + draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  34. + "This book is beyond your comprehension.");
  35. + else if (lev_diff < 8)
  36. + draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  37. + "This book is quite a bit beyond your comprehension.");
  38. + else if (lev_diff < 15)
  39. + draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  40. + "This book is way beyond your comprehension.");
  41. + else
  42. + draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  43. + "This book is totally beyond your comprehension.");
  44. return METHOD_OK;
  45. - }
  46.  
  47. get_levelnumber(spell->level, level, sizeof(level));
  48. draw_ext_info_format(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS,
  49. @@ -148,11 +173,6 @@
  50. spell = book->inv;
  51. }
  52.  
  53. - /* I removed the check for special_prayer_mark here - it didn't make
  54. - * a lot of sense - special prayers are not found in spellbooks, and
  55. - * if the player doesn't know the spell, doesn't make a lot of sense
  56. - * that they would have a special prayer mark.
  57. - */
  58. if (check_spell_known(applier, spell->name)) {
  59. draw_ext_info(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE,
  60. "You already know that spell.\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement