mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
51 lines
1.0 KiB
Plaintext
51 lines
1.0 KiB
Plaintext
include library.create;
|
|
include library.ai_lib;
|
|
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
string setting = getConfigSetting("EventTeam", "lifeday");
|
|
|
|
if(setting == null || setting == "")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (setting == "true" || setting == "1")
|
|
{
|
|
string spawn = getStringObjVar (self, "spawns");
|
|
obj_id celeb = create.object (spawn, getLocation(self));
|
|
|
|
if(!isIdValid(celeb) )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
return SCRIPT_CONTINUE;
|
|
} |