summaryrefslogtreecommitdiff
path: root/src/emap/itemdb.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-08 00:13:58 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-08 00:13:58 +0300
commitc3262df069c597bd3c56e167cadc077c077d0096 (patch)
treea9e1cee57703634384b543bd0bf6531e364391ce /src/emap/itemdb.c
parent60bc3c265d6633a6f8e98160184d97d362c89a96 (diff)
downloadevol-hercules-c3262df069c597bd3c56e167cadc077c077d0096.tar.gz
evol-hercules-c3262df069c597bd3c56e167cadc077c077d0096.tar.bz2
evol-hercules-c3262df069c597bd3c56e167cadc077c077d0096.tar.xz
evol-hercules-c3262df069c597bd3c56e167cadc077c077d0096.zip
Add support for identified attribute in item_db.conf.s20180313
This attribute set on dropped equipment by mobs. Default value true.
Diffstat (limited to 'src/emap/itemdb.c')
-rw-r--r--src/emap/itemdb.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/emap/itemdb.c b/src/emap/itemdb.c
index eefb4b1..d9ff7d8 100644
--- a/src/emap/itemdb.c
+++ b/src/emap/itemdb.c
@@ -12,6 +12,7 @@
#include "common/db.h"
#include "common/memmgr.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/socket.h"
#include "common/strlib.h"
#include "map/itemdb.h"
@@ -93,6 +94,8 @@ void eitemdb_readdb_additional_fields_pre(int *itemid,
data->requiredSkill = i32;
if (libconfig->setting_lookup_bool(it, "Charm", &i32) && i32 >= 0)
data->charmItem = i32 ? true : false;
+ if (libconfig->setting_lookup_bool(it, "Identified", &i32) && i32 >= 0)
+ data->identified = i32 ? true : false;
if ((t = libconfig->setting_get_member(it, "MaxFloorOffset")))
{
if (config_setting_is_aggregate(t))
@@ -213,3 +216,24 @@ void edestroy_item_data_pre(struct item_data **selfPtr,
VECTOR_CLEAR(data->allowedCards);
VECTOR_CLEAR(data->allowedAmmo);
}
+
+int eitemdb_isidentified(int nameid)
+{
+ struct item_data *item = itemdb->exists(nameid);
+ nullpo_ret(item);
+
+ struct ItemdExt *data = itemd_get(item);
+ if (!data)
+ return 0;
+ return data->identified;
+}
+
+int eitemdb_isidentified2(struct item_data *item)
+{
+ nullpo_ret(item);
+
+ struct ItemdExt *data = itemd_get(item);
+ if (!data)
+ return 0;
+ return data->identified;
+}