Page 1 of 1
Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Thu Jun 04, 2015 12:25 pm
by bluesolarflare
Hello,
I am looking to create a shop that instead of using gil to purchase items, uses Cruor or Bayld. Is it possible that this can be coded into a shop script?
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Thu Jun 04, 2015 4:06 pm
by whasf
I don't think so, I think the client is hard-coded that way for shops.
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Thu Jun 04, 2015 5:01 pm
by TeoTwawki
Can't use actual shop windows to do it. You can make NPC's deduct any "point" type via script, but you've no way to create a a menu for the player to select from.
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Thu Jun 04, 2015 5:55 pm
by bluesolarflare
Yeah that was pretty much my fallback. I set up a normal shop with the price in gil, but I have a condition to check for bayld. If the player doesn't have enough to purchase the lowest item, a system message pops up saying they need X amount purchase anything. Once they have enough, the shop opens and they can purchase with gil and it deducts bayld as well. The only problem I have is finding a way to force close the shop (requiring another bayld check) after the purchase so they can't stay in the menu to buy infinite items.
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Thu Jun 04, 2015 9:02 pm
by bluesolarflare
Actually ran into a problem. Is there a way to track a purchase so that a rule can be used to delCurrency? I was thinking through the system message "you buy a ___ from the shop" but I don't know how to script that portion.
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Thu Jun 04, 2015 11:16 pm
by TeoTwawki
Nope. This is simply not a thing you can get working exactly how you want by script.
You could possibly edit the core where it deals with shops but then you have the problem of how to tell your custom shops from regular shops (and you'd need to know C++ for that). There is no easy road to a real shop that uses anything but gil.
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Fri Jun 05, 2015 2:09 pm
by bluesolarflare
Thanks for the reply. I was able to setup a different system that gave me somewhat what I wanted:
Talking to the NPC opens up the store to "sell" endgame gear. The price is set fairly high in gil, but there is a system message that states that if you do not have the gil, you can exchange certain vanilla 99 armor and he will upgrade it to the same pieces he sells but deduct the same amount of bayld listed. There is a check to ensure that when a player trades the vanilla gear that they have enough bayld for the transaction.
The vanilla gear can only be obtained through the mogstore which has certain requirements that need to be met (currently level 99 but plan to expand it to full Zilart clear)
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Sat Aug 15, 2015 9:58 pm
by bluesolarflare
If anyone is curious here is the code I used as an example. It uses Mweya Plasm as the currency and when the player trades an Exuine Coat, if they have 17,500 plasm, the NPC upgrades it to a Manibozo Jerkin.
Code: Select all
function onTrade(player,npc,trade)
balance = 0;
jerkin = 17500; // This is how much the upgraded item costs
local uplasm = player:getCurrency("mweya_plasm");
if (trade:hasItemQty( 10475, 1 )) then
if (uplasm >= jerkin) then //This is a check to see if the player has enough plasm
player:delCurrency("mweya_plasm", 17500);
player:tradeComplete();
player:addItem(27918,1);
player:messageSpecial(ITEM_OBTAINED,27918,1);
else
balance = jerkin - uplasm; //variable to determine how much is needed if not enough
player:PrintToPlayer( "I'm sorry, you need "..balance.." more Plasm for me to upgrade that armor");
end
else
player:PrintToPlayer("I can't do anything with that armor...");
end
end;
Re: Custom Shop using different currency (Cruor, Bayld, etc)
Posted: Fri Feb 05, 2016 11:07 pm
by kennxonline
how would one do this using conquest points?