Jump to content
  • 0

Custom Item Shop


trann123

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  01/08/12
  • Last Seen:  

Hi I would like to request an NPC shop that allows you to buy items using "unknown coupon" item # 7199 :( Thank you

Link to comment
Share on other sites

5 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:  

Original Post : Link

Well..this is my First Release for the year 2012 ~ :)

and also a Release before i away from rAthena Works for few weeks... Dx


[ Update ] : Added a Multi Currency Shop Script :

Description :

It is a Simple Shop take use Item Currency to Buy items. It Support Multiple Shop in 1 NPC. This Script is based on the Idea of those other TCG / POD / etc Shop that users keep requesting.

The only different is, this Script only use 1 NPC + 1 Shop ( Invinsible ) NPC to settle all your Problems.

Of Course, that this script can fulfill certain User Request like ,

"Please help me create a Custom Dynamic Shop with Multiple Menu ."..

You can add around ~128 Shop in this NPC. Add the Shop Selection at the Menu / New Cases for each of it.

Simple Explaination :

A Script that allow GM to setup several Shop that using Different Items as Currency to buy Items for the Corresponding Shop...


Multi Currency Shop [ Version 3 ]

Changelog :

  • [ Version 1 ] - Simple Shop Based Currency Shop.
  • [ Version 2 ] - Support Multiple Different Currency Shop in 1 NPC.
  • [ Version 3 ] - Fixed Repeating Items Lists Problem.

Scripts : View Download

Please let me know if there is any problems. As well as any Suggestion to Improve it.

Link to comment
Share on other sites


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

here im use for my server

just change id

new_zone02,93,107,6 script Middle Trader 895,{
mes .name$;
mes "You currently have "+countitem(.custom_item)+" Poring Coin.";
mes "Would you like to look at the shop?";
next;
if(select("Yes:No") == 2) {
close;
}
close2;
callshop "USABLE_SHOP",1;
npcshopattach "USABLE_SHOP";
dispbottom "You currently have "+countitem(.custom_item)+" Poring Coin.";
end;
OnBuyItem:
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
for(set @j,0; @j < getarraysize(.CUSTOM_ITEMS); set @j,@j+2) {
if(.CUSTOM_ITEMS[@j] == @bought_nameid[@i]) {
set @itemcost,(.CUSTOM_ITEMS[(@j+1)]*@bought_quantity[@i]);
set @totalcost,(@totalcost+@itemcost);
break;
}
}
}
if(@totalcost > countitem(.custom_item)) {
dispbottom "You don't have enough Poring Coin.";
}
else {
for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
getitem @bought_nameid[@i],@bought_quantity[@i];
}
delitem .custom_item,@totalcost;
dispbottom "Thank you for shopping.";
dispbottom "You now have "+countitem(.custom_item)+" Poring Coin left.";
}
set @totalcost,0;
deletearray @bought_nameid[0],128;
deletearray @bought_quantity[0],128;
end;OnInit:
npcshopdelitem "USABLE_SHOP",909;				   // Leave this alone
set .name$,"[CUSTOM Trader]";
set .custom_item,7539;							   // Input TCG ID
setarray .CUSTOM_ITEMS[0],501,50,502,50;	 // Input as many items as you want (item::price)


for(set .@i,0; .@i < getarraysize(.CUSTOM_ITEMS); set .@i,.@i+2) {
npcshopadditem "USABLE_SHOP",.CUSTOM_ITEMS[.@i],.CUSTOM_ITEMS[(.@i+1)];
}
}
- shop USABLE_SHOP 139,909:100

to change item id to use

find this

set .custom_item,7539; // Input TCG ID

Edited by PapaZola
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  01/08/12
  • Last Seen:  

Thank you guys so much :) mwa mwa chupchup

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  02/05/12
  • Last Seen:  

i got error.

screenshot : errorid.jpg

code here:

// Fixed some Bug. [ By Goddameit ]
// Leave this alone...
- shop Emistry_Shop -1,2121:1

