From abd68f2f5452c236ee5d023048c38f09764c3cd4 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Wed, 2 Mar 2011 11:55:27 +0000 Subject: * Updates to the super novice's guardian angel prayer effect and related handling code. - Removed the server-side chat tracking code (since r492) responsible for invoking the effect, since this functionality is handled by the client (invocation also processed by the server). This also fixes the missing 7 lines requirement on the server-side handling (bugreport:4786). - Updated the checks in the client-invoked code part and documented the packet. - Now only the prayer in client-side data\msgstringtable.txt (lines 791~794) applies. - The prayer is no longer blocked by noskill-restrictions. - Exp at 0% and 100% no longer causes the effect to trigger. - Fixed the exp percent check to also check one digit after the decimal point (requirement is 10.0% not 10%). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14729 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 75 +++++++++++++++++++--------------------------------------- 1 file changed, 24 insertions(+), 51 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 0c7dc16b2..54e7f7737 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8861,41 +8861,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl); #endif - // check for special supernovice phrase - if( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE ) - { - unsigned int next = pc_nextbaseexp(sd); - if( next == 0 ) next = pc_thisbaseexp(sd); - if( get_percentage(sd->status.base_exp, next)% 10 == 0 ) // 0%, 10%, 20%, ... - { - switch (sd->state.snovice_call_flag) { - case 0: - if( strstr(message, msg_txt(504)) ) // "Guardian Angel, can you hear my voice? ^^;" - sd->state.snovice_call_flag++; - break; - case 1: { - char buf[256]; - sprintf(buf, msg_txt(505), sd->status.name); - if( strstr(message, buf) ) // "My name is %s, and I'm a Super Novice~" - sd->state.snovice_call_flag++; - } - break; - case 2: - if( strstr(message, msg_txt(506)) ) // "Please help me~ T.T" - sd->state.snovice_call_flag++; - break; - case 3: - if( skillnotok(MO_EXPLOSIONSPIRITS,sd) ) - break; //Do not override the noskill mapflag. [Skotlex] - clif_skill_nodamage(&sd->bl,&sd->bl,MO_EXPLOSIONSPIRITS,-1, - sc_start(&sd->bl,status_skill2sc(MO_EXPLOSIONSPIRITS),100, - 17,skill_get_time(MO_EXPLOSIONSPIRITS,1))); //Lv17-> +50 critical (noted by Poki) [Skotlex] - sd->state.snovice_call_flag = 0; - break; - } - } - } - // Chat logging type 'O' / Global Chat if( log_config.chat&1 || (log_config.chat&2 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("O", 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); @@ -11835,28 +11800,36 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) } return; } -/*========================================== - * ƒXƒpƒmƒr‚Ì”š—ô”g“® - *------------------------------------------*/ + + +/// Request to invoke the effect of super novice's guardian angel prayer (CZ_CHOPOKGI) +/// 01ed +/// Note: This packet is caused by 7 lines of any text, followed by +/// the prayer and an another line of any text. The prayer is +/// defined by lines 791~794 in data\msgstringtable.txt +/// "Dear angel, can you hear my voice?" +/// "I am" (space separated player name) "Super Novice~" +/// "Help me out~ Please~ T_T" void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd) { - if(sd){ - int nextbaseexp=pc_nextbaseexp(sd); - if (battle_config.etc_log){ - if(nextbaseexp != 0) - ShowInfo("SuperNovice explosionspirits!! %d %d %d %d\n",sd->bl.id,sd->status.class_,sd->status.base_exp,(int)((double)1000*sd->status.base_exp/nextbaseexp)); - else - ShowInfo("SuperNovice explosionspirits!! %d %d %d 000\n",sd->bl.id,sd->status.class_,sd->status.base_exp); - } - if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_exp > 0 && nextbaseexp > 0 && (int)((double)1000*sd->status.base_exp/nextbaseexp)%100==0){ - clif_skill_nodamage(&sd->bl,&sd->bl,MO_EXPLOSIONSPIRITS,5, - sc_start(&sd->bl,status_skill2sc(MO_EXPLOSIONSPIRITS),100, - 5,skill_get_time(MO_EXPLOSIONSPIRITS,5))); + if( ( sd->class_&MAPID_UPPERMASK ) == MAPID_SUPER_NOVICE ) + { + unsigned int next = pc_nextbaseexp(sd); + + if( next ) + { + int percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. ); + + if( percent && ( percent%100 ) == 0 ) + {// 10.0%, 20.0%, ..., 90.0% + sc_start(&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 + } } } - return; } + /*========================================== * Friends List *------------------------------------------*/ -- cgit v1.2.3-70-g09d2