Jump to content
  • 0

how to duplicate Currency Multi-Shop by Euhpy


Kariton Revolution

Question


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

how can i duplicate Currency Multi-Shop by Euhpys

 

Here :(
 

//===== 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;
}
Edited by Capuche
Code
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

I tried an older version of Euphy's script. What I recall doing was changing the shop name and every new shop is on another .txt file. Tried doing all inside one but it didn't work.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  566
  • Reputation:   34
  • Joined:  11/17/11
  • Last Seen:  

Change:

 

- MSHOP to anything you want, for ex. ASHOP or BSHOP

- Change NPC name.

- Change coordinate.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

//===== 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    DSHOP4    -1,512:-1
-    shop    DSHOP5    -1,512:-1
-    shop    DSHOP6    -1,512:-1
-    shop    DSHOP7 -1,512:-1


que_temsky,100,147,3    script    Donate Shop    834,{

    set @s, select("Set's:Headgear's:Wing's:Weapon's");

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

    message strcharinfo(0),"This shop only accepts "+getitemname(.Currency[@s])+".";
    dispbottom "You have "+countitem(.Currency[@s])+" "+getitemname(.Currency[@s])+".";
    callshop "DSHOP"+@s,1;
    npcshopattach "DSHOP"+@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],7179,7179,7179,7179,7179,7179,7179,7179;
    setarray .Shop1[0,16,100,17,100,18,100,19,100,24,100,25,100,26,100,27,100,28,100,29,100,30,100,31,100,32,100,33,100,34,100,35,100,36,100,37,100,38,100,39,100;
    setarray .Shop2[0,20000,100,20002,100,20003,100,20004,100,20005,100,20006,100,20007,100,20008,100,20009,100,20010,100;
    setarray .Shop3[0,20265,200,20266,200,20267,200,20268,200,20269,200,20270,200,20271,200,20272,200,20273,200,20274,200;
    setarray .Shop4[0,1577,80,1640,100,1281,150,1826,150,1187,100,1310,80,1641,80,2002,150,1827,150,13416,100,13177,80,13042,100,13179,100,1927,80,13418,100,1743,100,1282,150,1486,100,1981,80,1546,150,113110,80,13417,100,13417,80,134178,80,13307,80,1426,100,1576,80;

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

    set .@i,1;
    while (.@i <= getarraysize(.Currency)) {
        set .@j,0;
        while (.@j < getarraysize(getd(".Shop"+.@i))) {
            npcshopdelitem "DSHOP"+.@i,512;
            npcshopadditem "DSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
            set .@j, .@j+2; }
        set .@i, .@i+1; }
    end;
}

 

not working i did this

Edited by Capuche
Code
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...