Initial commit
Initial commit [v9.7]
This commit is contained in:
50
_module/nss/entr_telp_myrbs3.nss
Normal file
50
_module/nss/entr_telp_myrbs3.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
void main()
|
||||
{
|
||||
int nHench;
|
||||
object oHench;
|
||||
object oTarget;
|
||||
|
||||
// Get the creature who triggered this event.
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
// Only fire for (real) PCs.
|
||||
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
|
||||
return;
|
||||
|
||||
// Only fire once per PC.
|
||||
if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) )
|
||||
return;
|
||||
SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
|
||||
|
||||
// Find the location to which to teleport.
|
||||
oTarget = GetWaypointByTag("WP_MyrBase3");
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user