PoA_PRC8/_module/nss/door_teleport.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

157 lines
5.6 KiB
Plaintext

/////////////////////////////////////////////////
//Script Name: door_teleport
/////////////////////////////////////////////////
//Ultimate Teleport Script v 1.3 - (TEMPLATE)
/////////////////////////////////////////////////
//Designed By: Amurayi (mschdesign@hotmail.com)
//Modified By: Genisys (galefer003@hotmail.com)
/*Modified On: 8/15/08
////////////////////////////////////////////////////
IMPORTANT: This is a Template, so, SAVE THIS
under a new name FIRST!
The door that uses this script must NOT be openable!
////////////////////////////////////////////////////
The problem with most of the teleport scripts out there is
that your companions won't be teleported with you if you are being
teleported within the same area. This easy to configure script
is the solution for this old problem. Simply adjust the settings
below to easially set up this script for ANY teleport!
What this script can do:
- Teleports player out of conversation, trigger or from an item
- Teleports player with or without companions
- Teleports player alone or the player's whole party
*/
/////////////////////////////////////////////////////////////////////////
////////////////IMPORTANT SETTINGS///////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//Enter the tagname below (inside of the "") of the waypoint (destination)
const string sTagname = "tagname"; //What is the tagname of the waypoint?
//Set to 1 if you want to use fancy Visual Effects in the teleport
const int nVisuals = 0; //(0 = Default, don't play animations)
//Set to 1 if you want to teleport the whole party of the PC
const int iTeleportWholeParty = 0; //(Default = 0, don't teleport party)
//Set to 1 if you want the Associates of the PC to be teleporeted as well.
const int iTeleportAssociateToo = 1; //(Set this to 0 to turn OFF)
//PROTOTYPE DECLARED
void JumpAssociate(object i_oPC, int i_type, object i_oWP);
//Main Script
void main()
{
object oPC;
oPC = GetClickingObject();
///////////////////////////////////////////////////////////////////////
//Your Additional Code Goes here...
//////////////////////////////////////////////////////////////////////////////
///////////////////DON'T TOUCH ANYTHING BELOW THIS LINE!!!////////////////////
//Major Variables
object oDWP = GetWaypointByTag(sTagname);
object oFM;
effect eVis;
////////////////////////////////////////////
//***Conditional***//
//If the destination is not valid, tell the PC, DMs, and log file!
if (oDWP == OBJECT_INVALID)
{
SendMessageToPC(oPC, "Destination not found.");
SendMessageToAllDMs("The Way Point tagnamed: " + sTagname + "WAS NOT FOUND IN THE MODULE!!");
WriteTimestampedLogEntry(sTagname + " Way Point NOT FOUND IN THE MODULE!!**");
return; //Stop the script here..
}
///////The Teleport (depending upon conditionals set above)////////
//If we are teleporting the whole party.
if (iTeleportWholeParty == 1)
{
float fT = 3.0;
oFM = GetFirstFactionMember(oPC);
// Step through the party members.
while(GetIsObjectValid(oFM))
{
//Delay The Teleports properly
fT +=0.1;
//if we are using visual effects (On All PCs only)
if(nVisuals ==1)
{
eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oFM);
}
AssignCommand(oFM, DelayCommand(fT, JumpToObject(oDWP)));
if (iTeleportAssociateToo == 1)
{
// now send the players companions over as well:
DelayCommand(fT+4.3, JumpAssociate(oFM, ASSOCIATE_TYPE_ANIMALCOMPANION, oDWP));
DelayCommand(fT+4.4, JumpAssociate(oFM, ASSOCIATE_TYPE_DOMINATED, oDWP));
DelayCommand(fT+4.5, JumpAssociate(oFM, ASSOCIATE_TYPE_FAMILIAR, oDWP));
DelayCommand(fT+4.6, JumpAssociate(oFM, ASSOCIATE_TYPE_HENCHMAN, oDWP));
DelayCommand(fT+4.7, JumpAssociate(oFM, ASSOCIATE_TYPE_SUMMONED, oDWP));
}
// Select the next member of the faction and loop.
oFM = GetNextFactionMember(oFM);
}
}
//Otherwise just jump the PC (and possibly associates)
else
{
//If we are using visual effects (on the PC only)
if(nVisuals ==1)
{
eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC);
//Delay The Jump..
AssignCommand(oPC, DelayCommand(3.0, JumpToObject(oDWP)));
}
else
{
//Do a quick jump if no visual is used..
AssignCommand(oPC, DelayCommand(0.1, JumpToObject(oDWP)));
}
//If the Associates are assigned to go as well
if (iTeleportAssociateToo == 1)
{
// now send the players companions over as well:
DelayCommand(3.1, JumpAssociate(oPC, ASSOCIATE_TYPE_ANIMALCOMPANION, oDWP));
DelayCommand(3.2, JumpAssociate(oPC, ASSOCIATE_TYPE_DOMINATED, oDWP));
DelayCommand(3.3, JumpAssociate(oPC, ASSOCIATE_TYPE_FAMILIAR, oDWP));
DelayCommand(3.4, JumpAssociate(oPC, ASSOCIATE_TYPE_HENCHMAN, oDWP));
DelayCommand(3.5, JumpAssociate(oPC, ASSOCIATE_TYPE_SUMMONED, oDWP));
}
}
}
//PROTOTYPE DEFINED
void JumpAssociate(object i_oPC, int i_type, object i_oWP)
{
object oAssociate = GetAssociate(i_type, i_oPC);
if(GetIsObjectValid(oAssociate))
AssignCommand(oAssociate, JumpToObject(i_oWP));
}