summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-18 14:13:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-18 14:13:09 +0300
commit0846b3e83759b42d8d5abea155605d7bcc0c2e22 (patch)
tree1e791a8b2a0b7a9dc2b503474c4f041a2076c777 /src/map/map.c
parentda93a53f7630a62f342f51743d63914f3ea5f266 (diff)
downloadevol-hercules-0846b3e83759b42d8d5abea155605d7bcc0c2e22.tar.gz
evol-hercules-0846b3e83759b42d8d5abea155605d7bcc0c2e22.tar.bz2
evol-hercules-0846b3e83759b42d8d5abea155605d7bcc0c2e22.tar.xz
evol-hercules-0846b3e83759b42d8d5abea155605d7bcc0c2e22.zip
Impliment FloorLifeTime in item_db.conf
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
new file mode 100644
index 0000000..08ad216
--- /dev/null
+++ b/src/map/map.c
@@ -0,0 +1,43 @@
+// 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 "../../../common/timer.h"
+#include "../../../map/battle.h"
+#include "../../../map/itemdb.h"
+#include "../../../map/map.h"
+
+#include "map/data/itemd.h"
+#include "map/struct/itemdext.h"
+
+int emap_addflooritem_post(int retVal,
+ struct item *item,
+ int *amount __attribute__ ((unused)),
+ int16 *m __attribute__ ((unused)),
+ int16 *x __attribute__ ((unused)),
+ int16 *y __attribute__ ((unused)),
+ int *first_charid __attribute__ ((unused)),
+ int *second_charid __attribute__ ((unused)),
+ int *third_charid __attribute__ ((unused)),
+ int *flags __attribute__ ((unused)))
+{
+ struct flooritem_data* fitem = (struct flooritem_data*)idb_get(map->id_db, retVal);
+ if (fitem->cleartimer != INVALID_TIMER)
+ {
+ int timeout = battle->bc->flooritem_lifetime;
+ struct ItemdExt *data = itemd_get_by_item(item);
+ if (data)
+ timeout = data->floorLifeTime;
+ timer->delete(fitem->cleartimer, map->clearflooritem_timer);
+ fitem->cleartimer = timer->add(timer->gettick() + timeout, map->clearflooritem_timer, fitem->bl.id, 0);
+ }
+ return retVal;
+}