phebs Posted September 13, 2012 Posted September 13, 2012 example if you use @go/warp/storage command you need a item first example 501 Red Potions i hope you understand me hehehe thank you Quote
lekkereten Posted September 13, 2012 Posted September 13, 2012 You can do something like this: http://pastebin.com/QF5ZxvAG And the @storage command would be: http://pastebin.com/r48ynwUA If you want the amount of item do be deleted after using the command, you can add this line: if (found) pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); I tested here and it is working. Quote
phebs Posted September 13, 2012 Author Posted September 13, 2012 ill just edit it in atcommand.c right? and this commands can be use to @vend also? Quote
lekkereten Posted September 13, 2012 Posted September 13, 2012 Yeah. They can be used with pretty much all atcommands. But you have to put the code in a place before the command itself is executed. On @storage, for example, the line that open the storage is this one: if (storage_storageopen(sd) == 1) So I had to put the verification code before that, so it'll check for the items before open the storage. Quote
phebs Posted September 13, 2012 Author Posted September 13, 2012 thank you very much, do you know where i could change command for vending i cant find it in atcommand.. thank you again Quote
lekkereten Posted September 13, 2012 Posted September 13, 2012 Go to src/map/vending.c and find this function: void vending_openvending(struct map_session_data* sd, const char* message, bool flag, const uint8* data, int count) { And then put the code before this line: vending_skill_lvl = pc_checkskill(sd, MC_VENDING); Also, find this line int the code I sent you: sprintf(atcmd_output, "You need %dx %s in order to use this command", item_qty_req, itemdb_jname(item_id_req)); Add this before: char atcmd_output[150]; Then I think it'll work, didn't test though. 1 Quote
Question
phebs
example if you use @go/warp/storage command
you need a item first example 501 Red Potions
i hope you understand me hehehe thank you
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.