Request - NPC SHOP for Proof of Donations Only

You could make it as a text item shop, but if I were you I'd wait for the release of our newest NPC shops with items or variables as currency, which is being cooked here in Hercules.

 
Last edited by a moderator:
Try this :

- shop dynamicshop -1,501:222prontera,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, 7179; // pods         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 Part : 

Code:
set .currency, 7179; // podssetarray .items, 4001,5,7227,100; // Usage : <item id>,<price> 
 
Last edited by a moderator:
patskie code works great, but is it supposed to check for zenny and not currency item?


1. i try to buy without zenny and it says i dont have enough zenny, even though i have enough pods

2. but if i have enough zeny it doesnt take the zeny and works as it should

3. if i buy without pods the deal is succesful but no items receive

 
patskie code works great, but is it supposed to check for zenny and not currency item?

1. i try to buy without zenny and it says i dont have enough zenny, even though i have enough pods

2. but if i have enough zeny it doesnt take the zeny and works as it should

3. if i buy without pods the deal is succesful but no items receive
Thats normal.

 
Yeah its normal

 
Last edited by a moderator:
getitem @bought_nameid[.@k], @bought_quantity[.@k];announce strcharinfo(0)+ " bought " +getitemname(@bought_nameid[.@k])+ " (" +@bought_quantity[.@k]+ ") in our dynamic shop",0; // <- add this
Didn't test

 
Try this :

- shop dynamicshop -1,501:222prontera,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, 7179; // pods         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 Part : 

set .currency, 7179; // podssetarray .items, 4001,5,7227,100; // Usage : <item id>,<price> 
Its working but once merchant type bought any item it will gives Discount because of Discount skill hahahah!

 
Maybe you can restrict merchants from buying into the Dynamic shop?

 
Try this :

- shop dynamicshop -1,501:222prontera,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, 7179; // pods         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 Part : 

set .currency, 7179; // podssetarray .items, 4001,5,7227,100; // Usage : <item id>,<price> 
Its working but once merchant type bought any item it will gives Discount because of Discount skill hahahah!
weird but i was not able to produce the discount thing, it shows the discounted prize but if you buy it it will take the original price

 
I never test my scripts so sorry for that. I guess that the discount you see in the dynamic shop is kinda a illusion thing? Dunno but i set the price as it is. So if you set a 7227 (TCG) @ 50 coins. If you use a merchant it will have a discount on the shop. But when u buy the item it will delete 50 coins on your inventory.
default_tongue.png


 
Thanks for this, works great! 

However:

I can't duplicate the npc.
default_sad.png
please help... I tried to change dynamicshop to dynamicshop2 but only one is working.. maybe because of callshop?

 
Last edited by a moderator:
Back
Top