summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-02 11:55:27 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-02 11:55:27 +0000
commitabd68f2f5452c236ee5d023048c38f09764c3cd4 (patch)
treeeaf8c41a1e4eaa8ee18654c1c29f1f5354054518 /src
parent9d99ade0a1022ea09287d11c6f3f67b06d5c87f2 (diff)
downloadhercules-abd68f2f5452c236ee5d023048c38f09764c3cd4.tar.gz
hercules-abd68f2f5452c236ee5d023048c38f09764c3cd4.tar.bz2
hercules-abd68f2f5452c236ee5d023048c38f09764c3cd4.tar.xz
hercules-abd68f2f5452c236ee5d023048c38f09764c3cd4.zip
* 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
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c75
-rw-r--r--src/map/pc.h1
2 files changed, 24 insertions, 52 deletions
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
*------------------------------------------*/
diff --git a/src/map/pc.h b/src/map/pc.h
index 328e43047..4b176b659 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -105,7 +105,6 @@ struct map_session_data {
unsigned gangsterparadise : 1;
unsigned rest : 1;
unsigned storage_flag : 2; //0: closed, 1: Normal Storage open, 2: guild storage open [Skotlex]
- unsigned snovice_call_flag : 2; //Summon Angel (stage 1~3)
unsigned snovice_dead_flag : 1; //Explosion spirits on death: 0 off, 1 used.
unsigned abra_flag : 1; // Abracadabra bugfix by Aru
unsigned autocast : 1; // Autospell flag [Inkfish]