RoT2_PRC8/_module/nss/mcain_on_death.nss
Jaysyn904 499aba4eb3 Initial upload
Initial upload
2023-09-25 18:13:22 -04:00

35 lines
1012 B
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 OnDeath
void main()
{
object oPC = GetLastKiller();
object oTarget;
object oSpawn;
//
// Create portal regardless of who kills Cain.
//
oTarget = GetWaypointByTag("wp_cain_portal");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "cainportal", GetLocation(oTarget));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_IMPLOSION), GetLocation(oTarget));
DestroyObject(oSpawn, 300.0);
if (!GetIsPC(oPC)) return;
//
// Only port Cains killer if they are a PC. They port immediately on killing cain!
//
AssignCommand(oPC, ClearAllActions(TRUE));
oTarget = GetWaypointByTag("wp_caindeath");
AssignCommand(oPC, JumpToObject(oTarget));
oTarget = oPC;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_DUR_DARKNESS), GetLocation(oTarget));
}