Jump to content
  • 0

callshop script


paolokupal

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

I am having problem in getting the value for the @sold_card1,@sold_card2,@sold_card3,@sold_card4, and @sold_refine.

when i am selling my dagger full load with card in this order.

1 : Turtle_General_Card

2 : Doppelganger_Card

3 : Doppelganger_Card

4 : Phreeoni_Card

I do get Phreeoni_Card in @sold_card1 and the rest with no result.

Help me to solve this ..

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

show your script...nobody is going to guess how you make your script .... i dont even think you could get much help with the current information you provided.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

callshop "EnTrade",2;

npcshopattach "EnTrade";

end;

OnSellItem:

set @totalcost,0;

for(set @i,0; @i < getarraysize(@sold_nameid); set @i,@i+1) {

dispbottom @sold_nameid[@i] + ":" + @sold_refine[@i] + ":" + @sold_card1[@i] + ":" + @card2[@i] + ":" + @sold_card3[@i] + ":" + @sold_card4[@i];

}

Sorry for that because the variables are special given for the callshop script ..

Edited by paolokupal
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,159,172,5	script	market#2	100,{
getitem2 1201, 1,1,0,0, 4001,4002,4003,0;
callshop "market2#hidden", 2;
end;
OnSellItem:
.@size = getarraysize( @sold_nameid );
for ( .@i = 0; .@i < .@size; .@i++ )
	dispbottom callfunc( "getitemname2", @sold_nameid[.@i], @sold_identify[.@i], @sold_refine[.@i], @sold_attribute[.@i], @sold_card1[.@i], @sold_card2[.@i], @sold_card3[.@i], @sold_card4[.@i]);
end;
OnInit:
npcshopattach "market2#hidden";
end;
}
-	shop	market2#hidden	-1,512:10,513:20,514:30,515:40,516:50

wow ... you're right, my getitemname2 function only able to show the @sold_card4, but not the card1~card3 area

maybe I should file a bug report

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

alright i will wait for the fixed script .. thank you so much .. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

ok , reported

http://rathena.org/board/tracker/issue-6847-onsellitem-only-the-sold-card4-return-value/

Index: npc.c
===================================================================
--- npc.c	(revision 16857)
+++ npc.c	(working copy)
@@ -1561,14 +1561,16 @@
static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_list, struct npc_data* nd)
{
 char npc_ev[EVENT_NAME_LENGTH];
-	char card_slot[NAME_LENGTH];
-	int i, j, idx;
+	int i, idx;
 int key_nameid = 0;
 int key_amount = 0;
 int key_refine = 0;
 int key_attribute = 0;
 int key_identify = 0;
-	int key_card = 0;
+	int key_card1 = 0;
+	int key_card2 = 0;
+	int key_card3 = 0;
+	int key_card4 = 0;

 // discard old contents
 script_cleararray_pc(sd, "@sold_nameid", (void*)0);
@@ -1576,12 +1578,10 @@
 script_cleararray_pc(sd, "@sold_refine", (void*)0);
 script_cleararray_pc(sd, "@sold_attribute", (void*)0);
 script_cleararray_pc(sd, "@sold_identify", (void*)0);
-
-	for( j = 0; MAX_SLOTS > j; j++ )
-	{// clear each of the card slot entries
-		snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
-		script_cleararray_pc(sd, card_slot, (void*)0);
-	}
+	script_cleararray_pc(sd, "@sold_card1", (void*)0);
+	script_cleararray_pc(sd, "@sold_card2", (void*)0);
+	script_cleararray_pc(sd, "@sold_card3", (void*)0);
+	script_cleararray_pc(sd, "@sold_card4", (void*)0);

 // save list of to be sold items
 for( i = 0; i < n; i++ )
@@ -1596,12 +1596,11 @@
		 script_setarray_pc(sd, "@sold_refine", i, (void*)(intptr_t)sd->status.inventory[idx].refine, &key_refine);
		 script_setarray_pc(sd, "@sold_attribute", i, (void*)(intptr_t)sd->status.inventory[idx].attribute, &key_attribute);
		 script_setarray_pc(sd, "@sold_identify", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify);
-		
-			for( j = 0; MAX_SLOTS > j; j++ )
-			{// store each of the cards from the equipment in the array
-				snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
-				script_setarray_pc(sd, card_slot, i, (void*)(intptr_t)sd->status.inventory[idx].card[j], &key_card);
-			}
+			script_setarray_pc(sd, "@sold_sold", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify);
+			script_setarray_pc(sd, "@sold_card1", i, (void*)(intptr)sd->status.inventory[idx].card[0], &key_card1);
+			script_setarray_pc(sd, "@sold_card2", i, (void*)(intptr)sd->status.inventory[idx].card[1], &key_card2);
+			script_setarray_pc(sd, "@sold_card3", i, (void*)(intptr)sd->status.inventory[idx].card[2], &key_card3);
+			script_setarray_pc(sd, "@sold_card4", i, (void*)(intptr)sd->status.inventory[idx].card[3], &key_card4);
	 }
 }


you can try apply this noob source code to fix the bug

if developer already fix it with proper code, apply official one and throw this custom one out

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

Thank you so much ! :)

Thank you so much ! :)

---

I think this code must be removed ?

script_setarray_pc(sd, "@sold_sold", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify);

Edited by paolokupal
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I wonder do you know how to apply a patch ? /hmm

http://rathena.org/wiki/Diff

  1. add a "-" and write the line that must be modified
    • example:[code.]-this line will be removed from the original code[/code.]

  • add a "+" and write the line that need to be placed to replace or added to the original code
    • example:[code.]+this line will be added in the new code[/code.]

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Okay, I think it's fixed now /ic

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