mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
88 lines
2.3 KiB
Plaintext
88 lines
2.3 KiB
Plaintext
include library.groundquests;
|
|
include library.create;
|
|
include library.trial;
|
|
include library.utils;
|
|
|
|
const string STF = "som/som_quest";
|
|
const string_id TRACK = new string_id(STF, "xandank_trophy_track");
|
|
const string_id TRACK_FOUND_ONE = new string_id(STF, "xandank_trophy_track_one");
|
|
const string_id TRACK_FOUND_TWO = new string_id(STF, "xandank_trophy_track_two");
|
|
const string_id TRACK_COMPLETE = new string_id(STF, "xandank_trophy_track_complete");
|
|
|
|
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
|
|
{
|
|
if( groundquests.isQuestActive(player, "som_xandank_trophey"))
|
|
{
|
|
int menu = mi.addRootMenu( menu_info_types.ITEM_USE, TRACK );
|
|
|
|
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(hasObjVar(self, "xandank_trophy_one"))
|
|
{
|
|
if (groundquests.isTaskActive(player, "som_xandank_trophey", "xandank_trophy_two"))
|
|
{
|
|
doAnimationAction (player, "search");
|
|
dictionary dict = new dictionary();
|
|
dict.put("target", player);
|
|
messageTo(self, "handleFindTrackOne", dict, 5f, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(player, TRACK_COMPLETE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if(hasObjVar(self, "xandank_trophy_two"))
|
|
{
|
|
if (groundquests.isTaskActive(player, "som_xandank_trophey", "xandank_trophy_four"))
|
|
{
|
|
doAnimationAction (player, "search");
|
|
dictionary dict = new dictionary();
|
|
dict.put("target", player);
|
|
messageTo(self, "handleFindTrackTwo", dict, 5f, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(player, TRACK_COMPLETE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleFindTrackOne()
|
|
{
|
|
obj_id player = params.getObjId("target");
|
|
sendSystemMessage(player, TRACK_FOUND_ONE);
|
|
groundquests.sendSignal(player, "xandank_trophy_signal_one");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleFindTrackTwo()
|
|
{
|
|
obj_id player = params.getObjId("target");
|
|
sendSystemMessage(player, TRACK_FOUND_TWO);
|
|
groundquests.sendSignal(player, "xandank_trophy_signal_two");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
} |