Addition to do_vnum by Cathy Gore Little note: Tested on a CircleMUD 3.0 bpl 17. Don't ya hate looking for a dagger to test out backstab with, but can't get ALL the piercing weapons in one list? vnum obj dagger works to an extent... but there's more than just daggers to pierce with! So I tweaked up do_vnum to now accept the following as arguments: vnum { obj | mob | weapon } where attacktype is something like pierce, hit, maul, etc. example: >vnum w pierce 1. [ 101] the Oldtimer 2. [ 314] a smurfy dagger 3. [ 907] a heavy spear 4. [ 908] a trident 5. [ 1501] a Pike 6. [ 1608] The Spear of Sagittarius the Archer Here's the snippet: -------------------------------------- in act.wizard.c, add the following function: +int find_attack_type(char *arg) +{ + int nr; + + for (nr=0; nr < NUM_ATTACK_TYPES; nr++) { + if (is_abbrev(arg, attack_hit_text[nr].singular)) + break; + } + + return (nr); +} and change ACMD(do_vnum) as follows: ACMD(do_vnum) { half_chop(argument, buf, buf2); - if (!*buf || !*buf2 || (!is_abbrev(buf, "mob") && !is_abbrev(buf, "obj"))) { - send_to_char("Usage: vnum { obj | mob } \r\n", ch); + if (!*buf || !*buf2 || (!is_abbrev(buf, "mob") && !is_abbrev(buf, "obj") && !is_abbrev(buf, "weapon"))) { + send_to_char("Usage: vnum { obj | mob | weapon } \r\n", ch); return; } if (is_abbrev(buf, "mob")) ... if (is_abbrev(buf, "obj")) if (!vnum_object(buf2, ch)) send_to_char("No objects by that name.\r\n", ch); + + if (is_abbrev(buf, "weapon")) + if (!vnum_weapon(find_attack_type(buf2), ch)) + send_to_char("No weapons with that attack-type.\r\n", ch); } -------- in db.c, add the following function after int vnum_object: + +int vnum_weapon(int attacktype, struct char_data * ch) +{ + int nr, found = 0; + + for (nr = 0; nr <= top_of_objt; nr++) { + if (obj_proto[nr].obj_flags.type_flag == ITEM_WEAPON && obj_proto[nr].obj_flags.value[3] == attacktype) { + sprintf(buf, "%3d. [%5d] %s\r\n", ++found, + obj_index[nr].vnum, + obj_proto[nr].short_description); + send_to_char(buf, ch); + } + } + return (found); +} + + -------- in db.h, add the following line under the prototype for vnum_object: +int vnum_weapon(int attacktype, struct char_data *ch); -------------------------------------- And that's it! Recompile and reboot, and search! As per the standard disclaimer, I am not responsible if this messes up your mud. Always backup any file that is changed before adding any snippet. But you knew that already. And as usual, if you have any problems or find a way to make this better, email me at cheron98@hotmail.com. If you use this, please email me. I don't care if you put me in the credits or not, I'd just like to know who's usin it. Look for my various other snippets around the CircleMUD FTP site! Cathy Gore aka Cheron, DarkonMUD