summaryrefslogtreecommitdiff
path: root/src/map/data/itemd.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-17 22:30:10 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-18 01:44:19 +0300
commit4537814684bc50d1154d9f54500c0602303ca862 (patch)
tree3307383febbe723af7fd37b45efbcb78387d301c /src/map/data/itemd.c
parentcbc5fbb5c063bfb64c2086a0e965adc60669cbdf (diff)
downloadevol-hercules-4537814684bc50d1154d9f54500c0602303ca862.tar.gz
evol-hercules-4537814684bc50d1154d9f54500c0602303ca862.tar.bz2
evol-hercules-4537814684bc50d1154d9f54500c0602303ca862.tar.xz
evol-hercules-4537814684bc50d1154d9f54500c0602303ca862.zip
Add itemdb plugin structure.
Diffstat (limited to 'src/map/data/itemd.c')
-rw-r--r--src/map/data/itemd.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/map/data/itemd.c b/src/map/data/itemd.c
new file mode 100644
index 0000000..a862617
--- /dev/null
+++ b/src/map/data/itemd.c
@@ -0,0 +1,41 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../../../common/HPMi.h"
+#include "../../../common/malloc.h"
+#include "../../../common/mmo.h"
+#include "../../../common/socket.h"
+#include "../../../common/strlib.h"
+#include "../../../map/battle.h"
+#include "../../../map/itemdb.h"
+
+#include "map/data/itemd.h"
+#include "map/struct/itemdext.h"
+
+struct ItemdExt *itemd_get(struct item_data *item)
+{
+ if (!item)
+ return NULL;
+
+ struct ItemdExt *data = getFromITEMDATA(item, 0);
+ if (!data)
+ {
+ data = itemd_create();
+ addToITEMDATA(item, data, 0, true);
+ }
+ return data;
+}
+
+struct ItemdExt *itemd_create(void)
+{
+ struct ItemdExt *data = NULL;
+ CREATE(data, struct ItemdExt, 1);
+ if (!data)
+ return NULL;
+ data->floorLifeTime = battle->bc->flooritem_lifetime;
+ return data;
+}