Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -4868,21 +4868,19 @@ ACMD(undisguiseguild)
*------------------------------------------*/
ACMD(exp)
{
char output[CHAT_SIZE_MAX];
double nextb, nextj;

memset(output, '\0', sizeof(output));
double percentb = 0.0, percentj = 0.0;
uint64 nextb, nextj;

nextb = pc->nextbaseexp(sd);
if (nextb)
nextb = sd->status.base_exp*100.0/nextb;
if (nextb != 0)
percentb = sd->status.base_exp * 100.0 / nextb;

nextj = pc->nextjobexp(sd);
if (nextj)
nextj = sd->status.job_exp*100.0/nextj;
if (nextj != 0)
percentj = sd->status.job_exp * 100.0 / nextj;

sprintf(output, msg_fd(fd,1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)
clif->message(fd, output);
sprintf(atcmd_output, msg_fd(fd,1148), sd->status.base_level, percentb, sd->status.job_level, percentj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)
clif->message(fd, atcmd_output);
return true;
}

Expand Down
18 changes: 9 additions & 9 deletions src/map/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8332,7 +8332,7 @@ int pc_setparam(struct map_session_data *sd, int type, int64 val)
if (val >= sd->status.job_level) {
if (val > pc->maxjoblv(sd))
val = pc->maxjoblv(sd);
sd->status.skill_point += val - sd->status.job_level;
sd->status.skill_point += (int)val - sd->status.job_level;
clif->updatestatus(sd, SP_SKILLPOINT);
}
sd->status.job_level = (int32)val;
Expand Down Expand Up @@ -8413,28 +8413,28 @@ int pc_setparam(struct map_session_data *sd, int type, int64 val)
}
break;
case SP_STR:
sd->status.str = cap_value(val, 1, pc_maxparameter(sd));
sd->status.str = cap_value((int)val, 1, pc_maxparameter(sd));
break;
case SP_AGI:
sd->status.agi = cap_value(val, 1, pc_maxparameter(sd));
sd->status.agi = cap_value((int)val, 1, pc_maxparameter(sd));
break;
case SP_VIT:
sd->status.vit = cap_value(val, 1, pc_maxparameter(sd));
sd->status.vit = cap_value((int)val, 1, pc_maxparameter(sd));
break;
case SP_INT:
sd->status.int_ = cap_value(val, 1, pc_maxparameter(sd));
sd->status.int_ = cap_value((int)val, 1, pc_maxparameter(sd));
break;
case SP_DEX:
sd->status.dex = cap_value(val, 1, pc_maxparameter(sd));
sd->status.dex = cap_value((int)val, 1, pc_maxparameter(sd));
break;
case SP_LUK:
sd->status.luk = cap_value(val, 1, pc_maxparameter(sd));
sd->status.luk = cap_value((int)val, 1, pc_maxparameter(sd));
break;
case SP_KARMA:
sd->status.karma = val;
sd->status.karma = (int)val;
break;
case SP_MANNER:
sd->status.manner = val;
sd->status.manner = (int)val;
if( val < 0 )
sc_start(NULL, &sd->bl, SC_NOCHAT, 100, 0, 0);
else {
Expand Down