From 7d42cf2ba499209b2d2f5522a4d24b0eaf689c23 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Sat, 28 Feb 2015 13:05:06 +0700 Subject: [PATCH] Follow up fa75733cc109f926b1df4156ccdf1292c78f8f79 * `getiteminfo` fix after `elvmax` added Signed-off-by: Cydh Ramdh --- doc/sample/getiteminfo.txt | 2 +- doc/script_commands.txt | 3 ++- src/map/itemdb.h | 2 +- src/map/script.c | 9 ++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt index 47d6da5f878..70f731e5822 100644 --- a/doc/sample/getiteminfo.txt +++ b/doc/sample/getiteminfo.txt @@ -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; } \ No newline at end of file diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a860997148b..99fb05079d9 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -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'. diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 882c97ee714..22184108a25 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -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 diff --git a/src/map/script.c b/src/map/script.c index 73bf5f447c4..1a8bb697bff 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -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);