Re: Showing a list of objects.

"Valnir" <[email protected]> Mon, 13 Jun 2005 16:44:41 -0400
Newsgroups gmane.games.devel.mud.rom
Message-ID <[email protected]>
Hey there.. it SHOULD look something like this.

--- Code block - put it in your own "do_" function -----

void do_xxxxx ( CHAR_DATA *ch, char *argument )
{
AFFECT_DATA *paf;
OBJ_DATA *obj;
BUFFFER *buffer;
char buf[MSL];
int vnum;
int MAX_VNUM = 32099;
bool found = FALSE;

buffer = new_buf();

for ( vnum = 1; vnum < MAX_VNUM; vnum++ )
{
    if ( ( obj = get_obj_index(vnum) ) == NULL )
 continue;

    for ( paf = obj->affected; paf != NULL; paf = paf->next )
    {
 if ( paf->where != TO_IMMUNE )
     continue;

 if ( !found )
     add_buf( buffer, " Vnum   Immunity\n\r"
        "====== ========================\n\r" );

 sprintf( buf, "%6d %s\n\r", obj->pIndexData->vnum,
     flag_bit_name(paf->bitvector,imm_flags) );
 add_buf( buffer, buf )

 found = TRUE;
        }
    }
}

if ( !found )
    send_to_char( "No objects found.\n\r", ch );
else
    page_to_char( buf_string(buffer), ch );

free_buf(buffer);
return;
}

----- End block ----
Should do the trick.

- Valnir


----- Original Message ----- 
From: "KJM" <[email protected]>
To: <[email protected]>
Sent: Friday, June 10, 2005 11:16 AM
Subject: Showing a list of objects.


> How would one show a list of objects that had immunities on them.  IE
> 
> Vnum   Immunity
> 1234     weapon
> 2345     magic
> 
> Items that when worn you are immune from those attacks....
> 
> Any ideas?  the code I attemted didnt want to work :P
> 
> Thanks
> 
> -K
> 
> -- 
> ROM mailing list
> [email protected]
> Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>

-- 
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom