mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-14 23:07:51 -04:00
73 lines
2.5 KiB
Java
Executable File
73 lines
2.5 KiB
Java
Executable File
package script.quest.som;
|
|
|
|
import script.*;
|
|
import script.library.groundquests;
|
|
import script.library.mustafar;
|
|
import script.library.sui;
|
|
import script.library.utils;
|
|
|
|
public class xandank_jaw extends script.base_script
|
|
{
|
|
public xandank_jaw()
|
|
{
|
|
}
|
|
public static final String STF = "som/som_quest";
|
|
public static final string_id EXAMINE = new string_id(STF, "xandank_jaw_examine");
|
|
public static final string_id DESTROY = new string_id(STF, "xandank_jaw_destroy");
|
|
public static final string_id ALREADY = new string_id(STF, "xandank_jaw_already");
|
|
public static final string_id UNABLE = new string_id(STF, "unable_to_examine");
|
|
public static final string_id DECLINE = new string_id(STF, "quest_decline");
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
|
{
|
|
int menu = mi.addRootMenu(menu_info_types.ITEM_USE, EXAMINE);
|
|
menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE);
|
|
if (mid == null)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
mid.setServerNotify(true);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
|
{
|
|
if (item == menu_info_types.ITEM_USE)
|
|
{
|
|
if (utils.getContainingPlayer(self) == null)
|
|
{
|
|
sendSystemMessage(player, UNABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!groundquests.isQuestActive(player, "som_xandank_hunt_25"))
|
|
{
|
|
mustafar.activateQuestAcceptSUI(player, self);
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(player, ALREADY);
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int handleQuestOfferResponse(obj_id self, dictionary params) throws InterruptedException
|
|
{
|
|
if ((params == null) || (params.isEmpty()))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id player = sui.getPlayerId(params);
|
|
int bp = sui.getIntButtonPressed(params);
|
|
switch (bp)
|
|
{
|
|
case sui.BP_OK:
|
|
groundquests.grantQuest(player, "som_xandank_hunt_25");
|
|
sendSystemMessage(player, DESTROY);
|
|
destroyObject(self);
|
|
break;
|
|
case sui.BP_CANCEL:
|
|
sendSystemMessage(player, DECLINE);
|
|
break;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|