diff options
author | csnv <ctt@csnv.es> | 2014-09-11 19:07:54 +0200 |
---|---|---|
committer | csnv <ctt@csnv.es> | 2014-09-11 19:07:54 +0200 |
commit | f36f01ba8099a741c3eb86076d3bc1f89d758e52 (patch) | |
tree | a6cfa10058dcce45089521cdc81c61496dc48c7a | |
parent | 4abf2cfb29dbca5d920b4d3fc641a60d0771f126 (diff) | |
download | hercules-f36f01ba8099a741c3eb86076d3bc1f89d758e52.tar.gz hercules-f36f01ba8099a741c3eb86076d3bc1f89d758e52.tar.bz2 hercules-f36f01ba8099a741c3eb86076d3bc1f89d758e52.tar.xz hercules-f36f01ba8099a741c3eb86076d3bc1f89d758e52.zip |
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)
-rw-r--r-- | conf/battle/skill.conf | 7 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/skill.c | 24 |
4 files changed, 25 insertions, 8 deletions
diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index 849989709..10cca4af7 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -127,6 +127,13 @@ traps_setting: 0 // one hydra out) summon_flora_setting: 3 +// When songs are canceled, terminated or the character goes out of the +// area of effect, there's an additional effect that lasts for 20 seconds +// Should that time be reset for each song? +// 0: No, you must recast the song AFTER those 20 seconds to have the effect again (Aegis) +// 1: Yes, recasting songs reset the 20 seconds timer (eathena) +song_timer_reset: 0 + // Whether placed down skills will check walls (Note 1) // (Makes it so that Storm Gust/Lord of Vermillion/etc when cast next to a wall, won't hit on the other side) skill_wall_check: yes diff --git a/src/map/battle.c b/src/map/battle.c index 30b358492..8930d3a7e 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6733,6 +6733,7 @@ static const struct battle_data { { "mail_show_status", &battle_config.mail_show_status, 0, 0, 2, }, { "client_limit_unit_lv", &battle_config.client_limit_unit_lv, 0, 0, BL_ALL, }, { "client_emblem_max_blank_percent", &battle_config.client_emblem_max_blank_percent, 100, 0, 100, }, + { "song_timer_reset", &battle_config.song_timer_reset, 0, 0, 1, }, // BattleGround Settings { "bg_update_interval", &battle_config.bg_update_interval, 1000, 100, INT_MAX, }, { "bg_flee_penalty", &battle_config.bg_flee_penalty, 20, 0, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index 8d1a3cd39..161ddebc4 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -169,6 +169,7 @@ struct Battle_Config { int emergency_call; int guild_aura; int pc_invincible_time; + int song_timer_reset; int pet_catch_rate; int pet_rename; 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. |