Adjust EXP storage to uint64 (#4377)
* Updates EXP table to 200/70 * Always store exp as uint64 no matter the client date. * Adjusts guild exp to uint64. Co-authored-by: Aleos <aleos89@users.noreply.github.com> Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
@@ -65,6 +65,16 @@ static inline uint32 client_tick( t_tick tick ){
|
||||
return (uint32)tick;
|
||||
}
|
||||
|
||||
#if PACKETVER >= 20170830
|
||||
static inline int64 client_exp(t_exp exp) {
|
||||
return (int64)u64min(exp, MAX_EXP);
|
||||
}
|
||||
#else
|
||||
static inline int32 client_exp(t_exp exp) {
|
||||
return (int32)u64min(exp, MAX_EXP);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* for clif_clearunit_delayed */
|
||||
static struct eri *delay_clearunit_ers;
|
||||
|
||||
@@ -3357,40 +3367,40 @@ void clif_updatestatus(struct map_session_data *sd,int type)
|
||||
#if PACKETVER >= 20170830
|
||||
case SP_BASEEXP:
|
||||
WFIFOW(fd,0)=0xacb;
|
||||
WFIFOQ(fd,4)=sd->status.base_exp;
|
||||
WFIFOQ(fd,4)=client_exp(sd->status.base_exp);
|
||||
len = packet_len(0xacb);
|
||||
break;
|
||||
case SP_JOBEXP:
|
||||
WFIFOW(fd,0)=0xacb;
|
||||
WFIFOQ(fd,4)=sd->status.job_exp;
|
||||
WFIFOQ(fd,4)=client_exp(sd->status.job_exp);
|
||||
len = packet_len(0xacb);
|
||||
break;
|
||||
case SP_NEXTBASEEXP:
|
||||
WFIFOW(fd,0)=0xacb;
|
||||
WFIFOQ(fd,4)=pc_nextbaseexp(sd);
|
||||
WFIFOQ(fd,4)=client_exp(pc_nextbaseexp(sd));
|
||||
len = packet_len(0xacb);
|
||||
break;
|
||||
case SP_NEXTJOBEXP:
|
||||
WFIFOW(fd,0)=0xacb;
|
||||
WFIFOQ(fd,4)=pc_nextjobexp(sd);
|
||||
WFIFOQ(fd,4)=client_exp(pc_nextjobexp(sd));
|
||||
len = packet_len(0xacb);
|
||||
break;
|
||||
#else
|
||||
case SP_BASEEXP:
|
||||
WFIFOW(fd,0)=0xb1;
|
||||
WFIFOL(fd,4)=sd->status.base_exp;
|
||||
WFIFOL(fd,4)=client_exp(sd->status.base_exp);
|
||||
break;
|
||||
case SP_JOBEXP:
|
||||
WFIFOW(fd,0)=0xb1;
|
||||
WFIFOL(fd,4)=sd->status.job_exp;
|
||||
WFIFOL(fd,4)=client_exp(sd->status.job_exp);
|
||||
break;
|
||||
case SP_NEXTBASEEXP:
|
||||
WFIFOW(fd,0)=0xb1;
|
||||
WFIFOL(fd,4)=pc_nextbaseexp(sd);
|
||||
WFIFOL(fd,4)= client_exp(pc_nextbaseexp(sd));
|
||||
break;
|
||||
case SP_NEXTJOBEXP:
|
||||
WFIFOW(fd,0)=0xb1;
|
||||
WFIFOL(fd,4)=pc_nextjobexp(sd);
|
||||
WFIFOL(fd,4)= client_exp(pc_nextjobexp(sd));
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -8525,8 +8535,8 @@ void clif_guild_basicinfo(struct map_session_data *sd) {
|
||||
WFIFOL(fd,10)=g->connect_member;
|
||||
WFIFOL(fd,14)=g->max_member;
|
||||
WFIFOL(fd,18)=g->average_lv;
|
||||
WFIFOL(fd,22)=(uint32)cap_value(g->exp,0,INT32_MAX);
|
||||
WFIFOL(fd,26)=g->next_exp;
|
||||
WFIFOL(fd,22)=(uint32)cap_value(g->exp, 0, MAX_GUILD_EXP);
|
||||
WFIFOL(fd,26)=(uint32)cap_value(g->next_exp, 0, MAX_GUILD_EXP);
|
||||
WFIFOL(fd,30)=0; // Tax Points
|
||||
WFIFOL(fd,34)=0; // Honor: (left) Vulgar [-100,100] Famed (right)
|
||||
WFIFOL(fd,38)=0; // Virtue: (down) Wicked [-100,100] Righteous (up)
|
||||
@@ -14707,10 +14717,10 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
|
||||
void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
|
||||
{
|
||||
if( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE ) {
|
||||
unsigned int next = pc_nextbaseexp(sd);
|
||||
t_exp next = pc_nextbaseexp(sd);
|
||||
|
||||
if( next ) {
|
||||
int percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. );
|
||||
int percent = (int)( ( (double)sd->status.base_exp/(double)next )*1000. );
|
||||
|
||||
if( percent && ( percent%100 ) == 0 ) {// 10.0%, 20.0%, ..., 90.0%
|
||||
sc_start(&sd->bl,&sd->bl, status_skill2sc(MO_EXPLOSIONSPIRITS), 100, 17, skill_get_time(MO_EXPLOSIONSPIRITS, 5)); //Lv17-> +50 critical (noted by Poki) [Skotlex]
|
||||
@@ -18168,9 +18178,9 @@ void clif_party_show_picker( struct map_session_data* sd, struct item* item_data
|
||||
* @param exp EXP value gained/loss
|
||||
* @param type SP_BASEEXP, SP_JOBEXP
|
||||
* @param quest False:Normal EXP; True:Quest EXP (displayed in purple color)
|
||||
* @param lost True:if lossing EXP
|
||||
* @param lost True:if losing EXP
|
||||
*/
|
||||
void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool quest, bool lost)
|
||||
void clif_displayexp(struct map_session_data *sd, t_exp exp, char type, bool quest, bool lost)
|
||||
{
|
||||
int fd;
|
||||
int offset;
|
||||
@@ -18188,10 +18198,10 @@ void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, b
|
||||
WFIFOW(fd,0) = cmd;
|
||||
WFIFOL(fd,2) = sd->bl.id;
|
||||
#if PACKETVER >= 20170830
|
||||
WFIFOQ(fd,6) = (int64)u64min((uint64)exp, INT_MAX) * (lost ? -1 : 1);
|
||||
WFIFOQ(fd,6) = client_exp(exp) * (lost ? -1 : 1);
|
||||
offset = 4;
|
||||
#else
|
||||
WFIFOL(fd,6) = (int)umin(exp, INT_MAX) * (lost ? -1 : 1);
|
||||
WFIFOL(fd,6) = client_exp(exp) * (lost ? -1 : 1);
|
||||
offset = 0;
|
||||
#endif
|
||||
WFIFOW(fd,10+offset) = type;
|
||||
|
||||
Reference in New Issue
Block a user