summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-12-17 23:42:42 +0100
committerHaru <haru@dotalux.com>2017-12-17 23:42:42 +0100
commita6822ed0303480a8be24dc68f2c4b250cc1b2791 (patch)
tree8694b5c192bf9613bf44d9fc937373ec5411bdae
parent7761f8e9f9c5db58ac8b12eb0a44059fe7c1ae63 (diff)
parente259ba1a0f508d11a525fb5bde1d03bf2948ff9b (diff)
downloadhercules-a6822ed0303480a8be24dc68f2c4b250cc1b2791.tar.gz
hercules-a6822ed0303480a8be24dc68f2c4b250cc1b2791.tar.bz2
hercules-a6822ed0303480a8be24dc68f2c4b250cc1b2791.tar.xz
hercules-a6822ed0303480a8be24dc68f2c4b250cc1b2791.zip
Merge pull request #1925 from MishimaHaruna/slowpoison
Natural expiration of Poison when under Slow Poison effect
-rw-r--r--src/map/status.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/map/status.c b/src/map/status.c
index ddb8c7e6a..9e578bc12 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -11546,24 +11546,26 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data)
break;
case SC_POISON:
- if(st->hp <= max(st->max_hp>>2, sce->val4)) //Stop damaging after 25% HP left.
+ if (st->hp <= max(st->max_hp / 4, sce->val4)) //Stop damaging after 25% HP left.
break;
FALLTHROUGH
case SC_DPOISON:
if (--(sce->val3) > 0) {
- if (!sc->data[SC_SLOWPOISON]) {
- if( sce->val2 && bl->type == BL_MOB ) {
- struct block_list* src = map->id2bl(sce->val2);
- if (src != NULL)
- mob->log_damage(BL_UCAST(BL_MOB, bl), src, sce->val4);
- }
- map->freeblock_lock();
- status_zap(bl, sce->val4, 0);
- if (sc->data[type]) { // Check if the status still last ( can be dead since then ).
- sc_timer_next(1000 + tick, status->change_timer, bl->id, data );
- }
- map->freeblock_unlock();
+ if (sc->data[SC_SLOWPOISON] != NULL) {
+ sc_timer_next(1000 + tick, status->change_timer, bl->id, data);
+ return 0;
}
+ if (sce->val2 != 0 && bl->type == BL_MOB) {
+ struct block_list* src = map->id2bl(sce->val2);
+ if (src != NULL)
+ mob->log_damage(BL_UCAST(BL_MOB, bl), src, sce->val4);
+ }
+ map->freeblock_lock();
+ status_zap(bl, sce->val4, 0);
+ if (sc->data[type] != NULL) { // Check if the status still last (can be dead since then).
+ sc_timer_next(1000 + tick, status->change_timer, bl->id, data);
+ }
+ map->freeblock_unlock();
return 0;
}
break;