Initial Upload
Initial Upload
This commit is contained in:
21
_module/nss/sendportalcomm.nss
Normal file
21
_module/nss/sendportalcomm.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
void main()
|
||||
{
|
||||
//These commands beneath here are just used to get the player and the relevant locations, basically to define variables
|
||||
object oPC = GetLastUsedBy(); //Gets the PC that activated the portal
|
||||
location lPortalLocation = GetLocation(OBJECT_SELF); //Gets the location of the portal, this could also be done with waypoints
|
||||
object oDestPortal = GetObjectByTag("communityportal1"); //Gets the object that represents the destination portal
|
||||
location lDestPortal = GetLocation(oDestPortal); //Gets the location of the destination portal
|
||||
string sPortalTag = GetTag(OBJECT_SELF); //This gets the tag of the activated portal
|
||||
//From here down, these commands are responsible for moving the player to the beam and playing the teleport effects
|
||||
SetLocalString(oPC, "PortalCameFrom", sPortalTag); //This stores the tag of the activated portal, so that it can be determined which portal the PC came from
|
||||
string sPortalCameFrom = GetLocalString(oPC, "PortalCameFrom"); //Debugging Command
|
||||
SendMessageToPC(oPC, sPortalCameFrom); //Debugging Command
|
||||
AssignCommand(oPC, ClearAllActions()); //This just clears the player's action queue
|
||||
AssignCommand(oPC, ActionMoveToLocation(lPortalLocation)); //Moves the player to the location of the sending portal
|
||||
effect eTPRing = EffectVisualEffect(20); //This defines the spiral effect
|
||||
DelayCommand(1.0,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eTPRing, lPortalLocation, 10.0)); //This delays the play of the spiral effect for 1 second
|
||||
effect eTPBeam = EffectVisualEffect(70); //This defines the beam-from-the-heavens effect
|
||||
DelayCommand(1.0,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eTPBeam, lPortalLocation, 10.0)); //This delays the play of the beam effect for 1 second
|
||||
//This is where the player gets teleported
|
||||
DelayCommand(1.75,AssignCommand(oPC, ActionJumpToLocation(lDestPortal)));
|
||||
}
|
||||
Reference in New Issue
Block a user