diff options
author | Haru <haru@dotalux.com> | 2020-04-20 21:17:25 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-05-04 02:10:25 +0200 |
commit | bfa423fea55aa5659506cf85e6c418346804ac89 (patch) | |
tree | efd3809adcc899e92de16df032b12d34ca7e177e /src/map/skill.c | |
parent | 595dae284856bcf442274b39b63cce8746687c13 (diff) | |
download | hercules-bfa423fea55aa5659506cf85e6c418346804ac89.tar.gz hercules-bfa423fea55aa5659506cf85e6c418346804ac89.tar.bz2 hercules-bfa423fea55aa5659506cf85e6c418346804ac89.tar.xz hercules-bfa423fea55aa5659506cf85e6c418346804ac89.zip |
Refactor the Bard/Dancer Soul Link temporary skill granting code
The code no longer relies on invalid assumptions about the mapping between skill IDs and indices
Fixes #2670
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 0fcd5fd0c..2fae7e7f9 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -10938,6 +10938,37 @@ static int skill_count_wos(struct block_list *bl, va_list ap) return 0; } +/** + * Returns the linked song/dance skill ID, if any (for the Bard/Dancer Soul Link). + * + * @param skill_id The skill ID to look up + * + * @return The linked song or dance's skill ID if any + * @retval 0 if the given skill_id doesn't have a linked skill ID + */ +static int skill_get_linked_song_dance_id(int skill_id) +{ + switch (skill_id) { + case BA_WHISTLE: + return DC_HUMMING; + case BA_ASSASSINCROSS: + return DC_DONTFORGETME; + case BA_POEMBRAGI: + return DC_FORTUNEKISS; + case BA_APPLEIDUN: + return DC_SERVICEFORYOU; + case DC_HUMMING: + return BA_WHISTLE; + case DC_DONTFORGETME: + return BA_ASSASSINCROSS; + case DC_FORTUNEKISS: + return BA_POEMBRAGI; + case DC_SERVICEFORYOU: + return BA_APPLEIDUN; + } + return 0; +} + /*========================================== * *------------------------------------------*/ @@ -21812,4 +21843,5 @@ void skill_defaults(void) skill->splash_target = skill_splash_target; skill->check_npc_chaospanic = skill_check_npc_chaospanic; skill->count_wos = skill_count_wos; + skill->get_linked_song_dance_id = skill_get_linked_song_dance_id; } |