mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-14 05:13:14 -04:00
47 lines
1.4 KiB
Java
Executable File
47 lines
1.4 KiB
Java
Executable File
package script.npc.celebrity;
|
|
|
|
import script.library.ai_lib;
|
|
import script.library.create;
|
|
import script.library.events;
|
|
import script.library.instance;
|
|
import script.obj_id;
|
|
|
|
public class herald_spawner extends script.base_script
|
|
{
|
|
public herald_spawner()
|
|
{
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
if(!events.isEventActive(events.GEONOSIAN)) {
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
String spawn = getStringObjVar(self, "spawns");
|
|
obj_id celeb = create.object(spawn, getLocation(self));
|
|
setInvulnerable(celeb, true);
|
|
ai_lib.setDefaultCalmBehavior(celeb, ai_lib.BEHAVIOR_SENTINEL);
|
|
if (hasObjVar(self, "quest_script"))
|
|
{
|
|
String script = getStringObjVar(self, "quest_script");
|
|
attachScript(celeb, script);
|
|
}
|
|
if (hasObjVar(self, "quest_table"))
|
|
{
|
|
String table = getStringObjVar(self, "quest_table");
|
|
setObjVar(celeb, "quest_table", table);
|
|
}
|
|
if (hasObjVar(self, "npc_name"))
|
|
{
|
|
String name = getStringObjVar(self, "npc_name");
|
|
if (name != null)
|
|
{
|
|
if (!name.equals(""))
|
|
{
|
|
setName(celeb, name);
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|