summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-18 16:43:56 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-18 16:43:56 +0000
commit43ef20ac3322589050c6fd670861925512aadb84 (patch)
tree27c37b03ef676e71e00582af0a8a4ab751a11145 /src
parent944722c6abf8f1d899dfd5fccf6636db4e0f214c (diff)
downloadhercules-43ef20ac3322589050c6fd670861925512aadb84.tar.gz
hercules-43ef20ac3322589050c6fd670861925512aadb84.tar.bz2
hercules-43ef20ac3322589050c6fd670861925512aadb84.tar.xz
hercules-43ef20ac3322589050c6fd670861925512aadb84.zip
Fixed skill point bug... i hope. ^^;
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@252 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/pc.c23
2 files changed, 21 insertions, 6 deletions
diff --git a/src/map/map.h b/src/map/map.h
index da9ba3777..e7f1811ee 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -311,7 +311,9 @@ struct map_session_data {
int last_skillid,last_skilllv; // Added by RoVeRT
short sg_count;
-
+
+ unsigned char change_level; // [celest]
+
#ifndef TXT_ONLY
int mail_counter; // mail counter for mail system [Valaris]
#endif
diff --git a/src/map/pc.c b/src/map/pc.c
index 863f48ce1..b38d283b7 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -707,6 +707,8 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
sd->doridori_counter = 0;
+ sd->change_level = pc_readglobalreg(sd,"jobchange_level");
+
#ifndef TXT_ONLY // mail system [Valaris]
if(battle_config.mail_system)
sd->mail_counter = 0;
@@ -913,7 +915,8 @@ int pc_calc_skilltree(struct map_session_data *sd)
if(skill_point < 9)
c = 0;
//else if((sd->status.skill_point >= sd->status.job_level && skill_point < 58) && ((c > 6 && c < 23) || (c > 4007 && c < 4023) || (c > 4029 && c < 4045))) {
- else if ((sd->status.skill_point >= sd->status.job_level && skill_point < 58) && (c > 6 && c < 23)) {
+ //else if ((sd->status.skill_point >= sd->status.job_level && skill_point < 58) && (c > 6 && c < 23)) {
+ else if ((sd->status.skill_point >= sd->status.job_level && skill_point < sd->change_level+8) && (c > 6 && c < 23)) {
switch(c) {
case 7:
case 14:
@@ -5602,12 +5605,12 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
int i;
int b_class = 0;
//転生や養子の場合の元の職業を算出する
- //struct pc_base_job s_class = pc_calc_base_job(sd->status.class);
+ struct pc_base_job s_class = pc_calc_base_job(sd->status.class);
nullpo_retr(0, sd);
if (upper < 0 || upper > 2) //現在転生かどうかを判断する
- upper = pc_calc_upper (sd->status.class);
+ upper = s_class.upper;
b_class = job; //通常職ならjobそのまんま
if (job < 23) {
@@ -5615,7 +5618,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
b_class += 4001;
else if (upper == 2) //養子に結婚はないけどどうせ次で蹴られるからいいや
b_class += 4023;
- } else if (job == 23) {
+ } else if (job == 23) {
if (upper == 1) //転生にスパノビは存在しないのでお断り
return 1;
else if (upper == 2)
@@ -5625,10 +5628,20 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
} else if ((job >= 69 && job < 4001) || (job > 4045))
return 1;
+ job = pc_calc_base_job2 (b_class); // check base class [celest]
+
if((sd->status.sex == 0 && job == 19) || (sd->status.sex == 1 && job == 20) ||
- (sd->status.sex == 0 && job == 4020) || (sd->status.sex == 1 && job == 4021) ||
+ // not needed [celest]
+ //(sd->status.sex == 0 && job == 4020) || (sd->status.sex == 1 && job == 4021) ||
job == 22 || sd->status.class == b_class) //♀はバードになれない、♂はダンサーになれない、結婚衣裳もお断り
return 1;
+
+ // check if we are changing from 1st to 2nd job
+ if (s_class.job > 0 && s_class.job < 7 && job >= 7 && job <= 21)
+ sd->change_level = sd->status.job_level;
+ else
+ sd->change_level = 0;
+ pc_setglobalreg (sd, "jobchange_level", sd->change_level);
sd->status.class = sd->view_class = b_class;