Files
dsrc/sku.0/sys.server/compiled/game/script/npc/celebrity/herald_spawner.java
T
2018-06-07 00:32:29 +01:00

55 lines
1.7 KiB
Java
Executable File

package script.npc.celebrity;
import script.library.ai_lib;
import script.library.create;
import script.obj_id;
public class herald_spawner extends script.base_script
{
public herald_spawner()
{
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if (hasObjVar(self, "switch"))
{
String serverSwitch = getStringObjVar(self, "switch");
String switchValue = getConfigSetting("Dungeon", serverSwitch);
if (switchValue == null || switchValue.equals(""))
{
return SCRIPT_CONTINUE;
}
if ((toLower(switchValue)).equals("false"))
{
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;
}
}