DragonTayl wrote...
If a device has both Cast Spell: Unique Power (self and targetted), is there a way to tell (for example, in the OnActivated script) which power is being used? Whether the player chose the targetted version or the self-only version? ...
...So I'm not sure, during the activate script, how to know if they chose the self-only or the targetted version. GetSpellID() returns a constant for SPELL_* but there is no constant listed for the unique abilities in nwscript. Am I missing it somewhere?
Yes, Each Unique Power Type will have a unique Spell ID. The Spell ID is simply the Line number in spells.2da that defines the power. You can either look them up in spells.2da or just run a quick test script on your item and have it report back the SpellID being used.
#include "x2_inc_switches"
void main()
{
object oPC;
object oItem;
int nEvent = GetUserDefinedItemEventNumber();
if ( nEvent != X2_ITEM_EVENT_ACTIVATE) return;
SpeakString( "Spell ID = "+ IntToString(GetSpellId()));
}
Edit: Whizard solution may work better for you. When using the standard Item events the script is running on the module. in order for the GetSpellID function to work the Function has to be running on the Object that cast the spell.
Modifié par Lightfoot8, 10 décembre 2011 - 07:17 .