Aschbourne_PRC8/_module/nss/vamp_enc_versus.nss

29 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2024-06-14 10:48:20 -04:00
// 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 triggered an encounter only for vampires.");
SetEncounterActive(TRUE, OBJECT_SELF);
DelayCommand(6.0f, SetEncounterActive(FALSE, OBJECT_SELF));
}
else
{
PrintString("vamp_encounter: " +GetName(oPC)+ " is a PC who would have triggered an encounter only for vampires.");
SetEncounterActive(FALSE, OBJECT_SELF);
}
}
}