mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
158 lines
5.5 KiB
Plaintext
158 lines
5.5 KiB
Plaintext
/***** INCLUDES ********************************************************/
|
|
|
|
include library.utils;
|
|
include library.sui;
|
|
include library.groundquests;
|
|
include library.create;
|
|
include library.chat;
|
|
|
|
/***** CONSTANTS *******************************************************/
|
|
|
|
const string_id SID_MNU_HAX = new string_id("npe", "hax"); //menu1
|
|
const string_id SID_MNU_PART = new string_id("npe", "part"); //menu1
|
|
const string_id SID_MNU_SPLICE = new string_id("npe", "splice"); //menu1
|
|
const string_id SID_MNU_DUMP = new string_id("npe", "dump"); //menu1
|
|
const string_id SID_MNU_DROID = new string_id("npe", "droid"); //menu1
|
|
|
|
/***** TRIGGERS ********************************************************/
|
|
|
|
|
|
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
|
|
{
|
|
if (isMob(self))
|
|
return SCRIPT_CONTINUE;
|
|
string myTemplate = getTemplateName(self);
|
|
|
|
if (groundquests.isTaskActive(player, "npe_spy_try", "generator") && myTemplate.equals("object/tangible/terminal/npe_generator.iff"))
|
|
{
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_HAX);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else if (groundquests.isTaskActive(player, "npe_spy_try", "placePart") && myTemplate.equals("object/tangible/terminal/npe_droid_production.iff"))
|
|
{
|
|
//debugSpeakMsg(player, "Noob has quest!");
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_PART);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else if (groundquests.isTaskActive(player, "npe_spy_try", "doIt") && myTemplate.equals("object/tangible/terminal/systems_control_terminal.iff"))
|
|
{
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_SPLICE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else if (groundquests.isTaskActive(player, "npe_smuggler_try", "dumpItem"))
|
|
{
|
|
//debugSpeakMsg (self, "You have a quest for me.");
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DUMP);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else if (groundquests.isTaskActive(player, "npe_spy_try", "triggerVolume") && myTemplate.equals("object/tangible/terminal/systems_control_terminal.iff"))
|
|
{
|
|
//debugSpeakMsg (self, "You have a quest for me.");
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DROID);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
trigger OnObjectMenuSelect(obj_id player, int item)
|
|
{
|
|
if ( item == menu_info_types.ITEM_USE)
|
|
{
|
|
string myTemplate = getTemplateName(self);
|
|
//debugSpeakMsg (player, "Yo.");
|
|
if (groundquests.isTaskActive(player, "npe_spy_try", "generator") && myTemplate.equals("object/tangible/terminal/npe_generator.iff"))
|
|
{
|
|
//doWarning (self);
|
|
groundquests.sendSignal(player, "generator");
|
|
sendSystemMessage(player, new string_id("npe", "core"));
|
|
playClientEffectObj(self, "clienteffect/npe_generator_pwrdwn.cef", self, "");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (groundquests.isTaskActive(player, "npe_spy_try", "placePart") && myTemplate.equals("object/tangible/terminal/npe_droid_production.iff"))
|
|
{
|
|
groundquests.sendSignal(player, "placePart");
|
|
sendSystemMessage(player, new string_id("npe", "machine"));
|
|
sendSystemMessage(player, new string_id("npe", "machine2"));
|
|
playClientEffectObj(self, "clienteffect/npe_quest_place_part.cef", self, "");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (groundquests.isTaskActive(player, "npe_spy_try", "doIt") && myTemplate.equals("object/tangible/terminal/systems_control_terminal.iff"))
|
|
{
|
|
groundquests.sendSignal(player, "doIt");
|
|
sendSystemMessage(player, new string_id("npe", "splice1"));
|
|
playClientEffectObj(self, "clienteffect/npe_systems_terminal.cef", self, "");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
//debugSpeakMsg (self, "I have a button for you.");
|
|
if (groundquests.isTaskActive(player, "npe_smuggler_try", "dumpItem"))
|
|
{
|
|
groundquests.sendSignal(player, "dumpItem");
|
|
sendSystemMessage(player, new string_id("npe", "dump1"));
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (groundquests.isTaskActive(player, "npe_spy_try", "triggerVolume") && myTemplate.equals("object/tangible/terminal/systems_control_terminal.iff"))
|
|
{
|
|
groundquests.sendSignal(player, "stopEscort");
|
|
sendSystemMessage(player, new string_id("npe", "droidmsg"));
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest"));
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void playWarningAndSpawn(obj_id player, obj_id self, string toSpawn)
|
|
{
|
|
//obj_id building = getTopMostContainer(self);
|
|
|
|
location me = getLocation (player);
|
|
chat.chat (self, "INTRUDER ALERT! INTRUDER ALERT!");
|
|
//location droid1 = new location (-107.0f, -29.0f, 175.0f, me.area, getCellId(building, "cargobay2"));
|
|
//obj_id droid01 = create.object("npe_droid_generator", droid1);
|
|
|
|
//location droid2 = new location (-102.0f, -29.0f, 169.0f, me.area, getCellId(building, "cargobay2"));
|
|
//obj_id droid02 = create.object("npe_droid_generator", droid2);
|
|
|
|
|
|
me.x = me.x + 3;
|
|
create.object (toSpawn, me);
|
|
me.y = me.y + 1;
|
|
create.object (toSpawn, me);
|
|
return;
|
|
}
|
|
|
|
void doWarning(obj_id self)
|
|
{
|
|
obj_id building = getTopMostContainer(self);
|
|
resizeable obj_id[] alarms = utils.getResizeableObjIdArrayScriptVar(building, "objAlarms");
|
|
|
|
for (int i = 0; i < alarms.length; i++)
|
|
{
|
|
if(isIdValid(alarms[i]))
|
|
{
|
|
setCondition(alarms[i], CONDITION_ON);
|
|
messageTo(self, "turnAlarmsOff", null, 10, false);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
messageHandler turnAlarmsOff()
|
|
{
|
|
obj_id building = getTopMostContainer(self);
|
|
resizeable obj_id[] alarms = utils.getResizeableObjIdArrayScriptVar(building, "objAlarms");
|
|
|
|
for (int i = 0; i < alarms.length; i++)
|
|
{
|
|
if(isIdValid(alarms[i]))
|
|
{
|
|
clearCondition(alarms[i], CONDITION_ON);
|
|
}
|
|
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
} |