Skip to content

OnActivateItem Help

Just trying to add some nifty elements to the PC's skin and am having trouble with it. Sort of going for an Uber lore/Spell Penetration thingy... :)

Code:
// Grimoire of Improved Lore & Knowledge
     object oUsed7 = GetItemActivated();
     oPC = GetItemActivator();
     if (GetTag(oUsed7) == "GRIMOIRE_KNOWLEDGE")
     {
        // Skin #1
        object oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipAward = ItemPropertyBonusFeat(FEAT_SKILL_AFFINITY_LORE);
        AddItemProperty(DURATION_TYPE_PERMANENT, ipAward, oSkin);
        // Skin #2
        oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipAward2 = ItemPropertyBonusFeat(IP_CONST_FEAT_SPELLPENETRATION);
        AddItemProperty(DURATION_TYPE_PERMANENT, ipAward2, oSkin);
        // Skin #3
        oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipAward3 = ItemPropertyBonusFeat(FEAT_EPIC_SKILL_FOCUS_LORE);
        AddItemProperty(DURATION_TYPE_PERMANENT, ipAward3, oSkin);
        //Skin #4
        oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipAward4 = ItemPropertyCastSpell(IP_CONST_CASTSPELL_LEGEND_LORE_5, 3);
        AddItemProperty(DURATION_TYPE_INSTANT, ipAward4, oSkin);
     }

Right now skin #2 is the only one being applied to the PC's skin. I don't understand why?

Comments

  • TerrorbleTerrorble Member Posts: 169
    In order to add a feat as an item property it needs to have an entry in iprp_feats.2da. Spell Penetration is the only one of those that has that by default.

    The info you need to add entries in iprp_feats is found in feats.2da.
  • ZephiriusZephirius Member Posts: 411
    edited December 2022
    Thanks for the info Terrorble! ;)
  • ZephiriusZephirius Member Posts: 411
    I've got feats.2da open right now...
    ...how and where do I find the germane paramater information so that I can type and edit the .2da?
  • TerrorbleTerrorble Member Posts: 169
    edited December 2022
    For FEAT_SKILL_AFFINITY_LORE add this line to iprp_feats. All the info is from line 234 in feats.2da.

    Name: 1968
    Label: skillaffinitylore
    Cost: 1 (it doesn't matter much if you're adding it to a skin, but would affect the cost of an item if it were in a shop)
    FeatIndex: 234

    *edit*
    I'm forgetting something important!

    ItemPropertyBonusFeat() doesn't use this type of constant: FEAT_SKILL_AFFINITY_LORE. It uses IP_CONST_FEAT_SPELLPENETRATION.

    You'll see that IP_CONST_FEAT_SKILL_AFFINITY_LORE doesn't exist. But you can just use the line# from iprp_feats instead. For example: ItemPropertyBonuseFeat(63)

    *more edits*
    Handy editor for 2da on the vault:
    https://neverwintervault.org/project/nwn1/other/tool/tlkedit2-2datlkgfferf-editor

    All the 2da files from the game:
    https://neverwintervault.org/project/nwnee/other/nwn-ee-819313-full-2da-source
  • TarotRedhandTarotRedhand Member Posts: 1,481
    IMO There is a better windows 2da editor on the vault and it is continuously being updated too. Don't let the fact that it is in the NwN 2 section of the vault put you off. It works great for NwN EE also. So give it a try -

    Yata written by and maintained by kevL's

    TR
  • ZephiriusZephirius Member Posts: 411
    Thanks Tarot. If I'm to be honest, I do kinda skim over NWN 2 material.
Sign In or Register to comment.