summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-15 22:23:13 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-15 22:23:13 +0000
commitffc0cf64aaababedef5dfdd3c2ef16a534fa8b06 (patch)
tree24de64a326147c96468989df3cde3a8dee187916 /src
parent3e0134afea766e42d4727e9c5547b8aa86bd00d0 (diff)
downloadhercules-ffc0cf64aaababedef5dfdd3c2ef16a534fa8b06.tar.gz
hercules-ffc0cf64aaababedef5dfdd3c2ef16a534fa8b06.tar.bz2
hercules-ffc0cf64aaababedef5dfdd3c2ef16a534fa8b06.tar.xz
hercules-ffc0cf64aaababedef5dfdd3c2ef16a534fa8b06.zip
Corrected pc_jobchange and skill_tree_get_max, sorry >.<
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@195 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.c84
-rw-r--r--src/map/skill.c41
2 files changed, 77 insertions, 48 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index b7f23dbbd..cd87455d0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -60,7 +60,7 @@ static char statp[255][7];
struct {
short id,lv;
} need[6];
-} skill_tree[3][MAX_PC_CLASS][100];*/ // moved to pc.h
+} skill_tree[3][MAX_PC_CLASS][100];*/ // moved to pc.h - celest
static int atkmods[3][20]; // 武器ATKサイズ修正(size_fix.txt)
static int refinebonus[5][3]; // 精錬ボーナステーブル(refine_db.txt)
@@ -1472,12 +1472,23 @@ int pc_calcstatus(struct map_session_data* sd,int first)
sd->paramb[5]+= 5;
}
if(sd->sc_data[SC_MARIONETTE].timer!=-1){
- sd->paramb[0]-= (sd->status.str+sd->paramb[0]+sd->parame[0])/2;
- sd->paramb[1]-= (sd->status.agi+sd->paramb[1]+sd->parame[1])/2;
- sd->paramb[2]-= (sd->status.vit+sd->paramb[2]+sd->parame[2])/2;
- sd->paramb[3]-= (sd->status.int_+sd->paramb[3]+sd->parame[3])/2;
- sd->paramb[4]-= (sd->status.dex+sd->paramb[4]+sd->parame[4])/2;
- sd->paramb[5]-= (sd->status.luk+sd->paramb[5]+sd->parame[5])/2;
+ sd->paramb[0]-= sd->status.str/2; // bonuses not included
+ sd->paramb[1]-= sd->status.agi/2;
+ sd->paramb[2]-= sd->status.vit/2;
+ sd->paramb[3]-= sd->status.int_/2;
+ sd->paramb[4]-= sd->status.dex/2;
+ sd->paramb[5]-= sd->status.luk/2;
+ }
+ else if(sd->sc_data[SC_MARIONETTE2].timer!=-1){
+ struct map_session_data *psd = (struct map_session_data *)map_id2bl(sd->sc_data[SC_MARIONETTE2].val3);
+ if (psd) { // if partner is found
+ sd->paramb[0] += sd->status.str+psd->status.str/2 > 99 ? 99-sd->status.str : psd->status.str/2;
+ sd->paramb[1] += sd->status.agi+psd->status.agi/2 > 99 ? 99-sd->status.agi : psd->status.agi/2;
+ sd->paramb[2] += sd->status.vit+psd->status.vit/2 > 99 ? 99-sd->status.vit : psd->status.vit/2;
+ sd->paramb[3] += sd->status.int_+psd->status.int_/2 > 99 ? 99-sd->status.int_ : psd->status.int_/2;
+ sd->paramb[4] += sd->status.dex+psd->status.dex/2 > 99 ? 99-sd->status.dex : psd->status.dex/2;
+ sd->paramb[5] += sd->status.luk+psd->status.luk/2 > 99 ? 99-sd->status.luk : psd->status.luk/2;
+ }
}
}
@@ -1613,7 +1624,7 @@ int pc_calcstatus(struct map_session_data* sd,int first)
if(sd->sc_data && sd->sc_data[SC_BERSERK].timer!=-1){ // バーサーク
sd->status.max_hp = sd->status.max_hp * 3;
- sd->status.hp = sd->status.hp * 3;
+ // sd->status.hp = sd->status.hp * 3;
if(sd->status.max_hp > battle_config.max_hp) // removed negative max hp bug by Valaris
sd->status.max_hp = battle_config.max_hp;
if(sd->status.hp > battle_config.max_hp) // removed negative max hp bug by Valaris
@@ -1909,6 +1920,11 @@ int pc_calcstatus(struct map_session_data* sd,int first)
if(sd->sc_data[SC_DELUGE].timer!=-1) // エンチャントポイズン(属性はbattle.cで)
sd->addeff[0]+=sd->sc_data[SC_DELUGE].val2;//% of granting
*/
+ if(sd->sc_data[SC_BERSERK].timer!=-1) { //All Def/MDef reduced to 0 while in Berserk [DracoRPG]
+ sd->def = sd->def2 = 0;
+ sd->mdef = sd->mdef2 = 0;
+ sd->flee -= sd->flee*50/100;
+ }
if(sd->sc_data[SC_KEEPING].timer!=-1)
sd->def = 100;
if(sd->sc_data[SC_BARRIER].timer!=-1)
@@ -3073,6 +3089,7 @@ int pc_useitem(struct map_session_data *sd,int n)
if(sd->status.inventory[n].nameid <= 0 ||
sd->status.inventory[n].amount <= 0 ||
sd->sc_data[SC_BERSERK].timer!=-1 ||
+ sd->sc_data[SC_MARIONETTE].timer!=-1 ||
!pc_isUseitem(sd,n) ) {
clif_useitemack(sd,n,0,0);
return 1;
@@ -5563,6 +5580,7 @@ int pc_percentheal(struct map_session_data *sd,int hp,int sp)
* 職変更
* 引数 job 職業 0〜23
* upper 通常 0, 転生 1, 養子 2, そのまま -1
+ * Rewrote to make it tidider [Celest]
*------------------------------------------
*/
int pc_jobchange(struct map_session_data *sd,int job, int upper)
@@ -5570,36 +5588,32 @@ 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((job > 23) && (job < 68))
- job += 3977;
-
- if((job > 69) && (job < 4000))
- return 1;
+ if (upper < 0 || upper > 2) //現在転生かどうかを判断する
+ upper = pc_calc_upper (sd->status.class);
- if(upper < 0) //現在転生かどうかを判断する
- upper = s_class.upper;
-
- if(upper == 0){ //通常職ならjobそのまんま
- b_class = job;
- }else if(upper == 1){
- if(job == 23){ //転生にスパノビは存在しないのでお断り
+ b_class = job; //通常職ならjobそのまんま
+ if (job < 23) {
+ if (upper == 1)
+ b_class += 4001;
+ else if (upper == 2) //養子に結婚はないけどどうせ次で蹴られるからいいや
+ b_class += 4023;
+ } else if (job == 23) {
+ if (upper == 1) //転生にスパノビは存在しないのでお断り
return 1;
- }else{
- b_class = job + 4001;
- }
- }else if(upper == 2){ //養子に結婚はないけどどうせ次で蹴られるからいいや
- b_class = (job==23)?job + 4022:job + 4023;
- }else{
+ else if (upper == 2)
+ b_class += 4022;
+ } else if (job > 23 && job < 69) {
+ b_class += 3977;
+ } else if ((job >= 69 && job < 4001) || (job > 4045))
return 1;
- }
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) ||
- job ==22 || sd->status.class == b_class) //♀はバードになれない、♂はダンサーになれない、結婚衣裳もお断り
+ job == 22 || sd->status.class == b_class) //♀はバードになれない、♂はダンサーになれない、結婚衣裳もお断り
return 1;
sd->status.class = sd->view_class = b_class;
@@ -6980,14 +6994,13 @@ static int pc_natural_heal_sub(struct map_session_data *sd,va_list ap) {
if ((battle_config.natural_heal_weight_rate > 100 || sd->weight*100/sd->max_weight < battle_config.natural_heal_weight_rate) &&
!pc_isdead(sd) &&
!pc_ishiding(sd) &&
- sd->sc_data[SC_POISON].timer == -1
- ) {
+ sd->sc_data[SC_POISON].timer == -1 &&
+ sd->sc_data[SC_BERSERK].timer == -1 ) {
pc_natural_heal_hp(sd);
if( sd->sc_data && sd->sc_data[SC_EXTREMITYFIST].timer == -1 && //阿修羅状態ではSPが回復しない
sd->sc_data[SC_DANCING].timer == -1 && //ダンス状態ではSPが回復しない
- sd->sc_data[SC_BERSERK].timer == -1 //バーサーク状態ではSPが回復しない
- )
- pc_natural_heal_sp(sd);
+ sd->sc_data[SC_BERSERK].timer == -1 ) //バーサーク状態ではSPが回復しない
+ pc_natural_heal_sp(sd);
} else {
sd->hp_sub = sd->inchealhptick = 0;
sd->sp_sub = sd->inchealsptick = 0;
@@ -7357,11 +7370,10 @@ int pc_readdb(void)
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]); //養子職は良く分からないので暫定
diff --git a/src/map/skill.c b/src/map/skill.c
index dfef6c036..543a4c43c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -756,7 +756,10 @@ int skill_get_castnodex( int id ,int lv ){ return (lv <= 0) ? 0:skill_db[id].cas
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;
+ int i, skillid;
+ for(i=0;(skillid=skill_tree[s_class.upper][s_class.job][i].id)>0;i++)
+ if (id == skillid) return skill_tree[s_class.upper][s_class.job][i].max;
+ return skill_get_max (id);
}
/* プロトタイプ */
@@ -2917,7 +2920,6 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case PR_SUFFRAGIUM: /* サフラギウム */
case PR_BENEDICTIO: /* 聖?降福 */
case CR_PROVIDENCE: /* プロヴィデンス */
- //case CG_MARIONETTE: // moved - Celest
if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ){
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}else{
@@ -2928,7 +2930,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case CG_MARIONETTE: /* マリオネットコントロ?ル */
if(sd && dstsd){
- struct status_change *tsc_data = battle_get_sc_data(src);
+ struct status_change *sc_data = battle_get_sc_data(src);
+ struct status_change *tsc_data = battle_get_sc_data(bl);
int sc = SkillStatusChangeTable[skillid];
int sc2 = SC_MARIONETTE2;
@@ -2940,15 +2943,21 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
map_freeblock_unlock();
return 1;
}
- if(tsc_data){
- if(tsc_data[sc].timer == -1) {
+ if(sc_data && tsc_data){
+ if(sc_data[sc].timer == -1 && tsc_data[sc2].timer == -1) {
skill_status_change_start (src,sc,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0);
skill_status_change_start (bl,sc2,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0);
}
- else {
+ else if (sc_data[sc].timer != -1 && tsc_data[sc2].timer != -1 &&
+ sc_data[sc].val3 == bl->id && tsc_data[sc2].val3 == src->id) {
skill_status_change_end(src, sc, -1);
skill_status_change_end(bl, sc2, -1);
}
+ else {
+ clif_skill_fail(sd,skillid,0,0);
+ map_freeblock_unlock();
+ return 1;
+ }
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}
}
@@ -3017,7 +3026,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case LK_AURABLADE: /* オ?ラブレ?ド */
case LK_PARRYING: /* パリイング */
case LK_CONCENTRATION: /* コンセントレ?ション */
- case LK_BERSERK: /* バ?サ?ク */
+// case LK_BERSERK: /* バ?サ?ク */
case HP_ASSUMPTIO: /* */
case WS_CARTBOOST: /* カ?トブ?スト */
case SN_SIGHT: /* トゥル?サイト */
@@ -3049,6 +3058,11 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
clif_sitting(sd);
skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
+ case LK_BERSERK: /* バ?サ?ク */
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ sd->status.hp = sd->status.max_hp * 3;
+ break;
case MC_CHANGECART:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
break;
@@ -6726,7 +6740,7 @@ int skill_use_id( struct map_session_data *sd, int target_id,
case AL_WARP:
case WZ_ICEWALL:
case TF_BACKSLIDING:
- case LK_BERSERK:
+ //case LK_BERSERK: // now usable in WoE - celest
case HP_BASILICA:
case ST_CHASEWALK:
return 0;
@@ -7832,6 +7846,7 @@ int skill_status_change_end(struct block_list* bl, int type, int tid)
case SC_BERSERK: /* バ?サ?ク */
calc_flag = 1;
clif_status_change(bl,SC_INCREASEAGI,0); /* アイコン消去 */
+ skill_status_change_end(bl,SC_ENDURE,-1);
break;
case SC_DEVOTION: /* ディボ?ション */
{
@@ -7985,6 +8000,7 @@ int skill_status_change_end(struct block_list* bl, int type, int tid)
*opt3 &= ~128;
break;
case SC_MARIONETTE: /* マリオネットコントロ?ル */
+ case SC_MARIONETTE2:
*opt3 &= ~1024;
break;
case SC_ASSUMPTIO: /* アスムプティオ */
@@ -8331,11 +8347,11 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data)
break;
case SC_BERSERK: /* バ?サ?ク */
if(sd){ /* HPが100以上なら?? */
- if( (sd->status.hp - sd->status.hp/100) > 100 ){
- sd->status.hp -= sd->status.hp/100;
+ if( (sd->status.hp - sd->status.hp/100) > 100 ){ // 5% every 10 seconds [DracoRPG]
+ sd->status.hp -= sd->status.hp*5/100;
clif_updatestatus(sd,SP_HP);
- sc_data[type].timer=add_timer( /* タイマ?再設定 */
- 15000+tick, skill_status_change_timer,
+ sc_data[type].timer = add_timer( /* タイマ?再設定 */
+ 10000+tick, skill_status_change_timer,
bl->id, data);
return 0;
}
@@ -9045,6 +9061,7 @@ int skill_status_change_start(struct block_list *bl, int type, int val1, int val
sd->status.sp = 0;
clif_updatestatus(sd,SP_SP);
clif_status_change(bl,SC_INCREASEAGI,1); /* アイコン表示 */
+ skill_status_change_start(bl,SC_ENDURE,10,0,0,0,tick,0 ); // celest
}
*opt3 |= 128;
tick = 1000;