Jump to content
  • 0

request custom event coin shop


Avian

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  01/08/13
  • Last Seen:  

Hello I'm new to scripting can someone make me a script of an Event Shop NPC.

you can exchange the right amount of Event Coin for an item in the shop.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Try this one :

-    shop    dynamicshop    -1,501:20000
prontera,150,150,0    script    Dynamic Shop    100,{
    callshop "dynamicshop",1;
    npcshopattach "dynamicshop";
    end;
    
    OnBuyItem:
        for ( set .@j, 0; .@j < getarraysize(.items); set .@j, .@j + 2 ) {
            for ( set .@k, 0; .@k < getarraysize(@bought_nameid); set .@k, .@k + 1 ) {
                if ( @bought_nameid[.@k] == .items[.@j] ) {
                    if ( checkweight( @bought_nameid[.@k], @bought_quantity[.@k] ) ) {
                        if ( countitem(.currency) < .items[.@j+1] )
                            dispbottom "You don't have enough " +getitemname(.currency)+ " to purchase this item.";
                        else {
                            delitem .currency, .items[.@j+1] * @bought_quantity[.@k];
                            getitem @bought_nameid[.@k], @bought_quantity[.@k];
                        }
                    } else dispbottom "You cannot carry out more items with you";
                }
            }
        }
        deletearray @bought_quantity, getarraysize(@bought_quantity);
        deletearray @bought_nameid, getarraysize(@bought_nameid);
        end;

    OnInit:
        set .currency, 7227; // TCG is used to buy items
        setarray .items, 4001,5,7227,100; // Usage : <item id>,<price>
        npcshopitem "dynamicshop",0,0;
        for ( set .@i, 0; .@i < getarraysize(.items); set .@i, .@i + 2 )
            npcshopadditem "dynamicshop",.items[.@i],.items[.@i+1];
        end;
}

Configuration :

setarray .items, 4001,5,7227,100; // Usage : <item id>,<price>
set .currency, 7227; // TCG is used to buy items
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  01/08/13
  • Last Seen:  

Thank you ill try it right now  /ok  /no1  /meh  /lv  /kis2



Try this one :

-    shop    dynamicshop    -1,501:20000
prontera,150,150,0    script    Dynamic Shop    100,{
    callshop "dynamicshop",1;
    npcshopattach "dynamicshop";
    end;
    
    OnBuyItem:
        for ( set .@j, 0; .@j < getarraysize(.items); set .@j, .@j + 2 ) {
            for ( set .@k, 0; .@k < getarraysize(@bought_nameid); set .@k, .@k + 1 ) {
                if ( @bought_nameid[.@k] == .items[.@j] ) {
                    if ( checkweight( @bought_nameid[.@k], @bought_quantity[.@k] ) ) {
                        if ( countitem(.currency) < .items[.@j+1] )
                            dispbottom "You don't have enough " +getitemname(.currency)+ " to purchase this item.";
                        else {
                            delitem .currency, .items[.@j+1] * @bought_quantity[.@k];
                            getitem @bought_nameid[.@k], @bought_quantity[.@k];
                        }
                    } else dispbottom "You cannot carry out more items with you";
                }
            }
        }
        deletearray @bought_quantity, getarraysize(@bought_quantity);
        deletearray @bought_nameid, getarraysize(@bought_nameid);
        end;

    OnInit:
        set .currency, 7227; // TCG is used to buy items
        setarray .items, 4001,5,7227,100; // Usage : <item id>,<price>
        npcshopitem "dynamicshop",0,0;
        for ( set .@i, 0; .@i < getarraysize(.items); set .@i, .@i + 2 )
            npcshopadditem "dynamicshop",.items[.@i],.items[.@i+1];
        end;
}

Configuration :

setarray .items, 4001,5,7227,100; // Usage : <item id>,<price>
set .currency, 7227; // TCG is used to buy items

It's not wirking for me :/

Link to comment
Share on other sites


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

you can try euphy quest shop or my multi currency shop

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Perhaps you can show your console if any error occur. Working fine on me.

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