mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-14 23:07:51 -04:00
* 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
80 lines
3.0 KiB
Java
Executable File
80 lines
3.0 KiB
Java
Executable File
package script.item.goggles;
|
|
|
|
import script.library.features;
|
|
import script.library.utils;
|
|
import script.obj_id;
|
|
import script.string_id;
|
|
|
|
public class reset extends script.base_script
|
|
{
|
|
public reset()
|
|
{
|
|
}
|
|
public static final String[] COLLECTOR_EDITION_ITEMS =
|
|
{
|
|
"object/tangible/wearables/goggles/goggles_s01.iff",
|
|
"object/tangible/wearables/goggles/goggles_s02.iff",
|
|
"object/tangible/wearables/goggles/goggles_s03.iff"
|
|
};
|
|
public static final String[] JP_COLLECTOR_EDITION_ITEMS =
|
|
{
|
|
"object/tangible/wearables/goggles/goggles_s04.iff",
|
|
"object/tangible/wearables/goggles/goggles_s05.iff",
|
|
"object/tangible/wearables/goggles/goggles_s06.iff"
|
|
};
|
|
public int createNewGoggles(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
|
|
{
|
|
boolean createFailed = false;
|
|
if (features.isCollectorEdition(self) || features.isJPCollectorEdition(self))
|
|
{
|
|
if (features.isCollectorEdition(self))
|
|
{
|
|
obj_id[] allItems = utils.getAllItemsInBankAndInventory(self);
|
|
obj_id inventory = getObjectInSlot(self, "inventory");
|
|
for (String collectorEditionItem : COLLECTOR_EDITION_ITEMS) {
|
|
if (checkItems(allItems, collectorEditionItem)) {
|
|
continue;
|
|
}
|
|
obj_id newItem = createObject(collectorEditionItem, inventory, "");
|
|
if (!isIdValid(newItem)) {
|
|
createFailed = true;
|
|
}
|
|
}
|
|
}
|
|
if (features.isJPCollectorEdition(self))
|
|
{
|
|
obj_id[] allItems = utils.getAllItemsInBankAndInventory(self);
|
|
obj_id inventory = getObjectInSlot(self, "inventory");
|
|
for (String jpCollectorEditionItem : JP_COLLECTOR_EDITION_ITEMS) {
|
|
if (checkItems(allItems, jpCollectorEditionItem)) {
|
|
continue;
|
|
}
|
|
obj_id newItem = createObject(jpCollectorEditionItem, inventory, "");
|
|
if (!isIdValid(newItem)) {
|
|
createFailed = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(self, new string_id("error_message", "create_goggle_non_se"));
|
|
}
|
|
if (createFailed)
|
|
{
|
|
sendSystemMessage(self, new string_id("error_message", "create_goggle_fail"));
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public boolean checkItems(obj_id[] itemList, String template) throws InterruptedException
|
|
{
|
|
for (obj_id obj_id : itemList) {
|
|
String itemTemplate = getTemplateName(obj_id);
|
|
if (itemTemplate.equals(template)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|