I've searched high and low, but cannot find any property, setting, check box, or drop menu that has this option for items.
What am I missing? I noticed that online modules have items that fire custom scripts when used, so I know it's possible.
Here I am using tag-based scripting to call a function for each item. It would be a trivial change to call a script with the same name as the item tag.[dascript]
case EVENT_TYPE_UNIQUE_POWER:
{
int nAbility = GetEventInteger(ev, 0);
object oItem = GetEventObject(ev, 0);
object oCaster = GetEventObject(ev, 1);
object oTarget = GetEventObject(ev, 2);
string sItem = GetTag(oItem);
if (sItem == "cocim_test") zTest();
if (sItem == "cocpt_cod_bks_khasi") zTeleportHeartOfDarkness();
}
[/dascript]
FergusM wrote...
In the item editor, you want to pick an 'activated ability'. It is right near the top. This selects an ability from the ABI_base 2DA with abilitytype 4 (which is item abilities). You can add a new item ability (look into 2DA editing on the wiki) and set the spellscript column to the script you would like to run. This script will get called multiple times with different events when the ability is used. Take a look at some of the other ability spellscripts (for example, item_singletarget.nss) for an example of how the system works.
Modifié par Gisle Aune, 08 décembre 2010 - 03:07 .
Artevere wrote...
FergusM wrote...
In the item editor, you want to pick an 'activated ability'. It is right near the top. This selects an ability from the ABI_base 2DA with abilitytype 4 (which is item abilities). You can add a new item ability (look into 2DA editing on the wiki) and set the spellscript column to the script you would like to run. This script will get called multiple times with different events when the ability is used. Take a look at some of the other ability spellscripts (for example, item_singletarget.nss) for an example of how the system works.
Well, at the top it just has appearance, basics etc. Only thing in that category I can see is "Item Property Activation Preference" and my only choices are Active When Equipped, Active When Equipped or in Repository, and Active Only In repository.