Files
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

67 lines
2.5 KiB
Java
Executable File

package script.beta;
import script.library.player_structure;
import script.location;
import script.obj_id;
public class e3_housing extends script.base_script
{
public e3_housing()
{
}
public int OnSpeaking(obj_id self, String text) throws InterruptedException
{
obj_id deed = obj_id.NULL_ID;
obj_id inv = getObjectInSlot(self, "inventory");
if (inv == null)
{
sendSystemMessageTestingOnly(self, "Player inventory is null.");
return SCRIPT_CONTINUE;
}
switch (text) {
case "tatooine small":
deed = createObjectOverloaded("object/tangible/deed/player_house_deed/tatooine_house_small_deed.iff", inv);
break;
case "naboo medium":
deed = createObjectOverloaded("object/tangible/deed/player_house_deed/naboo_house_medium_deed.iff", inv);
break;
case "corellia large":
deed = createObjectOverloaded("object/tangible/deed/player_house_deed/corellia_house_large_deed.iff", inv);
break;
case "tatooine guild":
deed = createObjectOverloaded("object/tangible/deed/guild_deed/tatooine_guild_style_02_deed.iff", inv);
break;
}
if (isIdValid(deed))
{
setObjVar(deed, player_structure.VAR_DEED_BUILDTIME, 15);
removeObjVar(deed, player_structure.VAR_DEED_SCENE);
sendSystemMessageTestingOnly(self, deed + " created.");
return SCRIPT_CONTINUE;
}
if (text.startsWith("destroy"))
{
location loc = getLocation(self);
obj_id[] objects = getObjectsInRange(loc, 30.0f);
for (obj_id object : objects) {
if (player_structure.isBuilding(object) || player_structure.isInstallation(object)) {
if (player_structure.getStructureOwnerObjId(object) == self) {
player_structure.destroyStructure(object);
sendSystemMessageTestingOnly(self, object + " destroyed.");
}
}
}
}
if (text.startsWith("damagestructure"))
{
obj_id target = getLookAtTarget(self);
if (target != null)
{
player_structure.damageStructure(target, 100);
debugSpeakMsg(self, "Structure damaged.");
}
}
return SCRIPT_CONTINUE;
}
}