This scripting is for a working Mode Switch. For those who don't understand or know how it works.
I have confirmed this will work with the nw_s0_summon and cs_summon__inc scripts linked here, in a blank module.
To create a Mode Switch:
Use the Toolset to create a new Miscellaneous Small item. Name it "Mode Switch" (without the "). This way, the tag/resref will be modeswitch.
Create two blank scripts in the Script Editor. They should look like this:
//modeswitch
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
switch (nEvent)
{
case X2_ITEM_EVENT_ACTIVATE: ExecuteScript("ac_"+GetTag(GetItemActivated()), OBJECT_SELF); break;
}
}
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */
//ac_modeswitch
void main()
{
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
SetLocalObject(oPC, "oLastTargettedItem", oTarget);
SendMessageToPC(GetItemActivator(), "You take hold of the " + GetName(oTarget) + " and concentrate.");
}
The second script is special, in that when you target a reagent, it will speak a line in your dialog. This line will fire no matter what you target:
You take hold of the Light Crossbow and concentrate.
You take hold of the Fiery Stick of Dhoom and concentrate.
You take hold of the Slaad's Tongue and concentrate.
Any of these could pop up, depending on what you target. But they aren't all going to have reagent themes. (Slaad's Tongue, however, does.)
The Mode Switch just selects what you want to attempt to use as a reagent. If it is, in fact, a reagent, when you cast Summon Creature (1-9), you will receive a special creature.
If you target something that isn't a reagent, you will fall back to either a Deity/Racial/Alignment theme, or the default theme, as a last resort. So the spell won't be wasted.
I hope it was okay to post this here for other scripters, to help those who may not have understood how a Mode Switch worked. If not, you can deleted as needed.