Before I begin thanks to Yeldrig Yar for
his Stone of Recall script which this is based on.
Name: Stone of Recall System
Function: Creates a Stone of Recall System for any module in a step by
step process.
Creating Stone of Recall (Taken from Yeldrig Yar post)
Quote:
1 - 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.
2 - 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.
3 - 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.
3 - 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:
1. Go to Edit->Module Properties->Events
2. For the OnActivateItem click Edit.
3. Paste this script and save as StoneRecall01 (or whatever you want)
NWScript: void main()
{
object oActivated = GetItemActivated();
switch(2);
{
case 1: if(GetTag(oActivated) == "item1")
{
object oObject = GetItemActivator();
object oTarget = GetItemActivator();
location lLocation = GetLocation(oObject);
{
CreateObject(OBJECT_TYPE_PLACEABLE, "object1", lLocation, FALSE);
}
{
ExecuteScript("stonerecall02", oTarget);
}
}
}
}
4.Create a new placeable object and give it a unique tag. Make sure it's
apperance is set to Invisible Object. This is your object1 in the script
above.
5. Create a new waypoint and give it a unique name. Place this where you
want the player to appear after activating the item.
6. Go to the Script Editor, paste this in and save as "stonerecall02".
NWScript: void main()
{
object oActivated = GetItemActivated();
switch(2);
{
case 1: if(GetTag(oActivated) == "item1")
{
object oPC = GetItemActivator();
object oTarget = GetWaypointByTag ("waypoint1");
AssignCommand (oPC,JumpToObject(oTarget));
ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectVisualEffect (VFX_IMP_HOLY_AID), oPC);
}
}
}
7. Create a Recall Portal near the waypoint you just made.
8. Go to the Advanced Tab and edit the conversation.
9. 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.
NWScript: void main()
{
location lLocation;
object oObject, oActionSubject, oPC, oDestroy;
{
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);
}
}
}
That's it. If it seems complicated trust me it isn't. Obviously this
script is open to improvement and I welcome any constructive critisism.
Thanks again to Yeldrig Yar.
|