You are assigning the actions to oTarget which I believe is supposed to go to oSpawn unless oTarget does exist in which case it should go to oTarget. So you will have some problems there.
Another thing I would change though, you only need to use DetermineCombatRound to make the enemy hostile to the pc and attack. Maybe something like so:
#include "nw_i0_generic"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
location lTarget;
object oSpawn;
object oTarget;
object oWP;
//1ST KOBOLD START
oWP = GetWaypointByTag("kobold_guard_1");
oTarget = GetObjectByTag("KoboldGuardBennemeiger");
lTarget = GetLocation(oWP);
if (GetIsObjectValid(oTarget) == FALSE)
{
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "kobold002", lTarget);
AssignCommand(oSpawn, DetermineCombatRound(oPC));
}//end if
else
{
AssignCommand(oTarget, DetermineCombatRound(oPC));
}
//1ST KOBOLD END
//2ND KOBOLD START
oWP = GetWaypointByTag("kobold_guard_2");
oTarget = GetObjectByTag("KoboldGuardBennemeigerUndt");
lTarget = GetLocation(oWP);
if (GetIsObjectValid(oTarget) == FALSE)
{
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "kobold002", lTarget);
AssignCommand(oSpawn, DetermineCombatRound(oPC));
}//end if
else
{
AssignCommand(oTarget, DetermineCombatRound(oPC));
}
//2ND KOBOLD END
}//end main
EDITED
Modifié par GhostOfGod, 20 avril 2011 - 09:06 .