summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-04-21 21:20:29 +0200
committerHaru <haru@dotalux.com>2016-04-23 09:52:30 +0200
commit235a8d18f8cbbb5aaf7563566ff68f15fc1054c1 (patch)
treef090523acfc78e49804f4acc175ed6afe844174b /src/map/clif.c
parent2dc732fe12f9748a2601f06ea8e4c2848de4b6f1 (diff)
downloadhercules-235a8d18f8cbbb5aaf7563566ff68f15fc1054c1.tar.gz
hercules-235a8d18f8cbbb5aaf7563566ff68f15fc1054c1.tar.bz2
hercules-235a8d18f8cbbb5aaf7563566ff68f15fc1054c1.tar.xz
hercules-235a8d18f8cbbb5aaf7563566ff68f15fc1054c1.zip
Split supernovice angel call message detection to its own function
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e1b4be8f4..64e652252 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9743,37 +9743,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE ) {
- unsigned int next = pc->nextbaseexp(sd);
- if( next == 0 ) next = pc->thisbaseexp(sd);
- if( next ) { // 0%, 10%, 20%, ...
- int percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. );
- if( (battle_config.snovice_call_type || percent) && ( percent%100 ) == 0 ) {// 10.0%, 20.0%, ..., 90.0%
- switch (sd->state.snovice_call_flag) {
- case 0:
- if( strstr(message, msg_txt(1479)) ) // "Dear angel, can you hear my voice?"
- sd->state.snovice_call_flag = 1;
- break;
- case 1: {
- char buf[256];
- snprintf(buf, 256, msg_txt(1480), sd->status.name);
- if( strstr(message, buf) ) // "I am %s Super Novice~"
- sd->state.snovice_call_flag = 2;
- }
- break;
- case 2:
- if( strstr(message, msg_txt(1481)) ) // "Help me out~ Please~ T_T"
- sd->state.snovice_call_flag = 3;
- break;
- case 3:
- sc_start(NULL,&sd->bl, status->skill2sc(MO_EXPLOSIONSPIRITS), 100, 17, skill->get_time(MO_EXPLOSIONSPIRITS, 5)); //Lv17-> +50 critical (noted by Poki) [Skotlex]
- clif->skill_nodamage(&sd->bl, &sd->bl, MO_EXPLOSIONSPIRITS, 5, 1); // prayer always shows successful Lv5 cast and disregards noskill restrictions
- sd->state.snovice_call_flag = 0;
- break;
- }
- }
- }
- }
+ pc->check_supernovice_call(sd, message);
pc->update_idle_time(sd, BCIDLE_CHAT);