Aschbourne_PRC8/_module/nss/vamp_encounter.nss
Jaysyn904 f5ffe7d0b9 Module commit
Module commit.
2024-06-14 10:48:20 -04:00

29 lines
1.1 KiB
Plaintext

// Add this to encounter OnEnter event.
/*
This script, if placed into the OnEnter of an Encounter Trigger will set the
encounter to active if certain conditions are met. In this instance, it checks
the subrace of the creature entering and only if it's a PC. This script uses
the ability to preset variables in the toolset with HoTU by getting the subrace
to test for from a preset string variable with the name SubRaceCheck.
After a six second delay, it will reset the encounter back to inactive, so that
it will not trigger again for just anyone entering the trigger.
*/
void main()
{
object oPC = GetEnteringObject();
if (GetIsPC(oPC))
{
if (GetSubRace(oPC) == "Vampire")
{
PrintString("vamp_encounter: " +GetName(oPC)+ " is a vampire who would have triggered an encounter of undead.");
SetEncounterActive(FALSE, OBJECT_SELF);
}
else
{
PrintString("vamp_encounter: " +GetName(oPC)+ " is a PC who triggered an encounter of undead.");
SetEncounterActive(TRUE, OBJECT_SELF);
DelayCommand(6.0f, SetEncounterActive(FALSE, OBJECT_SELF));
}
}
}