AndarianTD wrote...
GOG: Yep, that looks like that'll do it quite nicely. From the description here, it looks like all that's needed is to add entries to iprp_addcost.2DA, iprp_additional.2DA, and my custom tlk. Then using ItemPropertyAdditional will add the property associated with the extra cost. Thanks!
Hmm... well, this doesn't seem to be working as expected. Here's what I'm doing:
1. Modifying iprp_addcost.2da as follows:
[nwscript]2DA V2.0
Name Label Cost
0 111775 Unknown 0
1 111874 Cursed 0
2 111775 Testprop 5.0[/nwscript]
2. Modifying iprp_additional.2da as follows:
[nwscript]2DA V2.0
Label Name
0 Unknown 111775
1 Cursed 111874
2 Testprop 111775[/nwscript]
3. Running this script (as a unique power) from one item on another:
[nwscript]
#include "x2_inc_switches"
#include "nw_i0_spells"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
object oPC;
object oItem;
//SendMessageToPC(GetFirstPC(),IntToString(nEvent));
// * This code runs when the item has the OnHitCastSpell: Unique power property
// * and it hits a target(weapon) or is being hit (armor)
// * Note that this event fires for non PC creatures as well.
if (nEvent == X2_ITEM_EVENT_ONHITCAST)
{
// The item casting triggering this spellscript
oItem = GetSpellCastItem();
object oSpellOrigin = OBJECT_SELF ;
object oSpellTarget = GetSpellTargetObject();
oPC = OBJECT_SELF;
}
// * This code runs when the Unique Power property of the item is used
// * Note that this event fires PCs only
else if (nEvent == X2_ITEM_EVENT_ACTIVATE)
{
oPC = GetItemActivator();
oItem = GetItemActivated();
object oPT = GetItemActivatedTarget();
if (oPT != OBJECT_INVALID)
{
SendMessageToPC(GetFirstPC(),"Adding Additional Property to "+GetName(oPT));
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyAdditional(2),oPT);
}
}
}
[/nwscript]
Both 2das are in my top (patch) hak. The script is running and displaying the correct message, but nothing seems to be happening to the item it is used on -- either with regard to price (tested in a store) or visible properties on the item. Has anyone confirmed that this does in fact work, and if so know what I may be missing? For example, do I also need to add an entry to itemprops.2da?
Thanks in advance for any feedback -- Andarian