mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-14 23:07:51 -04:00
49 lines
1.3 KiB
Java
Executable File
49 lines
1.3 KiB
Java
Executable File
package script.systems.event_perk;
|
|
|
|
import script.library.ai_lib;
|
|
import script.obj_id;
|
|
|
|
public class invulnerable extends script.base_script
|
|
{
|
|
public invulnerable()
|
|
{
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
setInvulnerable(self, true);
|
|
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
ai_lib.stop(self);
|
|
pickNameByTemplate(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public void pickNameByTemplate(obj_id self) throws InterruptedException
|
|
{
|
|
String name = " ";
|
|
String whatAmI = getTemplateName(self);
|
|
if (whatAmI.equals("object/mobile/dressed_stormtrooper_m.iff"))
|
|
{
|
|
int roll = rand(100, 999);
|
|
name = "TK-" + roll;
|
|
}
|
|
if (whatAmI.equals("object/mobile/dressed_tie_fighter_m.iff"))
|
|
{
|
|
int roll = rand(100, 999);
|
|
name = "DS-" + roll;
|
|
}
|
|
if (whatAmI.equals("object/mobile/atat.iff"))
|
|
{
|
|
name = "AT-AT";
|
|
}
|
|
if (whatAmI.equals("object/mobile/atst.iff"))
|
|
{
|
|
name = "AT-ST";
|
|
}
|
|
if (whatAmI.equals("object/mobile/bantha_saddle.iff"))
|
|
{
|
|
name = "a bantha mount";
|
|
}
|
|
setName(self, name);
|
|
return;
|
|
}
|
|
}
|