Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command callshop:
* callshop "Shop Name",<flag>;
These are a series of commands used to create dynamic shops.
The callshop function calls a invisible shop (view -1) as if the player clicked on it.

For the options on callShop:
0 = The normal window (buy, sell and cancel)
1 = The buy window
2 = The sell window


callshop "DaShop",1; //Will call the shop named DaShop and opens the buy menu.

The shop which is called by callshop (as long as an npcshopattach command is executed
from that NPC (see note 1)) will trigger the labels OnBuyItem and OnSellitem. These
labels can take over handling for relatively the buying of items from the shop
and selling the items to a shop. Via these labels you can customize the way an item
is bought or sold by a player.

In the OnBuyItem, two arrays are set (@bought_nameid and @bough_quantity), which
hold information about the name id (item id) sold and the amount sold of it. Same
goes for the OnSellItem label, only the variables are named different
(@sold_nameid and @sold_quantity). An example on a shop comes with eAthena, and
can be found in the npc/sample/npc_dynamic_shop.txt file.

This example shows how to use the labels and their set variables to create a dynamic shop.

Note 1: These labels will only be triggered if a npcshopattach command is executed (and the shop got attached to the script), this is
because this commands set a special data on the shop npc,named master_nd in the source.

Valid XHTML 1.0 Strict Valid CSS!