Ok. I know i posted this a while back, I started to comment the code, to try
and help myself out. The reason the code didnt work for me before (i think) is
because it doesnt have silver. When i sell all of my crystals, (10) it gives
me the exact ammount of the cost in gold. So if someone wouldnt mind helping a
newbie, so i may learn, could ya help me add silver into this loop.
if (!str_cmp(arg, "all"))
{
for (obj = ch->carrying; obj != NULL; obj = obj_next)
{
obj_next = obj->next_content;
if (can_drop_obj(ch, obj) //if the pc can drop the obj
&& obj->wear_loc == WEAR_NONE // if the obj is in the inventory
&& can_see_obj(keeper, obj) // can the keeper see the object?
&& ((cost = get_cost(keeper, obj, FALSE)) > 0) //
&& (cost < keeper->gold))
{
tcost += cost;
count++;
ch->gold += cost;
deduct_cost(keeper, cost);
if (keeper->gold < 0)
keeper->gold = 0;
if (obj->item_type == ITEM_TRASH || IS_OBJ_STAT(obj, ITEM_SELL_EXTRACT))
{
extract_obj(obj);
}
else
{
obj_from_char(obj);
if (obj->timer)
SET_BIT(obj->extra_flags, ITEM_HAD_TIMER);
else
obj->timer = number_range(50, 100);
obj_to_keeper(obj, keeper);
}
} // salable item ifcheck
} // for loop
sprintf(buf, "You sell %d items for %d gold.\r\n", count, tcost);
send_to_char(buf, ch);
return;
} // 'all' if check
Thank you for help, guidance, and even maybe a flame or two ;)
Atm, of Forgotten Empire
__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397
Get AOL Instant Messenger 5.1 free of charge. Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455