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

114 lines
4.7 KiB
Java
Executable File

package script.theme_park;
import script.*;
import script.library.chat;
public class bldg_destroy extends script.base_script
{
public bldg_destroy()
{
}
public int OnAttach(obj_id self) throws InterruptedException
{
return SCRIPT_CONTINUE;
}
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
{
int mnu = mi.addRootMenu(menu_info_types.SELF_DESTRUCT, new string_id("self_destruct", "self_destruct"));
mi.addSubMenu(mnu, menu_info_types.THIRTY_SEC, new string_id("self_destruct", "thirty"));
mi.addSubMenu(mnu, menu_info_types.FIFTEEN_SEC, new string_id("self_destruct", "fifteen"));
return SCRIPT_CONTINUE;
}
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
{
if (item == menu_info_types.THIRTY_SEC)
{
obj_id bldg = getTopMostContainer(self);
if (bldg == self)
{
bldg = getObjIdObjVar(self, "bldg");
}
playMusic(player, "sound/music_darth_vader_theme.snd");
chat.chat(self, new string_id("self_destruct", "thirty_seconds"));
dictionary destroyer = new dictionary();
destroyer.put("player", player);
destroyer.put("bldg", bldg);
messageTo(self, "firstPop", destroyer, 10, true);
messageTo(self, "firstPop", destroyer, 20, true);
messageTo(self, "blowUp", destroyer, 30, true);
return SCRIPT_CONTINUE;
}
else if (item == menu_info_types.FIFTEEN_SEC)
{
obj_id bldg = getTopMostContainer(self);
if (bldg == self)
{
bldg = getObjIdObjVar(self, "bldg");
}
chat.chat(self, new string_id("self_destruct", "fifteen_seconds"));
dictionary destroyer = new dictionary();
destroyer.put("player", player);
destroyer.put("bldg", bldg);
messageTo(self, "firstPop", destroyer, 5, true);
messageTo(self, "blowUp", destroyer, 15, true);
return SCRIPT_CONTINUE;
}
return SCRIPT_CONTINUE;
}
public int blowUp(obj_id self, dictionary params) throws InterruptedException
{
obj_id viewer = params.getObjId("player");
obj_id bldg = params.getObjId("bldg");
location death = getLocation(bldg);
playClientEffectLoc(viewer, "clienteffect/combat_explosion_lair_large.cef", death, 10.0f);
death.x = death.x + 5;
playClientEffectLoc(viewer, "clienteffect/combat_explosion_lair_large.cef", death, 10.0f);
death.z = death.z + 5;
playClientEffectLoc(viewer, "clienteffect/combat_explosion_lair_large.cef", death, 10.0f);
death.x = death.x - 10;
playClientEffectLoc(viewer, "clienteffect/combat_explosion_lair_large.cef", death, 10.0f);
death.z = death.z - 10;
playClientEffectLoc(viewer, "clienteffect/combat_explosion_lair_large.cef", death, 10.0f);
boolean blowUp = destroyObject(bldg);
dictionary destroyer = new dictionary();
destroyer.put("player", viewer);
destroyer.put("bldg", bldg);
messageTo(self, "bldgCheck", destroyer, 1, true);
return SCRIPT_CONTINUE;
}
public int firstPop(obj_id self, dictionary params) throws InterruptedException
{
obj_id viewer = params.getObjId("player");
obj_id bldg = getTopMostContainer(self);
location death = getLocation(bldg);
playClientEffectLoc(viewer, "clienteffect/combat_explosion_lair_large.cef", death, 10.0f);
obj_id player = getObjIdObjVar(bldg, "player");
if (!hasObjVar(self, "sentMsgToPlayer"))
{
messageTo(player, "finishQuest", null, 0, true);
setObjVar(self, "sentMsgToPlayer", 1);
}
return SCRIPT_CONTINUE;
}
public int bark(obj_id self, dictionary params) throws InterruptedException
{
debugSpeakMsg(self, "I'm right here at " + getLocation(self));
messageTo(self, "bark", null, 10, true);
return SCRIPT_CONTINUE;
}
public int bldgCheck(obj_id self, dictionary params) throws InterruptedException
{
obj_id viewer = params.getObjId("player");
obj_id bldg = params.getObjId("bldg");
if (exists(bldg))
{
sendSystemMessage(viewer, "System detects lifeforms inside building, shutting down self destruct", null);
}
else
{
destroyObject(self);
}
return SCRIPT_CONTINUE;
}
}