summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
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;
+}