Files
dsrc/sku.0/sys.server/compiled/game/script/npc/skillteacher/civic_skillteacher.script
T
2013-09-10 23:17:15 -07:00

53 lines
1.4 KiB
Plaintext

//------------------------------------------------
// civic_skillteacher
//------------------------------------------------
//------------------------------------------------
// Includes
//------------------------------------------------
include library.city;
//------------------------------------------------
// Constants
//------------------------------------------------
const string_id SID_MT_REMOVE = new string_id("city/city", "mt_remove");
const string_id SID_MT_REMOVED = new string_id("city/city", "mt_removed");
//------------------------------------------------
// OnObjectMenuRequest
//------------------------------------------------
trigger OnObjectMenuRequest( obj_id player, menu_info mi )
{
int city_id = city.checkMayorCity( player, false );
if ( city_id == 0 )
return SCRIPT_CONTINUE;
mi.addRootMenu( menu_info_types.SERVER_MENU1, SID_MT_REMOVE );
return SCRIPT_CONTINUE;
}
//------------------------------------------------
// OnObjectMenuSelect
//------------------------------------------------
trigger OnObjectMenuSelect( obj_id player, int item )
{
int city_id = city.checkMayorCity( player, false );
if ( city_id == 0 )
return SCRIPT_CONTINUE;
if ( item == menu_info_types.SERVER_MENU1 )
{
obj_id spawner = getObjIdObjVar( self, "spawner" );
sendSystemMessage( player, SID_MT_REMOVED );
messageTo( spawner, "requestDestroy", null, 0.f, false );
}
return SCRIPT_CONTINUE;
}