Jump to content
  • 0

Item Shop with different coins as payment


Question

Posted

Hello, is it possible to script a shop which calls the shop functions that will sell items for example 

 

1 Kafra doll = 1 poring coin, 1 gold coin and 1 mithrill coin.

1 poopoo hat = 1 bronze coin 1 gold coin and 1 mithrill coin.

 

in one npc? if you can give me a sample that would be awesome. Thank you. I have 5 different coins for the said shop some items will be needing 3 of the 5 some will need 2 of the 5 coins,

3 answers to this question

Recommended Posts

  • 0
Posted
2 hours ago, noobonly said:

Hello, is it possible to script a shop which calls the shop functions that will sell items for example 

 

1 Kafra doll = 1 poring coin, 1 gold coin and 1 mithrill coin.

1 poopoo hat = 1 bronze coin 1 gold coin and 1 mithrill coin.

 

in one npc? if you can give me a sample that would be awesome. Thank you. I have 5 different coins for the said shop some items will be needing 3 of the 5 some will need 2 of the 5 coins,

Is this can suit your requirements needed ?

 

  • 0
Posted

No that doesn't suit my needs.

The request would be 1 shop which uses 5 different coins. Gold Silver Bronze Mithrill and Platinum.

Some Items will require Gold and Silver, some will require Bronze and Mithrill at the same time, i know it can be scripted using the simple scripting with delitem and getitem etc, but i want to use the shop function/display.

 

Hello I have this shop wherein you can use poring coin to purchase an item but i want to use different coins

	-    shop    custom_merchant    -1,501:2000000
prontera,150,150,4    script    Poring Coin Shop    100,{
    mes "[Poring Coin Shop]";
    mes "Hello! " + strcharinfo(0) +"...";
    mes "I can sell you items in exchange for your Poring Coins";
    callshop "custom_merchant",1;
    npcshopattach "custom_merchant";
    end;
    OnBuyItem:
    for(set .@i,0; .@i<getarraysize(.itemsforsale); set .@i,.@i+1) {
        for(set .@d,0; .@d<getarraysize(@item_nameid); set .@d,.@d+1) {
            if(@item_nameid[.@d]==.itemsforsale[.@i]) {
                if(checkweight(@item_nameid[.@d],@item_count[.@d])) {
                    if(countitem(.PriceItemID) >= .Price[.@i]*@item_count[.@d]) {
                        delitem .PriceItemID,.Price[.@i]*@item_count[.@d];
                        getitem @item_nameid[.@d],@item_count[.@d];
                    } else dispbottom "You don't have enough "+getitemname(.PriceItemID)+" to buy the item.";
                } else dispbottom "You are overweight! Get rid of the unnecessary items first.";
            }
        }
    }
    deletearray @item_count, getarraysize(@item_count);
    deletearray @item_nameid, getarraysize(@item_nameid);
    close;
	OnInit:
    setarray .itemsforsale[0],501,502,503,504,505,506,507,508,509,510,511;
    set .PriceItemID,7539; 
    setarray .Price[0],60,80,70,80,120,80,60,70,3,15,1; 
    npcshopitem "custom_merchant",0,0; // Don't touch any coding beyond here
    for(set .i,0; .itemsforsale[.i]; set .i,.i+1) npcshopadditem "custom_merchant",.itemsforsale[.i],.Price[.i];
    end;
}
	

 

How to set it to have 5 different coins as payment, some items may need 2 different coins some will need 4.

The thing about Euphy's Quest Shop is you can't have the same item or reward. I want something with the same reward item multiple times.

Hi is it possible to make this script allow 3 different coins per shop

	//===== eAthena Script =======================================
//= Custom-Currency Multi-Shop
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.2
//===== Description: =========================================
//= Allows for better organization in a single shop call.
//= Note that there are two configuration areas.
//============================================================
	// -------------------- Config 1 --------------------
// For each shop added, copy this MSHOPX dummy data.
// Write your shop names in the select() function.
	-    shop    MSHOP1    -1,512:-1
-    shop    MSHOP2    -1,512:-1
-    shop    MSHOP3    -1,512:-1
-    shop    MSHOP4    -1,512:-1
-    shop    MSHOP5    -1,512:-1
-    shop    MSHOP6    -1,512:-1
-    shop    MSHOP7    -1,512:-1
-    shop    MSHOP8    -1,512:-1
	prontera,163,174,4    script    A Shop    984,{
	    set @s, select("Weapons:Headgears:Armors:Garments:Shoes:Shields:Cards:Misc");
	// --------------------------------------------------
	    message strcharinfo(0),"This shop only accepts "+getitemname(.Currency[@s])+".";
    dispbottom "You have "+countitem(.Currency[@s])+" "+getitemname(.Currency[@s])+".";
    callshop "MSHOP"+@s,1;
    npcshopattach "MSHOP"+@s;
    end;
	OnBuyItem:
    set .@i,0;
    while (.@i < getarraysize(@bought_nameid)) {
        set .@j, 0;
        while (.@j < getarraysize(getd(".Shop"+@s))) {
            if(getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
                set @itemcost, (getd(".Shop"+@s+"["+(.@j+1)+"]") * @bought_quantity[.@i]);
                set @totalcost, @totalcost + @itemcost;
                break; }
            set .@j, .@j+2; }
        set .@i, .@i+1; }
    if (@totalcost > countitem(.Currency[@s])) dispbottom "You don't have enough "+getitemname(.Currency[@s])+".";
    else {
        set .@i,0;
        while (.@i < getarraysize(@bought_nameid)) {
            getitem @bought_nameid[.@i], @bought_quantity[.@i];
            dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".";
            set .@i, .@i+1; }
        delitem .Currency[@s], @totalcost; }
    set @totalcost, 0;
    deletearray @bought_nameid[0], 128;
    deletearray @bought_quantity[0], 128;
    end;
	OnInit:
	// -------------------- Config 2 --------------------
// Currency:  The ID of each shop currency,
//    in the same order as the shops.
// Shop order follows that of the select() call,
//   and is formatted "ID1,Count1,ID2,Count2,..."
	    setarray .Currency[1],513,513,513,513,513,513,513,513;
    setarray .Shop1[0],1202,5,1229,20;
    setarray .Shop2[0],5116,15;
    setarray .Shop3[0],2302,2,2348,30;
    setarray .Shop4[0],2502,2,2513,15,2523,15;
    setarray .Shop5[0],2441,15;
    setarray .Shop6[0],2199,32768;
    setarray .Shop7[0],4051,3,4285,6;
    setarray .Shop8[0],513,1,532,2,634,4;
	// --------------------------------------------------
	    set .@i,1;
    while (.@i <= getarraysize(.Currency)) {
        set .@j,0;
        while (.@j < getarraysize(getd(".Shop"+.@i))) {
            npcshopdelitem "MSHOP"+.@i,512;
            npcshopadditem "MSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
            set .@j, .@j+2; }
        set .@i, .@i+1; }
    end;
}
	

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...