Initial Upload
Initial Upload
This commit is contained in:
43
_module/nss/useportal.nss
Normal file
43
_module/nss/useportal.nss
Normal file
@@ -0,0 +1,43 @@
|
||||
//:: Script for the town portal scroll
|
||||
//:: Created by: Helge "DarkFame" Ingvoldstad
|
||||
//::
|
||||
//:: Purpose: Teleports the PC back to town when town portal is used
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
location lLoc = GetLocalLocation(oPC,"Backportal"); // Finds the location the player is bound to.
|
||||
if (GetLocalInt(oPC,"Bound") == 1) {
|
||||
if(GetIsPC(oPC) == 1)
|
||||
{
|
||||
// Effects start
|
||||
object oTarget = oPC;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DISPEL, FALSE);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 6.0);
|
||||
// Effects stop
|
||||
AssignCommand(oPC, ActionJumpToLocation(lLoc)); // Teleports the PC
|
||||
if (GetLocalLocation(oPC,"Owner") == GetLocation(OBJECT_SELF))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF); // Destroys the portal when the OWNER enters it, remove this line if you want a permanent portal
|
||||
DeleteLocalLocation(oPC,"Owner"); // Deletes the owner variable as it's not need anymore
|
||||
}
|
||||
SetLocalLocation(oPC,"Portal",GetLocation(OBJECT_SELF));
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(GetIsPC(oPC) == 1)
|
||||
{
|
||||
object Destination = GetWaypointByTag("DefualtBind");
|
||||
object oTarget = oPC;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_DISPEL, FALSE);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 6.0);
|
||||
AssignCommand(oPC, JumpToObject(Destination));
|
||||
if (GetLocalLocation(oPC,"Owner") == GetLocation(OBJECT_SELF))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF); // Destroys the portal when the OWNER enters it, remove this line if you want a permanent portal
|
||||
DeleteLocalLocation(oPC,"Owner"); // Deletes the owner variable as it's not need anymore
|
||||
}
|
||||
SetLocalLocation(oPC,"Portal",GetLocation(OBJECT_SELF));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user