Jump to content

whosell


java

Recommended Posts


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  251
  • Reputation:   20
  • Joined:  12/22/11
  • Last Seen:  

hi this is whosell source.. this source credit to people who make it, i just edit it :D

add this at src/map/atcommand.c

/*==========================================
* @whosell - List who is vending the item (amount, price, and location).
* revamped by VoidLess, original by zephyrus_cr
*------------------------------------------*/
ACMD_FUNC(whosell)
{
   char item_name[100];
   int item_id = 0, j, count = 0, sat_num = 0;
   int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine
   int refine = 0,card_id = 0;
   bool flag = 0; // place dot on the minimap?
   struct map_session_data* pl_sd;
   struct s_mapiterator* iter;
   unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0;
   struct item_data *item_data;
   nullpo_retr(-1, sd);
   if (!message || !*message) {
    clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
    return -1;
   }
   if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){
    s_type = 1+2+4;
   }
   else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){
    s_type = 1+4;
   }
   else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){
    s_type = 2+4;
   }
   else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){
    s_type = 1+2;
   }
   else if (sscanf(message, "[%d]", &card_id) == 1){
    s_type = 2;
   }
   else if (sscanf(message, "+%d", &refine) == 1){
    s_type = 4;
   }
   else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){
   //names, that start on num are not working
   //so implemented minumum item_id>500
   //or better make item_id == atoi(message) ?
    s_type = 1;
   }
   else if (sscanf(message, "%99[^\n]", item_name) == 1){
    s_type = 1;
    if ((item_data = itemdb_searchname(item_name)) == NULL){
	    clif_displaymessage(fd, "Not found item with this name");
	    return -1;
    }
    item_id = item_data->nameid;
   }
   else {
    clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
    return -1;
   }

   //check card
   if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){
    clif_displaymessage(fd, "Not found a card with than ID");
    return -1;
   }
   //check item
   if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){
    clif_displaymessage(fd, "Not found an item with than ID");
    return -1;
   }
   //check refine
   if(s_type & 4){
    if (refine<0 || refine>10){
	    clif_displaymessage(fd, "Refine out of bounds: 0 - 10");
	    return -1;
    }
    /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){
	    clif_displaymessage(fd, "Use refine only with weapon or armor");
	    return -1;
    }*/
   }
   iter = mapit_getallusers();
   for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
   {
    if( pl_sd->vender_id ) //check if player is vending
    {
	    for (j = 0; j < pl_sd->vend_num; j++) {
		    if((item_data = itemdb_exists(pl_sd->status.cart[pl_sd->vending[j].index].nameid)) == NULL)
			    continue;
		    if(s_type & 1 && pl_sd->status.cart[pl_sd->vending[j].index].nameid != item_id)
			    continue;
		    if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) ||
						    (pl_sd->status.cart[pl_sd->vending[j].index].card[0] != card_id &&
						    pl_sd->status.cart[pl_sd->vending[j].index].card[1] != card_id &&
						    pl_sd->status.cart[pl_sd->vending[j].index].card[2] != card_id &&
						    pl_sd->status.cart[pl_sd->vending[j].index].card[3] != card_id)))
			    continue;
		    if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || pl_sd->status.cart[pl_sd->vending[j].index].refine != refine))
			    continue;
		    if(item_data->type == IT_ARMOR)
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",pl_sd->status.cart[pl_sd->vending[j].index].refine
					    ,pl_sd->status.cart[pl_sd->vending[j].index].nameid
					    ,pl_sd->status.cart[pl_sd->vending[j].index].card[0]
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x,pl_sd->bl.y
					    ,pl_sd->status.name);
		    else if(item_data->type == IT_WEAPON)
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d,%d,%d,%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",pl_sd->status.cart[pl_sd->vending[j].index].refine
					    ,pl_sd->status.cart[pl_sd->vending[j].index].nameid
					    ,pl_sd->status.cart[pl_sd->vending[j].index].card[0]
					    ,pl_sd->status.cart[pl_sd->vending[j].index].card[1]
					    ,pl_sd->status.cart[pl_sd->vending[j].index].card[2]
					    ,pl_sd->status.cart[pl_sd->vending[j].index].card[3]
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x,pl_sd->bl.y
					    ,pl_sd->status.name);
		    else
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "ID %d | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",pl_sd->status.cart[pl_sd->vending[j].index].nameid
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x, pl_sd->bl.y
					    ,pl_sd->status.name);
		    if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value;
		    if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value;
		    clif_displaymessage(fd, atcmd_output);
		    count++;
		    flag = 1;
	    }
	    if(flag && pl_sd->mapindex == sd->mapindex){
		    clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF);
		    flag = 0;
	    }
    }
   }
   mapit_free(iter);
   if(count > 0) {
    snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice);
    clif_displaymessage(fd, atcmd_output);
   } else
    clif_displaymessage(fd, "Nobody is selling it now.");
   return 0;
}