prontera,155,181,5 script Donation 757,{
// NPC Name
set .name$,"[^FF0000  Emistry Shop  ^000000]";
mes .name$;
mes "Each Shop Buy Item Using Different Items.";
mes "Which shop you like to look at it";
next;
select("Valkyrie Items:Diabolus Items:Cards");
callsub CaseCH,@menu;
npcshopitem "Emistry_Shop",2121,1;
npcshopdelitem "Emistry_Shop",2121;
for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)
npcshopadditem "Emistry_Shop",@ItemLists[.@i],@ItemPrice[.@i];
mes "Okay...wait awhile";
mes "This Shop use ^FF0000"+getitemname( @Currency )+"^000000 to buy the Items.";
close2;
callsub CaseCH,@menu;
callshop "Emistry_Shop",1;
npcshopattach "Emistry_Shop";
dispbottom "You currently have "+countitem( @Currency )+" "+getitemname( @Currency )+".";
end;
OnBuyItem:
callsub CaseCH,@menu;
for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
 for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1)
  if( @ItemLists[@j] == @bought_nameid[@i] )
  set @TotalCost,@TotalCost + ( @ItemPrice[@j] * @bought_quantity[@i] );
if( countitem( @Currency ) < @TotalCost ){
 for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 ){
  mes "Item : ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
  mes "Quantity : ^0000FF"+@bought_quantity[@i]+"^000000";
 }
 mes "^00FF00____________________________^000000";
 mes "Total Cost : ^0000FF"+@TotalCost+" x "+getitemname( @Currency )+"^000000";
 mes "^00FF00____________________________^000000";
 mes "[ ^FF0000X^000000 ] You do not have enough ^0000FF"+getitemname( @Currency )+"^000000 to purchase this.";
}else{
 for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1){
  getitem @bought_nameid[@i],@bought_quantity[@i];
  message strcharinfo(0),"Purchased "+getitemname( @bought_nameid[@i] );
 }
 delitem @Currency,@TotalCost;
 mes "Thank you for shopping.";
 mes "You now have ^FF0000"+countitem( @Currency )+" "+getitemname( @Currency )+"^000000 left.";
}
set @TotalCost,0;
deletearray @bought_nameid[0],getarraysize( @bought_nameid );
deletearray @bought_quantity[0],getarraysize( @bought_quantity );
deletearray @ItemLists[0],getarraysize( @ItemLists );
deletearray @ItemPrice[0],getarraysize( @ItemPrice );
close;
CaseCH:
deletearray @ItemLists[0],getarraysize( @ItemLists );
deletearray @ItemPrice[0],getarraysize( @ItemPrice );
switch( getarg(0) ){
 Case 1:
  // Item Currency
  set @Currency,7179;
  // Item ID Lists
  setarray @ItemLists[0],2524,5171,2357,2421,2115;
  // Item Price
  setarray @ItemPrice[0],10,10,10,10,10;
  return;
 Case 2:
  // Item Currency
  set @Currency,7179;
  // Item ID Lists
  setarray @ItemLists[0],5808,2375,2374,2537,2433;
  // Item Price
  setarray @ItemPrice[0],30,30,30,30,30;
  return;
 Case 3:
  // Item Currency
  set @Currency,7179;
  // Item ID Lists
  setarray @ItemLists[0],4357,4359,4361,4363,4365,4367;
  // Item Price
  setarray @ItemPrice[0],300,500,200,100,100,200;
  return;
 // Case 4,5,6.....etc...
 default:
  mes "Wrong Selection / Configurations";
  close;
}
}

hoping that someone can help me.. /hmm

problem solved /lv

- shop Emistry_Shop -1,2121:1 i just replace it with this > -1,2121:500 since i got my max price which is 500.

Link to comment
Share on other sites


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

- shop Emistry_Shop -1,2121:1

this line is actually useless...

no matter what you put it wont appear in the shop...

but it is still advised not to touch this line if you dunno what it is...

the error occur becoz the price you set in above line..is lower than the default selling price...

just a warning message to inform you that this can be an exploit to your server if your NPC do sell this item with this price...

and next time remember use CODEBOX for long content..or use pastebin or upload as attachment.. >.<

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