diff options
author | Haru <haru@dotalux.com> | 2017-11-12 01:46:40 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2017-11-12 01:46:40 +0100 |
commit | ab1c84c8586b18ebb194d2f67120df7307399712 (patch) | |
tree | 35dc8320db48da8d26ba7c9aee9bfeef04933f80 /doc/sample/npc_test_setitemx.txt | |
parent | 82da003c98d1525b6302cb7c753959a3b3e8c10d (diff) | |
download | hercules-ab1c84c8586b18ebb194d2f67120df7307399712.tar.gz hercules-ab1c84c8586b18ebb194d2f67120df7307399712.tar.bz2 hercules-ab1c84c8586b18ebb194d2f67120df7307399712.tar.xz hercules-ab1c84c8586b18ebb194d2f67120df7307399712.zip |
Add type constants for the getiteminfo()/setiteminfo() buildins
Replacements are as follows:
0 => ITEMINFO_BUYPRICE
1 => ITEMINFO_SELLPRICE
2 => ITEMINFO_TYPE
3 => ITEMINFO_MAXCHANCE
4 => ITEMINFO_SEX
5 => ITEMINFO_LOC
6 => ITEMINFO_WEIGHT
7 => ITEMINFO_ATK
8 => ITEMINFO_DEF
9 => ITEMINFO_RANGE
10 => ITEMINFO_SLOTS
11 (Subtype, for weapons and ammunitions) => ITEMINFO_SUBTYPE
11 (ViewSprite, for other item types) => ITEMINFO_VIEWSPRITE (NOT AVAILABLE YET)
12 => ITEMINFO_ELV
13 => ITEMINFO_WLV
14 => ITEMINFO_VIEWID
15 => ITEMINFO_MATK (NOT AVAILABLE YET - this was documented but never implemented)
Calls to getiteminfo() and setiteminfo() have been replaced with the
newly introduced constants. Other constants (such as W_ weapon subtypes)
in related code have been replaced as well, to improve code readability.
This fixes an issue in the Eden Tutorial script "Tutorial Goal", where
ITEMINFO_ATK was accidentally used instead of ITEMINFO_WEIGHT.
Note: calls to getiteminfo or setiteminfo with numeric type arguments in
third party scripts must be replaced with the respective constants. The
use of numeric literals is no longer recommended, and those values may
change in the future without notice. See the getiteminfo documentation
for details.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'doc/sample/npc_test_setitemx.txt')
-rw-r--r-- | doc/sample/npc_test_setitemx.txt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt index a06f0dc9f..990c09bae 100644 --- a/doc/sample/npc_test_setitemx.txt +++ b/doc/sample/npc_test_setitemx.txt @@ -14,15 +14,14 @@ prontera,164,161,5 script Lupus WOLF,{ switch (select("Make Knife[3] Edible", "Make Apple Equippable", "Edible Knife = Full SP", "Knife = Weapon + 3 Notes")) { case 1: mes "Ok. We made Knife[3] edible."; - setiteminfo(Knife, 2, IT_HEALING); //type = 0 : potion + setiteminfo(Knife, ITEIMINFO_TYPE, IT_HEALING); setitemscript(Knife, "{dispbottom \"* You used Knife[3]\";}"); break; case 2: mes "Ok. We made Apple equippable."; - setiteminfo(Apple, 2, IT_ARMOR); //item type -> headgear (type = 5 -> IT_ARMOR) - setiteminfo(Apple, 5, 512); //where to equip to (equip = 512) - setiteminfo(Apple, 11, 256); //set as headgear location (loc = 256) - setiteminfo(Apple, 14, 85); //set Headgear Sprite ID (view id = 85) + setiteminfo(Apple, ITEMINFO_TYPE, IT_ARMOR); + setiteminfo(Apple, ITEMINFO_LOC, EQP_HEAD_MID); //where to equip to (equip = 512) + //setiteminfo(Apple, 14, 85); //set Headgear Sprite ID (view id = 85) setitemscript(Apple, "{dispbottom \"* Other item's changed\";}", 0); setitemscript(Apple, "{dispbottom \"* Equipped\";}", 1); setitemscript(Apple, "{dispbottom \"* Unequipped\";}", 2); @@ -34,7 +33,7 @@ prontera,164,161,5 script Lupus WOLF,{ break; case 4: mes "Ok. We made Knife a weapon, but added 3 notes."; - setiteminfo(Knife, 2, IT_WEAPON); //type = 4 -> IT_WEAPON + setiteminfo(Knife, ITEIMINFO_TYPE, IT_WEAPON); setitemscript(Knife, "{dispbottom \"* 1 Used\";}", 0); setitemscript(Knife, "{dispbottom \"* 2 Equipped\";}", 1); setitemscript(Knife, "{dispbottom \"* 3 Unequipped\";}", 2); |