diff options
author | Haru <haru@dotalux.com> | 2018-10-21 23:51:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-21 23:51:35 +0200 |
commit | eb71c78f0872567a33196b72420d3d081651a23f (patch) | |
tree | c14b23ec6f2532487ceacb275a71f086def15ef6 /src | |
parent | b196e2b794bb96c1584c885f50e63326678ae89e (diff) | |
parent | 9b878ee44765010758c7c6da630431d9aaef71dc (diff) | |
download | hercules-eb71c78f0872567a33196b72420d3d081651a23f.tar.gz hercules-eb71c78f0872567a33196b72420d3d081651a23f.tar.bz2 hercules-eb71c78f0872567a33196b72420d3d081651a23f.tar.xz hercules-eb71c78f0872567a33196b72420d3d081651a23f.zip |
Merge pull request #2172 from dastgirp/enhance/getiteminfo
Updated getiteminfo and setiteminfo.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 21 | ||||
-rw-r--r-- | src/map/script.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 5eed58977..fbf842f18 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14415,6 +14415,9 @@ static BUILDIN(getiteminfo) case ITEMINFO_VIEWSPRITE: script_pushint(st, it->view_sprite); break; + case ITEMINFO_TRADE: + script_pushint(st, it->flag.trade_restriction); + break; default: ShowError("buildin_getiteminfo: Invalid item type %d.\n", n); script_pushint(st,-1); @@ -14681,6 +14684,9 @@ static BUILDIN(setiteminfo) case ITEMINFO_VIEWSPRITE: it->view_sprite = value; break; + case ITEMINFO_TRADE: + it->flag.trade_restriction = value; + break; default: ShowError("buildin_setiteminfo: invalid type %d.\n", n); script_pushint(st,-1); @@ -25859,6 +25865,7 @@ static void script_hardcoded_constants(void) script->set_constant("ITEMINFO_VIEWID", ITEMINFO_VIEWID, false, false); script->set_constant("ITEMINFO_MATK", ITEMINFO_MATK, false, false); script->set_constant("ITEMINFO_VIEWSPRITE", ITEMINFO_VIEWSPRITE, false, false); + script->set_constant("ITEMINFO_TRADE", ITEMINFO_TRADE, false, false); script->constdb_comment("monster skill states"); script->set_constant("MSS_ANY", MSS_ANY, false, false); @@ -25949,6 +25956,20 @@ static void script_hardcoded_constants(void) script->set_constant("FUNCTION_IS_LOCAL", FUNCTION_IS_LOCAL, false, false); script->set_constant("FUNCTION_IS_LABEL", FUNCTION_IS_LABEL, false, false); + script->constdb_comment("item trade restrictions"); + script->set_constant("ITR_NONE", ITR_NONE, false, false); + script->set_constant("ITR_NODROP", ITR_NODROP, false, false); + script->set_constant("ITR_NOTRADE", ITR_NOTRADE, false, false); + script->set_constant("ITR_PARTNEROVERRIDE", ITR_PARTNEROVERRIDE, false, false); + script->set_constant("ITR_NOSELLTONPC", ITR_NOSELLTONPC, false, false); + script->set_constant("ITR_NOCART", ITR_NOCART, false, false); + script->set_constant("ITR_NOSTORAGE", ITR_NOSTORAGE, false, false); + script->set_constant("ITR_NOGSTORAGE", ITR_NOGSTORAGE, false, false); + script->set_constant("ITR_NOMAIL", ITR_NOMAIL, false, false); + script->set_constant("ITR_NOAUCTION", ITR_NOAUCTION, false, false); + script->set_constant("ITR_ALL", ITR_ALL, false, false); + + script->constdb_comment("Renewal"); #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); diff --git a/src/map/script.h b/src/map/script.h index 9c72b793c..72210b05b 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -450,6 +450,7 @@ enum script_iteminfo_types { ITEMINFO_VIEWID, ITEMINFO_MATK, ITEMINFO_VIEWSPRITE, + ITEMINFO_TRADE, ITEMINFO_MAX }; |