PoA_PRC8/_module/nss/portmemberout.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

54 lines
1.3 KiB
Plaintext

//Created by Genisys
//This script ports the partymemeber back to where they were before being
//teleported to the party room.
//This script goes in the OnUsed Event of a placeable.
//Put this script OnUsed
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oItem;
object oTarget;
location lTarget;
//Remove all partyroom tokens from the player!
if (GetItemPossessedBy(oPC, "partyroom")!= OBJECT_INVALID)
{
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="partyroom") DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
lTarget = GetLocalLocation(oPC, "ls_stored_loc");
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
oTarget = oPC;
//Remove thier power to re-enter the area.
DeleteLocalInt(oPC, "IMemberA");
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
DelayCommand(5.0, ExecuteScript("checkarea1", oPC));
}