mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-29 23:15:55 -04:00
40 lines
760 B
Plaintext
40 lines
760 B
Plaintext
include library.locations;
|
|
include library.create;
|
|
|
|
trigger OnAttach()
|
|
{
|
|
doKraytSpawn();
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void doKraytSpawn()
|
|
{
|
|
obj_id self = getSelf();
|
|
if (hasObjVar (self, "Krayt"))
|
|
{
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
location here = getLocation (self);
|
|
location dragon = locations.getGoodLocationAroundLocation(here, 100f, 100f, 100f, 100f);
|
|
obj_id kd = create.object ("canyon_krayt_dragon", dragon);
|
|
setObjVar (kd, "creater", self);
|
|
setObjVar (self, "Krayt", kd);
|
|
attachScript (kd, "creature_spawner.death_msg");
|
|
return;
|
|
}
|
|
}
|
|
|
|
messageHandler creatureDied()
|
|
{
|
|
messageTo (self, "spawnNew", null, 30, true);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler spawnNew()
|
|
{
|
|
removeObjVar (self, "Krayt");
|
|
doKraytSpawn();
|
|
return SCRIPT_CONTINUE;
|
|
} |