mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
99 lines
2.5 KiB
Plaintext
99 lines
2.5 KiB
Plaintext
include library.space_crafting;
|
|
include library.sui;
|
|
include library.space_utils;
|
|
include library.utils;
|
|
include library.space_transition;
|
|
|
|
|
|
trigger OnAttach()
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
|
|
{
|
|
menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE);
|
|
string_id strSpam = new string_id("space/space_interaction", "eject");
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, strSpam);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnObjectMenuSelect(obj_id objPlayer, int item)
|
|
{
|
|
LOG("space", "ESCAPE POD");
|
|
|
|
if (item == menu_info_types.ITEM_USE)
|
|
{
|
|
// if it's your ship, KABOOM
|
|
// if it's not your ship, eject.
|
|
obj_id objShip = space_transition.getContainingShip(objPlayer);
|
|
obj_id objOwner = getOwner(objShip);
|
|
LOG("space", "objOwner is "+objOwner+" player is "+objPlayer);
|
|
if(objOwner==objPlayer)
|
|
{
|
|
LOG("space", "Queing command ");
|
|
string_id strSpam = new string_id("space/space_interaction", "ejecting");
|
|
sendSystemMessage(objPlayer, strSpam);
|
|
utils.setLocalVar(objShip, "intEjecting", 1);
|
|
dictionary dctParams = new dictionary();
|
|
dctParams.put("objShip", objShip);
|
|
messageTo(objShip, "megaDamage", dctParams, 2, false);
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
else
|
|
{
|
|
string_id strSpam = new string_id("space/space_interaction", "ejecting");
|
|
sendSystemMessage(objPlayer, strSpam);
|
|
space_transition.teleportPlayerToLaunchLoc(objPlayer);
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
/*
|
|
// escape
|
|
|
|
// CONFIRM SELF DESTRUCT CODE X
|
|
// CONFIRM SELF DESTRUCT CODE Y
|
|
// FINAL CONFIRMATION ADN FINALIZATION FOR SELF DESTRUCT
|
|
|
|
|
|
void selfDestruct( obj_id objPlayer)
|
|
{
|
|
obj_id self = getSelf();
|
|
int pid = createSUIPage ("Script.Keypad", self, objPlayer, "KeypadCallback");
|
|
sui.setAssociateRange(objPlayer, pid, self, 8.0f);
|
|
subscribeToSUIProperty(pid, "result.numberBox", "localtext");
|
|
subscribeToSUIProperty(pid, "buttonEnter", "ButtonPressed");
|
|
setSUIProperty(pid, "buttonKeyCard", "enabled", "false");
|
|
showSUIPage (pid);
|
|
return;
|
|
}
|
|
|
|
messageHandler KeypadCallback()
|
|
{
|
|
string result = params.getString("result.numberBox" + "." + "localtext");
|
|
string button = params.getString("buttonEnter.ButtonPressed");
|
|
obj_id player = params.getObjId ("player");
|
|
|
|
/*string str
|
|
|
|
if (button == "enter")
|
|
{
|
|
//debugSpeakMsg (self, "Passkey was " + passkey);
|
|
if (passkey == result)
|
|
{
|
|
else
|
|
{
|
|
}
|
|
}
|
|
*/
|
|
|
|
// return SCRIPT_CONTINUE;
|
|
//}
|
|
|
|
|
|
|