summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-02 23:57:56 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-02 23:57:56 +0300
commitea151b73fd14c5d9ced60979b91c7d13cf0c4422 (patch)
treec35e3addd2fa1f10f6cbaa38f186582e2b532a52 /src
parent179e2a097cdf9190c46a3e4c93eee5535e707530 (diff)
downloadplugin-ea151b73fd14c5d9ced60979b91c7d13cf0c4422.tar.gz
plugin-ea151b73fd14c5d9ced60979b91c7d13cf0c4422.tar.bz2
plugin-ea151b73fd14c5d9ced60979b91c7d13cf0c4422.tar.xz
plugin-ea151b73fd14c5d9ced60979b91c7d13cf0c4422.zip
map: add new attributes to item_db.
New attributes RequiredDef, RequiredMDef.
Diffstat (limited to 'src')
-rw-r--r--src/map/data/itemd.c2
-rw-r--r--src/map/itemdb.c4
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/struct/itemdext.h2
4 files changed, 10 insertions, 0 deletions
diff --git a/src/map/data/itemd.c b/src/map/data/itemd.c
index 468c072..974c86c 100644
--- a/src/map/data/itemd.c
+++ b/src/map/data/itemd.c
@@ -58,5 +58,7 @@ struct ItemdExt *itemd_create(void)
data->requiredAtk = 0;
data->requiredMAtkMin = 0;
data->requiredMAtkMax = 0;
+ data->requiredDef = 0;
+ data->requiredMDef = 0;
return data;
}
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index c777a44..50c2728 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -74,6 +74,10 @@ void eitemdb_readdb_additional_fields(int *itemid,
data->requiredMAtkMin = i32;
if (libconfig->setting_lookup_int(it, "RequiredMAtkMax", &i32) && i32 >= 0)
data->requiredMAtkMax = i32;
+ if (libconfig->setting_lookup_int(it, "requiredDef", &i32) && i32 >= 0)
+ data->requiredDef = i32;
+ if (libconfig->setting_lookup_int(it, "requiredMDef", &i32) && i32 >= 0)
+ data->requiredMDef = i32;
hookStop();
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 84f8638..929b57f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -214,6 +214,8 @@ int epc_isuseequip_post(int retVal, struct map_session_data *sd, int *nPtr)
sd->battle_status.batk < data->requiredAtk ||
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 ||
)
{
return 0;
diff --git a/src/map/struct/itemdext.h b/src/map/struct/itemdext.h
index b8fc7be..283f20d 100644
--- a/src/map/struct/itemdext.h
+++ b/src/map/struct/itemdext.h
@@ -18,6 +18,8 @@ struct ItemdExt
int requiredAtk;
int requiredMAtkMin;
int requiredMAtkMax;
+ int requiredDef;
+ int requiredMDef;
bool allowPickup;
};