I know there are several threads that talk about this, but I thought I’d make a new one since it’s easier and less confusing.
So I have this item that’s in the game world in a container, or it might be in the inventory of the PC or one of the companions. I would like to add an item property to this item only if certain conditions are set. I will probably do this through dialouge, I think. The property I’d like to add is the Cast Spell: Unique Power (Single Use)
that gets activated through a i_itemtag_ac script. So here’s the script I made. I know through reading a bunch of old posts where I’ve asked similar questions before (getting answers and script examples from @travus @kevL_s and @Lance_Botelle ) that this can be a bit complicated. If I remember correctly there are some caveats to consider when it comes to a script like this, but…well, anyway. Here’s the script I was intending to use. I hope this is alright, and would work:
#include "x2_inc_itemprop"
void main()
{
object oPainting = GetObjectByTag("ipainting");
itemproperty ipProperty = ItemPropertyCastSpell(IP_CONST_CASTSPELL_UNIQUE_POWER,1);
//AddItemProperty(DURATION_TYPE_PERMANENT, ipProperty, oPainting);
IPSafeAddItemProperty(oPainting, ipProperty, 0.0);
}
Like I said, I would put this script in a conversation. Then I would add another script with i_itemtag_ac where I put code what I want to happen if the player activates the item.
Thanks for your time!