mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
96 lines
1.6 KiB
Plaintext
96 lines
1.6 KiB
Plaintext
trigger OnAttach()
|
|
{
|
|
messageTo (self, "pathRandom", null, 2, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
messageTo (self, "pathRandom", null, rand(10,20), false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler pathRandom()
|
|
{
|
|
string waypoint = pickDestination();
|
|
if ( hasScript(self, "ai.ai") )
|
|
{
|
|
// let the ai script handle the moving the npc
|
|
setObjVar(self, "ai.persistentPathingWaypoint", waypoint);
|
|
messageTo (self, "resumeDefaultCalmBehavior", null, 0, false);
|
|
}
|
|
else
|
|
{
|
|
pathTo (self, waypoint);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
string pickDestination()
|
|
{
|
|
string waypoint = "exit";
|
|
int whichWay = rand (1, 12);
|
|
switch (whichWay)
|
|
{
|
|
case 1:
|
|
waypoint = "square";
|
|
break;
|
|
case 2:
|
|
waypoint = "cafe1";
|
|
break;
|
|
case 3:
|
|
waypoint = "cafe2";
|
|
break;
|
|
case 4:
|
|
waypoint = "cafe3";
|
|
break;
|
|
case 5:
|
|
waypoint = "cafe4";
|
|
break;
|
|
case 6:
|
|
waypoint = "hotel";
|
|
break;
|
|
case 7:
|
|
waypoint = "capitol";
|
|
break;
|
|
case 8:
|
|
waypoint = "mission1";
|
|
break;
|
|
case 9:
|
|
waypoint = "mission2";
|
|
break;
|
|
case 10:
|
|
waypoint = "installation";
|
|
break;
|
|
case 11:
|
|
waypoint = "exit";
|
|
break;
|
|
case 12:
|
|
waypoint = "gate1";
|
|
break;
|
|
|
|
}
|
|
return waypoint;
|
|
}
|
|
|
|
|
|
//messageHandler resumeDefaultCalmBehavior()
|
|
//{
|
|
// messageTo (self, "pathRandom", null, rand(30,60), false);
|
|
// return SCRIPT_OVERRIDE;
|
|
//}
|
|
|
|
trigger OnMovePathComplete()
|
|
{
|
|
messageTo (self, "pathRandom", null, rand(30,60), false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnMovePathNotFound()
|
|
{
|
|
|
|
messageTo (self, "pathRandom", null, rand(30,60), false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|