Hopefully the script is somewhat self-explanatory. If there is a ‘rookfeather’ and a bottle of ‘mojo’ in the chest, then add the weight reduction item property to the oItem not equal to the rookfeather or mojo.
It runs, the rookfeather and mojo do get deleted, but the item does not get the property. What am I missing?
if ( GetItemPossessedBy(oTarget, "rookfeather") != OBJECT_INVALID && GetItemPossessedBy(oTarget, "mojo") != OBJECT_INVALID)
{
while(GetIsObjectValid(oItem) == TRUE && GetTag(oItem) != "rookfeather" && GetTag(oItem) != "mojo")
{
itemproperty ipAdd;
oItem = GetNextItemInInventory(oTarget);
ipAdd = ItemPropertyWeightReduction(IP_CONST_REDUCEDWEIGHT_40_PERCENT);
IPSafeAddItemProperty(oItem, ipAdd,0.0);
AssignCommand(oPC, SpeakString("kNotez hEavi-oH!"));
DestroyObject(GetItemPossessedBy(oTarget, "rookfeather"));
DestroyObject(GetItemPossessedBy(oTarget, "mojo"));
//Do some Effects..
effect eVFX;
// Apply some visual effects.
eVFX = EffectVisualEffect(SPELLABILITY_BOLT_LIGHTNING);
oTarget = GetObjectByTag("EnchantingCauldron");
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget);
eVFX = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GLOW_LIGHT_PURPLE));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVFX, oTarget, 3.0);
}