mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-02 02:15:48 -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
88 lines
2.6 KiB
Java
Executable File
88 lines
2.6 KiB
Java
Executable File
package script.poi.city;
|
|
|
|
import script.dictionary;
|
|
import script.library.create;
|
|
import script.obj_id;
|
|
|
|
public class droid_convo2 extends script.base_script
|
|
{
|
|
public droid_convo2()
|
|
{
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
spawnDroid(self);
|
|
spawnGuy(self);
|
|
messageTo(self, "handleChatting", null, 10, false);
|
|
messageTo(self, "checkForScripts", null, 10, true);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int handleChatting(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
messageTo(self, "handleChatting", null, 600, false);
|
|
obj_id droid = getObjIdObjVar(self, "droidSpawn");
|
|
obj_id guy1 = getObjIdObjVar(self, "guy1");
|
|
if (!exists(droid) || !exists(guy1))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
faceTo(guy1, droid);
|
|
faceTo(droid, guy1);
|
|
setAnimationMood(guy1, "conversation");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public void spawnGuy(obj_id baseObject) throws InterruptedException
|
|
{
|
|
obj_id guy1 = create.themeParkObject(getRandomGuy(), 1.0f, 0.0f, "handleDeadGuy", 0.0f);
|
|
if (isIdValid(guy1))
|
|
{
|
|
setObjVar(baseObject, "guy1", guy1);
|
|
}
|
|
}
|
|
public int handleDeadGuy(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
spawnGuy(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public void spawnDroid(obj_id baseObject) throws InterruptedException
|
|
{
|
|
String[] droids = new String[4];
|
|
droids[0] = "r2";
|
|
droids[1] = "r3";
|
|
droids[2] = "r4";
|
|
droids[3] = "r5";
|
|
obj_id droid = create.themeParkObject(droids[rand(0, 3)], 2.0f, 1.0f, "handleDeadDroid", 0.0f);
|
|
if (isIdValid(droid))
|
|
{
|
|
setObjVar(baseObject, "droidSpawn", droid);
|
|
}
|
|
}
|
|
public int handleDeadDroid(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
spawnDroid(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public String getRandomGuy() throws InterruptedException
|
|
{
|
|
int whichGuy = rand(1, 5);
|
|
String guy;
|
|
if (whichGuy == 1)
|
|
{
|
|
guy = "commoner";
|
|
}
|
|
else
|
|
{
|
|
guy = "noble";
|
|
}
|
|
return guy;
|
|
}
|
|
public int checkForScripts(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
if (hasScript(self, "theme_park.poi.launch"))
|
|
{
|
|
detachScript(self, "theme_park.poi.launch");
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|