summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-15 09:54:39 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-15 09:54:39 +0000
commitab5cb3ae9f7ab77bdcbf1b57c1da8e3d82ca53cb (patch)
tree61e9d42d58d0940fbf90be4cfebf1ee870585163 /src
parent431127c95f4443d08e0bcee53168226b5299db18 (diff)
downloadhercules-ab5cb3ae9f7ab77bdcbf1b57c1da8e3d82ca53cb.tar.gz
hercules-ab5cb3ae9f7ab77bdcbf1b57c1da8e3d82ca53cb.tar.bz2
hercules-ab5cb3ae9f7ab77bdcbf1b57c1da8e3d82ca53cb.tar.xz
hercules-ab5cb3ae9f7ab77bdcbf1b57c1da8e3d82ca53cb.zip
Fixed max skill levels, pc_calc_base_job, baby jobs.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@190 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c1
-rw-r--r--src/map/clif.c9
-rw-r--r--src/map/pc.c123
-rw-r--r--src/map/pc.h10
-rw-r--r--src/map/skill.c11
-rw-r--r--src/map/skill.h1
6 files changed, 112 insertions, 43 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 6edbeba69..1ca2b9be5 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4738,6 +4738,7 @@ int atcommand_character_joblevel(
if (pl_s_class.job == 0)
max_level -= 40;
if ((pl_s_class.job == 23) || (pl_s_class.upper == 1 && pl_s_class.type == 2)) //スパノビと転生職はJobレベルの最高が70
+ // To-do: super novices has max level 99 - celest
max_level += 20;
if (level > 0) {
diff --git a/src/map/clif.c b/src/map/clif.c
index ac7261b79..624e00d73 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4164,7 +4164,8 @@ int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range)
WFIFOW(fd,12)= range;
memset(WFIFOP(fd,14),0,24);
if(!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn == 1 || (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill) )
- WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_get_max(id) && sd->status.skill[skillid].flag ==0 )? 1:0;
+ //WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_get_max(id) && sd->status.skill[skillid].flag ==0 )? 1:0;
+ WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_tree_get_max(id, sd->status.class) && sd->status.skill[skillid].flag ==0 )? 1:0;
else
WFIFOB(fd,38) = 0;
WFIFOSET(fd,packet_len_table[0x147]);
@@ -4198,7 +4199,8 @@ int clif_skillinfoblock(struct map_session_data *sd)
WFIFOW(fd,len+10)= range;
memset(WFIFOP(fd,len+12),0,24);
if(!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn == 1 || (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill) )
- WFIFOB(fd,len+36)= (sd->status.skill[i].lv < skill_get_max(id) && sd->status.skill[i].flag ==0 )? 1:0;
+ //WFIFOB(fd,len+36)= (sd->status.skill[i].lv < skill_get_max(id) && sd->status.skill[i].flag ==0 )? 1:0;
+ WFIFOB(fd,len+36)= (sd->status.skill[i].lv < skill_tree_get_max(id, sd->status.class) && sd->status.skill[i].flag ==0 )? 1:0;
else
WFIFOB(fd,len+36) = 0;
len+=37;
@@ -4230,7 +4232,8 @@ int clif_skillup(struct map_session_data *sd,int skill_num)
if(range < 0)
range = battle_get_range(&sd->bl) - (range + 1);
WFIFOW(fd,8) = range;
- WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_get_max(sd->status.skill[skill_num].id)) ? 1 : 0;
+ //WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_get_max(sd->status.skill[skill_num].id)) ? 1 : 0;
+ WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_tree_get_max(sd->status.skill[skill_num].id, sd->status.class)) ? 1 : 0;
WFIFOSET(fd,packet_len_table[0x10e]);
return 0;
diff --git a/src/map/pc.c b/src/map/pc.c
index 2022f1e58..b7f23dbbd 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -53,13 +53,14 @@ static int aspd_base[MAX_PC_CLASS][20];
static char job_bonus[3][MAX_PC_CLASS][MAX_LEVEL];
static int exp_table[14][MAX_LEVEL];
static char statp[255][7];
-static struct {
+
+/*static struct {
int id;
int max;
struct {
short id,lv;
} need[6];
-} skill_tree[3][MAX_PC_CLASS][100];
+} skill_tree[3][MAX_PC_CLASS][100];*/ // moved to pc.h
static int atkmods[3][20]; // 武器ATKサイズ修正(size_fix.txt)
static int refinebonus[5][3]; // 精錬ボーナステーブル(refine_db.txt)
@@ -903,13 +904,16 @@ int pc_calc_skilltree(struct map_session_data *sd)
s_class = pc_calc_base_job(sd->status.class);
c = s_class.job;
- s = (s_class.upper==1) ? 1 : 0 ; //転生以外は通常のスキル?
+ //s = (s_class.upper==1) ? 1 : 0 ; //転生以外は通常のスキル?
+ s = s_class.upper;
- if((battle_config.skillup_limit) && ((c >= 0 && c < 23) || (c >= 4001 && c < 4023) || (c >= 4023 && c < 4045))) {
+ //if((battle_config.skillup_limit) && ((c >= 0 && c < 23) || (c >= 4001 && c < 4023) || (c >= 4023 && c < 4045))) {
+ if (battle_config.skillup_limit && c >= 0 && c < 23) {
int skill_point = pc_calc_skillpoint(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) || (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)) {
switch(c) {
case 7:
case 14:
@@ -936,7 +940,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
case 17:
c = 6;
break;
- case 4008:
+ /*case 4008:
case 4015:
c = 4002;
break;
@@ -985,8 +989,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
case 4035:
case 4043:
c = 4029;
- break;
-
+ break;*/
}
}
}
@@ -1052,7 +1055,7 @@ int pc_checkweighticon(struct map_session_data *sd)
flag=1;
if(sd->weight*10 >= sd->max_weight*9)
flag=2;
-
+
if(flag==1){
if(sd->sc_data[SC_WEIGHT50].timer==-1)
skill_status_change_start(&sd->bl,SC_WEIGHT50,0,0,0,0,0,0);
@@ -1600,8 +1603,11 @@ int pc_calcstatus(struct map_session_data* sd,int first)
bl=sd->status.base_level;
sd->status.max_hp += (3500 + bl*hp_coefficient2[s_class.job] + hp_sigma_val[s_class.job][(bl > 0)? bl-1:0])/100 * (100 + sd->paramc[2])/100 + (sd->parame[2] - sd->paramcard[2]);
- if (s_class.upper==1) // [MouseJstr]
- sd->status.max_hp = sd->status.max_hp * 130/100;
+ if (s_class.upper==1) // [MouseJstr]
+ sd->status.max_hp = sd->status.max_hp * 130/100;
+ else if (s_class.upper==2)
+ sd->status.max_hp = sd->status.max_hp * 70/100;
+
if(sd->hprate!=100)
sd->status.max_hp = sd->status.max_hp*sd->hprate/100;
@@ -1623,8 +1629,10 @@ int pc_calcstatus(struct map_session_data* sd,int first)
// 最大SP計算
sd->status.max_sp += ((sp_coefficient[s_class.job] * bl) + 1000)/100 * (100 + sd->paramc[3])/100 + (sd->parame[3] - sd->paramcard[3]);
- if (s_class.upper==1) // [MouseJstr]
- sd->status.max_sp = sd->status.max_sp * 130/100;
+ if (s_class.upper==1) // [MouseJstr]
+ sd->status.max_sp = sd->status.max_sp * 130/100;
+ else if (s_class.upper==2)
+ sd->status.max_sp = sd->status.max_sp * 70/100;
if(sd->sprate!=100)
sd->status.max_sp = sd->status.max_sp*sd->sprate/100;
@@ -4006,14 +4014,18 @@ struct pc_base_job pc_calc_base_job(int b_class)
{
struct pc_base_job bj;
//転生や養子の場合の元の職業を算出する
- if(b_class < MAX_PC_CLASS){ //通常
+ //if(b_class < MAX_PC_CLASS){ //通常
+ if(b_class < 4001){
bj.job = b_class;
bj.upper = 0;
}else if(b_class >= 4001 && b_class < 4023){ //転生職
+ // Athena almost never uses this... well, used this. :3
bj.job = b_class - 4001;
bj.upper = 1;
- }else if(b_class == 23 + 4023 -1){ //養子スパノビ
- bj.job = b_class - (4023 - 1);
+ //}else if(b_class == 23 + 4023 -1){ //養子スパノビ
+ }else if(b_class == 4045){ // super baby
+ //bj.job = b_class - (4023 - 1);
+ bj.job = 23;
bj.upper = 2;
}else{ //養子スパノビ以外の養子
bj.job = b_class - 4023;
@@ -4036,6 +4048,30 @@ struct pc_base_job pc_calc_base_job(int b_class)
}
/*==========================================
+ * For quick calculating [Celest]
+ *------------------------------------------
+ */
+int pc_calc_base_job2 (int b_class)
+{
+ if(b_class < 4001)
+ return b_class;
+ else if(b_class >= 4001 && b_class < 4023)
+ return b_class - 4001;
+ else if(b_class == 4045)
+ return 23;
+ return b_class - 4023;
+}
+
+int pc_calc_upper(int b_class)
+{
+ if(b_class < 4001)
+ return 0;
+ else if(b_class >= 4001 && b_class < 4023)
+ return 1;
+ return 2;
+}
+
+/*==========================================
* PCの攻撃 (timer関数)
*------------------------------------------
*/
@@ -4510,9 +4546,11 @@ int pc_need_status_point(struct map_session_data *sd,int type)
int pc_statusup(struct map_session_data *sd,int type)
{
int need,val = 0;
-
+
nullpo_retr(0, sd);
+ int max = (pc_calc_upper(sd->status.class)==2) ? 80 : battle_config.max_parameter;
+
need=pc_need_status_point(sd,type);
if(type<SP_STR || type>SP_LUK || need<0 || need>sd->status.status_point){
clif_statusupack(sd,type,0,0);
@@ -4520,42 +4558,42 @@ int pc_statusup(struct map_session_data *sd,int type)
}
switch(type){
case SP_STR:
- if(sd->status.str >= battle_config.max_parameter) {
+ if(sd->status.str >= max) {
clif_statusupack(sd,type,0,0);
return 1;
}
val= ++sd->status.str;
break;
case SP_AGI:
- if(sd->status.agi >= battle_config.max_parameter) {
+ if(sd->status.agi >= max) {
clif_statusupack(sd,type,0,0);
return 1;
}
val= ++sd->status.agi;
break;
case SP_VIT:
- if(sd->status.vit >= battle_config.max_parameter) {
+ if(sd->status.vit >= max) {
clif_statusupack(sd,type,0,0);
return 1;
}
val= ++sd->status.vit;
break;
case SP_INT:
- if(sd->status.int_ >= battle_config.max_parameter) {
+ if(sd->status.int_ >= max) {
clif_statusupack(sd,type,0,0);
return 1;
}
val= ++sd->status.int_;
break;
case SP_DEX:
- if(sd->status.dex >= battle_config.max_parameter) {
+ if(sd->status.dex >= max) {
clif_statusupack(sd,type,0,0);
return 1;
}
val= ++sd->status.dex;
break;
case SP_LUK:
- if(sd->status.luk >= battle_config.max_parameter) {
+ if(sd->status.luk >= max) {
clif_statusupack(sd,type,0,0);
return 1;
}
@@ -4665,7 +4703,8 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
if( sd->status.skill_point>0 &&
sd->status.skill[skill_num].id!=0 &&
- sd->status.skill[skill_num].lv < skill_get_max(skill_num) )
+ //sd->status.skill[skill_num].lv < skill_get_max(skill_num) ) - celest
+ sd->status.skill[skill_num].lv < skill_tree_get_max(skill_num, sd->status.class) )
{
sd->status.skill[skill_num].lv++;
sd->status.skill_point--;
@@ -4717,7 +4756,8 @@ int pc_allskillup(struct map_session_data *sd)
else {
for(i=0;(id=skill_tree[s][c][i].id)>0;i++){
if(sd->status.skill[id].id==0 && (!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn) )
- sd->status.skill[id].lv=skill_get_max(id);
+ // sd->status.skill[id].lv=skill_get_max(id);
+ sd->status.skill[id].lv=skill_tree_get_max(id, sd->status.class); // celest
}
}
pc_calcstatus(sd,0);
@@ -6562,7 +6602,7 @@ int pc_ismarried(struct map_session_data *sd)
*/
int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
{
- if(sd == NULL || dstsd == NULL || sd->status.partner_id > 0 || dstsd->status.partner_id > 0)
+ if(sd == NULL || dstsd == NULL || sd->status.partner_id > 0 || dstsd->status.partner_id > 0 || pc_calc_upper(sd->status.class)==2)
return -1;
sd->status.partner_id=dstsd->status.char_id;
dstsd->status.partner_id=sd->status.char_id;
@@ -7168,7 +7208,8 @@ void pc_setstand(struct map_session_data *sd){
*/
int pc_readdb(void)
{
- int i,j,k;
+ int i,j,k,u;
+ struct pc_base_job s_class;
FILE *fp;
char line[1024],*p;
@@ -7300,6 +7341,7 @@ int pc_readdb(void)
printf("can't read db/skill_tree.txt\n");
return 1;
}
+
while(fgets(line, sizeof(line)-1, fp)){
char *split[50];
if(line[0]=='/' && line[1]=='/')
@@ -7311,17 +7353,24 @@ int pc_readdb(void)
}
if(j<13)
continue;
- i=atoi(split[0]);
- for(j=0;skill_tree[0][i][j].id;j++);
- skill_tree[0][i][j].id=atoi(split[1]);
- skill_tree[0][i][j].max=atoi(split[2]);
- skill_tree[2][i][j].id=atoi(split[1]); //養子職は良く分からないので暫定
- skill_tree[2][i][j].max=atoi(split[2]); //養子職は良く分からないので暫定
+ //i=atoi(split[0]);
+ s_class = pc_calc_base_job(atoi(split[0]));
+ i = s_class.job;
+ u = s_class.upper;
+ //printf ("i = %d, u = %d\n",i,u);
+ for(j=0;skill_tree[u][i][j].id;j++);
+ skill_tree[u][i][j].id=atoi(split[1]);
+ skill_tree[u][i][j].max=atoi(split[2]);
+
+ //not required - Celest
+ //skill_tree[2][i][j].id=atoi(split[1]); //養子職は良く分からないので暫定
+ //skill_tree[2][i][j].max=atoi(split[2]); //養子職は良く分からないので暫定
+
for(k=0;k<5;k++){
- skill_tree[0][i][j].need[k].id=atoi(split[k*2+3]);
- skill_tree[0][i][j].need[k].lv=atoi(split[k*2+4]);
- skill_tree[2][i][j].need[k].id=atoi(split[k*2+3]); //養子職は良く分からないので暫定
- skill_tree[2][i][j].need[k].lv=atoi(split[k*2+4]); //養子職は良く分からないので暫定
+ skill_tree[u][i][j].need[k].id=atoi(split[k*2+3]);
+ skill_tree[u][i][j].need[k].lv=atoi(split[k*2+4]);
+ //skill_tree[2][i][j].need[k].id=atoi(split[k*2+3]); //養子職は良く分からないので暫定
+ //skill_tree[2][i][j].need[k].lv=atoi(split[k*2+4]); //養子職は良く分からないので暫定
}
}
fclose(fp);
diff --git a/src/map/pc.h b/src/map/pc.h
index 1919007a0..2260fcdb7 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -165,6 +165,16 @@ struct pc_base_job{
};
struct pc_base_job pc_calc_base_job(int b_class);//転生や養子職の元の職業を返す
+int pc_calc_base_job2(int b_class); // Celest
+int pc_calc_upper(int b_class);
+
+struct {
+ int id;
+ int max;
+ struct {
+ short id,lv;
+ } need[6];
+} skill_tree[3][MAX_PC_CLASS][100]; // Celest
int pc_read_gm_account(int fd);
int pc_setinvincibletimer(struct map_session_data *sd,int);
diff --git a/src/map/skill.c b/src/map/skill.c
index 433c03a93..dfef6c036 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -736,7 +736,7 @@ int skill_get_hit( int id ){ return skill_db[id].hit; }
int skill_get_inf( int id ){ return skill_db[id].inf; }
int skill_get_pl( int id ){ return skill_db[id].pl; }
int skill_get_nk( int id ){ return skill_db[id].nk; }
-int skill_get_max( int id ){ return skill_db[id].max; }
+int skill_get_max( int id ){ return skill_db[id].max; }
int skill_get_range( int id , int lv ){ return (lv <= 0) ? 0:skill_db[id].range[lv-1]; }
int skill_get_hp( int id ,int lv ){ return (lv <= 0) ? 0:skill_db[id].hp[lv-1]; }
int skill_get_sp( int id ,int lv ){ return (lv <= 0) ? 0:skill_db[id].sp[lv-1]; }
@@ -754,6 +754,11 @@ int skill_get_blewcount( int id ,int lv ){ return (lv <= 0) ? 0:skill_db[id].ble
int skill_get_mhp( int id ,int lv ){ return (lv <= 0) ? 0:skill_db[id].mhp[lv-1]; }
int skill_get_castnodex( int id ,int lv ){ return (lv <= 0) ? 0:skill_db[id].castnodex[lv-1]; }
+int skill_tree_get_max(int id, int b_class){
+ struct pc_base_job s_class = pc_calc_base_job(b_class);
+ return skill_tree[s_class.upper][s_class.job][id].max;
+}
+
/* プロトタイプ */
struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,int skilllv,int x,int y,int flag);
int skill_check_condition( struct map_session_data *sd,int type);
@@ -2711,8 +2716,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
heal=0; /* ?金蟲カ?ド(ヒ?ル量0) */
if (sd){
s_class = pc_calc_base_job(sd->status.class);
- if((skill=pc_checkskill(sd,HP_MEDITATIO))>0) // メディテイティオ
- heal += heal*(skill*2/100);
+ if((skill=pc_checkskill(sd,HP_MEDITATIO))>0) // メディテイティオ
+ heal += heal*(skill*2/100);
if(sd && dstsd && sd->status.partner_id == dstsd->status.char_id && s_class.job == 23 && sd->status.sex == 0) //自分も?象もPC、?象が自分のパ?トナ?、自分がスパノビ、自分が♀なら
heal = heal*2; //スパノビの嫁が旦那にヒ?ルすると2倍になる
}
diff --git a/src/map/skill.h b/src/map/skill.h
index 6ea93f819..6b77b4fa3 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -84,6 +84,7 @@ int skill_get_unit_id(int id,int flag);
int skill_get_inf2( int id );
int skill_get_maxcount( int id );
int skill_get_blewcount( int id ,int lv );
+int skill_tree_get_max( int id, int b_class ); // Celest
// スキルの使用
int skill_use_id( struct map_session_data *sd, int target_id,