Files
2018-06-07 00:32:29 +01:00

47 lines
1.5 KiB
Java
Executable File

package script.e3demo;
import script.location;
import script.menu_info;
import script.obj_id;
public class hanger_elevator extends script.base_script
{
public hanger_elevator()
{
}
public int OnAttach(obj_id self) throws InterruptedException
{
setName(self, "an elevator terminal");
return SCRIPT_CONTINUE;
}
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
{
location myLoc = getLocation(player);
obj_id building = getTopMostContainer(player);
String currentCell = getCellName(myLoc.cell);
if (currentCell.equals("elevator_e3_down"))
{
playClientEffectObj(player, "clienteffect/elevator_rise.cef", player, null);
obj_id objCell = getCellId(building, "elevator_e3_up");
myLoc = new location();
myLoc.cell = objCell;
myLoc.x = 19.3f;
myLoc.y = 453.6f;
myLoc.z = 341.8f;
setLocation(player, myLoc);
}
else
{
playClientEffectObj(player, "clienteffect/elevator_descend.cef", player, null);
obj_id objCell = getCellId(building, "elevator_e3_down");
myLoc = new location();
myLoc.cell = objCell;
myLoc.x = -74.4f;
myLoc.y = 204.9f;
myLoc.z = 330.2f;
setLocation(player, myLoc);
}
return SCRIPT_CONTINUE;
}
}