Alright, here is another script issue I got…
So the scenario:
Player walks to questgiver and gets the quest and needs to walk around the area where the trigger will be activated when walked upon, spawning some goblins to fight the PC.
So here is the problem:
Basically it all works perfectly fine but they spawn every time the player walks over the trigger! I would like to have it set to once per PC but then it does not really work…
#include "nw_i0_generic"
void main()
{
object oTarget;
object oSpawn;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Only fire once per PC.
if ( GetLocalInt(oPC, "DO_TWICE__" + GetTag(OBJECT_SELF)) )
return;
SetLocalInt(oPC, "DO_TWICE__" + GetTag(OBJECT_SELF), TRUE);
// Abort if the PC is not exactly at stage 2 of journal quest "FARMHAND".
if ( GetLocalInt(oPC, "NW_JOURNAL_ENTRYFARMHAND") != 2 )
return;
// Spawn some critters.
oTarget = GetWaypointByTag("WP_GOBO_ATTACK_1");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_goblinwor001", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_goblinwor001", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "db_benette_gob", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "db_benette_gob", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "db_benette_gob", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "benette_gob_rang", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "benette_gob_rang", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "benette_g_shaman", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "benette_g_shaman", GetLocation(oTarget));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
}
So this script I am using but since the PC needs to walk over the trigger but since the PC already had to walk over it since it works on the “untouched” triggers. So how can I make it work?