Follow up fa75733cc109f926b1df4156ccdf1292c78f8f79

* `getiteminfo` fix after `elvmax` added

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
This commit is contained in:
Cydh Ramdh 2015-02-28 13:05:06 +07:00
parent d8ecfeb48b
commit 7d42cf2ba4
4 changed files with 12 additions and 4 deletions

View File

@ -17,7 +17,7 @@ prontera,156,179,6 script test_getiteminfo 117,{
mes "Item ID: " + .@value + " ^nItemID^" + .@value;
mes "Current item info:";
for(.@id = 0; .@id < 14; .@id++)
for(.@id = 0; .@id <= 16; .@id++)
mes " getiteminfo(" + .@value + "," + .@id + ") = " + getiteminfo(.@value,.@id);
close;
}

View File

@ -2829,7 +2829,8 @@ Valid types are:
12 - eLV
13 - wLV
14 - SpriteID from 'db/item_avail.txt'
15 - matk if RENEWAL is defined
15 - eLVMax
16 - matk if RENEWAL is defined
See the sample in 'doc/sample/getiteminfo.txt'.

View File

@ -390,9 +390,9 @@ struct item_data
int slot;
int look;
int elv;
int elvmax; ///< Maximum level for this item
int wlv;
int view_id;
int elvmax; ///< Maximum level for this item
#ifdef RENEWAL
int matk;
#endif

View File

@ -12590,6 +12590,8 @@ BUILDIN_FUNC(getitemslots)
12 elv;
13 wlv;
14 view id
15 eLvmax
16 matk (renewal)
*------------------------------------------*/
BUILDIN_FUNC(getiteminfo)
{
@ -12600,8 +12602,13 @@ BUILDIN_FUNC(getiteminfo)
n = script_getnum(st,3);
i_data = itemdb_exists(item_id);
if (i_data && n <= 14) {
if (i_data && n <= 16) {
int *item_arr = (int*)&i_data->value_buy;
#ifndef RENEWAL
if (n == 16)
script_pushint(st,0);
else
#endif
script_pushint(st,item_arr[n]);
} else
script_pushint(st,-1);