Files
dsrc/sku.0/sys.server/compiled/game/script/theme_park/poi/launch.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

124 lines
4.1 KiB
Java
Executable File

package script.theme_park.poi;
import script.dictionary;
import script.obj_id;
public class launch extends script.theme_park.poi.base
{
public launch()
{
}
public static final String POI_SCRIPT = "poi.script";
public int OnAttach(obj_id self) throws InterruptedException
{
if (hasObjVar(self, POI_BASE_OBJECT))
{
return SCRIPT_CONTINUE;
}
else
{
messageTo(self, "handle_Spawn_Setup_Complete", null, 20, isObjectPersisted(self));
return SCRIPT_CONTINUE;
}
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if (hasObjVar(self, POI_BASE_OBJECT))
{
return SCRIPT_CONTINUE;
}
else
{
messageTo(self, "handle_Spawn_Setup_Complete", null, 20, isObjectPersisted(self));
return SCRIPT_CONTINUE;
}
}
public int handle_Spawn_Setup_Complete(obj_id self, dictionary params) throws InterruptedException
{
if (hasObjVar(self, "npc_lair.delayedLaunch"))
{
return SCRIPT_CONTINUE;
}
if (hasObjVar(self, POI_BASE_OBJECT))
{
LOG("spawning", self + " hasobjVar " + POI_BASE_OBJECT);
return SCRIPT_CONTINUE;
}
if (!hasObjVar(self, POI_SCRIPT))
{
LOG("spawning", self + " !hasobjVar " + POI_SCRIPT);
return SCRIPT_CONTINUE;
}
if (hasScript(self, "systems.spawning.spawn_template"))
{
setObjVar(self, "npc_lair.delayedLaunch", true);
messageTo(self, "handleLairInRangeCheck", null, 2, false);
}
else
{
launchPoi(self);
}
return SCRIPT_CONTINUE;
}
public void launchPoi(obj_id self) throws InterruptedException
{
if (!isIdValid(self) || !hasObjVar(self, POI_SCRIPT))
{
return;
}
String poiScript = getStringObjVar(self, POI_SCRIPT);
LOG("spawning", self + " script im looking for is " + poiScript);
if (hasScript(self, poiScript))
{
LOG("spawning", self + " already got one script");
return;
}
setObjVar(self, POI_BASE_OBJECT, self);
LOG("spawning", self + " setObjVar");
attachScript(self, poiScript);
LOG("spawning", self + " attachScript poiscript above");
if (hasScript(self, POI_OBJECT_SCRIPT))
{
LOG("spawning", self + " hasScirpt " + POI_OBJECT_SCRIPT);
debugServerConsoleMsg(self, "WARNING: " + getName(self) + " already has the POI OBJECT script attached. Don't.");
}
else
{
LOG("spawning", self + " attaching Script " + POI_OBJECT_SCRIPT);
attachScript(self, POI_OBJECT_SCRIPT);
}
LOG("spawning", self + " returning");
}
public int handleLairInRangeCheck(obj_id self, dictionary params) throws InterruptedException
{
obj_id[] otherObjects = getAllObjectsWithTemplate(getLocation(self), 80.0f, "object/tangible/lair/npc_lair.iff");
if (otherObjects == null || otherObjects.length < 2)
{
launchPoi(self);
}
for (obj_id otherObject : otherObjects) {
if (otherObject != self) {
if (hasScript(self, "systems.spawning.spawn_template")) {
destroyObject(self);
return SCRIPT_CONTINUE;
} else {
if (hasScript(otherObject, "systems.spawning.spawn_template")) {
destroyObject(otherObject);
}
}
}
}
launchPoi(self);
return SCRIPT_CONTINUE;
}
public int OnDestroy(obj_id self) throws InterruptedException
{
if (hasObjVar(self, "objLocationReservation"))
{
destroyObject(getObjIdObjVar(self, "objLocationReservation"));
removeObjVar(self, "objLocationReservation");
}
return SCRIPT_CONTINUE;
}
}