Module commit
Module commit.
This commit is contained in:
28
_module/nss/vamp_encounter.nss
Normal file
28
_module/nss/vamp_encounter.nss
Normal file
@@ -0,0 +1,28 @@
|
||||
// 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));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user