From 9b878ee44765010758c7c6da630431d9aaef71dc Mon Sep 17 00:00:00 2001 From: Dastgir Date: Wed, 8 Aug 2018 15:34:57 +0530 Subject: Updated getiteminfo and setiteminfo. Added ITR_TRADE (Trade restriction) for both script commands --- src/map/script.c | 21 +++++++++++++++++++++ src/map/script.h | 1 + 2 files changed, 22 insertions(+) (limited to 'src/map') 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 }; -- cgit v1.2.3-70-g09d2