and dont forget add this too at src/map/atcommand.c

ACMD_DEF(whosell),

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  291
  • Reputation:   4
  • Joined:  04/24/12
  • Last Seen:  

you edited it so whats new on it? sorry but im not good on codes thats wh im asking ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  251
  • Reputation:   20
  • Joined:  12/22/11
  • Last Seen:  

someone aksing for it at this thread >> http://rathena.org/b...afk-whosell-pk/

he give me source at http://www.eathena.w...howtopic=216350 the original whos make this source.. it was for eathena.. and he ask , can u edit that so can be use at rathena emulator ,,

nothing big changes here, just try to make this compatible to rathena :)

im noob to at source , need more practice >.<

Edited by java
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  62
  • Reputation:   0
  • Joined:  07/13/12
  • Last Seen:  

I don't think this works?

It keeps saying no one sells it,

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   2
  • Joined:  01/08/12
  • Last Seen:  

Same problem, only the message "Nobody is selling it now."

Does anyone has a solution?

 

OK, it seems to be a bug as mentioned here: http://rathena.org/board/topic/62877-atcommand-whobuy/#entry107407

After reopening the test (for testing purposes only 2 players on testserver) vending shop, @whoseel shows the items.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

just dont know where to put this

ACMD_DEF(whosell),

Link to comment
Share on other sites

  • 4 years later...

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

where to put this??

 

ACMD_DEF(whosell)

Edited by Questune09
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

1 hour ago, Questune09 said:

where to put this??

 

ACMD_DEF(whosell)

Also in your src/map/atcommand add it with rest if of the command list

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

27 minutes ago, Cyro said:

Also in your src/map/atcommand add it with rest if of the command list

Thank you... i add this before but my server crash when i try to reload and restart server via console do i missed something to do?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

17 minutes ago, Questune09 said:

Thank you... i add this before but my server crash when i try to reload and restart server via console do i missed something to do?

You need to recompile

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  1167
  • Reputation:   159
  • Joined:  06/12/12
  • Last Seen:  

i think this feature can replace with item Universal Catalog Silver

You can buy this item form npc at prontera town

if not at prontera town you can found it at Eden paradise group

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.08
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

On 7/17/2017 at 11:37 AM, hendra814 said:

i think this feature can replace with item Universal Catalog Silver

You can buy this item form npc at prontera town

if not at prontera town you can found it at Eden paradise group

I will search that thank you

 

On 7/17/2017 at 11:01 AM, Cyro said:

You need to recompile

Any recompile guide?? That will not delete all.my works

I recompile also before but my server is gone hahahaha i think  ive been search and do a wrong guide

Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

on the terminal stop your server >

./athena-start stop

then use this >

./configure && make clean && make server

to recompile

make sure you take backup from the files you want to edit before

if you didn't edit it as it should be you wont be able to start the server

everytime you edit file in the src folder you need to recompile the server to apply the changes

Edited by sader1992
  • Upvote 1
Link to comment
Share on other sites

  • 5 months later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

Hello everyone, even if the post is old I prefer not to open another, and I'll explain my problem ... In practice I tried to add the command to rAthena but when I compile it with vc ++ gives me error.
Error VC++

1. class "mmo_charstatus" does not include any members "cart"

 

 atcommand.cpp

Where am I doing wrong?

Edited by Shinto
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

Request a new update. storages such as inventory/ cart / storages / guild_storage etc.. was revamped and they no longer lie in mmo_status.

To fix the mentionned issues you have to edit all "sd->status.cart" to "sd->cart"

