summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-02 22:52:38 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-02 22:52:38 +0300
commit179e2a097cdf9190c46a3e4c93eee5535e707530 (patch)
treeb8ab32b29f4c053e42ed28b0519f2b9125482cc5 /src/map
parent9bc41f3285ebd0c83243b2f207ff6d6b08ddf5f6 (diff)
downloadplugin-179e2a097cdf9190c46a3e4c93eee5535e707530.tar.gz
plugin-179e2a097cdf9190c46a3e4c93eee5535e707530.tar.bz2
plugin-179e2a097cdf9190c46a3e4c93eee5535e707530.tar.xz
plugin-179e2a097cdf9190c46a3e4c93eee5535e707530.zip
map: add some more attributes into item_db.
Added RequiredMaxHp, RequiredMaxSp, RequiredAtk, RequiredMAtkMin, RequiredMAtkMax
Diffstat (limited to 'src/map')
-rw-r--r--src/map/data/itemd.c5
-rw-r--r--src/map/itemdb.c10
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/struct/itemdext.h5
4 files changed, 27 insertions, 1 deletions
diff --git a/src/map/data/itemd.c b/src/map/data/itemd.c
index 671c8e5..468c072 100644
--- a/src/map/data/itemd.c
+++ b/src/map/data/itemd.c
@@ -53,5 +53,10 @@ struct ItemdExt *itemd_create(void)
data->requiredInt = 0;
data->requiredDex = 0;
data->requiredLuk = 0;
+ data->requiredMaxHp = 0;
+ data->requiredMaxSp = 0;
+ data->requiredAtk = 0;
+ data->requiredMAtkMin = 0;
+ data->requiredMAtkMax = 0;
return data;
}
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index fcce487..c777a44 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -64,6 +64,16 @@ void eitemdb_readdb_additional_fields(int *itemid,
data->requiredDex = i32;
if (libconfig->setting_lookup_int(it, "RequiredLuk", &i32) && i32 >= 0)
data->requiredLuk = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredMaxHp", &i32) && i32 >= 0)
+ data->requiredMaxHp = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredMaxSp", &i32) && i32 >= 0)
+ data->requiredMaxSp = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredAtk", &i32) && i32 >= 0)
+ data->requiredAtk = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredMAtkMin", &i32) && i32 >= 0)
+ data->requiredMAtkMin = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredMAtkMax", &i32) && i32 >= 0)
+ data->requiredMAtkMax = i32;
hookStop();
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 5b36576..84f8638 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -208,7 +208,13 @@ int epc_isuseequip_post(int retVal, struct map_session_data *sd, int *nPtr)
sd->battle_status.vit < data->requiredVit ||
sd->battle_status.int_ < data->requiredInt ||
sd->battle_status.dex < data->requiredDex ||
- sd->battle_status.luk < data->requiredLuk)
+ sd->battle_status.luk < data->requiredLuk ||
+ sd->battle_status.maHp < data->requiredMaxHp ||
+ sd->battle_status.maSp < data->requiredMaxSp ||
+ sd->battle_status.batk < data->requiredAtk ||
+ sd->battle_status.matk_min < data->requiredMAtkMin ||
+ sd->battle_status.matk_max < data->requiredMAtkMax ||
+ )
{
return 0;
}
diff --git a/src/map/struct/itemdext.h b/src/map/struct/itemdext.h
index bf60e8b..b8fc7be 100644
--- a/src/map/struct/itemdext.h
+++ b/src/map/struct/itemdext.h
@@ -13,6 +13,11 @@ struct ItemdExt
int requiredInt;
int requiredDex;
int requiredLuk;
+ int requiredMaxHp;
+ int requiredMaxSp;
+ int requiredAtk;
+ int requiredMAtkMin;
+ int requiredMAtkMax;
bool allowPickup;
};