rathena / rathena

rAthena is an open-source cross-platform MMORPG server.
https://rathena.org/board/
GNU General Public License v3.0
2.88k stars 2.31k forks source link

Extra arguments to script command searchstores #6222

Open plsfixrito opened 3 years ago

plsfixrito commented 3 years ago

Is your request related to a missing feature? No

Describe the solution you'd like

Adding extra functionality to searchstores script command. for instance:

searchstores <uses>,<effect>{,<type>,<item_id>}
searchstores <uses>,<effect>{,<type>,<item_name>}
Type: 0 = Vending Stores, 1 = Buying Stores
Lemongrass3110 commented 3 years ago

Hmm I would understand the type parameter, but why would you want to limit the search of the player to a certain item?

plsfixrito commented 3 years ago

Hmm I would understand the type parameter, but why would you want to limit the search of the player to a certain item?

Not necessarily limit it to a certain item, but have it as a first search on opening the window. Useful for adding custom atcommands that use the functionality of searchstores command.

for example, if an item id/name is passed to this command it should open a search window with a default search for the defined item. Otherwise it just opens the search store window with default option being "Vending Stores" or "Sell"

-   script  atcmd_whosell   -1,{
OnInit:
    bindatcmd "whosell",strnpcinfo(3)+"::OnAtcommand",0,99;
    end;

OnAtcommand:
    if (.@atcmd_numparameters == 0)
    {
        searchstores 255,1,0;
    }
    else
    {
        searchstores 255,1,0,.@atcmd_parameters$[0];
    }
    end;
}
OptimusM commented 3 years ago

this would be really nice, but as lemon said, not for a single item. It would be so much better if the UI itself accept itemID beside ItemName, that would be great.