LoD_PRC8/_module/nss/backportal_use.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

22 lines
804 B
Plaintext

//:: Back portal script.
//:: Created by: Helge "DarkFame" Ingvoldstad
//::
//:: Purpose: Teleport PC back to the portal he once created
void main()
{
location lLoc = GetLocalLocation(GetPCSpeaker(),"Portal"); // gets the location of the town portal the PC once created
object oPC = GetPCSpeaker(); // gets the PC
if(GetIsPC(oPC) == 1)
{
// Remove the effects if you don't want it
// 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 PC to the correct location
SetLocalLocation(oPC,"Portal",GetLocation(GetObjectByTag("WP_Townportal"))); // resets the variable
}
}