mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -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
102 lines
3.9 KiB
Java
Executable File
102 lines
3.9 KiB
Java
Executable File
package script.beta;
|
|
|
|
import script.dictionary;
|
|
import script.library.utils;
|
|
import script.obj_id;
|
|
|
|
public class player_warp extends script.base_script
|
|
{
|
|
public player_warp()
|
|
{
|
|
}
|
|
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
|
{
|
|
if (text.startsWith("warp"))
|
|
{
|
|
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
|
if (st.countTokens() < 5)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "format: warp <planet> <x> <y> <z>");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
LOG("LOG_CHANNEL", "tokens -> " + st.countTokens() + " nextToken ->" + st.nextToken());
|
|
if (st.hasMoreTokens())
|
|
{
|
|
String planet = st.nextToken();
|
|
float x = utils.stringToInt(st.nextToken());
|
|
float y = utils.stringToInt(st.nextToken());
|
|
float z = utils.stringToInt(st.nextToken());
|
|
warpPlayer(self, planet, x, y, z, null, 0.0f, 0.0f, 0.0f);
|
|
}
|
|
}
|
|
if (text.startsWith("create"))
|
|
{
|
|
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
|
if (st.countTokens() < 2)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "format: create <template>");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id inv = getObjectInSlot(self, "inventory");
|
|
if (inv == null)
|
|
{
|
|
LOG("LOG_CHANNEL", "player_warp: create -- Unable to get an inventory slot for " + self);
|
|
sendSystemMessageTestingOnly(self, "Your inventory object is null!");
|
|
}
|
|
String command = st.nextToken();
|
|
String template = st.nextToken();
|
|
if (template == null || template.length() < 1)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "That is an invalid object.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
LOG("LOG_CHANNEL", "template ->" + template);
|
|
int template_idx = dataTableSearchColumnForString(template, "Template", "datatables/beta/restricted_template.iff");
|
|
LOG("LOG_CHANNEL", "template_idx ->" + template_idx);
|
|
if (template_idx != -1)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "You cannot create that object.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
int num_rows = dataTableGetNumRows("datatables/beta/restricted_template.iff");
|
|
for (int i = 0; i < num_rows; i++)
|
|
{
|
|
dictionary row = dataTableGetRow("datatables/beta/restricted_template.iff", i);
|
|
if (row != null)
|
|
{
|
|
String directory = row.getString("Directory");
|
|
if (directory.length() > 0)
|
|
{
|
|
if (template.contains(directory))
|
|
{
|
|
sendSystemMessageTestingOnly(self, "You cannot create that object.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (template.length() < 1)
|
|
{
|
|
sendSystemMessageTestingOnly(self, "That is an invalid object.");
|
|
}
|
|
else
|
|
{
|
|
obj_id object = createObjectOverloaded(template, inv);
|
|
if (!isIdValid(object))
|
|
{
|
|
sendSystemMessageTestingOnly(self, "That is an invalid object.");
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessageTestingOnly(self, object + " created.");
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|