diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | conf/battle/exp.conf | 2 | ||||
-rw-r--r-- | db/packet_db.txt | 2 | ||||
-rw-r--r-- | src/map/clif.c | 26 | ||||
-rw-r--r-- | src/map/clif.h | 1 | ||||
-rw-r--r-- | src/map/mob.c | 4 | ||||
-rw-r--r-- | src/map/npc.c | 4 | ||||
-rw-r--r-- | src/map/party.c | 2 | ||||
-rw-r--r-- | src/map/pc.c | 11 | ||||
-rw-r--r-- | src/map/pc.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 6 |
12 files changed, 49 insertions, 15 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 42e22f760..bee9eefda 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,8 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2010/02/06 + * Added official packet to display received expirience. [Inkfish] 2010/01/30 * Added support for PACKETVER 20100105, which updates the vending related packets on this and later clients. [Skotlex] 2010/01/28 diff --git a/conf/battle/exp.conf b/conf/battle/exp.conf index f3d438ea2..7e9675ed2 100644 --- a/conf/battle/exp.conf +++ b/conf/battle/exp.conf @@ -92,7 +92,7 @@ death_penalty_job: 100 zeny_penalty: 0 // Will display experience gained from killing a monster. (Note 1) -disp_experience: no +disp_experience: yes // Will display zeny earned (from mobs, trades, etc) (Note 1) disp_zeny: no diff --git a/db/packet_db.txt b/db/packet_db.txt index ceefde5a9..db9863860 100644 --- a/db/packet_db.txt +++ b/db/packet_db.txt @@ -1428,7 +1428,7 @@ packet_ver: 25 //2009-10-27aRagexeRE //0x07f5,6 -//0x07f6,14 +0x07f6,14 //2009-11-03aRagexeRE //0x07f7,0 diff --git a/src/map/clif.c b/src/map/clif.c index ab43524e8..f9fd3ffca 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -13455,6 +13455,30 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat #endif } +// Display gain exp +// type = 1 -> base_exp +// type = 2 -> job_exp +// flag = 0 -> normal exp gain/lost +// flag = 1 -> quest exp gain/lost +void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool quest) +{ + int fd; + + nullpo_retv(sd); + + fd = sd->fd; + + WFIFOHEAD(fd, packet_len(0x7f6)); + WFIFOW(fd,0) = 0x7f6; + WFIFOL(fd,2) = sd->bl.id; + WFIFOL(fd,6) = exp; + WFIFOW(fd,10) = type; + WFIFOW(fd,12) = quest?1:0;// Normal exp is shown in yellow, quest exp is shown in purple. + WFIFOSET(fd,packet_len(0x7f6)); + + return; +} + /*========================================== * パケットデバッグ *------------------------------------------*/ @@ -13846,7 +13870,7 @@ static int packetdb_readdb(void) 6, 2, -1, 4, 4, 4, 4, 8, 8,268, 6, 8, 6, 54, 30, 54, #endif 0, 0, 0, 0, 0, 8, 8, 32, -1, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, //#0x800 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; diff --git a/src/map/clif.h b/src/map/clif.h index 512be8c3d..2a7007e2b 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -413,6 +413,7 @@ void clif_quest_delete(struct map_session_data * sd, int quest_id); void clif_quest_update_status(struct map_session_data * sd, int quest_id, bool active); void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd, int index); void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, short state, short color); +void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool quest); int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type); int do_final_clif(void); diff --git a/src/map/mob.c b/src/map/mob.c index 803453718..de9b66ba1 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2151,7 +2151,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if(base_exp || job_exp) { if( md->dmglog[i].flag != 2 || battle_config.pet_attack_exp_to_master ) - pc_gainexp(tmpsd[i], &md->bl, base_exp, job_exp); + pc_gainexp(tmpsd[i], &md->bl, base_exp, job_exp, false); } if(zeny) // zeny from mobs [Valaris] pc_getzeny(tmpsd[i], zeny); @@ -2320,7 +2320,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) clif_mvp_effect(mvp_sd); clif_mvp_exp(mvp_sd,mexp); - pc_gainexp(mvp_sd, &md->bl, mexp,0); + pc_gainexp(mvp_sd, &md->bl, mexp,0, false); log_mvp[1] = mexp; if(map[m].flag.nomvploot || type&1) ; //No drops. diff --git a/src/map/npc.c b/src/map/npc.c index a5512eefc..e629848fe 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1331,7 +1331,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) z = z * (double)skill * (double)battle_config.shop_exp/10000.; if( z < 1 ) z = 1; - pc_gainexp(sd,NULL,0,(int)z); + pc_gainexp(sd,NULL,0,(int)z, false); } } @@ -1404,7 +1404,7 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list) z = z * (double)skill * (double)battle_config.shop_exp/10000.; if (z < 1) z = 1; - pc_gainexp(sd,NULL,0,(int)z); + pc_gainexp(sd,NULL,0,(int)z, false); } } diff --git a/src/map/party.c b/src/map/party.c index be54455d7..207e6c297 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -906,7 +906,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b for (i = 0; i < c; i++) { - pc_gainexp(sd[i], src, base_exp, job_exp); + pc_gainexp(sd[i], src, base_exp, job_exp, false); if (zeny) // zeny from mobs [Valaris] pc_getzeny(sd[i],zeny); } diff --git a/src/map/pc.c b/src/map/pc.c index 068e6ce8f..0df3cda48 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4743,9 +4743,8 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi /*========================================== * ??値取得 *------------------------------------------*/ -int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp) +int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool quest) { - char output[256]; float nextbp=0, nextjp=0; unsigned int nextb=0, nextj=0; nullpo_retr(0, sd); @@ -4808,9 +4807,17 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int } if(sd->state.showexp){ +#if PACKETVER >= 20091027 + if(base_exp) + clif_displayexp(sd, base_exp, 1, quest); + if(job_exp) + clif_displayexp(sd, job_exp, 2, quest); +#else + char output[256]; sprintf(output, "Experience Gained Base:%u (%.2f%%) Job:%u (%.2f%%)",base_exp,nextbp*(float)100,job_exp,nextjp*(float)100); clif_disp_onlyself(sd,output,strlen(output)); +#endif } return 1; diff --git a/src/map/pc.h b/src/map/pc.h index 7a6afd78c..65d21739a 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -610,7 +610,7 @@ unsigned int pc_maxbaselv(struct map_session_data *sd); unsigned int pc_maxjoblv(struct map_session_data *sd); int pc_checkbaselevelup(struct map_session_data *sd); int pc_checkjoblevelup(struct map_session_data *sd); -int pc_gainexp(struct map_session_data*,struct block_list*,unsigned int,unsigned int); +int pc_gainexp(struct map_session_data*,struct block_list*,unsigned int,unsigned int, bool); unsigned int pc_nextbaseexp(struct map_session_data *); unsigned int pc_thisbaseexp(struct map_session_data *); unsigned int pc_nextjobexp(struct map_session_data *); diff --git a/src/map/script.c b/src/map/script.c index 6ef06c2a2..640fa6bdb 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7422,7 +7422,7 @@ BUILDIN_FUNC(getexp) base = (int) cap_value(base * bonus, 0, INT_MAX); job = (int) cap_value(job * bonus, 0, INT_MAX); - pc_gainexp(sd, NULL, base, job); + pc_gainexp(sd, NULL, base, job, true); return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index 4f991272f..336d93975 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3245,7 +3245,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in heal_get_jobexp = heal_get_jobexp * battle_config.heal_exp / 100; if (heal_get_jobexp <= 0) heal_get_jobexp = 1; - pc_gainexp (sd, bl, 0, heal_get_jobexp); + pc_gainexp (sd, bl, 0, heal_get_jobexp, false); } } break; @@ -3321,7 +3321,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (jexp < 1) jexp = 1; } if(exp > 0 || jexp > 0) - pc_gainexp (sd, bl, exp, jexp); + pc_gainexp (sd, bl, exp, jexp, false); } } } @@ -3433,7 +3433,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case SA_LEVELUP: clif_skill_nodamage(src,bl,skillid,skilllv,1); - if (sd && pc_nextbaseexp(sd)) pc_gainexp(sd, NULL, pc_nextbaseexp(sd) * 10 / 100, 0); + if (sd && pc_nextbaseexp(sd)) pc_gainexp(sd, NULL, pc_nextbaseexp(sd) * 10 / 100, 0, false); break; case SA_INSTANTDEATH: clif_skill_nodamage(src,bl,skillid,skilllv,1); |