From 1d0dfca9c714b93a467f7544142fced97c125e81 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 18 Oct 2015 13:36:53 -0500 Subject: [PATCH] more fixups --- .../theme_park/npc_died/spawned_tracker.java | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 sku.0/sys.server/compiled/game/script/theme_park/npc_died/spawned_tracker.java diff --git a/sku.0/sys.server/compiled/game/script/theme_park/npc_died/spawned_tracker.java b/sku.0/sys.server/compiled/game/script/theme_park/npc_died/spawned_tracker.java new file mode 100755 index 000000000..7ceeef3ed --- /dev/null +++ b/sku.0/sys.server/compiled/game/script/theme_park/npc_died/spawned_tracker.java @@ -0,0 +1,77 @@ +package script.systems.spawning; + +import script.*; +import script.base_class.*; +import script.combat_engine.*; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.Vector; +import script.base_script; + +import script.library.utils; + +public class spawned_tracker extends script.base_script +{ + public spawned_tracker() + { + } + public int OnIncapacitated(obj_id self, obj_id objAttacker) throws InterruptedException + { + if (!utils.hasScriptVar(self, "intCleanedUp")) + { + utils.setScriptVar(self, "intCleanedUp", 1); + obj_id objParent = getObjIdObjVar(self, "objParent"); + float fltRespawnTime = getFloatObjVar(self, "fltRespawnTime"); + if (utils.hasScriptVar(self, "deathTracker")) + { + location loc = utils.getLocationScriptVar(self, "deathTracker"); + dictionary params = new dictionary(); + params.put("loc", loc); + messageTo(objParent, "spawnDestroyed", params, fltRespawnTime, false); + return SCRIPT_CONTINUE; + } + messageTo(objParent, "spawnDestroyed", null, fltRespawnTime, false); + } + return SCRIPT_CONTINUE; + } + public int OnDestroy(obj_id self) throws InterruptedException + { + if (hasObjVar(self, "dontCountDeath")) + { + return SCRIPT_CONTINUE; + } + if (!utils.hasScriptVar(self, "intCleanedUp")) + { + utils.setScriptVar(self, "intCleanedUp", 1); + obj_id objParent = getObjIdObjVar(self, "objParent"); + if (!isIdValid(objParent)) + { + return SCRIPT_CONTINUE; + } + float fltRespawnTime = getFloatObjVar(self, "fltRespawnTime"); + if (utils.hasScriptVar(self, "deathTracker")) + { + location loc = utils.getLocationScriptVar(self, "deathTracker"); + dictionary params = new dictionary(); + params.put("loc", loc); + messageTo(objParent, "spawnDestroyed", params, fltRespawnTime, false); + return SCRIPT_CONTINUE; + } + messageTo(objParent, "spawnDestroyed", null, fltRespawnTime, false); + } + return SCRIPT_CONTINUE; + } + public int selfDestruct(obj_id self, dictionary params) throws InterruptedException + { + if (hasObjVar(self, "force_cleanup")) + { + setPosture(self, POSTURE_INCAPACITATED); + } + destroyObject(self); + return SCRIPT_CONTINUE; + } + public int OnRemovingFromWorld(obj_id self) throws InterruptedException + { + return SCRIPT_CONTINUE; + } +}