05 Apr, 2008, Tailsthefox wrote in the 1st comment:
Votes: 0
Okay so, I need a bit of help for smaug shops idea I have. I want to make it where places can analyze the items that shops hold before buying them. That way they can see the stats on a item before wasting their money. I need to know How would I go about doing it, and is there snippet or mudcodebase that does this that I could pull it from?
06 Apr, 2008, tphegley wrote in the 2nd comment:
Votes: 0
I'd say a value command would work for this.

IE: value gloves

and just go through the do_list and spell_identify code and piece it together. Make sure that the item is coming from the shop keeper, and then would use identify to get the numbers off of it.
06 Apr, 2008, Darwin wrote in the 3rd comment:
Votes: 0
I've done something similar so perhaps this may help you.
Try this

The comments in the code should be enough explaination, but in case it's not, it works like this:
command: list
( # ) [ Price ] Item
( 1) [ 565] A beltpouch.
( 2) [ 847] A leather cap.
( 3) [ 1412] A leather tunic.
( 4) [ 847] A pair of leather boots.
( 5) [ 1130] A set of leather leggings.
( 6) [ 5650] A set of tracking goggles.
( 7) [ 2825] A thin rapier.
( 8) [ 3390] A yew longbow.

command: list 4
Object 'a pair of leather boots' is an armor, with wear location: feet
Object key words: boots leather
Special properties: inventory
Its weight is 3 and value is 750.
Armor class is 5.

command: list boots
( # ) [ Price ] Item
( 4) [ 847] A pair of leather boots.
06 Apr, 2008, Tailsthefox wrote in the 4th comment:
Votes: 0
06 Apr, 2008, Conner wrote in the 5th comment:
Votes: 0
Hey Darwin, that looks pretty nifty, mind if I use it too? (What sort of credits do you want/need for that?)

Mind you, I'll need to modify it a wee bit as it's not got the item levels that Smaug includes at shops already and which I don't want to get rid of, but…
07 Apr, 2008, Darwin wrote in the 6th comment:
Votes: 0
I don't mind. It's mostly just chopped out of spell_identify, but there was stuff being used over and over so many times similar to it that I chopped it out to be less redundant. Just leave the comments in I guess would be good enough.

I had thought of putting in an optional in there for shop useage so that it wouldn't show the inventory flag or cost values, but I got a bit lazy and left that out.

Oh yeah, the item levels were removed 'cause we don't use those on our mud, everyone can wear everything unless restricted by class.
07 Apr, 2008, kiasyn wrote in the 7th comment:
Votes: 0
in drazon i made a view_object function for displaying objects to characters.. it really helps a lot, as you quite often need to call this sort of thing. i would recommend turning this into a function rather than copy pasting the code.