Files
dsrc/sku.0/sys.server/compiled/game/script/npc/celebrity/herald_spawner.script
T
2013-09-10 23:17:15 -07:00

54 lines
1.0 KiB
Plaintext

include library.create;
include library.ai_lib;
trigger OnInitialize() {
if(hasObjVar(self, "switch")) {
string serverSwitch = getStringObjVar(self, "switch");
string switchValue = getConfigSetting("Dungeon", serverSwitch);
if(switchValue == null || switchValue == "") {
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 != "") {
setName(celeb, name);
}
}
}
return SCRIPT_CONTINUE;
}