Jump to content
  • 0

problem with Itemshop, does not work´s


Tassadar

Question


  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

Good morning everyone. I am using this npc on my server. thank you @n0tttt !!!
But when I choose the option to buy item 7720. (Golden Coin) npc returns an error saying that I do not have enough cash points. Could someone take a look and if possible test to see if I did something wrong?

 prontera,169,179,1	script	Hefesto	813,{

	mes "Bem Vindo;
	mes "Hoje estamos vendendo diversos Conjuntos de Itens Especiais.";	
next;	
	mes "Como você prefere pagar?";
	switch(select("Pontos de Voto","Rops","Moedas Douradas","Sair")) {
	case 1:
		callshop "shop1",1;
		end;	
	case 2:
		callshop "shop2",1;
		end;
	case 3:
		callshop "shop3",1;
		end;
	case 4:
		close;
	}

}

-	pointshop	shop1	-1,#VOTEPOINTS,15110:100,20732:60
-	cashshop	shop2	-1,15110:10000,20732:6000
-	itemshop	shop3	-1,7720,15110:500,20732:300

I used the <TABs> correctly. I do not know what the problem might be. My client is new:
 

#ifndef PACKETVER
	/// Do NOT edit this line! To set your client version, please do this instead:
	/// In Windows: Add this line in your src\custom\defines_pre.hpp file: #define PACKETVER YYYYMMDD
	/// In Linux: The same as above or run the following command: ./configure --enable-packetver=YYYYMMDD
	#define PACKETVER 20180620
#endif

#ifndef PACKETVER_RE
	/// From this point on only kRO RE clients are supported
	#if PACKETVER > 20151104
		#define PACKETVER_RE
	#endif
#endif

Something's missing? I've seen the npcs that put the separate price items like this:

 

// This code runs first. When the server is started.
OnInit:
	setarray .customs[0],7179,6665,16683,17441,12549,12103,12912,12412,12411,12105,18550,2423,22014,15041,6230,6234,6228,6232,13710,7620,7619,6240,6241,6226,6225,6438,6439,12436,12437,12475; // An array of out custom items.
	
	set .CoinID,7720; // ID da Moeda em uso.
	
	setarray .Price[0],5,50,100,300,10,35,70,100,150,20,120,250,300,250,100,100,200,200,50,5,5,7,7,10,10,15,15,2,2,2; // The amount of coins needed for our items. (For example: Item 12103 = 20 coins)
	
	npcshopitem "custom_seller2",0,0; // Remove all items from our dummy shop.
	
	for( set .@i, 0; .customs[.@i]; set .@i, .@i+1 ) // Loop through our custom items.
		npcshopadditem "custom_seller2",.customs[.@i],.Price[.@i]; // Add our custom items to the cleared dummy shop.
	
	end;
}

But I need it to be like stores because there are many items to add and in two lines it gets tricky to find and modify some item.

In time have problems if I duplicate an npc? Changing only the name and name of the stores? The variables that start with @ in an npc, can not give problems in another npc with the variable of the same name ???

moedas.png

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

