Stone of recall system
From NWNWiki
[edit] Stone of Recall System
[edit] What it does
Creates a Stone of Recall System for any module in a step by step process.
[edit] Creating Stone of Recall
- Create your item. Be sure to give it a unique tag name and that you remember that tagname....you'll want that info later. Make it "magical." Edit the properties of the item and click the "Properties" tab.
- There, you should see a whole bunch of effects. Go down to "Cast Spell" and click that to open that, then go down to "Unique Power." Decide if it's a power that you will cast on others, or only on the wielder, then double-click the appropriate decision.
- When you double-clicked, that added that Unique Power to the right-hand pane of the window. Double-click the power there, to determine how many charges per day it gets.
- When done, click OK/Done to get back to the editor
Now you have your item, you need to get it to work. Here's what you do:
- Go to Edit->Module Properties->Events
- For the OnActivateItem click Edit.
- Paste this script and save as StoneRecall01 (or whatever you want)
void main()
{
object oActivated = GetItemActivated();
switch(2);
{
// Item 1 = Stone of Recall type item.
case 1: if(GetTag(oActivated) == "item1")
{
object oObject = GetItemActivator();
object oTarget = GetItemActivator();
location lLocation = GetLocation(oObject);
{
// Object 1 = A Placeable object (invisible object works best). Must be the blueprint name NOT TAG!!
CreateObject(OBJECT_TYPE_PLACEABLE, "object1", lLocation, FALSE);
}
{
// stonerecall02 = name of second script
ExecuteScript("stonerecall02", oTarget);
}
}
}
}
- Create a new placeable object and give it a unique tag. Make sure its appearance is set to Invisible Object. This is your object1 in the script above.
- Create a new waypoint and give it a unique name. Place this where you want the player to appear after activating the item.
- Go to the Script Editor, paste this in and save as "stonerecall02".
void main()
{
object oActivated = GetItemActivated();
switch(2);
{
case 1: if(GetTag(oActivated) == "item1")
{
object oPC = GetItemActivator();
// waypoint1 = Tag of waypoint where the player will be taken to when they activate the stone
object oTarget = GetWaypointByTag ("waypoint1");
AssignCommand (oPC,JumpToObject(oTarget));
ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectVisualEffect (VFX_IMP_HOLY_AID), oPC);
}
}
}
- Create a Recall Portal near the waypoint you just made.
- Go to the Advanced Tab and edit the conversation.
- Create a new conversation, with just a simple line like "This will take you back to where you activated the Stone of Recall". Add a PC line such as "Step in to the Portal" and then add this script to the Actions Taken part.
void main()
{
location lLocation;
object oObject, oActionSubject, oPC, oDestroy;
{
// object1 = TAG name of the placeable created in the first script
oObject = GetObjectByTag("object1", 0);
oDestroy = GetObjectByTag("object1", 0);
oActionSubject = GetPCSpeaker();
oPC = GetPCSpeaker();
lLocation = GetLocation(oObject);
{
AssignCommand(oActionSubject, ActionJumpToLocation(lLocation));
ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectVisualEffect (VFX_IMP_UNSUMMON), oPC);
}
{
DestroyObject(oDestroy, 3.0);
}
}
}
