mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
111 lines
3.1 KiB
Java
Executable File
111 lines
3.1 KiB
Java
Executable File
package script.ai;
|
|
|
|
import script.dictionary;
|
|
import script.library.ai_lib;
|
|
import script.modifiable_float;
|
|
import script.obj_id;
|
|
|
|
public class droid extends script.base_script
|
|
{
|
|
public droid()
|
|
{
|
|
}
|
|
public static final String ALERT_VOLUME_NAME = "alertTriggerVolume";
|
|
public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id breacher) throws InterruptedException
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
public int OnLoiterWaiting(obj_id self, modifiable_float time) throws InterruptedException
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
public int OnBehaviorChange(obj_id self, int newBehavior, int oldBehavior, int[] changeFlags) throws InterruptedException
|
|
{
|
|
if (ai_lib.isAiDead(self))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ai_lib.isInCombat(self))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (newBehavior <= oldBehavior)
|
|
{
|
|
if (doCalmerBehavior(self, newBehavior, oldBehavior) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (doAgitatedBehavior(self, newBehavior, oldBehavior) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
}
|
|
}
|
|
public int doCalmerBehavior(obj_id npc, int newBehavior, int oldBehavior) throws InterruptedException
|
|
{
|
|
switch (newBehavior)
|
|
{
|
|
case BEHAVIOR_CALM:
|
|
messageTo(npc, "resumeDefaultCalmBehavior", null, 5, false);
|
|
break;
|
|
case BEHAVIOR_ALERT:
|
|
break;
|
|
case BEHAVIOR_THREATEN:
|
|
break;
|
|
case BEHAVIOR_FLEE:
|
|
break;
|
|
case BEHAVIOR_PANIC:
|
|
break;
|
|
case BEHAVIOR_ATTACK:
|
|
break;
|
|
case BEHAVIOR_FRENZY:
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
public int doAgitatedBehavior(obj_id npc, int newBehavior, int oldBehavior) throws InterruptedException
|
|
{
|
|
switch (newBehavior)
|
|
{
|
|
case BEHAVIOR_CALM:
|
|
break;
|
|
case BEHAVIOR_ALERT:
|
|
break;
|
|
case BEHAVIOR_THREATEN:
|
|
break;
|
|
case BEHAVIOR_FLEE:
|
|
break;
|
|
case BEHAVIOR_PANIC:
|
|
break;
|
|
case BEHAVIOR_ATTACK:
|
|
break;
|
|
case BEHAVIOR_FRENZY:
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
public int lairThreatened(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
}
|