Files
HeroesStone_PRC8/_module/nss/tp_custom1.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

38 lines
1.3 KiB
Plaintext

/* tp_custom1
* by dluan on jan 2003 */
void main()
{
object oObject = GetLocalObject(OBJECT_SELF, "TP_CUSTOM1");
object oTarget = GetLocalObject(OBJECT_SELF, "TP_TARGET");
effect eVisual = EffectVisualEffect(VFX_IMP_UNSUMMON);
ActionCastFakeSpellAtObject(SPELL_TIME_STOP, oTarget);
if (GetLocalInt(OBJECT_SELF, "TP_TYPE")) {
object oWayPoint = GetFirstObjectInArea(oObject);
while (GetIsObjectValid(oWayPoint) && GetTag(oWayPoint) != "TP_WAYPOINT")
oWayPoint = GetNextObjectInArea(oObject);
if (GetIsObjectValid(oWayPoint)) oObject = oWayPoint;
else {
SendMessageToPC(OBJECT_SELF, "Something prevents you from teleporting to this location.");
return;
}
}
if (GetLocalInt(OBJECT_SELF, "TP_PARTY")) {
object oPlayer = GetFirstFactionMember(oTarget);
while (GetIsObjectValid(oPlayer)) {
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer));
DelayCommand(4.0, AssignCommand(oPlayer, JumpToObject(oObject)));
oPlayer = GetNextFactionMember(oTarget);
}
} else {
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget));
DelayCommand(4.0, AssignCommand(oTarget, JumpToObject(oObject)));
}
}