eg line 234
(pl_sd->status.cart[pl_sd->vending[j].index].card[0] != card_id &&
to
(pl_sd->cart[pl_sd->vending[j].index].card[0] != card_id &&

cf :

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

Lighta I modified the source as you told me but it does not work .... it always gives me error when compiling the emulator.

Ps. I modified all the strings "pl_sd->status.cart" in "pl_sd->cart", that were in the source command

Immagine.png.a33919d331a2c5b14d5b7e17dc9ec428.png

Error VC++
No operator [] corresponding to the operands

 

Edited by Shinto
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

My bas it seem to be "sd->cart.u.items_cart"
We'll need to make few accessor as this is not friendly enough imo

Edited by Lighta
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

Thanks Lights I solved ..... I modified with "sd-> card.u.items_cart" and now it works .... here is the working script :)

 

/*==========================================
* @whosell - List who is vending the item (amount, price, and location).
* revamped by VoidLess, original by zephyrus_cr
*------------------------------------------*/
ACMD_FUNC(whosell)
{
   char item_name[100];
   int item_id = 0, j, count = 0, sat_num = 0;
   int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine
   int refine = 0,card_id = 0;
   bool flag = 0; // place dot on the minimap?
   struct map_session_data* pl_sd;
   struct s_mapiterator* iter;
   unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0;
   struct item_data *item_data;
   nullpo_retr(-1, sd);
   if (!message || !*message) {
    clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
    return -1;
   }
   if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){
    s_type = 1+2+4;
   }
   else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){
    s_type = 1+4;
   }
   else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){
    s_type = 2+4;
   }
   else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){
    s_type = 1+2;
   }
   else if (sscanf(message, "[%d]", &card_id) == 1){
    s_type = 2;
   }
   else if (sscanf(message, "+%d", &refine) == 1){
    s_type = 4;
   }
   else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){
   //names, that start on num are not working
   //so implemented minumum item_id>500
   //or better make item_id == atoi(message) ?
    s_type = 1;
   }
   else if (sscanf(message, "%99[^\n]", item_name) == 1){
    s_type = 1;
    if ((item_data = itemdb_searchname(item_name)) == NULL){
	    clif_displaymessage(fd, "Not found item with this name");
	    return -1;
    }
    item_id = item_data->nameid;
   }
   else {
    clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
    return -1;
   }

   //check card
   if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){
    clif_displaymessage(fd, "Not found a card with than ID");
    return -1;
   }
   //check item
   if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){
    clif_displaymessage(fd, "Not found an item with than ID");
    return -1;
   }
   //check refine
   if(s_type & 4){
    if (refine<0 || refine>10){
	    clif_displaymessage(fd, "Refine out of bounds: 0 - 10");
	    return -1;
    }
    /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){
	    clif_displaymessage(fd, "Use refine only with weapon or armor");
	    return -1;
    }*/
   }
   iter = mapit_getallusers();
   for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
   {
    if( pl_sd->vender_id ) //check if player is vending
    {
	    for (j = 0; j < pl_sd->vend_num; j++) {
		    if((item_data = itemdb_exists(sd->cart.u.items_cart[pl_sd->vending[j].index].nameid)) == NULL)
			    continue;
		    if(s_type & 1 && sd->cart.u.items_cart[pl_sd->vending[j].index].nameid != item_id)
			    continue;
		    if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) ||
						    (sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] != card_id &&
						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] != card_id &&
						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] != card_id &&
						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] != card_id)))
			    continue;
		    if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || sd->cart.u.items_cart[pl_sd->vending[j].index].refine != refine))
			    continue;
		    if(item_data->type == IT_ARMOR)
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].refine
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[0]
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x,pl_sd->bl.y
					    ,pl_sd->status.name);
		    else if(item_data->type == IT_WEAPON)
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d,%d,%d,%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].refine
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[0]
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[1]
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[2]
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[3]
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x,pl_sd->bl.y
					    ,pl_sd->status.name);
		    else
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "ID %d | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x, pl_sd->bl.y
					    ,pl_sd->status.name);
		    if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value;
		    if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value;
		    clif_displaymessage(fd, atcmd_output);
		    count++;
		    flag = 1;
	    }
	    if(flag && pl_sd->mapindex == sd->mapindex){
		    clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF);
		    flag = 0;
	    }
    }
   }
   mapit_free(iter);
   if(count > 0) {
    snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice);
    clif_displaymessage(fd, atcmd_output);
   } else
    clif_displaymessage(fd, "Nobody is selling it now.");
   return 0;
}

 

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  436
  • Reputation:   31
  • Joined:  02/19/12
  • Last Seen:  

On 12/20/2017 at 5:59 PM, Shinto said:

Thanks Lights I solved ..... I modified with "sd-> card.u.items_cart" and now it works .... here is the working script :)

 


