Jump to content
  • 0

NPC with this feature


HristDead

Question


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Hi all. I have a request...

I'm not good in explaining, but I'll try give it a shot.

I have custom items within ID 8000 and 8200, and I'm looking for a NPC that let's players trade their custom item for another custom item/ID in that ID-range. Like if the item is in that range then a window pops up and the player is able to trade their current item for another item within those IDs.

Does a script like that exist?

  • Upvote 1
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   0
  • Joined:  08/05/12
  • Last Seen:  

nice Idea.

I want it, too.

Anyone who can tell us how it works?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

http://upaste.me/00c3961ef9f4b5a

setarray .@exc_1,671,673,674; // Trade Away Items
setarray .@exc_2,672,674; // Available Items

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Ah, I've been meaning to write something like this for a while but forgot about it. Here's a cooler script than Joseph's, :3~

prontera,163,168,4	script	Item Trader	797,{
mes "[item Trader]";
mes "Would you like to";
mes "trade something in?";
mes "The item ID must be";
mes "between ^0055FF["+.Bounds[0]+"]^000000 and ^0055FF["+.Bounds[1]+"]^000000.";
next;
if(select("Sure.:No, thanks.") == 2) close;
mes "[item Trader]";
mes "Select a single item to trade in.";
mes "You can change your mind later, don't worry.";
callshop "item_trader",2;
npcshopattach "item_trader";
end;
OnSellItem:
mes "[item Trader]";
if (@sold_nameid < .Bounds[0] || @sold_nameid > .Bounds[1]) {
	mes "I'm afraid I can't do anything with this ^0055FF"+getitemname(@sold_nameid)+"^000000...";
	close;
}
mes "You want to trade in your ^0055FF"+getitemname(@sold_nameid)+"^000000?";
sleep2 1000;
doevent strnpcinfo(0)+"::OnContinue";
end;
OnContinue:
mes "Pick one item you'd like, then.";
callshop "item_trader",1;
npcshopattach "item_trader";
end;
OnBuyItem:
mes "[item Trader]";
mes "Are you sure you want to trade your ^0055FF"+getitemname(@sold_nameid)+"^000000 for a ^0055FF"+getitemname(@bought_nameid)+"^000000?";
next;
if(select("Yes, I'm sure.:Wait a second...") == 2) {
	mes "[item Trader]";
	mes "Okay, take your time.";
	close;
}
mes "[item Trader]";
mes "Here you go.";
mes "Enjoy!";
delitem @sold_nameid,1;
getitem @bought_nameid,1;
close;
OnInit:
// Write the lower and upper bounds of item IDs to trade in.
setarray .Bounds[0],500,550;
// List the items available to purchase.
setarray .@Items[0],501,502,503,504,505,506,507,508,509,510,511;
freeloop(1);
npcshopdelitem "item_trader",512;
for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1)
	npcshopadditem "item_trader",.@Items[.@i],0;
freeloop(0);
end;
}
-	shop	item_trader	-1,512:-1

upaste: http://upaste.me/raw/e99b962ab10812a

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

Ah, I've been meaning to write something like this for a while but forgot about it. Here's a cooler script than Joseph's, :3~

/me slaps Euphy with a large trout.

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