mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
49 lines
1.5 KiB
Java
49 lines
1.5 KiB
Java
package script.npe;
|
|
|
|
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.locations;
|
|
import script.library.groundquests;
|
|
|
|
public class elevator_down extends script.base_script
|
|
{
|
|
public elevator_down()
|
|
{
|
|
}
|
|
public static final String STF_FILE = "elevator_text";
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
|
{
|
|
int mnu2 = mi.addRootMenu(menu_info_types.ITEM_USE, new string_id(STF_FILE, "down"));
|
|
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_descend.cef", player, null);
|
|
groundquests.sendSignal(player, "npe_elevator_main_down");
|
|
if (elevatorMove(player, -1) == 0)
|
|
{
|
|
sendSystemMessage(player, new string_id(STF_FILE, "lowest_floor"));
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|