diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-18 14:13:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-18 14:13:09 +0300 |
commit | 0846b3e83759b42d8d5abea155605d7bcc0c2e22 (patch) | |
tree | 1e791a8b2a0b7a9dc2b503474c4f041a2076c777 /src/map/map.c | |
parent | da93a53f7630a62f342f51743d63914f3ea5f266 (diff) | |
download | plugin-0846b3e83759b42d8d5abea155605d7bcc0c2e22.tar.gz plugin-0846b3e83759b42d8d5abea155605d7bcc0c2e22.tar.bz2 plugin-0846b3e83759b42d8d5abea155605d7bcc0c2e22.tar.xz plugin-0846b3e83759b42d8d5abea155605d7bcc0c2e22.zip |
Impliment FloorLifeTime in item_db.conf
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 43 |
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; +} |