Files
dsrc/sku.0/sys.server/compiled/game/script/ai/spy_decoy.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

86 lines
3.0 KiB
Java
Executable File

package script.ai;
import script.*;
import script.library.buff;
import script.library.trial;
import script.library.utils;
public class spy_decoy extends script.base_script
{
public spy_decoy()
{
}
public int OnAttach(obj_id self) throws InterruptedException
{
detachScript(self, "systems.combat.credit_for_kills");
dictionary dict = new dictionary();
dict.put("degrade", 0);
messageTo(self, "destroyDecoy", null, 8.0f, false);
return SCRIPT_CONTINUE;
}
public int OnAboutToLoseItem(obj_id self, obj_id destContainer, obj_id transferer, obj_id item) throws InterruptedException
{
return SCRIPT_OVERRIDE;
}
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
{
messageTo(self, "handleDecoyCleanup", null, 2.0f, false);
return SCRIPT_CONTINUE;
}
public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException
{
if (pvpCanAttack(self, attacker) && isFlanking(self))
{
buff.applyBuff(attacker, "sp_decoy_debuff");
}
return SCRIPT_CONTINUE;
}
public int destroyDecoy(obj_id self, dictionary params) throws InterruptedException
{
int stage = params.getInt("degrade");
switch (stage)
{
case 0:
setHologramType(self, HOLOGRAM_TYPE1_QUALITY4);
break;
case 1:
setCreatureCoverVisibility(self, false);
kill(self);
messageTo(self, "handleDecoyCleanup", null, 2.0f, false);
return SCRIPT_CONTINUE;
}
stage++;
params.put("degrade", stage);
messageTo(self, "destroyDecoy", params, 2.0f, false);
return SCRIPT_CONTINUE;
}
public boolean isFlanking(obj_id self) throws InterruptedException
{
return utils.getBooleanScriptVar(self, "flank");
}
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
{
mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("spam", "decoy_start_trade"));
mi.addRootMenu(menu_info_types.ELEVATOR_UP, new string_id("spam", "decoy_character_sheet"));
mi.addRootMenu(menu_info_types.ELEVATOR_DOWN, new string_id("spam", "invite_to_group"));
return SCRIPT_CONTINUE;
}
public int handleDecoyCleanup(obj_id self, dictionary params) throws InterruptedException
{
obj_id[] haters = getHateList(self);
if (haters.length > 0)
{
for (obj_id hater : haters) {
removeHateTarget(hater, self);
}
}
trial.cleanupObject(self);
return SCRIPT_CONTINUE;
}
public int queue_ad(obj_id self, dictionary params) throws InterruptedException
{
queueCommand(self, (-1782321567), self, "", COMMAND_PRIORITY_DEFAULT);
return SCRIPT_CONTINUE;
}
}