Jump to content
  • 0

Help with Euphy's multi currency (pods shop)


Question

Posted

Hi ! 

I am using Euphy's script for a pod shop but the items that it sells repeats. here's an example from below and also the script I edited for my server. 

hourly.txt

Here's how it looks like. 

image.png.5e9102aae9e1586ce15a1653b16ffe3d.png

I just don't understand why anymore ?

6 answers to this question

Recommended Posts

  • 0
Posted (edited)
12 hours ago, Drinna said:

Hi ! 

I am using Euphy's script for a pod shop but the items that it sells repeats. here's an example from below and also the script I edited for my server. 

hourly.txt

Here's how it looks like. 

image.png.5e9102aae9e1586ce15a1653b16ffe3d.png

I just don't understand why anymore ?

can't download your script, could you put in here in code box.

Edited by hendra814
  • 0
Posted

that's because you duplicated the main script that generate the shop.

prontera,143,99,5	duplicate(Rewards)	Rewards#prt	114
alberta,139,71,5	duplicate(Rewards)	Rewards#alb	114
morocc,127,77,5	duplicate(Rewards)	Rewards#mrc	114
geffen,97,71,5	duplicate(Rewards)	Rewards#gef	114

you can fix it by adding this line under the OnInit label..

OnInit:
	if (strnpcinfo(1) != "") end;

 

  • 0
Posted (edited)
On 7/1/2018 at 10:29 PM, Drinna said:

Hi ! 

I am using Euphy's script for a pod shop but the items that it sells repeats. here's an example from below and also the script I edited for my server. 

hourly.txt

Here's how it looks like. 

image.png.5e9102aae9e1586ce15a1653b16ffe3d.png

I just don't understand why anymore ?

//===== 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,19544:-1
-    shop    MSHOP2    -1,19522:-1


payon,166,111,5    script    Rewards    114 ,{

    set @s, select("Upper Headgears:Mid & Lower Headgears");

// --------------------------------------------------

    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],32020,32020;
    setarray .Shop1[0],19544,30,20273,80,19513,5,19507,5,19517,10;
    setarray .Shop2[0],19522,10,19537,20,19539,200,19613,300;
//    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,32020;
            npcshopadditem "MSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
            set .@j, .@j+2; }
        set .@i, .@i+1; }
    end;
}

// ----------------Duplicate--------------------

prontera,143,99,5    duplicate(Rewards)    Rewards#prt    114
alberta,139,71,5    duplicate(Rewards)    Rewards#alb    114
morocc,127,77,5    duplicate(Rewards)    Rewards#mrc    114
geffen,97,71,5    duplicate(Rewards)    Rewards#gef    114

 

Edited by Emistry
Please use codebox.
  • 0
Posted
4 hours ago, Emistry said:

that's because you duplicated the main script that generate the shop.


prontera,143,99,5	duplicate(Rewards)	Rewards#prt	114
alberta,139,71,5	duplicate(Rewards)	Rewards#alb	114
morocc,127,77,5	duplicate(Rewards)	Rewards#mrc	114
geffen,97,71,5	duplicate(Rewards)	Rewards#gef	114

you can fix it by adding this line under the OnInit label..


OnInit:
	if (strnpcinfo(1) != "") end;

 

Okay ? thanks ! I will try this for now ? let's see if it will work ❤️ 

 

  • 0
Posted
5 hours ago, Emistry said:

that's because you duplicated the main script that generate the shop.


prontera,143,99,5	duplicate(Rewards)	Rewards#prt	114
alberta,139,71,5	duplicate(Rewards)	Rewards#alb	114
morocc,127,77,5	duplicate(Rewards)	Rewards#mrc	114
geffen,97,71,5	duplicate(Rewards)	Rewards#gef	114

you can fix it by adding this line under the OnInit label..


OnInit:
	if (strnpcinfo(1) != "") end;

 

Now I know that it is because of the duplicates. I did not know that ?  but when I put the 

if (strnpcinfo(1) != "") end;

what happens now is that it only shows this below
image.png.36ce0480ec1b6cbfd5f6da4422df0e89.png
 

I can see it's because of this : 
-    shop    MSHOP1    -1,19544:-1
-    shop    MSHOP2    -1,19522:-1

But it wasn't doing that before ?

 

 

 

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