From f36f01ba8099a741c3eb86076d3bc1f89d758e52 Mon Sep 17 00:00:00 2001 From: csnv Date: Thu, 11 Sep 2014 19:07:54 +0200 Subject: Added option for song timers behaviour. Fixes bug 8265 - Fixes bug 8265: http://hercules.ws/board/tracker/issue-8265-bragis-poem-overlapped-20-seconds-effect/ - Added setting in /conf/battle/skill.conf song_timer_reset: switch between official behaviour (songs don't reset time from prior songs) or eathena (every song resets the timer) --- src/map/skill.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 3e3a6507a..9046ff975 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11458,13 +11458,15 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick return 0; if (!sc) return 0; - if (!sce) - sc_start4(ss,bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit); - else if (sce->val4 == 1) { - //Readjust timers since the effect will not last long. - sce->val4 = 0; - timer->delete(sce->timer, status->change_timer); - sce->timer = timer->add(tick+sg->limit, status->change_timer, bl->id, type); + if (battle_config.song_timer_reset) { // Aegis like behaviour goes on skill_unit_onplace_timer + if (!sce) + sc_start4(ss,bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit); + else if (sce->val4 == 1) { + //Readjust timers since the effect will not last long. + sce->val4 = 0; + timer->delete(sce->timer, status->change_timer); + sce->timer = timer->add(tick+sg->limit, status->change_timer, bl->id, type); + } } break; @@ -11848,6 +11850,12 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 heal = ~heal + 1; clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1); status->heal(bl, heal, 0, 0); + + if (!(battle_config.song_timer_reset) // songs don't reset prior timers + && !(sg->src_id == bl->id && !(tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_BARDDANCER)) // Don't affect itself + && (!(tsc->data[type]) || (tsc->data[type] && tsc->data[type]->val4 != 1))) // Check for 20 seconds song effect + sc_start4(ss,bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->interval + 100); + break; } @@ -12362,7 +12370,7 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) { case DC_DONTFORGETME: case DC_FORTUNEKISS: case DC_SERVICEFORYOU: - if (sce) { + if ((battle_config.song_timer_reset && sce) || (!battle_config.song_timer_reset && sce && sce->val4 != 1)) { timer->delete(sce->timer, status->change_timer); //NOTE: It'd be nice if we could get the skill_lv for a more accurate extra time, but alas... //not possible on our current implementation. -- cgit v1.2.3-70-g09d2