mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
43 lines
987 B
Plaintext
43 lines
987 B
Plaintext
include library.space_crafting;
|
|
include library.space_utils;
|
|
include library.utils;
|
|
include library.space_transition;
|
|
|
|
|
|
trigger OnAttach()
|
|
{
|
|
// 2 types.. component items, and general items
|
|
|
|
// general items are
|
|
|
|
// hull, life support, plasma conduit and hyperspace..
|
|
// so we initialize everything 2 ways
|
|
|
|
|
|
// WhAT TYPE AM I?
|
|
LOG("space", "ONATTACH GOING OFF ON INTERIOR COMPONETNES");
|
|
// we lookup what we are
|
|
setInvulnerable(self, true);
|
|
obj_id objShip = space_transition.getContainingShip(self);
|
|
LOG("space", "I AM INSIDE "+objShip);
|
|
resizeable obj_id[] objAlarms = new obj_id[0];
|
|
if(utils.hasScriptVar(objShip, "objAlarms"))
|
|
{
|
|
|
|
objAlarms = utils.getResizeableObjIdArrayScriptVar(objShip, "objAlarms");
|
|
|
|
}
|
|
|
|
objAlarms = utils.addElement(objAlarms, self);
|
|
|
|
utils.setScriptVar(objShip, "objAlarms", objAlarms);
|
|
location locTest = getLocation(self);
|
|
if(hasObjVar(objShip, "intAlarmsOn"))
|
|
{
|
|
setInvulnerableHitpoints(self, 1);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|