This is all you need in a script to add a feat to any item, in this case the PC skin. I chose Knockdown as an example for this script. You'll still have to determine the method of assigning the PC, OBJECT_SELF really only gets the PC if it's done in a spell script.
The easiest way to see what bonus feats can be added is to copy/past this into the script editor, move the cursor to the IP_CONST_*, and press F2. That should give you the full list of constants you can choose from.
#include "x2_inc_itemprop"
void main()
{
// You'll have to decide what method you're using to assign the feat to know how
// you're determining oPC. OBJECT_SELF is just so it'll compile as is right now.
object oPC = OBJECT_SELF;
// if present, the creature skin is always in this slot, whether PC, NPC, or creature.
object oSkin = GetItemInSlot (INVENTORY_SLOT_CARMOUR, oPC);
// As an example, I've chosen knockdown as the bonus feat, but it can be any that's
// been defined as being able to be a bonus feat. I can't remember the 2da offhand.
itemproperty ipSkin = ItemPropertyBonusFeat (IP_CONST_FEAT_KNOCKDOWN);
// I greatly prefer the safe add script to the standard add item property script.
// You need the include in this script in order to access it, but it's worth it.
// Four straight-forward lines and you're done.
IPSafeAddItemProperty(oSkin, ipSkin, 0.0f, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
}
Modifié par Failed.Bard, 17 juin 2011 - 01:35 .