mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-29 15:12:58 -04:00
who isn't sick of converting the freaking scripts? this negates the need
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package script.event.invasion;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.ai_lib;
|
||||
import script.library.create;
|
||||
import script.library.utils;
|
||||
import script.ai.ai_combat;
|
||||
|
||||
public class invader extends script.base_script
|
||||
{
|
||||
public invader()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
messageTo(self, "startAttack", null, 1, false);
|
||||
messageTo(self, "cleanUp", null, 7200, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException
|
||||
{
|
||||
obj_id coordinator = getObjIdObjVar(self, "event.invasion.coordinator");
|
||||
obj_id target = getObjIdObjVar(self, "event.invasion.target");
|
||||
if (objSpeaker == coordinator && strText.equals("abortEventNow"))
|
||||
{
|
||||
messageTo(target, "cleanUp", null, 1, false);
|
||||
messageTo(self, "cleanUp", null, 1, false);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int startAttack(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
obj_id target = getObjIdObjVar(self, "event.invasion.target");
|
||||
obj_id coordinator = getObjIdObjVar(self, "event.invasion.coordinator");
|
||||
float destinationOffset = getFloatObjVar(target, "event.invasion.spawning.destinationOffset");
|
||||
location locationDestination = getLocation(target);
|
||||
location adjustedLoc = utils.getRandomLocationInRing(locationDestination, destinationOffset, destinationOffset + 10);
|
||||
ai_lib.aiPathTo(self, adjustedLoc);
|
||||
setMovementRun(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int cleanUp(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
destroyObject(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user