mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
54 lines
1.0 KiB
Plaintext
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;
|
|
} |