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

objects.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "merc.h"
#include "interp.h"
#include "recycle.h"
#include "tables.h"
#include "lookup.h"

Include dependency graph for objects.c:

Go to the source code of this file.

Functions

void do_find_bad_object (CHAR_DATA *ch, char *argument)


Function Documentation

void do_find_bad_object CHAR_DATA ch,
char *  argument
 

Definition at line 19 of file objects.c.

References add_buf(), buf_string(), FALSE, free_buf(), get_obj_index(), ITEM_ARMOR, obj_index_data::item_type, ITEM_WEAPON, MAX_STRING_LENGTH, new_buf(), page_to_char(), send_to_char(), top_obj_index, TRUE, obj_index_data::value, and obj_index_data::vnum.

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 }

Here is the call graph for this function:


Generated on Thu Jan 13 22:12:08 2005 for Beyond the Shadows by  doxygen 1.4.0