summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-11-12 01:56:57 +0100
committerHaru <haru@dotalux.com>2017-11-12 01:56:57 +0100
commitdfcb1ff37ad077249c0050bb1bab8994225191e1 (patch)
tree080515e1774e1bcb8fa4906d4eeaee5b42d572b6
parentab1c84c8586b18ebb194d2f67120df7307399712 (diff)
downloadhercules-dfcb1ff37ad077249c0050bb1bab8994225191e1.tar.gz
hercules-dfcb1ff37ad077249c0050bb1bab8994225191e1.tar.bz2
hercules-dfcb1ff37ad077249c0050bb1bab8994225191e1.tar.xz
hercules-dfcb1ff37ad077249c0050bb1bab8994225191e1.zip
Add ITEMINFO_MATK support to getiteminfo() / setiteminfo().
This item info type was documented in commit 315d632e69c60d2996872c9330164133101befdf, but never implemented. Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--doc/sample/getiteminfo.txt1
-rw-r--r--doc/script_commands.txt3
-rw-r--r--src/map/script.c7
-rw-r--r--src/map/script.h1
4 files changed, 10 insertions, 2 deletions
diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt
index 35dd9e27c..63a6e7928 100644
--- a/doc/sample/getiteminfo.txt
+++ b/doc/sample/getiteminfo.txt
@@ -32,5 +32,6 @@ prontera,156,179,6 script test_getiteminfo 4_F_KAFRA1,{
mesf("Equip Level: %d", getiteminfo(.@value, ITEMINFO_ELV));
mesf("Weapon Level: %d", getiteminfo(.@value, ITEMINFO_WLV));
mesf("View ID: %d", getiteminfo(.@value, ITEMINFO_VIEWID));
+ mesf("MATK: %d", getiteminfo(.@value, ITEMINFO_MATK));
close;
}
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index c8496d227..746eaea2b 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -3201,8 +3201,7 @@ Valid types are:
ITEMINFO_ELV - Equip min. level
ITEMINFO_WLV - Weapon level
ITEMINFO_VIEWID - View ID ("Sprite" field in the Item DB)
-
- If RENEWAL is defined, 15 - matk
+ ITEMINFO_MATK - MATK (only relevant if RENEWAL is set)
Check sample in doc/sample/getiteminfo.txt
diff --git a/src/map/script.c b/src/map/script.c
index 72c33dc5d..133142625 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14126,6 +14126,9 @@ BUILDIN(getiteminfo)
case ITEMINFO_VIEWID:
script_pushint(st, it->view_id);
break;
+ case ITEMINFO_MATK:
+ script_pushint(st, it->matk);
+ break;
default:
ShowError("buildin_getiteminfo: Invalid item type %d.\n", n);
script_pushint(st,-1);
@@ -14386,6 +14389,9 @@ BUILDIN(setiteminfo)
case ITEMINFO_VIEWID:
it->view_id = value;
break;
+ case ITEMINFO_MATK:
+ it->matk = value;
+ break;
default:
ShowError("buildin_setiteminfo: invalid type %d.\n", n);
script_pushint(st,-1);
@@ -24830,6 +24836,7 @@ void script_hardcoded_constants(void)
script->set_constant("ITEMINFO_ELV", ITEMINFO_ELV, false, false);
script->set_constant("ITEMINFO_WLV", ITEMINFO_WLV, false, false);
script->set_constant("ITEMINFO_VIEWID", ITEMINFO_VIEWID, false, false);
+ script->set_constant("ITEMINFO_MATK", ITEMINFO_MATK, false, false);
script->constdb_comment("Renewal");
#ifdef RENEWAL
diff --git a/src/map/script.h b/src/map/script.h
index 3fd62a3f8..f9d86007b 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -447,6 +447,7 @@ enum script_iteminfo_types {
ITEMINFO_ELV,
ITEMINFO_WLV,
ITEMINFO_VIEWID,
+ ITEMINFO_MATK,
ITEMINFO_MAX
};