-
Notifications
You must be signed in to change notification settings - Fork 772
getiteminfo() / setiteminfo() fixes #1902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getiteminfo() / setiteminfo() fixes #1902
Conversation
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 <[email protected]>
This item info type was documented in commit 315d632, but never implemented. Signed-off-by: Haru <[email protected]>
Adds the ability to query an item's view sprite, lost with HerculesWS#1828 Fixes HerculesWS#1895 Signed-off-by: Haru <[email protected]>
… ammunitions Both functions have now been updated to only check the subtype if the item type is correct (IT_AMMO for F_GetAmmoType, IT_WEAPON for F_GetWeaponType) Signed-off-by: Haru <[email protected]>
…a bitmask The function now handles multi-slot headgears and other uncommon cases better. Signed-off-by: Haru <[email protected]>
| ITEMINFO_RANGE - Range | ||
| ITEMINFO_SLOTS - Slots | ||
| ITEMINFO_SUBTYPE - Item subtype | ||
| ITEMINFO_ELV - Equip min. level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about equip max level? Maybe we should bring that under this command too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I opened a separate ticket, #1906, so that we can merge this PR (since it contains fixes for a regression that already landed in the stable branch)
Pull Request Prelude
Changes Proposed
This PR provides constants to be used with the
getiteminfo()andsetiteminfo()buildins, to replace the unsafe literal numeric values used in the past (and in fact, there was one case of incorrect value used in a script).The functions are also extended with support for
ITEMINFO_MATK(which was previously documented but never implemented) as well asITEMINFO_VIEWSPRITE(which was no longer available since #1828 was merged).This also includes an updated version of the global functions
F_GetWeaponType()andF_GetArmorType(), and the new functionF_GetAmmoType().The complete list of replacements for the previously used numeric literals is the following:
Affected Branches:
Issues addressed:
Known Issues and TODO List
N/A