summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/data/itemd.c1
-rw-r--r--src/emap/itemdb.c2
-rw-r--r--src/emap/pc.c3
-rw-r--r--src/emap/struct/itemdext.h1
4 files changed, 6 insertions, 1 deletions
diff --git a/src/emap/data/itemd.c b/src/emap/data/itemd.c
index 5e02dea..d5bb26b 100644
--- a/src/emap/data/itemd.c
+++ b/src/emap/data/itemd.c
@@ -62,6 +62,7 @@ struct ItemdExt *itemd_create(void)
data->requiredMAtkMax = 0;
data->requiredDef = 0;
data->requiredMDef = 0;
+ data->requiredSkill = 0;
data->useEffect = -1;
data->useFailEffect = -1;
data->unequipEffect = -1;
diff --git a/src/emap/itemdb.c b/src/emap/itemdb.c
index f79cc7e..63434bf 100644
--- a/src/emap/itemdb.c
+++ b/src/emap/itemdb.c
@@ -82,6 +82,8 @@ void eitemdb_readdb_additional_fields(int *itemid,
data->requiredDef = i32;
if (libconfig->setting_lookup_int(it, "RequiredMDef", &i32) && i32 >= 0)
data->requiredMDef = i32;
+ if (itemdb->lookup_const(it, "RequiredSkill", &i32))
+ data->requiredSkill = i32;
if (libconfig->setting_lookup_bool(it, "Charm", &i32) && i32 >= 0)
data->charmItem = i32 ? true : false;
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 152fabe..ae66edd 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -285,7 +285,8 @@ int epc_isequip_post(int retVal, struct map_session_data *sd, int *nPtr)
sd->battle_status.matk_min < data->requiredMAtkMin ||
sd->battle_status.matk_max < data->requiredMAtkMax ||
sd->battle_status.def < data->requiredDef ||
- sd->battle_status.mdef < data->requiredMDef
+ sd->battle_status.mdef < data->requiredMDef ||
+ (data->requiredSkill && !pc->checkskill(sd, data->requiredSkill))
)
{
return 0;
diff --git a/src/emap/struct/itemdext.h b/src/emap/struct/itemdext.h
index 5fd7159..6ce3017 100644
--- a/src/emap/struct/itemdext.h
+++ b/src/emap/struct/itemdext.h
@@ -27,6 +27,7 @@ struct ItemdExt
int requiredMAtkMax;
int requiredDef;
int requiredMDef;
+ int requiredSkill;
int useEffect;
int useFailEffect;