Page 1 of 1

Useful Generic Scripts

Posted: Wed Feb 02, 2005 8:16 pm
by Mistcaller
Here we can post generic scripts that are commonly used among servers. I'll start with the most popular one :) :

1. Jump PC to a waypoint (Placeable OnUsed)

Code: Select all

//:://///////////////////////////////////////////// 
//:: Name     jump_pc_2wp 
//:: FileName jump_pc_2wp.nss 
//:: Copyright (c) 2001 Bioware Corp. 
//::////////////////////////////////////////////// 
/*   When a PC uses the placeable, it teleports him to a destination waypoint 
with tag: WP_<tag of placeable> 
*/ 
//::////////////////////////////////////////////// 
//:: Created By: Mistcaller 
//:: Created On: November 11, 2003 
//::////////////////////////////////////////////// 
void main() 
{ 
  string sExplanation = GetLocalString(OBJECT_SELF,"sExplanation"); 
  object oPC=GetLastUsedBy(); 
  string sTempTag = GetTag(OBJECT_SELF); 
  object oTarget = GetObjectByTag("WP_"+ sTempTag); 

  if (GetIsObjectValid(oTarget)) 
{ 
     ClearAllActions(); 
     AssignCommand(oPC, JumpToObject(oTarget)); 
     if (sExplanation !="") 
        SendMessageToPC(oPC, sExplanation); 
  } 
}