Jump to content
  • 0

Extended Vending 2.0 Problem


qtdan

Question


  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   30
  • Joined:  10/21/12
  • Last Seen:  

/**
* 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) {

 

image.thumb.png.94c69af3d51760bc74b33006d52c0f7f.png

Edited by qtdan
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   13
  • Joined:  07/11/12
  • Last Seen:  

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 by LeonZ
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   30
  • Joined:  10/21/12
  • Last Seen:  

Already done that. Just the cancel is my issue.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   13
  • Joined:  07/11/12
  • Last Seen:  

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 by LeonZ
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   30
  • Joined:  10/21/12
  • Last Seen:  

Damnnn it works thanks a lot man.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...