So, with the discovery that Clangeddin’s Level Cap mod has an adverse effect on the Extra Slot feats, I have been trying to script around this issue, with kevL_s’ help. I am able to get one Extra Feat added to the character, but for some reason, unable to get the second one added. Right now, just trying to get Extra Slot 0 and Extra Slot 1 to work for the Wizard. Whichever one is selected first is the only one that gets added. Even though the location that the Item Properties are being added to can hold a total of 8 slots. The latest attempt, which shows what is happening via debug lines has shown that, as suspected, only one Item Property is being added. So, we are asking for anyone to throw in their ideas, please. If anyone out there is using Clangeddin’s Level Cap mod, please have a look and see if those feats work. One caveat here - I am only using the parts of the Level Cap mod that allow for advancement to level 40, which Clangeddin instructed me how to do. I am providing the script we are trying to implement, and a screenshot of the results.
#include "x2_inc_itemprop"
void printIps(object oArmor)
{
SendMessageToPC(GetFirstPC(FALSE), "printIps()");
if (GetIsObjectValid(oArmor))
{
itemproperty ip = GetFirstItemProperty(oArmor);
while (GetIsItemPropertyValid(ip))
{
int iProp = GetItemPropertyType(ip); // ref to ItemPropDef.2da
int iSubtype = GetItemPropertySubType(ip); // ref to Classes.2da
int iValue = GetItemPropertyCostTableValue(ip); // ref to IprpSpellLvCost.2da
SendMessageToPC(GetFirstPC(FALSE), "ip= " + IntToString(iProp)
+ " subtype= " + IntToString(iSubtype)
+ " value= " + IntToString(iValue));
ip = GetNextItemProperty(oArmor);
}
}
else
SendMessageToPC(GetFirstPC(FALSE), "armor invalid");
}
void CheckForExtraSlotFeats(object oCaster)
{
if (GetLevelByClass(CLASS_TYPE_WIZARD, oCaster) > 0)
{
SendMessageToPC(GetFirstPC(FALSE), "Wizard");
itemproperty ipBonus;
int bArmorCreated = FALSE;
int bIpAdded = FALSE;
object oArmor = GetItemInSlot(INVENTORY_SLOT_CARMOUR);
if (!GetIsObjectValid(oArmor))
{
SendMessageToPC(GetFirstPC(FALSE), "created armor");
bArmorCreated = TRUE;
oArmor = CreateItemOnObject("x2_it_emptyskin", OBJECT_SELF, 1, "", FALSE);
}
if (GetHasFeat(FEAT_EXTRA_SLOT_WIZARD_LEVEL0))
{
SendMessageToPC(GetFirstPC(FALSE), "Has Extra Slot 0");
bIpAdded = TRUE;
ipBonus = ItemPropertyBonusLevelSpell(IP_CONST_CLASS_WIZARD, 0);
IPSafeAddItemProperty(oArmor, ipBonus, 0.0f, X2_IP_ADDPROP_POLICY_KEEP_EXISTING);
}
if (GetHasFeat(FEAT_EXTRA_SLOT_WIZARD_LEVEL1))
{
SendMessageToPC(GetFirstPC(FALSE), "Has Extra Slot 1");
bIpAdded = TRUE;
ipBonus = ItemPropertyBonusLevelSpell(IP_CONST_CLASS_WIZARD, 1);
IPSafeAddItemProperty(oArmor, ipBonus, 0.0f, X2_IP_ADDPROP_POLICY_KEEP_EXISTING);
}
if (bArmorCreated)
{
if (bIpAdded)
{
SendMessageToPC(GetFirstPC(FALSE), "equip armor");
ActionEquipItem(oArmor, INVENTORY_SLOT_CARMOUR);
}
else
{
SendMessageToPC(GetFirstPC(FALSE), "destroy armor");
DestroyObject(oArmor, 0.1f, FALSE);
}
}
DelayCommand(0.3f, printIps(oArmor));
}
}