summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/achievement.c4
-rw-r--r--src/map/script.c21
-rw-r--r--src/map/script.h1
3 files changed, 26 insertions, 0 deletions
diff --git a/src/map/achievement.c b/src/map/achievement.c
index 68fc8a983..7148acae8 100644
--- a/src/map/achievement.c
+++ b/src/map/achievement.c
@@ -772,6 +772,10 @@ static void achievement_validate_refine(struct map_session_data *sd, unsigned in
criteria.goal = sd->status.inventory[idx].refine;
+ // achievement should not trigger if refine is 0
+ if (criteria.goal == 0)
+ return;
+
/* Universal */
achievement->validate_type(sd,
success ? ACH_EQUIP_REFINE_SUCCESS : ACH_EQUIP_REFINE_FAILURE,
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
};