werelynx wrote...
I would like my shifter PC to have an ability to use items while polymorphed.
I found (in script forums archives) that the proposed solution was either by custom feat or spell.
I tried to make a potion with unique power, but it does not work - it can't target items, only PC.
As I tried to explain in response to your pm, a potion can target whatever you like with script. What the item popup can and cannot target doesn't matter, at least for that purpose. Can you be more specific about what you're trying to do (why you're trying to target an item)?
1. I'm unsure how to "drop" custom player feat 1. onto the skin. On the other hand I know how to give spell to a polymorph(editing .2da). I have read Concept: OnPolymorphed and OnUnPolymorphed events without NWNX so I guess I could edit my onequip if I knew what function I should use.
You would need two functions and this const to add player tool 1: IP_CONST_FEAT_PLAYER_TOOL_01
// Returns Item property Bonus Feat. You need to specify the the feat
// constant(IP_CONST_FEAT_*).
itemproperty ItemPropertyBonusFeat(int nFeat)
// adds an item property to the specified item
// Only temporary and permanent duration types are allowed.
void AddItemProperty(int nDurationType, itemproperty ipProperty, object oItem, float fDuration=0.0f)
Bioware added some wrapper functions for adding ips, but I generally avoid them, and you likely wouldn't want them for this.
2. I'm unsure how to script feat/spell to force PC to use targeted item. It should check if polymorphed PC can use given item(like if he has the right alignment or race or simply check against given list of forbidden items).
While I guess the stuff like armour or weapons still can't be used/equipped, I would like that PC could use items like alchemist's bomb or custom items that grant other polymorphs/items with other special powers. Would I have to script every item with different code? Or could I just retrieve, for example spell, stored on a scroll/grenade item?
If you're using NWNX, there's a function to force use of a specific item. Otherwise all you have to work with is Talent functions. You might be able to force use of a healing potion reliably that way, but shifters can already use potions while shifted, so that doesn't accomplish much.
As per 1, you can create all those effects with custom functions, but yes, you'd have to code each of them. You don't have to use Unique Powers, though, as that just adds an unnecessary layer of events (unique power triggers spellscript nw_s3_actitem01, nw_s3_actitem01 triggers non-spellscript item activation script). Just hack a spell and appropriate it for your own uses in that particular situation. We've done this innumerable times for item special abilities and the like. Here's a copy of our Virtue spell, by way of example:
https://dl.dropbox.c...w_s0_virtue.nss
This technique has the added advantage of being able to tell what kind of unique power fired it, via spell id, allowing you to put multiple types of unique powers on a single item:
Activate Item 428
Activate Item Long 697
Activate Item Touch 795
Unique Power 386
Unique Power Self 413
If you explain with greater specificity what you're trying to accomplish, I can probably be of more help.
Funky