From 260655a3c49e3c1dc1521312379c82eb4b5e3702 Mon Sep 17 00:00:00 2001 From: Playtester Date: Sun, 25 Dec 2016 20:02:07 +0100 Subject: [PATCH] Songs and Dances vs. Dispell and Vanishing Buster (fixes #1824) * Songs and Dances can no longer be dispelled by Dispell and Vanishing Buster * Added a configuration to simulate the old behavior: Dispelling works if target not inside song area --- conf/battle/skill.conf | 5 +++++ src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/skill.c | 19 +++++++++---------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index 086e330468..c1e61962a2 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -358,3 +358,8 @@ can_damage_skill: 1 // 7%: CHARIOT | 6%: THE HANGED MAN | 5%: DEATH, STAR | 2%: TOWER | 1%: WHEEL OF FORTUNE, DEVIL // If you set this to "yes", the chance for each card becomes 1/14. tarotcard_equal_chance: no + +// Should Dispel work on songs when the target is not in the song area? (Note 1) +// On official servers, it's impossible to dispel songs. +// Hint: Also affects the Rebellion skill "Vanishing Buster". +dispel_song: no diff --git a/src/map/battle.c b/src/map/battle.c index ff5010b08f..9244178d6a 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -8383,6 +8383,7 @@ static const struct _battle_data { { "block_account_in_same_party", &battle_config.block_account_in_same_party, 1, 0, 1, }, { "tarotcard_equal_chance", &battle_config.tarotcard_equal_chance, 0, 0, 1, }, { "change_party_leader_samemap", &battle_config.change_party_leader_samemap, 1, 0, 1, }, + { "dispel_song", &battle_config.dispel_song, 0, 0, 1, }, #include "../custom/battle_config_init.inc" }; diff --git a/src/map/battle.h b/src/map/battle.h index 697642f8af..0d97466601 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -614,6 +614,7 @@ extern struct Battle_Config int block_account_in_same_party; int tarotcard_equal_chance; //Official or equal chance for each card int change_party_leader_samemap; + int dispel_song; //Can songs be dispelled? #include "../custom/battle_config_struct.inc" } battle_config; diff --git a/src/map/skill.c b/src/map/skill.c index a79d49ce7a..2c39f22ef5 100755 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1830,8 +1830,8 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 case SC_WHISTLE: case SC_ASSNCROS: case SC_POEMBRAGI: case SC_APPLEIDUN: case SC_HUMMING: case SC_DONTFORGETME: case SC_FORTUNE: case SC_SERVICE4U: - if(tsc->data[i]->val4==0) - continue; //if in song-area don't end it + if (!battle_config.dispel_song || tsc->data[i]->val4 == 0) + continue; //If in song area don't end it, even if config enabled break; case SC_ASSUMPTIO: if( bl->type == BL_MOB ) @@ -7903,7 +7903,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui case SC_CROSSBOWCLAN: case SC_JUMPINGCLAN: continue; - //bugreport:4888 these songs may only be dispelled if you're not in their song area anymore case SC_WHISTLE: case SC_ASSNCROS: case SC_POEMBRAGI: @@ -7912,13 +7911,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui case SC_DONTFORGETME: case SC_FORTUNE: case SC_SERVICE4U: - if(tsc->data[i]->val4==0) - continue; //if in song-area don't end it - break; - case SC_ASSUMPTIO: - if( bl->type == BL_MOB ) - continue; - break; + if (!battle_config.dispel_song || tsc->data[i]->val4 == 0) + continue; //If in song area don't end it, even if config enabled + break; + case SC_ASSUMPTIO: + if( bl->type == BL_MOB ) + continue; + break; } if(i == SC_BERSERK) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0. status_change_end(bl, (sc_type)i, INVALID_TIMER);