mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-04 04:15:52 -04:00
77 lines
1.7 KiB
Plaintext
77 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, "tulrus_horn_examine");
|
|
const string_id DESTROY = new string_id(STF, "tulrus_horn_destroy");
|
|
const string_id ALREADY = new string_id(STF, "tulrus_horn_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)
|
|
{
|
|
if ( utils.getContainingPlayer(self) != null )
|
|
{
|
|
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_tulrus_hunt_20"))
|
|
{
|
|
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_tulrus_hunt_20");
|
|
sendSystemMessage(player, DESTROY);
|
|
destroyObject(self);
|
|
break;
|
|
case sui.BP_CANCEL: // "Decline"
|
|
sendSystemMessage(player, DECLINE);
|
|
break;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|