/*==========================================
* @whosell - List who is vending the item (amount, price, and location).
* revamped by VoidLess, original by zephyrus_cr
*------------------------------------------*/
ACMD_FUNC(whosell)
{
   char item_name[100];
   int item_id = 0, j, count = 0, sat_num = 0;
   int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine
   int refine = 0,card_id = 0;
   bool flag = 0; // place dot on the minimap?
   struct map_session_data* pl_sd;
   struct s_mapiterator* iter;
   unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0;
   struct item_data *item_data;
   nullpo_retr(-1, sd);
   if (!message || !*message) {
    clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
    return -1;
   }
   if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){
    s_type = 1+2+4;
   }
   else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){
    s_type = 1+4;
   }
   else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){
    s_type = 2+4;
   }
   else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){
    s_type = 1+2;
   }
   else if (sscanf(message, "[%d]", &card_id) == 1){
    s_type = 2;
   }
   else if (sscanf(message, "+%d", &refine) == 1){
    s_type = 4;
   }
   else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){
   //names, that start on num are not working
   //so implemented minumum item_id>500
   //or better make item_id == atoi(message) ?
    s_type = 1;
   }
   else if (sscanf(message, "%99[^\n]", item_name) == 1){
    s_type = 1;
    if ((item_data = itemdb_searchname(item_name)) == NULL){
	    clif_displaymessage(fd, "Not found item with this name");
	    return -1;
    }
    item_id = item_data->nameid;
   }
   else {
    clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
    return -1;
   }

   //check card
   if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){
    clif_displaymessage(fd, "Not found a card with than ID");
    return -1;
   }
   //check item
   if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){
    clif_displaymessage(fd, "Not found an item with than ID");
    return -1;
   }
   //check refine
   if(s_type & 4){
    if (refine<0 || refine>10){
	    clif_displaymessage(fd, "Refine out of bounds: 0 - 10");
	    return -1;
    }
    /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){
	    clif_displaymessage(fd, "Use refine only with weapon or armor");
	    return -1;
    }*/
   }
   iter = mapit_getallusers();
   for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
   {
    if( pl_sd->vender_id ) //check if player is vending
    {
	    for (j = 0; j < pl_sd->vend_num; j++) {
		    if((item_data = itemdb_exists(sd->cart.u.items_cart[pl_sd->vending[j].index].nameid)) == NULL)
			    continue;
		    if(s_type & 1 && sd->cart.u.items_cart[pl_sd->vending[j].index].nameid != item_id)
			    continue;
		    if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) ||
						    (sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] != card_id &&
						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] != card_id &&
						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] != card_id &&
						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] != card_id)))
			    continue;
		    if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || sd->cart.u.items_cart[pl_sd->vending[j].index].refine != refine))
			    continue;
		    if(item_data->type == IT_ARMOR)
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].refine
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[0]
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x,pl_sd->bl.y
					    ,pl_sd->status.name);
		    else if(item_data->type == IT_WEAPON)
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d,%d,%d,%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].refine
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[0]
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[1]
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[2]
					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[3]
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x,pl_sd->bl.y
					    ,pl_sd->status.name);
		    else
			    snprintf(atcmd_output, CHAT_SIZE_MAX, "ID %d | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
					    ,pl_sd->vending[j].value
					    ,pl_sd->vending[j].amount
					    ,mapindex_id2name(pl_sd->mapindex)
					    ,pl_sd->bl.x, pl_sd->bl.y
					    ,pl_sd->status.name);
		    if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value;
		    if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value;
		    clif_displaymessage(fd, atcmd_output);
		    count++;
		    flag = 1;
	    }
	    if(flag && pl_sd->mapindex == sd->mapindex){
		    clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF);
		    flag = 0;
	    }
    }
   }
   mapit_free(iter);
   if(count > 0) {
    snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice);
    clif_displaymessage(fd, atcmd_output);
   } else
    clif_displaymessage(fd, "Nobody is selling it now.");
   return 0;
}

 

Why the output always "Nobody is selling it now." Is this really working?

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  08/12/17
  • Last Seen:  

On 12/31/2017 at 1:11 AM, Rebel said:

Why the output always "Nobody is selling it now." Is this really working?

I got the same result "Nobody is selling it now."

Link to comment
Share on other sites

  • 9 months later...

  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

only vending player can see 

need it

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  73
  • Reputation:   1
  • Joined:  11/27/18
  • Last Seen:  

Need update ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

13 hours ago, 3TAJIOH said:

Need update ?

The update on this is just change the variable that view the map area.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  73
  • Reputation:   1
  • Joined:  11/27/18
  • Last Seen:  

On 2/8/2019 at 4:48 AM, hikashin-rae said:

The update on this is just change the variable that view the map area.

Can u say plz where and how?)

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  251
  • Topics Per Day:  0.06
  • Content Count:  698
  • Reputation:   15
  • Joined:  01/07/12
  • Last Seen:  

is this still work for current rAthena release? or are they a newer version ?

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
Reply to this topic...

×   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...