/****************************************************************************
 * Land Of Legends by Conner and Dragona -> telnet://tcdbbs.zapto.org:4000  *
 * Web Page: http://tcdbbs.zapto.org/mud/  Email: csbsc@comcast.net         *
 *       Forums: http://s11.invisionfree.com/Land_Of_Legends                *
 * Copyright (C) 1996 - 2006 Computerized Services By Sacks & Chung of      *
 *           Glade Spring, Virginia - ALL RIGHTS RESERVED                   *
 ****************************************************************************
 * The text and pictures of this publication, or any part thereof, may not  *
 * be reproduced or transmitted in any form or by any means, electronic or  *
 * mechanical, includes photocopying, recording, storage in a information   *
 * retrieval system, or otherwise, without the prior written or e-mail      *
 * consent from the publisher.                                              *
 ****************************************************************************
 * I only ask that my name be mentioned in your code somewhere, whether as  *
 * Dragona, Dragona Destron, Conner and Dragona, or Land of Legends and that*
 * you drop me an email to let me know what mud this code is being used in  *
 * should you decide that you want to use it, any other credit is welcome   *
 * but not required. However, all license requirements of the codebase that *
 * you are using are expected to be upheld as well.                         *
 ****************************************************************************
 * This code was written for my mud and has been snippitized with the       *
 * intention of it being able to install and run cleanly and easily on any  *
 * SmaugFUSS 1.6 mud, but has only been tested on my own mud which was      *
 * started as SmaugFUSS 1.4 and has been hand modified to SmaugFUSS 1.6     *
 * with many modifications. I offer no guarantees that it will work for     *
 * your mud and will accept no responsibility if it causes any damage to    *
 * your mud. - Use entirely at your own risk.                               *
 ****************************************************************************
 * Finally, please let me know if you have suggestions or comments about    *
 * code that might improve upon it in some way, I will update it if I have  *
 * time, I can figure out how, and the suggestion meets my approval.        *
 ****************************************************************************/
/* What this snippet does is to add a SCRAP_PROG to be used in building */

//In mud.h find:
DAMAGE_PROG

//change:
   USE_PROG
} prog_types;

//to:
   USE_PROG, SCRAP_PROG
} prog_types;

//In build.c find:
"damage"

//change:
   "speechiw", "pull", "push", "sleep", "rest", "leave", "script", "use"
};

//to:
   "speechiw", "pull", "push", "sleep", "rest", "leave", "script", "use",
   "scrap"
};

//In db.c find:
   if( !str_cmp( name, "damage_prog" ) )
      return DAMAGE_PROG;

//after that add:
   if( !str_cmp( name, "scrap_prog" ) )
      return SCRAP_PROG;

//In makeobj.c after the includes add:
void oprog_scrap_trigger( CHAR_DATA *ch, OBJ_DATA *obj );

//Then find make_scraps and change:
   if( obj->carried_by )
   {
      act( AT_OBJECT, "$p falls to the ground in scraps!", obj->carried_by, obj, NULL, TO_CHAR );
//to:
   if( obj->carried_by )
   {
      ch = obj->carried_by;
      act( AT_OBJECT, "$p falls to the ground in scraps!", obj->carried_by, obj, NULL, TO_CHAR );

//Then towards the end of make_scraps find:
   }
   extract_obj( obj );
}
//and change it to:
   }
   oprog_scrap_trigger( ch, obj );
   extract_obj( obj );
}

//In mud_comm.c find:
      case DAMAGE_PROG:
         return "damage_prog";

//after that add:
      case SCRAP_PROG:
         return "scrap_prog";

//In mud_prog.c find:
void oprog_get_trigger( CHAR_DATA * ch, OBJ_DATA * obj )
{
   if( HAS_PROG( obj->pIndexData, GET_PROG ) )
   {
      set_supermob( obj );
      oprog_percent_check( supermob, ch, obj, NULL, GET_PROG );
      release_supermob(  );
   }
}
//after that add:
void oprog_scrap_trigger( CHAR_DATA *ch, OBJ_DATA *obj )
{
   if( HAS_PROG( obj->pIndexData, SCRAP_PROG ) )
   {
      set_supermob( obj );
      oprog_percent_check( supermob, ch, obj, NULL, SCRAP_PROG );
      release_supermob(  );
   }
}