summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-02 22:20:20 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-02 22:20:20 +0300
commit402cbb4310059bc37ffc2825b83a1659200bf12c (patch)
tree56faf21a6f91041fe25b9e6da31b66060e7c4f9c /src/map/itemdb.c
parent3a0767592d15288849ad16b6dcd9171af821af33 (diff)
downloadplugin-402cbb4310059bc37ffc2825b83a1659200bf12c.tar.gz
plugin-402cbb4310059bc37ffc2825b83a1659200bf12c.tar.bz2
plugin-402cbb4310059bc37ffc2825b83a1659200bf12c.tar.xz
plugin-402cbb4310059bc37ffc2825b83a1659200bf12c.zip
Add item_db attributes for limit item usage.
Added attributesRequiredStr, RequiredAgi, RequiredVit, RequiredInt, RequiredDex, RequiredLuk. Check this attributes before equip item.
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 6fb9f02..fcce487 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -52,6 +52,18 @@ void eitemdb_readdb_additional_fields(int *itemid,
data->floorLifeTime = i32;
if ((t = libconfig->setting_get_member(it, "AllowPickup")))
data->allowPickup = libconfig->setting_get_bool(t) ? 1 : 0;
+ if (libconfig->setting_lookup_int(it, "RequiredStr", &i32) && i32 >= 0)
+ data->requiredStr = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredAgi", &i32) && i32 >= 0)
+ data->requiredAgi = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredVit", &i32) && i32 >= 0)
+ data->requiredVit = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredInt", &i32) && i32 >= 0)
+ data->requiredInt = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredDex", &i32) && i32 >= 0)
+ data->requiredDex = i32;
+ if (libconfig->setting_lookup_int(it, "RequiredLuk", &i32) && i32 >= 0)
+ data->requiredLuk = i32;
hookStop();
}