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
134 lines
5.3 KiB
Java
Executable File
134 lines
5.3 KiB
Java
Executable File
package script.e3demo;
|
|
|
|
import script.dictionary;
|
|
import script.library.ship_ai;
|
|
import script.library.space_create;
|
|
import script.library.space_utils;
|
|
import script.obj_id;
|
|
import script.transform;
|
|
import script.vector;
|
|
|
|
public class spawner_nebulon extends script.base_script
|
|
{
|
|
public spawner_nebulon()
|
|
{
|
|
}
|
|
public static final String[] ATTACKER_LIST =
|
|
{
|
|
"tiefighter",
|
|
"tiefighter",
|
|
"tiefighter",
|
|
"tiefighter",
|
|
"tiefighter",
|
|
"tiefighter",
|
|
"tiefighter",
|
|
"tieinterceptor",
|
|
"tieinterceptor",
|
|
"tieinterceptor",
|
|
"tiebomber",
|
|
"tiebomber",
|
|
"tiebomber",
|
|
"tiebomber"
|
|
};
|
|
public static final String[] DEFENDER_LIST =
|
|
{
|
|
"xwing",
|
|
"xwing",
|
|
"xwing",
|
|
"xwing",
|
|
"ywing_average",
|
|
"ywing_average",
|
|
"ywing_average"
|
|
};
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
removeObjVar(self, "intNoDump");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnShipWasHit(obj_id self, obj_id objAttacker, int intWeaponIndex, boolean isMissile, int missileType, int intTargetedComponent, boolean fromPlayerAutoTurret, float hitLocationX_o, float hitLocationY_o, float hitLocationZ_o) throws InterruptedException
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int spawnNebulon(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
transform trMyTransform = getTransform_o2w(self);
|
|
vector vctTest = new vector(100.0f, 100.0f, 100.0f);
|
|
transform trNewTransform = trMyTransform.move_l(vctTest);
|
|
obj_id objNewNebulon = space_create.createShip("corellian_corvette", trNewTransform, null);
|
|
space_utils.setComponentDisabled(objNewNebulon, ship_chassis_slot_type.SCST_engine, true);
|
|
space_utils.setComponentDisabled(self, ship_chassis_slot_type.SCST_engine, true);
|
|
setObjVar(self, "objBuddy", objNewNebulon);
|
|
setObjVar(objNewNebulon, "intNebulon", 1);
|
|
setObjVar(objNewNebulon, "intNoDump", 1);
|
|
attachScript(objNewNebulon, "e3demo.nebulon_damaged");
|
|
dictionary dctParams = new dictionary();
|
|
space_utils.notifyObject(self, "startNebulonAttack", dctParams);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int startNebulonAttack(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
obj_id objFoo = null;
|
|
obj_id objFoo2 = null;
|
|
for (String s : DEFENDER_LIST) {
|
|
transform trNewTransform = space_utils.getRandomPositionInSphere(getTransform_o2w(self), 100, 150, true);
|
|
obj_id objShip = space_create.createShip(s, trNewTransform, null);
|
|
if (isIdValid(objShip)) {
|
|
objFoo = objShip;
|
|
setObjVar(objShip, "intNebulon", 1);
|
|
setObjVar(objShip, "strType", s);
|
|
setObjVar(objShip, "trSpawnLocation", trNewTransform);
|
|
setObjVar(objShip, "intNoDump", 1);
|
|
setObjVar(objShip, "objNebulon", self);
|
|
attachScript(objShip, "e3demo.nebulon_child_object");
|
|
} else {
|
|
LOG("space", "BAD DEFENDER NEBULON E3 SHIP OF TYPE " + s);
|
|
}
|
|
}
|
|
for (int intI = 0; intI < ATTACKER_LIST.length; intI++)
|
|
{
|
|
transform trNewTransform = space_utils.getRandomPositionInSphere(getTransform_o2w(self), 500, 600, true);
|
|
obj_id objShip = space_create.createShip(ATTACKER_LIST[intI], trNewTransform, null);
|
|
if (isIdValid(objShip))
|
|
{
|
|
objFoo2 = objShip;
|
|
setObjVar(objShip, "intNebulon", 1);
|
|
setObjVar(objShip, "intAttacker", 1);
|
|
setObjVar(objShip, "strType", ATTACKER_LIST[intI]);
|
|
setObjVar(objShip, "trSpawnLocation", trNewTransform);
|
|
setObjVar(objShip, "intNoDump", 1);
|
|
setObjVar(objShip, "objNebulon", self);
|
|
attachScript(objShip, "e3demo.nebulon_child_object");
|
|
obj_id objBuddy = getObjIdObjVar(self, "objBuddy");
|
|
ship_ai.spaceAttack(objShip, objBuddy);
|
|
}
|
|
else
|
|
{
|
|
LOG("space", "BAD DEFENDER NEBULON E3 SHIP OF TYPE " + DEFENDER_LIST[intI]);
|
|
}
|
|
}
|
|
ship_ai.spaceAttack(objFoo, objFoo2);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int shipDestroyed(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
String strType = params.getString("strType");
|
|
transform trSpawnLocation = params.getTransform("trSpawnLocation");
|
|
int intAttacker = params.getInt("intAttacker");
|
|
obj_id objShip = space_create.createShip(strType, trSpawnLocation, null);
|
|
if (isIdValid(objShip))
|
|
{
|
|
setObjVar(objShip, "intNebulon", 1);
|
|
setObjVar(objShip, "intAttacker", intAttacker);
|
|
setObjVar(objShip, "strType", strType);
|
|
setObjVar(objShip, "trSpawnLocation", trSpawnLocation);
|
|
setObjVar(objShip, "intNoDump", 1);
|
|
attachScript(objShip, "e3demo.nebulon_child_object");
|
|
if (intAttacker == 1)
|
|
{
|
|
ship_ai.spaceAttack(objShip, self);
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|