summaryrefslogtreecommitdiff
path: root/src/map/charcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-01-31 13:45:04 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-01-31 13:45:04 +0000
commitf4d04712b8383d5540f3178320af47de5486786b (patch)
treeabff309e040725f1d57efb2dc57d5b727ca4ba72 /src/map/charcommand.c
parentc23f21ed431558710c38cd81f5359d5c39cb6a76 (diff)
downloadhercules-f4d04712b8383d5540f3178320af47de5486786b.tar.gz
hercules-f4d04712b8383d5540f3178320af47de5486786b.tar.bz2
hercules-f4d04712b8383d5540f3178320af47de5486786b.tar.xz
hercules-f4d04712b8383d5540f3178320af47de5486786b.zip
- Changed the exp tables format.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5135 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/charcommand.c')
-rw-r--r--src/map/charcommand.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index e2c97b15f..216a6f450 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -1258,12 +1258,12 @@ int charcommand_baselevel(
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can change base level only lower or same gm level
if (level > 0) {
- if (pl_sd->status.base_level == battle_config.max_base_level) { // check for max level by Valaris
+ if (pl_sd->status.base_level == pc_maxbaselv(sd)) { // check for max level by Valaris
clif_displaymessage(fd, msg_table[91]); // Character's base level can't go any higher.
return 0;
} // End Addition
- if ((unsigned int)level > battle_config.max_base_level || (unsigned int)level > (battle_config.max_base_level - pl_sd->status.base_level)) // fix positiv overflow
- level = battle_config.max_base_level - pl_sd->status.base_level;
+ if (level > pc_maxbaselv(pl_sd) || level > (pc_maxbaselv(pl_sd)- pl_sd->status.base_level)) // fix positiv overflow
+ level = pc_maxbaselv(pl_sd) - pl_sd->status.base_level;
for (i = 1; i <= level; i++)
pl_sd->status.status_point += (pl_sd->status.base_level + i + 14) / 5;
pl_sd->status.base_level += level;
@@ -1279,7 +1279,7 @@ int charcommand_baselevel(
clif_displaymessage(fd, msg_table[193]); // Character's base level can't go any lower.
return -1;
}
- if (level < -(int)battle_config.max_base_level || level < (1 - (int)pl_sd->status.base_level)) // fix negativ overflow
+ if (level < -(int)pc_maxbaselv(pl_sd) || level < (1 - (int)pl_sd->status.base_level)) // fix negativ overflow
level = 1 - pl_sd->status.base_level;
if (pl_sd->status.status_point > 0) {
for (i = 0; i > level; i--)
@@ -1316,7 +1316,6 @@ int charcommand_joblevel(
const char* command, const char* message)
{
struct map_session_data *pl_sd;
- unsigned int max_level = battle_config.max_job_level;
char player[NAME_LENGTH];
int level = 0;
//転生や養子の場合の元の職業を算出する
@@ -1329,20 +1328,13 @@ int charcommand_joblevel(
if ((pl_sd = map_nick2sd(player)) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can change job level only lower or same gm level
- if ((pl_sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE)
- max_level = 10; //Novice
- else if ((pl_sd->class_&MAPID_BASEMASK) == MAPID_NOVICE)
- max_level = battle_config.max_sn_level; //S. Novice
- else if (pl_sd->class_&JOBL_UPPER && pl_sd->class_&JOBL_2)
- max_level = battle_config.max_adv_level; //Adv. Class
-
if (level > 0) {
- if (pl_sd->status.job_level == max_level) {
+ if (pl_sd->status.job_level == pc_maxjoblv(pl_sd)) {
clif_displaymessage(fd, msg_table[67]); // Character's job level can't go any higher.
return -1;
}
- if (pl_sd->status.job_level + level > max_level)
- level = max_level - pl_sd->status.job_level;
+ if (pl_sd->status.job_level + level > pc_maxjoblv(pl_sd))
+ level = pc_maxjoblv(pl_sd) - pl_sd->status.job_level;
pl_sd->status.job_level += level;
clif_updatestatus(pl_sd, SP_JOBLEVEL);
clif_updatestatus(pl_sd, SP_NEXTJOBEXP);