Files
dsrc/sku.0/sys.server/compiled/game/script/quest/som/xandank_jaw.script
T
2013-09-10 23:17:15 -07:00

74 lines
1.7 KiB
Plaintext

include library.groundquests;
include library.utils;
include library.sui;
include library.mustafar;
const string STF = "som/som_quest";
const string_id EXAMINE = new string_id(STF, "xandank_jaw_examine");
const string_id DESTROY = new string_id(STF, "xandank_jaw_destroy");
const string_id ALREADY = new string_id(STF, "xandank_jaw_already");
const string_id UNABLE = new string_id(STF, "unable_to_examine");
const string_id DECLINE = new string_id(STF, "quest_decline");
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
{
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;
}
trigger OnObjectMenuSelect( obj_id player, int item )
{
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;
}
messageHandler handleQuestOfferResponse()
{
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: // "Accept"
groundquests.grantQuest(player, "som_xandank_hunt_25");
sendSystemMessage(player, DESTROY);
destroyObject(self);
break;
case sui.BP_CANCEL: // "Decline"
sendSystemMessage(player, DECLINE);
break;
}
return SCRIPT_CONTINUE;
}