Jump to content
  • 0
esquilla13

Request - NPC SHOP for Proof of Donations Only

Question

14 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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> 
Edited by Patskie

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites
  • 0

 

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!

Share this post


Link to post
Share on other sites
  • 0

 

 

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

Thanks for this, works great! 

 

However:

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

Edited by Hadeszeus

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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