* Simplified exp gain equations (now more FPU-friendly and precise), also fixes the uninitialized variable problem

* Corrected one exp calculation overflow (mainly affected high-rate pk servers)
* Fixed Neuralizer item script typo

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10921 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2007-07-27 19:06:40 +00:00
parent 43e5652fb6
commit 0711d4375e
6 changed files with 106 additions and 124 deletions

View File

@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/07/27
* Simplified exp gain equations (now more FPU-friendly and precise)
- also fixes the uninitialized variable problem... sorry 'bout that >.>
* Changed the way hit bonus is applied.
http://www.eathena.ws/board/index.php?showtopic=157438 [Vicious]
* Cleaned up mob drop code, crashfix is still needed though...

View File

@ -48,6 +48,8 @@
13107 Western_Outlaw Need correct HIT and ASPD Rate
----
========================
07/27
* Fixed Neuralizer item script typo [ultramage]
07/26
* Rev. 10917 Updated Cash Shop Skill Scrolls to behave more like official scrolls. [L0ne_W0lf]
- Kafra Card, Neuralizer, Giant Fly Wing and Dungeon teleport scroll now call functions.

View File

@ -2919,7 +2919,7 @@
12210,Bubble_Gum,Bubble Gum,3,,,10,,,,,,,,,,,,,{},{},{}
12211,Kafra_Card,Kafra Card,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashStore"; },{},{}
12212,Giant_Fly_Wing,Giant Fly Wing,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashPartyCall"; },{},{}
12213,Neuralizer,Neuralizer,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "C_CashReset"; },{},{}
12213,Neuralizer,Neuralizer,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashReset"; },{},{}
12214,Convex_Mirror,Convex Mirror,3,20,,10,,,,,,,,,,,,,{},{},{}
12215,Blessing_10_Scroll,LV10 Blessing Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ skilleffect 34,0; sc_start SC_BLESSING,600000,10; },{},{}
12216,Inc_Agi_10_Scroll,LV10 Agil Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ skilleffect 29,0; sc_start SC_INCREASEAGI,600000,10; },{},{}

View File

@ -1815,7 +1815,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
int flag=1,zeny=0;
unsigned int base_exp, job_exp;
double per; //Your share of the mob's exp
double jper; //For the job-exp
int bonus; //Bonus on top of your share.
if (!tmpsd[i]) continue;
@ -1856,28 +1855,16 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(md->db->mexp > 0)
zeny*=rand()%250;
}
jper = per;
if (map[m].flag.nobaseexp || !md->db->base_exp)
base_exp = 0;
else {
if (map[m].bexp != 100)
temp = map[m].bexp*bonus/100;
if (temp != 100)
per = per*temp/100.;
else
base_exp = (unsigned int)cap_value(md->db->base_exp * per * bonus/100. * map[m].bexp/100., 1, UINT_MAX);
base_exp = (unsigned int)cap_value(md->db->base_exp * per, 1, UINT_MAX);
}
if (map[m].flag.nojobexp || !md->db->job_exp || md->dmglog[i].flag) //Homun earned job-exp is always lost.
job_exp = 0;
else {
if (map[m].jexp != 100)
temp = map[m].jexp*bonus/100;
if (temp != 100)
jper = jper*temp/100.;
job_exp = (unsigned int)cap_value(md->db->job_exp * jper, 1, UINT_MAX);
}
else
job_exp = (unsigned int)cap_value(md->db->job_exp * per * bonus/100. * map[m].jexp/100., 1, UINT_MAX);
if((temp = tmpsd[i]->status.party_id )>0 && !md->dmglog[i].flag) //Homun-done damage (flag 1) is not given to party
{

View File

@ -4230,17 +4230,8 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi
if (!bonus)
return;
temp = *base_exp*bonus/100;
if (*base_exp > UINT_MAX - temp)
*base_exp = UINT_MAX;
else
*base_exp += temp;
temp = *job_exp*bonus/100;
if (*job_exp > UINT_MAX - temp)
*job_exp = UINT_MAX;
else
*job_exp += temp;
*base_exp += (unsigned int) cap_value((double)*base_exp * bonus/100., 1, UINT_MAX);
*job_exp += (unsigned int) cap_value((double)*job_exp * bonus/100., 1, UINT_MAX);
return;
}