EN6_PRC8/_module/nss/nirra_ptl_onused.nss
Jaysyn904 a6f6db7303 Initial commit
Initial commit.  Updated release archive.
2024-06-13 15:08:33 -04:00

43 lines
1.3 KiB
Plaintext

//:: nirra_ptl_onused.nss
void main()
{
int nHench;
object oHench;
object oTarget;
// Get the creature who triggered this event.
object oPC = GetLastUsedBy();
// Find the location to which to teleport.
oTarget = GetWaypointByTag("NH1_Spawn");
// Teleport the PC.
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, JumpToObject(oTarget));
// Also teleport associates.
oHench = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
AssignCommand(oHench, ClearAllActions());
AssignCommand(oHench, JumpToObject(oTarget));
oHench = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
AssignCommand(oHench, ClearAllActions());
AssignCommand(oHench, JumpToObject(oTarget));
oHench = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
AssignCommand(oHench, ClearAllActions());
AssignCommand(oHench, JumpToObject(oTarget));
oHench = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
AssignCommand(oHench, ClearAllActions());
AssignCommand(oHench, JumpToObject(oTarget));
// Support for multiple henchmen (includes horses).
nHench = 1;
oHench = GetHenchman(oPC, 1);
while ( oHench != OBJECT_INVALID )
{
AssignCommand(oHench, ClearAllActions());
AssignCommand(oHench, JumpToObject(oTarget));
// Next henchman.
oHench = GetHenchman(oPC, ++nHench);
}
}