Files
dsrc/sku.0/sys.server/compiled/game/script/npe/npe_spy_terminal.java
T
TekaohandGitHub 5c2e112349 Java 11.0.2 migration (#32)
* Code compiles - execution NOT tested

* updating gitignore

* Removed intellij settings files

* Removed more intellij files

* Added exclusion for JDK classes.

* Fixed purchasing script for vendors that have listed coin types.

* Updated script to not kick off until the entire preload is complete.

* adds static name entry for Solo movie poster and tcg9 vendor entry

* clean up empty and orphaned object templates

* adds placeholder black market (static) spawns

* corrects entries for the video game table to correctly set it in tcg series 2 and remove series 1 console errors

* Updated gitignore and removed intellij project files

* Fixed appearance reference for thranta payroll and kashyyyk door, added skipLosCheck objvar due to cannit see issue. Requires updated src

* Fixed appearance and template for terminal (#2)

* Fixed appearance and template for terminal (#3)

* Fixed appearance and template for terminal (#4)

* Deleted another faulty/orphaned object template

* Fixed gcw ranks option on frog. Only issue is that it doesn't award the officer commands or badges.

* Fixed some unneeded java 11 changes
2019-04-18 18:31:52 -05:00

131 lines
6.0 KiB
Java
Executable File

package script.npe;
import script.*;
import script.library.chat;
import script.library.create;
import script.library.groundquests;
import script.library.utils;
import java.util.Vector;
public class npe_spy_terminal extends script.base_script
{
public npe_spy_terminal()
{
}
public static final string_id SID_MNU_HAX = new string_id("npe", "hax");
public static final string_id SID_MNU_PART = new string_id("npe", "part");
public static final string_id SID_MNU_SPLICE = new string_id("npe", "splice");
public static final string_id SID_MNU_DUMP = new string_id("npe", "dump");
public static final string_id SID_MNU_DROID = new string_id("npe", "droid");
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
{
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"))
{
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"))
{
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"))
{
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DROID);
return SCRIPT_CONTINUE;
}
return SCRIPT_CONTINUE;
}
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
{
if (item == menu_info_types.ITEM_USE)
{
String myTemplate = getTemplateName(self);
if (groundquests.isTaskActive(player, "npe_spy_try", "generator") && myTemplate.equals("object/tangible/terminal/npe_generator.iff"))
{
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;
}
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;
}
public void playWarningAndSpawn(obj_id player, obj_id self, String toSpawn) throws InterruptedException
{
location me = getLocation(player);
chat.chat(self, "INTRUDER ALERT! INTRUDER ALERT!");
me.x = me.x + 3;
create.object(toSpawn, me);
me.y = me.y + 1;
create.object(toSpawn, me);
return;
}
public void doWarning(obj_id self) throws InterruptedException
{
obj_id building = getTopMostContainer(self);
Vector alarms = utils.getResizeableObjIdArrayScriptVar(building, "objAlarms");
for (Object alarm : alarms) {
if (isIdValid(((obj_id) alarm))) {
setCondition(((obj_id) alarm), CONDITION_ON);
messageTo(self, "turnAlarmsOff", null, 10, false);
}
}
}
public int turnAlarmsOff(obj_id self, dictionary params) throws InterruptedException
{
obj_id building = getTopMostContainer(self);
Vector alarms = utils.getResizeableObjIdArrayScriptVar(building, "objAlarms");
for (Object alarm : alarms) {
if (isIdValid(((obj_id) alarm))) {
clearCondition(((obj_id) alarm), CONDITION_ON);
}
}
return SCRIPT_CONTINUE;
}
}