summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 22:23:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 22:23:14 +0000
commit5d58c4554f4264a1ba546a31439216c90da527b0 (patch)
treea6a87116ab523d5981808d9fa42fa415af186c7e /doc/script_commands.txt
parent3bd9f774303554a62f3e1dcb260b356d1fae3f6d (diff)
downloadhercules-5d58c4554f4264a1ba546a31439216c90da527b0.tar.gz
hercules-5d58c4554f4264a1ba546a31439216c90da527b0.tar.bz2
hercules-5d58c4554f4264a1ba546a31439216c90da527b0.tar.xz
hercules-5d58c4554f4264a1ba546a31439216c90da527b0.zip
- Cleaned up the npcshop(add/del) item script commands, fixed a possible dangling pointer crash caused by their improper use of realloc. They no longer automatically attach the script to the shop, and they will return true/false based on whether the shop was found or not.
- Added script command npcshopattach to enable attaching/detaching your script from any npc shop. - Updated doc/script_commands.txt with entries for npcshopitem, npcshopadditem, npcshopdelitem and npcshopattach git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9769 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt55
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 102380148..81462e634 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -43,6 +43,8 @@
//= 2.11.20070109 - removed the unused flag argument in guildskill, added an
//= optional argument to setcart,setfalcon,setriding and other cleanups
//= [FlavioJS]
+//= 2.12.20070201 - Added npcshopitem, npcshopadditem, npcshopdelitem and
+//= npcshopattach [Skotlex]
//===== Compatible With ===================================
//= LOL, can be used by anyone hopefully
//===== Description =======================================
@@ -3595,6 +3597,59 @@ itself).
---------------------------------------
+*npcshopitem "<name>",<itemId>,<Price>{,<itemId>,<Price>{,<itemId>,<Price>{,...}}}
+
+This command lets you override the contents of an existing npc shop. The
+current sell list will be wiped, and only the items specified with the price
+specified will be for sale.
+
+The function returns 1 if shop was updated successfully, or 0 if not found.
+
+Note that you cannot use -1 to specify default selling price!
+
+---------------------------------------
+
+*npcshopadditem "<name>",<itemId>,<Price>{,<itemId>,<Price>{,<itemId>,<Price>{,...}}}
+
+This command will add more items at the end of the selling list for the
+specified npc shop. If you specify an item already for sell, that item will
+appear twice on the sell list.
+
+The function returns 1 if shop was updated successfully, or 0 if not found.
+
+Note that you cannot use -1 to specify default selling price!
+
+---------------------------------------
+
+*npcshopdelitem "<name>",<itemId>{,<itemId>{,<itemId>{,...}}}
+
+This command will remove items from the specified npc shop.
+If the item to remove exists more than once on the shop, all instances will be
+removed.
+
+Note that the function returns 1 even if no items were removed. The return
+value is only to confirm that the shop was indeed found.
+
+---------------------------------------
+
+*npcshopattach "<name>"{,<flag>}
+
+This command will attach the current script to the given npc shop.
+When a script is attached to a shop, the events "OnBuyItem" and "OnSellItem"
+of your script will be executed whenever a player buys/sells from the shop.
+Additionally, the arrays @bought_nameid[], @bought_quantity[] or @sold_nameid[]
+and @sold_quantity[] will be filled up with the items and quantities
+bought/sold.
+
+The optional parameter specifies whether to attach ("1") or detach ("0") from
+the shop (the default is to attach). Note that detaching will detach any npc
+attached to the shop, even if it's from another script, while attaching will
+override any other script that may be already attached.
+
+The function returns 0 if the shop was not found, 1 otherwise.
+
+---------------------------------------
+
*debugmes "<message>";
This command will send the message to the server console (map-server window). It