mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-04 04:15:52 -04:00
41 lines
829 B
Plaintext
41 lines
829 B
Plaintext
include library.create;
|
|
include library.ai_lib;
|
|
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
string spawn = getStringObjVar (self, "spawns");
|
|
|
|
location here = getLocation(self);
|
|
here.y = here.y + 0.5f;
|
|
|
|
obj_id celeb = create.object (spawn, here);
|
|
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;
|
|
} |