PWE_PRC8/_module/nss/openportaldestro.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

62 lines
1.3 KiB
Plaintext

/* Script generated by
Lilac Soul's NWN Script Generator, v. 1.2
For download info, please visit:
http://www.angelfire.com/space/lilacsoul */
//Put this OnUsed
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
SetLocalInt(oPC, "isthereaportal", 1);
object oTarget;
object oSpawn;
oTarget = GetWaypointByTag("portalspawn");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "sewerportal", GetLocation(oTarget));
oTarget = oSpawn;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE), GetLocation(oTarget));
oTarget = GetObjectByTag("MajorTreasureDoor");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oTarget));
oTarget = GetObjectByTag("MajorTreasureDoor");
DestroyObject(oTarget, 3.0);
oTarget = GetObjectByTag("Brazier");
if (GetPlaceableIllumination(oTarget))
{
AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
SetPlaceableIllumination (oTarget, FALSE);
}
else
{
AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
SetPlaceableIllumination (oTarget, TRUE);
}
RecomputeStaticLighting(GetArea(oTarget));
}