Jump to content
  • 0

3in1 NPC trader


jobbyray25

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   1
  • Joined:  07/15/13
  • Last Seen:  

Can i Request an npc of YGG berry Poison bottle and Box of Thunder Trader all in one npc 

 

example

 

What you like to trade

YGG Berry
Box of Thunder

Poison Bottle

 

then if they choose YGG or Posion bottle or BOT

 

input multiple of 10

 

10pcs = 1 box

 

 

something like that 

 

 

 

thanks for in advance!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I'm a little confused if by pcs do you mean poring coins? or do you want the trader to exchange between the items.

 

If you meant Poring coins I already have an npc like this...

 

-	shop	custom_seller2	-1,501:20000
prontera.gat,95,99,5	script	Poring Coin Shop	100,{
	mes "I will sell you items for " + getitemname(.CoinID) + ".";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID,.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],12028,607,678;// Enter the ID of customs here
	setarray .Price[0],10,3,5; // Price for each custom is set to 20 coins
	set .CoinID,7539; // Enter the ID of the coin here.
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   1
  • Joined:  07/15/13
  • Last Seen:  

I'm a little confused if by pcs do you mean poring coins? or do you want the trader to exchange between the items.

 

If you meant Poring coins I already have an npc like this...

 

-	shop	custom_seller2	-1,501:20000
prontera.gat,95,99,5	script	Poring Coin Shop	100,{
	mes "I will sell you items for " + getitemname(.CoinID) + ".";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID,.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID)+" to purchase that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],12028,607,678;// Enter the ID of customs here
	setarray .Price[0],10,3,5; // Price for each custom is set to 20 coins
	set .CoinID,7539; // Enter the ID of the coin here.
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}

its not poring coin sir.... 

 

 

10pcs Yggdrassil berry = 1pc Yggdrassil berry box

10pcs Poison Bottle = 1pcs Poison bottle box

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Works pretty much the same.

 

-	shop	custom_seller2	-1,501:20000
prontera.gat,95,99,5	script	Item Exchanger	100,{
	mes "I will exchange items for the boxed version!";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID[.@i]) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID[.@i],.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID[.@i])+" to exchange for that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],12103,13517,13973;// Enter the ID of customs here
	setarray .CoinID[0],12103,607,678; // Enter the ID of the coin here.
	setarray .Price[0],1,2,30; // Price for each custom is set to 20 coins
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   1
  • Joined:  07/15/13
  • Last Seen:  

Works pretty much the same.

 

-	shop	custom_seller2	-1,501:20000
prontera.gat,95,99,5	script	Item Exchanger	100,{
	mes "I will exchange items for the boxed version!";
	callshop "custom_seller2",1;
	npcshopattach "custom_seller2";
	end;
	OnBuyItem:
	for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
		for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
			if(@bought_nameid[.@d]==.customs[.@i]) {
				if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
					if(countitem(.CoinID[.@i]) >= .Price[.@i]*@bought_quantity[.@d]) {
						delitem .CoinID[.@i],.Price[.@i]*@bought_quantity[.@d];
						getitem @bought_nameid[.@d],@bought_quantity[.@d];
					} else dispbottom "You don't have enough "+getitemname(.CoinID[.@i])+" to exchange for that item.";
				} else dispbottom "Purchasing these items will put you over the weight limit!";
			}
		}
	}
	deletearray @bought_quantity, getarraysize(@bought_quantity);
	deletearray @bought_nameid, getarraysize(@bought_nameid);
	close;

OnInit:
	setarray .customs[0],12103,13517,13973;// Enter the ID of customs here
	setarray .CoinID[0],12103,607,678; // Enter the ID of the coin here.
	setarray .Price[0],1,2,30; // Price for each custom is set to 20 coins
	npcshopitem "custom_seller2",0,0; // Don't touch any coding beyond here
	for(set .i,0; .customs[.i]; set .i,.i+1) npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
	end;
}

can you please be more specific because im just a new scripter and this is an advance for me 

 

 

so please help

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

//                            Item1, Item2, Item3, *;
	setarray .customs[0], 12103, 13517, 13973, x; // Enter the ID of customs here
	setarray .CoinID[0] , 12103, 607  , 678  , y; // Enter the ID of the coin here.
	setarray .Price[0]  , 1    , 2    , 30   , z; // Price for each custom is set to 20 coins

Where x would be the id of the custom box you're going to give for z amount of y.

Where y is the item id you'd exchange times z for x.

Where z is the amount of y you want to exchange for x.

 

In my example I've used .Price to the equivalent amount of items you would get in .customs box.

.CoinID is the item you would exchange for .customs.

 

I'm not sure I can explain it any clearer.

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