qtdan Posted February 18 Group: Members Topic Count: 67 Topics Per Day: 0.02 Content Count: 223 Reputation: 30 Joined: 10/21/12 Last Seen: Thursday at 11:30 AM Share Posted February 18 (edited) /** * Extended Vending system [Lilith] **/ int skill_vending(struct map_session_data *sd, t_itemid nameid) { struct item_data *item; char output[1024]; nullpo_ret(sd); if (!pc_can_give_items(sd) || (item = itemdb_search(nameid)) == NULL) { sd->state.prevend = 0; sd->vend_loot = 0; sd->state.workinprogress = WIP_DISABLE_NONE; clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); } else { sd->vend_loot = nameid; sd->state.prevend = 1; clif_openvendingreq(sd, 2 + sd->vend_lvl); sprintf(output, msg_txt(sd, 1594), item->ename.c_str()); clif_messagecolor(&sd->bl, color_table[COLOR_CYAN], output, false, SELF); } return 0; } how do you guys solve this part when canceling the vending it still go for vending and the currency becomes unknown item. if (!pc_can_give_items(sd) || (item = itemdb_search(nameid)) == NULL) { Edited February 18 by qtdan Quote Link to comment Share on other sites More sharing options...
0 LeonZ Posted February 19 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 20 Reputation: 13 Joined: 07/11/12 Last Seen: Monday at 10:59 PM Share Posted February 19 (edited) Regarding canceling and being left with unknown item, I couldn't resolve it. However, in relation to Warning, just create a file named item_db_ex.yml in the db/import folder. With the following: Quote # Easycore's Works # - - - ########################################################################### # Item Vending Database ########################################################################### # - Item Item Aegis Name. ########################################################################### Header: Type: ITEM_DB Version: 3 Body: - Id: 30000 AegisName: Zeny Name: Zeny Type: Etc Weight: 1 - Id: 30001 AegisName: Cash Name: Cash Type: Etc Weight: 1 After creating the file, go to the db folder and open Item_db and add the following line. Quote - Path: db/import/item_db_ex.yml Edited February 19 by LeonZ Quote Link to comment Share on other sites More sharing options...
0 qtdan Posted February 19 Group: Members Topic Count: 67 Topics Per Day: 0.02 Content Count: 223 Reputation: 30 Joined: 10/21/12 Last Seen: Thursday at 11:30 AM Author Share Posted February 19 Already done that. Just the cancel is my issue. Quote Link to comment Share on other sites More sharing options...
0 LeonZ Posted February 19 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 20 Reputation: 13 Joined: 07/11/12 Last Seen: Monday at 10:59 PM Share Posted February 19 (edited) I managed to solve it. I say at least it solved it for me, Every time I press cancel it appears that the skill failed, It depends a lot on your emulator too. Src/Map/Skill.cpp clif_item_identified(sd,idx,flag); } /** /* Extended Vending system [Lilith] **/ int skill_vending(struct map_session_data *sd, t_itemid nameid) { std::shared_ptr<item_data> item; char output[1024]; nullpo_ret(sd); if (!pc_can_give_items(sd) || (item = item_db.find(nameid)) == NULL) { sd->state.prevend = 0; sd->vend_loot = 0; sd->state.workinprogress = WIP_DISABLE_NONE; clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); } else { sd->vend_loot = nameid; sd->state.prevend = 1; clif_openvendingreq(sd, 2 + sd->vend_lvl); sprintf(output, msg_txt(sd, 1594), item->ename.c_str()); clif_messagecolor(&sd->bl, color_table[COLOR_CYAN], output, false, SELF); } return 0; } ExtendedVending_Rev9.2.diff Edited February 19 by LeonZ Quote Link to comment Share on other sites More sharing options...
0 qtdan Posted February 20 Group: Members Topic Count: 67 Topics Per Day: 0.02 Content Count: 223 Reputation: 30 Joined: 10/21/12 Last Seen: Thursday at 11:30 AM Author Share Posted February 20 Damnnn it works thanks a lot man. Quote Link to comment Share on other sites More sharing options...
Question
qtdan
how do you guys solve this part when canceling the vending it still go for vending and the currency becomes unknown item.
if (!pc_can_give_items(sd) || (item = itemdb_search(nameid)) == NULL) {
Link to comment
Share on other sites
4 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.