Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Yahoo!

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Checking inventory
Forum Rules | Mark all | Recent Posts

Checking inventory
< Newer Topic :: Older Topic > Checking inventory for objects

Pages:<< prev 1 next >>
Post is unread #1 Aug 20, 2002, 11:46 pm
Go to the top of the page
Go to the bottom of the page

barbus_007

GroupMembers
Posts16
JoinedJun 23, 2002

How would one sift through the players inventory to look for a defined object?
Eg:
OBJ_VNUM_WATER if you were making a potion or something.
       
Post is unread #2 Aug 21, 2002, 12:58 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Well this isn't what your asking for neccessarily, but its a good way to look for a certain object a player has.

/* Installation:

Just append this snippet after the "lck" ifcheck, which is located
between the if (chkchar) {} body of code in the mprog_do_ifcheck()
function in the mud_prog.c source file. Search for "lck" (include
the quotes in the search) in the mud_prog.c file and the first
instance should be the location you are looking for.

E-Mail me if you have any problems:
-Ron Kinney(minex@dod.hpi.net)
*/

/* This if check has the syntax within mprogs:
if iscarrying() ==
It will return true if the person is carrying the item of that vnum.
False will be returned otherwise.

Only the == check is supported, for I didn't see the need for other
comparisons. For example, iscarrying($n) > 100 didn't seem to have
much of a use in my opinion. However, feel free to add those
conditions if you feel so inclined.

ie,
if iscarrying($n) == 100
say You are holding vnum 100
else
say You are not holding vnum 100
endif
*/

if (!str_cmp(chck, "iscarrying";)) {

OBJ_DATA *pObj;
int vnum = atoi(rval);

if (vnum 2097152000) {
progbug("iscarrying: bad vnum", mob) ;
return BERR ;
}

if (str_cmp(opr, "==";)) {
progbug("iscarrying: bad check", mob) ;
return BERR ;
}

for (pObj = chkchar->first_carrying; pObj; pObj = pObj->next_content)
if (pObj->pIndexData->vnum == vnum)
return TRUE ;

return FALSE ;
}

Vladaar
       
Pages:<< prev 1 next >>