Jump to content
DemonChuck

Help sa Multi Currency NPC

Recommended Posts

Pahingi nmn po ng Simpleng Currency Shop for Quest lng po

tapos gus2 ko po sana walang category ung pag click mo

nndun na ung items rekta na thx po sa 22long sakin...

Try :

-    shop    dynamicshop    -1,501:20000
prontera,150,150,0    script    Dynamic Shop    100,{
    callshop "dynamicshop",1;
    npcshopattach "dynamicshop";
    end;
    
    OnBuyItem:
        for ( set [email protected], 0; [email protected] < getarraysize(.items); set [email protected], [email protected] + 2 ) {
            for ( set [email protected], 0; [email protected] < getarraysize(@bought_nameid); set [email protected], [email protected] + 1 ) {
                if ( @bought_nameid[[email protected]] == .items[[email protected]] ) {
                    if ( checkweight( @bought_nameid[[email protected]], @bought_quantity[[email protected]] ) ) {
                        if ( countitem(.currency) < .items[[email protected]+1] )
                            dispbottom "You don't have enough " +getitemname(.currency)+ " to purchase this item.";
                        else {
                            delitem .currency, .items[[email protected]+1] * @bought_quantity[[email protected]];
                            getitem @bought_nameid[[email protected]], @bought_quantity[[email protected]];
                        }
                    } 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 [email protected], 0; [email protected] < getarraysize(.items); set [email protected], [email protected] + 2 )
            npcshopadditem "dynamicshop",.items[[email protected]],.items[[email protected]+1];
        end;
}

Add mo lahat ng items mo :

setarray .items, 4001,5,7227,100; // Usage : <item id>,<price>

Currency na gagamitin mo :

 set .currency, 7227; // TCG is used to buy items
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
Reply to this topic...

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.