Spoiler

 prontera,169,179,1    script    Hefesto    813,{

    mes "Bem Vindo";
    mes "Hoje estamos vendendo diversos Conjuntos de Itens Especiais.";
    next;
    mes "Como você prefere pagar?";
    switch(select("cashshop","itemshop","pointshop","Kafra Point","Cash Point","Vote Point","Bye~")) {
    case 4:
                        #KAFRAPOINTS = #KAFRAPOINTS + 1000;
                        dispbottom ( " #KAFRAPOINTS :: " + #KAFRAPOINTS ) ;
                        end;
    case 5:
                        #CASHPOINTS = #CASHPOINTS + 1000;
                        dispbottom ( " #CASHPOINTS :: " + #CASHPOINTS ) ;
                        end;
    case 6:
                        #VOTEPOINTS = #VOTEPOINTS + 1000;
                        dispbottom ( " #VOTEPOINTS :: " + #VOTEPOINTS ) ;
                        end;

    case 1:
        callshop "shop1",1;
        end;    
    case 2:
        callshop "shop2",1;
        end;
    case 3:
        callshop "shop3",1;
        end;
    case 7:
        close;
    }

}


-    cashshop    shop1    -1,4001:1
//-    cashshop    shop1    -1,itemid>:<price>{,<itemid>:<price>...}
-    itemshop    shop2    -1,7720,4001:1
//-    itemshop    shop2    -1,costitemid>{:<discount>},<itemid>:<price>{,<itemid>:<price>...}
-    pointshop    shop3    -1,#VOTEPOINTS,4001:1
//-    pointshop    shop3    -1,costvariable>{:<discount>},<itemid>:<price>{,<itemid>:<price>...}


 

Working as intended

as mentioned check what

Haruka Mayumi said if it is sellable through npc

 

item_trade.txt <<<< Check this file

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1529
  • Reputation:   234
  • Joined:  08/03/12
  • Last Seen:  

2 hours ago, Tassadar said:

Good morning everyone. I am using this npc on my server. thank you @n0tttt !!!
But when I choose the option to buy item 7720. (Golden Coin) npc returns an error saying that I do not have enough cash points. Could someone take a look and if possible test to see if I did something wrong?


 prontera,169,179,1	script	Hefesto	813,{

	mes "Bem Vindo;
	mes "Hoje estamos vendendo diversos Conjuntos de Itens Especiais.";	
next;	
	mes "Como você prefere pagar?";
	switch(select("Pontos de Voto","Rops","Moedas Douradas","Sair")) {
	case 1:
		callshop "shop1",1;
		end;	
	case 2:
		callshop "shop2",1;
		end;
	case 3:
		callshop "shop3",1;
		end;
	case 4:
		close;
	}

}

-	pointshop	shop1	-1,#VOTEPOINTS,15110:100,20732:60
-	cashshop	shop2	-1,15110:10000,20732:6000
-	itemshop	shop3	-1,7720,15110:500,20732:300

I used the <TABs> correctly. I do not know what the problem might be. My client is new:
 


#ifndef PACKETVER
	/// Do NOT edit this line! To set your client version, please do this instead:
	/// In Windows: Add this line in your src\custom\defines_pre.hpp file: #define PACKETVER YYYYMMDD
	/// In Linux: The same as above or run the following command: ./configure --enable-packetver=YYYYMMDD
	#define PACKETVER 20180620
#endif

#ifndef PACKETVER_RE
	/// From this point on only kRO RE clients are supported
	#if PACKETVER > 20151104
		#define PACKETVER_RE
	#endif
#endif

Something's missing? I've seen the npcs that put the separate price items like this:

 


// This code runs first. When the server is started.
OnInit:
	setarray .customs[0],7179,6665,16683,17441,12549,12103,12912,12412,12411,12105,18550,2423,22014,15041,6230,6234,6228,6232,13710,7620,7619,6240,6241,6226,6225,6438,6439,12436,12437,12475; // An array of out custom items.
	
	set .CoinID,7720; // ID da Moeda em uso.
	
	setarray .Price[0],5,50,100,300,10,35,70,100,150,20,120,250,300,250,100,100,200,200,50,5,5,7,7,10,10,15,15,2,2,2; // The amount of coins needed for our items. (For example: Item 12103 = 20 coins)
	
	npcshopitem "custom_seller2",0,0; // Remove all items from our dummy shop.
	
	for( set .@i, 0; .customs[.@i]; set .@i, .@i+1 ) // Loop through our custom items.
		npcshopadditem "custom_seller2",.customs[.@i],.Price[.@i]; // Add our custom items to the cleared dummy shop.
	
	end;
}

But I need it to be like stores because there are many items to add and in two lines it gets tricky to find and modify some item.

In time have problems if I duplicate an npc? Changing only the name and name of the stores? The variables that start with @ in an npc, can not give problems in another npc with the variable of the same name ???

moedas.png

You doesnt need that OnInit code for ItemShop.

Just edit it here 

-	itemshop	shop3	-1,7720,15110:500,20732:300

Then, try to bought with 7720 item.

You should can bought using the same item as you set there.

Make sure you are using 2013 and above rathena version and also client.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

In the image shows that the item is right.

my client is new and my R-athena too.

I need to verify why npc does not sell with the item.

Edited by Tassadar
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  7
  • Reputation:   0
  • Joined:  12/28/16
  • Last Seen:  

I have the same problem...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

moedas.png

Make sure the item is sellable in NPC.. Check it at item_trade.txt

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

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

hi, sorry for bump this topic

i have same issue but only with normal account

http://prntscr.com/nsm7wo

So when try to buy with normal account, npc like didn't read our item in inventory and always say "you don't have enough Kafrapoints"

But if use GM account everything is fine?
http://prntscr.com/nsm83g
already check in item_trade.txt still have the issue

Edited by melv0
Link to comment
Share on other sites

  • 0

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

On 5/24/2019 at 6:11 AM, melv0 said:

hi, sorry for bump this topic

i have same issue but only with normal account

http://prntscr.com/nsm7wo

So when try to buy with normal account, npc like didn't read our item in inventory and always say "you don't have enough Kafrapoints"

But if use GM account everything is fine?
http://prntscr.com/nsm83g
already check in item_trade.txt still have the issue

Set flag 1 to item. I had the same problem with flag 9 (cannot be sold to npc)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

11 hours ago, 3TAJIOH said:

Set flag 1 to item. I had the same problem with flag 9 (cannot be sold to npc)

I forget to update my post already solved

i forget to setting the item can't be sell or thats why normal account cant use it LOL

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