Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

objects.c

Go to the documentation of this file.
00001 #if defined(macintosh)
00002 #include <types.h>
00003 #include <time.h>
00004 #else
00005 #include <sys/types.h>
00006 #include <sys/time.h>
00007 #endif
00008 #include <stdio.h>
00009 #include <string.h>
00010 #include <stdlib.h>
00011 #include <unistd.h>              
00012 #include "merc.h"
00013 #include "interp.h"
00014 #include "recycle.h"
00015 #include "tables.h"
00016 #include "lookup.h"
00017 
00018 
00019 void do_find_bad_object (CHAR_DATA *ch, char *argument)
00020 {
00021     char buf[MAX_STRING_LENGTH];
00022     BUFFER *buffer;
00023     OBJ_INDEX_DATA *obj;
00024     int number = 0;
00025     bool found;
00026     found = FALSE;
00027     int vnum;
00028     int match = 0;
00029     extern int top_obj_index;
00030 
00031     buffer = new_buf();
00032     send_to_char("Scanning for overpowered objects. . .\n\r",ch);
00033 
00034 
00035 
00036     for (vnum = 0; match < top_obj_index; vnum++)
00037     {
00038         if ((obj = get_obj_index (vnum)) != NULL)
00039         {
00040             match++;
00041 
00042         if (obj->item_type == ITEM_WEAPON && ((1 + obj->value[2]) * obj->value[1] /2) > 25)
00043         {
00044             sprintf(buf, "{RWeapon{x:Vnum[{c%-7d{x] D[{c%-3d{x] DT[{c%-3d{x] AVG[{C%-3d{x]%-2s", obj->vnum, obj->value[1],
00045                     obj->value[2], (1 + obj->value[2]) * obj->value[1] / 2,"");
00046             add_buf(buffer, buf);
00047             found = TRUE;
00048             if (++number % 2 == 0)
00049                 add_buf(buffer, "\n\r");
00050         }
00051         if (obj->item_type == ITEM_ARMOR && (obj->value[0] > 14 || obj->value[1] > 14 ||
00052                     obj->value[2] > 14 || obj->value[3] > 14))
00053         {
00054             sprintf(buf, "{RArmor{x :Vnum[{c%-7d{x] AC-[{C%-3d/%-3d/%-3d/%-3d{x]%-5s", obj->vnum, 
00055                     obj->value[0], obj->value[1], obj->value[2], obj->value[3], "");
00056             add_buf(buffer,buf);
00057             found = TRUE;
00058         
00059         if (++number % 2 == 0)
00060             add_buf(buffer,"\n\r");
00061         }
00062         }
00063         
00064     }
00065     add_buf(buffer, "\n\r\n\r");
00066     page_to_char(buf_string(buffer), ch);
00067     free_buf(buffer);
00068     if (found == FALSE)
00069     {
00070         send_to_char("No overpowered objects found. Thats a {RGOOD{x thing, is it not? ;)\n\r",ch);
00071         return;
00072     }
00073     return;
00074     
00075 }
00076 
00077             
00078             
00079 

Generated on Thu Jan 13 21:48:13 2005 for Beyond the Shadows by  doxygen 1.4.0