27 lines
767 B
Plaintext
Raw Normal View History

2023-09-21 21:20:34 -04:00
// lod_portals.nss
// This script will replace the plethera of individual portal scripts
// throughout the module. To use, add a Local Variable to the Placeble
// that is being used. This will be the tag of the target waypoint.
// ex: sWaypoint (string) planarpassage001
// This would jump the player from the used portal to the planarpassage001 waypoint.
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
AssignCommand(oPC, ClearAllActions());
object oTarget;
location lTarget;
oTarget = GetWaypointByTag(GetLocalString(OBJECT_SELF, "sWaypoint"));
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
DelayCommand(1.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
}