Skip to content

Gain Bonus Feat on reading?

Hi All
Not sure if this should go in the script forum or the toolset.

I'm taking inspiration from other RPG games, and I want to have an event that when a PC/Henchman reads a specific book, they gain a bonus feat or ability bonus or a Skill bonus.

This is to encourage character development among the party where XP rewards are low.

I can see how these bonuses work when equipping an item (like an amulet), but I cannot see where a script can be added to a book?

Any ideas?
Thanks in advance

Comments

  • ProlericProleric Member Posts: 1,282
    edited March 2022
    This is a common dilemma, not only for tomes of knowledge, but also for plot developments like finding a map or diary.

    You're right, no event script fires when a book is read, but there are methods:
    1. Book item with Unique Power
    2. Book placeable
    3. Book placeable that contains a book item
    4. Container holding book item

    In cases 1 and 2, hide the book's description using SetDescription, so the the player is forced to activate the item / use the placeable. The rationale might be that the writing is tiny, or otherwise requires close attention.

    In each case, when the object is activated / used for the first time, set a flag to prevent repetition, give the ability bonus / feat / journal update, unhide the description if necessary, then ActionExamine to force the player to read the book.

    In case 3, put the item in PC inventory, destroy the placeable.

    The only real difference between these methods is that the PC can't take the book away in case 2, must take the book in cases 1 and 3, has the option in case 4.

    A variation on case 1 is to change the item description to "I could read this if it were in my inventory" then use the module OnAcquire event - that removes the need for a special power, but maybe breaks immersion / credibility.
  • ProlericProleric Member Posts: 1,282
    One case in which the OnAcquire event is legitimate is when purchasing a book from a merchant. The book description is changed to "This book is sealed prior to purchase", then logic as before.

    This method forces the player to buy the book to get information, which otherwise they can obtain by browsing the merchant's stock (with no way of knowing whether they've done so).
  • ZephiriusZephirius Member Posts: 411
    For book ability bonus:

    This is what I do -
    #include "x3_inc_skin"
    void main()
    {
        object oPC = GetPCSpeaker();
        if (!GetIsPC(oPC)) return;
    
        object oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipAward = ItemPropertyAbilityBonus(IP_CONST_ABILITY_WIS, 2);
        AddItemProperty(DURATION_TYPE_PERMANENT, ipAward, oSkin);
    }
    

    In this instance the PC gains 2 to his/her wisdom stat by reading the tome before them...
Sign In or Register to comment.