Files
dsrc/sku.0/sys.server/compiled/game/script/event/ep3_herald_wookiee.script
T
2013-09-10 23:17:15 -07:00

47 lines
879 B
Plaintext

include library.locations;
include library.ai_lib;
include library.utils;
trigger OnAttach()
{
location here = getLocation(self);
location someLoc = null;
int x = 0;
while (x < 10)
{
location loc = utils.getRandomLocationInRing(here, 100, 500);
someLoc = locations.getGoodLocationAroundLocation(loc, 5f, 5f, 50f, 50f);
if (someLoc!= null)
break;
x++;
}
setObjVar(self, "event.ep3_trando_herald.wookiee_loc", someLoc);
messageTo(self, "startRunningAway", null, 3, false);
return SCRIPT_CONTINUE;
}
messageHandler startRunningAway()
{
location loc = getLocationObjVar(self, "event.ep3_trando_herald.wookiee_loc");
ai_lib.aiPathTo(self, loc);
setMovementRun(self);
messageTo(self, "disappearIntoTheCrowd", null, 20, false);
return SCRIPT_CONTINUE;
}
messageHandler disappearIntoTheCrowd()
{
destroyObject(self);
return SCRIPT_CONTINUE;
}