Skip to content

Commit

Permalink
Merge pull request #1925 from MishimaHaruna/slowpoison
Browse files Browse the repository at this point in the history
Natural expiration of Poison when under Slow Poison effect
  • Loading branch information
MishimaHaruna committed Dec 17, 2017
2 parents 7761f8e + e259ba1 commit a6822ed
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a6822ed

Please sign in to comment.