odd "acquire" behavior

alphacow

New member
Can someone explain the following:
Code:
> inv scroll of drast

scroll of drastic healing (93)

> acquire 95 scroll of drast

Searching for "scroll of drastic healing"...
Purchasing scroll of drastic healing (30 @ 480)...
You acquire scroll of drastic healing (30)
Purchases complete.

> inv scroll of drastic

scroll of drastic healing (123)

If I only needed 2, why did it buy 30?
 

fronobulax

Developer
Staff member
I'm guessing, because I don't recall all of the details, but there are circumstances where mafia will buy 30 of an item, regardless of what was asked for/needed. The thinking is that - whatever the circumstances are - the meat optimization is of minimal value to the player and the purchase of 30 at once reduces server hits. So I believe what you saw was the designed behavior, even if it is not what you expected.
 

alphacow

New member
Interesting argument. Do you know if there's any way to circumvent this internal logic and force it to get only the requested amount, while still taking advantage of the rest of the "acquire" logic (check inv, try to build, get from NPC, etc.)?
 

Grotfang

Developer
Interesting argument. Do you know if there's any way to circumvent this internal logic and force it to get only the requested amount, while still taking advantage of the rest of the "acquire" logic (check inv, try to build, get from NPC, etc.)?

Code:
void main(int itemNum , item itemName)
{
    int currentNum = item_amount(itemName);
    int needNum = itemNum - currentNum;
    if( needNum > 0 )
    {
        buy( needNum , itemName );
    }
    else
        print("You already have that many!");
}

I'm sure an easy alias could be made out of this...

EDIT: Although, it wouldn't consider building stuff in this example. Acquire is generally a better option
 
Last edited:

alphacow

New member
Yeah, from here it seems that the acquire command is actually pretty sophisticated, which is why I was surprised when I saw that odd behavior.
 
Top