Files
dsrc/sku.0/sys.server/compiled/game/script/theme_park/utils/npcdeath.java
T

43 lines
1.3 KiB
Java
Executable File

package script.theme_park.utils;
import script.dictionary;
import script.obj_id;
public class npcdeath extends script.base_script
{
public npcdeath()
{
}
public int OnAttach(obj_id self) throws InterruptedException
{
if (!hasObjVar(self, "quests.target"))
{
detachScript(self, "theme_park.utils.npcdeath");
}
return SCRIPT_CONTINUE;
}
public int OnDestroy(obj_id self) throws InterruptedException
{
if (!hasObjVar(self, "quests.target"))
{
detachScript(self, "theme_park.utils.npcdeath");
return SCRIPT_CONTINUE;
}
obj_id target = getObjIdObjVar(self, "quests.target");
String msgHandlerName = getStringObjVar(self, "quests.msgHandlerName");
messageTo(target, msgHandlerName, null, 0, true);
return SCRIPT_CONTINUE;
}
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
{
setHealth(self, -5000);
messageTo(self, "killMe", null, 5, true);
return SCRIPT_CONTINUE;
}
public int killMe(obj_id self, dictionary params) throws InterruptedException
{
destroyObject(self);
return SCRIPT_CONTINUE;
}
}