summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-11-29 20:10:38 +0300
committerAndrei Karas <akaras@inbox.ru>2017-11-29 20:10:38 +0300
commit840d7abbc65944855e5cd9281262256d74cf9ce6 (patch)
tree2907618c06748097effd185c7bc9e93c2dd16d60 /server
parent7922796c03645d29c8f2af2ddfcb6ce33067fd7b (diff)
downloaddocs-840d7abbc65944855e5cd9281262256d74cf9ce6.tar.gz
docs-840d7abbc65944855e5cd9281262256d74cf9ce6.tar.bz2
docs-840d7abbc65944855e5cd9281262256d74cf9ce6.tar.xz
docs-840d7abbc65944855e5cd9281262256d74cf9ce6.zip
Update script and constant docs from hercules.s20171226
Diffstat (limited to 'server')
-rw-r--r--server/scripts/constants.md20
-rw-r--r--server/scripts/script_commands.txt52
2 files changed, 46 insertions, 26 deletions
diff --git a/server/scripts/constants.md b/server/scripts/constants.md
index fa077b9..7a9e6ea 100644
--- a/server/scripts/constants.md
+++ b/server/scripts/constants.md
@@ -4080,6 +4080,26 @@
- `MAPINFO_SIZE_Y`: 3
- `MAPINFO_ZONE`: 4
+### set/getiteminfo options
+
+- `ITEMINFO_BUYPRICE`: 0
+- `ITEMINFO_SELLPRICE`: 1
+- `ITEMINFO_TYPE`: 2
+- `ITEMINFO_MAXCHANCE`: 3
+- `ITEMINFO_SEX`: 4
+- `ITEMINFO_LOC`: 5
+- `ITEMINFO_WEIGHT`: 6
+- `ITEMINFO_ATK`: 7
+- `ITEMINFO_DEF`: 8
+- `ITEMINFO_RANGE`: 9
+- `ITEMINFO_SLOTS`: 10
+- `ITEMINFO_SUBTYPE`: 11
+- `ITEMINFO_ELV`: 12
+- `ITEMINFO_WLV`: 13
+- `ITEMINFO_VIEWID`: 14
+- `ITEMINFO_MATK`: 15
+- `ITEMINFO_VIEWSPRITE`: 16
+
### Renewal
- `RENEWAL`: 1
diff --git a/server/scripts/script_commands.txt b/server/scripts/script_commands.txt
index 9403029..4658040 100644
--- a/server/scripts/script_commands.txt
+++ b/server/scripts/script_commands.txt
@@ -3176,23 +3176,43 @@ Example:
---------------------------------------
*getiteminfo(<item ID>, <type>)
+*setiteminfo(<item ID>, <type>, <value>)
This function will look up the item with the specified ID number in the
database and return the info set by TYPE argument.
It will return -1 if there is no such item.
Valid types are:
- 0 - Buy Price; 1 - Sell Price; 2 - Item Type;
- 3 - maxchance (Max drop chance of this item e.g. 1 = 0.01% , etc..
+
+ ITEMINFO_BUYPRICE - Buy Price
+ ITEMINFO_SELLPRICE - Sell Price
+ ITEMINFO_TYPE - Item Type
+ ITEMINFO_MAXCHANCE - Max drop chance of this item e.g. 1 = 0.01% , etc..
if = 0, then monsters don't drop it at all (rare or a quest item)
if = 10000, then this item is sold in NPC shops only
- 4 - sex; 5 - equip; 6 - weight; 7 - atk; 8 - def; 9 - range;
- 10 - slot; 11 - subtype; 12 - elv; 13 - wlv; 14 - view id
-
- If RENEWAL is defined, 15 - matk
+ ITEMINFO_SEX - Sex
+ ITEMINFO_LOC - Equip location
+ ITEMINFO_WEIGHT - Weight (note: 1/10 of unit)
+ ITEMINFO_ATK - Attack
+ ITEMINFO_DEF - Defense
+ ITEMINFO_RANGE - Range
+ ITEMINFO_SLOTS - Slots
+ ITEMINFO_SUBTYPE - Item subtype
+ ITEMINFO_ELV - Equip min. level
+ ITEMINFO_WLV - Weapon level
+ ITEMINFO_VIEWID - View ID ("Sprite" field in the Item DB)
+ ITEMINFO_MATK - MATK (only relevant if RENEWAL is set)
+ ITEMINFO_VIEWSPRITE - View Sprite ("ViewSprite" field in the Item DB)
Check sample in doc/sample/getiteminfo.txt
+The setiteminfo function will, instead, set the item's parameters. It returns
+the new value on success, or -1 on failure (item_id not found).
+
+Example:
+
+ setiteminfo(Stone, ITEMINFO_WEIGHT, 9990); // Stone now weighs 999.0
+
---------------------------------------
*getequipisenableopt(<equipment slot>)
@@ -8296,26 +8316,6 @@ Example:
---------------------------------------
-*setiteminfo(<item id>, <type>, <value>)
-
-This function will set some value of an item.
-Returns the new value on success, or -1 on fail (item_id not found or
-invalid type).
-
-Valid types are:
- 0 - Buy Price; 1 - Sell Price; 2 - Item Type;
- 3 - maxchance (Max drop chance of this item e.g. 1 = 0.01% , etc..
- if = 0, then monsters don't drop it at all (rare or a quest item)
- if = 10000, then this item is sold in NPC shops only
- 4 - sex; 5 - equip; 6 - weight; 7 - atk; 8 - def; 9 - range;
- 10 - slot; 11 - subtype; 12 - elv; 13 - wlv; 14 - view id
-
-Example:
-
-setiteminfo Stone, 6, 9990; // Stone now weighs 999.0
-
----------------------------------------
-
*setitemscript(<item id>, <"{ new item script }">{, <type>})
Set a new script bonus to the Item. Very useful for game events.