mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
41 lines
1.4 KiB
Java
Executable File
41 lines
1.4 KiB
Java
Executable File
package script.npe;
|
|
|
|
import script.library.groundquests;
|
|
import script.*;
|
|
|
|
public class elevator_up extends script.base_script
|
|
{
|
|
public elevator_up()
|
|
{
|
|
}
|
|
public static final String STF_FILE = "elevator_text";
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
|
{
|
|
int mnu = mi.addRootMenu(menu_info_types.ITEM_USE, new string_id(STF_FILE, "up"));
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
|
{
|
|
location here = getLocation(player);
|
|
location term = getLocation(self);
|
|
float range = getDistance(here, term);
|
|
if (range > 3.0)
|
|
{
|
|
sendSystemMessage(player, new string_id(STF_FILE, "too_far"));
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
if (item == menu_info_types.ITEM_USE)
|
|
{
|
|
playClientEffectObj(player, "clienteffect/elevator_rise.cef", player, null);
|
|
groundquests.sendSignal(player, "npe_elevator_main_up");
|
|
if (elevatorMove(player, 1) == 0)
|
|
{
|
|
sendSystemMessage(player, new string_id(STF_FILE, "highest_floor"));
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|