diff options
author | Dastgir <dastgirp@gmail.com> | 2018-08-08 15:34:57 +0530 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2018-10-21 21:19:14 +0200 |
commit | 9b878ee44765010758c7c6da630431d9aaef71dc (patch) | |
tree | 2686dfd2dced77902c01c1bb8550250861bd925c /src/map | |
parent | 852c13305f67948531bd0277eb1922dbd02b1f26 (diff) | |
download | hercules-9b878ee44765010758c7c6da630431d9aaef71dc.tar.gz hercules-9b878ee44765010758c7c6da630431d9aaef71dc.tar.bz2 hercules-9b878ee44765010758c7c6da630431d9aaef71dc.tar.xz hercules-9b878ee44765010758c7c6da630431d9aaef71dc.zip |
Updated getiteminfo and setiteminfo.
Added ITR_TRADE (Trade restriction) for both script commands
Diffstat (limited to 'src/map')
-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 b787d0138..f7bcc96af 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14480,6 +14480,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); @@ -14746,6 +14749,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); @@ -25847,6 +25853,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); @@ -25937,6 +25944,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 }; |