Barrels spawn from triggers outside this trigger (near entrences to area).
When player crosses a trigger near the barrels, this runs:
// script_name: maus_kobold_ambush
/*
Description:
*/
// Name_Date
void main()
{
object oPC = GetEnteringObject();
if(!(GetLocalInt(OBJECT_SELF, "nSpawn")==1) && (TRUE) )
{
int nN = 1;
int nRand;
object oKobold, oTarget;
location lKobold;
string sTag = "wp_kob_spawn_1";
for (nN; nN<=4; nN++)
{
if(nN==4)
{
oTarget=oPC;
}
else
{
oTarget = GetObjectByTag( "drl_afbarrel");
}
lKobold = GetLocation(GetWaypointByTag(sTag));
oKobold = CreateObject(OBJECT_TYPE_CREATURE, "tod_kobold", lKobold, FALSE);
nRand = d4(1)+1;
CreateItemOnObject("nw_wammbu005", oKobold, nRand);
AssignCommand(oKobold, ActionEquipMostDamagingRanged());
ClearAllActions(oKobold);
AssignCommand(oKobold, ActionAttack(oTarget, FALSE));
}
SetLocalInt(OBJECT_SELF, "nSpawn",1);
}
}
...but they don't attack the barrel! Any ideas on what I could do?
Modifié par EpicFetus, 25 mai 2012 - 04:50 .





Retour en haut






