Gift'o! From Hercules, to your server! We wish you happy holidays, and thank you for your support. May the New Year bring you happiness and peace.
2013-12-23c Client Support
Thanks to Yommy and Rytech!
NPC Market Support
A new type of NPC Shop where item availability is limited, for example you can have a vender start with 50x Red Potions and set mechanics for the red potions to be refurbished (for example could be as simple as a OnClock, where Red Potions are refurbished every y hour, or elaborate e.g. be connected with a game quest where players need to help a merchant npc get to the shop in order for it to be resupplied)
Available as a NPC Trader subset (details will follow)
@costume Oktoberfest
NPC Trader
A whole different way to set up shops, they're easier to read and flexible to customize.
Previous format still supported (in the scenario we drop the previous we'll provide a conversion tool)
To begin with, 'trader' is a phony name, its only purpose is to sign the parser that 'this npc will open the shop when clicked'. the trader npc is in fact a 'script' type (and thus script types can create/manipulate trader shops, and open them with the help of openshop()).
Normal Zeny Shop
moc_ruins,93,53,2 trader Item Collector#moc1 4_M_03,{
OnInit:
sellitem Scell;
sellitem Monster's_Feed;
sellitem Animal's_Skin;
sellitem Bill_Of_Birds;
}
Custom Shop
Script has full control over currency, which allows for scripts to use anything, from quests, to items, variables, etca.
For Example:
prontera,153,152,1 trader TestCustom2 952,{
OnInit:
tradertype(NST_CUSTOM);
sellitem Red_Potion;
end;
/* allows currency to be Red_Potion */
OnCountFunds:
setcurrency(countitem(Red_Potion));
end;
/* receives @price (total cost) */
OnPayFunds:
if( countitem(Red_Potion) < @price )
end;
delitem Red_Potion,@price;
purchaseok();
end;
}
NPC Market ShopThis is the type I mentioned earlier, where item availability is limited
prontera,150,160,6 trader HaiMarket 952,{
OnInit:
tradertype(NST_MARKET);
sellitem Red_Potion,-1,50;
end;
OnClock0000://resupplies red potions on midnight
OnMyResupply://instead of midnight, a event could trigger HaiMarket::OnMyResupply
if( shopcount(Red_Potion) < 50 )
sellitem Red_Potion,-1,50;
end;
}The quantity data is disaster-safe, I mean it is persistent to @reloadscript and server restarts (If there were 39 Red Potions on sale upon restart/reloadscript, it continues to be 39 instead of resetting back to 50).
7 script commands to help control (documentation for all of them is present in script_commands.txt): openshop,sellitem,stopselling,setcurrency,tradertype,purchaseok,shopcount
Trader Design by
Yommy
Haru
jaBote
mkbu95
Gepard
Emistry
Ind
Special Thanks To
Haru
Yommy
JaBote
Muad_Dib
Link'u~!
Commit: https://github.com/HerculesWS/Hercules/commit/cf19b26d50ac96111e44c33a80afd1f1ea935cec
NPC Trader Samples: https://raw.github.com/herculesWS/Hercules/master/doc/sample/npc_trader_sample.txt
(Upcoming) GM Interface for Cash Shop Control
Found that on the new client, support is being worked on (Data thanks to Yommy <3).