summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c64
1 files changed, 28 insertions, 36 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 682d7410c..20d88e296 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -659,7 +659,7 @@ void initChangeTables(void) {
set_sc( SC_STRIPACCESSARY , SC__STRIPACCESSARY , SI_STRIPACCESSARY , SCB_DEX|SCB_INT|SCB_LUK );
set_sc_with_vfx( SC_MANHOLE , SC__MANHOLE , SI_MANHOLE , SCB_NONE );
add_sc( SC_CHAOSPANIC , SC_CONFUSION );
- set_sc_with_vfx( SC_BLOODYLUST , SC__BLOODYLUST , SI_BLOODYLUST , SCB_DEF | SCB_DEF2 | SCB_MDEF | SCB_MDEF2 | SCB_FLEE | SCB_SPEED | SCB_ASPD | SCB_MAXHP | SCB_REGEN );
+ add_sc( SC_BLOODYLUST , SC_BERSERK );
/**
* Sura
**/
@@ -1236,8 +1236,6 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
status_change_end(target, SC_RAISINGDRAGON, INVALID_TIMER);
if (sc->data[SC_SATURDAY_NIGHT_FEVER] && status->hp <= 100)
status_change_end(target, SC_SATURDAY_NIGHT_FEVER, INVALID_TIMER);
- if (sc->data[SC__BLOODYLUST] && status->hp <= 100)
- status_change_end(target, SC__BLOODYLUST, INVALID_TIMER);
}
switch (target->type) {
@@ -1248,7 +1246,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
case BL_ELEM: elemental_heal((TBL_ELEM*)target,hp,sp); break;
}
- if( src && target->type == BL_PC && ((TBL_PC*)target)->disguise ) {// stop walking when attacked in disguise to prevent walk-delay bug
+ if( src && target->type == BL_PC && (((TBL_PC*)target)->disguise) > 0 ) {// stop walking when attacked in disguise to prevent walk-delay bug
unit_stop_walking( target, 1 );
}
@@ -1375,7 +1373,7 @@ int status_heal(struct block_list *bl,int hp,int sp, int flag)
}
if(hp) {
- if( sc && (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST]) ) {
+ if( sc && sc->data[SC_BERSERK] ) {
if( flag&1 )
flag &= ~2;
else
@@ -1668,7 +1666,6 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
sc->data[SC_SILENCE] ||
sc->data[SC_STEELBODY] ||
sc->data[SC_BERSERK] ||
- sc->data[SC__BLOODYLUST] ||
sc->data[SC_OBLIVIONCURSE] ||
sc->data[SC_WHITEIMPRISON] ||
sc->data[SC__INVISIBILITY] ||
@@ -3480,7 +3477,7 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
if (
(sc->data[SC_POISON] && !sc->data[SC_SLOWPOISON])
|| (sc->data[SC_DPOISON] && !sc->data[SC_SLOWPOISON])
- || sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST]
+ || sc->data[SC_BERSERK]
|| sc->data[SC_TRICKDEAD]
|| sc->data[SC_BLOODING]
|| sc->data[SC_MAGICMUSHROOM]
@@ -4813,7 +4810,7 @@ static signed short status_calc_flee(struct block_list *bl, struct status_change
flee += flee * sc->data[SC_INCFLEERATE]->val1/100;
if(sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1)
flee -= flee * 50/100;
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK])
flee -= flee * 50/100;
if(sc->data[SC_BLIND])
flee -= flee * 25/100;
@@ -4874,7 +4871,7 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);
}
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK])
return 0;
if(sc->data[SC_SKA])
return sc->data[SC_SKA]->val3;
@@ -4967,7 +4964,7 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i
#endif
}
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK])
return 0;
if(sc->data[SC_ETERNALCHAOS])
return 0;
@@ -5028,7 +5025,7 @@ defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int md
return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
}
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK])
return 0;
if(sc->data[SC_BARRIER])
return 100;
@@ -5086,7 +5083,7 @@ signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc,
#endif
}
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK])
return 0;
if(sc->data[SC_SKA])
return 90;
@@ -5232,7 +5229,7 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
val = max( val, 1 * pc->checkskill(sd,TF_MISS) );
if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 1 )
val = max( val, sc->data[SC_CLOAKING]->val1 >= 10 ? 25 : 3 * sc->data[SC_CLOAKING]->val1 - 3 );
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK])
val = max( val, 25 );
if( sc->data[SC_RUN] )
val = max( val, 55 );
@@ -5325,7 +5322,7 @@ static short status_calc_aspd(struct block_list *bl, struct status_change *sc, s
skills1 = 5;
}
- if((sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST]) && skills1 < 15)
+ if((sc->data[SC_BERSERK]) && skills1 < 15)
skills1 = 15;
else if(sc->data[SC_GS_MADNESSCANCEL] && skills1 < 20)
skills1 = 20;
@@ -5491,7 +5488,7 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change *
}
aspd_rate -= max;
- if((sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST]))
+ if(sc->data[SC_BERSERK])
aspd_rate -= 300;
else if(sc->data[SC_GS_MADNESSCANCEL])
aspd_rate -= 200;
@@ -5591,7 +5588,7 @@ static unsigned int status_calc_maxhp(struct block_list *bl, struct status_chang
maxhp += maxhp * sc->data[SC_APPLEIDUN]->val2/100;
if(sc->data[SC_DELUGE])
maxhp += maxhp * sc->data[SC_DELUGE]->val2/100;
- if (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST])
+ if(sc->data[SC_BERSERK])
maxhp += maxhp * 2;
if(sc->data[SC_MARIONETTE_MASTER])
maxhp -= 1000;
@@ -6246,7 +6243,6 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
case SC__LAZINESS:
case SC__UNLUCKY:
case SC__WEAKNESS:
- case SC__BLOODYLUST:
return 0;
}
@@ -6649,12 +6645,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
//There all like berserk, do not everlap each other
- case SC__BLOODYLUST:
- if(!sd) return 0; //should only affect player
case SC_BERSERK:
- if (((type == SC_BERSERK) && (sc->data[SC_SATURDAY_NIGHT_FEVER] || sc->data[SC__BLOODYLUST]))
- || ((type == SC__BLOODYLUST) && (sc->data[SC_SATURDAY_NIGHT_FEVER] || sc->data[SC_BERSERK]))
- )
+ if( sc->data[SC__BLOODYLUST] || sc->data[SC_SATURDAY_NIGHT_FEVER] )
return 0;
break;
@@ -6898,7 +6890,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
}
break;
case SC_SATURDAY_NIGHT_FEVER:
- if (sc->data[SC_BERSERK] || sc->data[SC_INSPIRATION] || sc->data[SC__BLOODYLUST])
+ if (sc->data[SC_BERSERK] || sc->data[SC_INSPIRATION])
return 0;
break;
case SC_OFFERTORIUM:
@@ -7007,8 +6999,9 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
status_change_end(bl, SC_RG_CCONFINE_M, INVALID_TIMER);
status_change_end(bl, SC_RG_CCONFINE_S, INVALID_TIMER);
break;
- case SC__BLOODYLUST:
case SC_BERSERK:
+ if( val3 == SC__BLOODYLUST )
+ break;
if(battle_config.berserk_cancels_buffs) {
status_change_end(bl, SC_ONEHANDQUICKEN, INVALID_TIMER);
status_change_end(bl, SC_TWOHANDQUICKEN, INVALID_TIMER);
@@ -7266,7 +7259,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val4 = sce->val4;
break;
case SC_LERADS_DEW:
- if (sc && (sc->data[SC_BERSERK] || sc->data[SC__BLOODYLUST]))
+ if (sc && sc->data[SC_BERSERK])
return 0;
case SC_SHAPESHIFT:
case SC_PROPERTYWALK:
@@ -7713,9 +7706,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_BERSERK:
- if (!sc->data[SC_ENDURE] || !sc->data[SC_ENDURE]->val4)
+ if( val3 == SC__BLOODYLUST )
+ sc_start(bl,(sc_type)val3,100,val1,tick);
+ if( !val3 && !(!sc->data[SC_ENDURE] || !sc->data[SC_ENDURE]->val4) )
sc_start4(bl, SC_ENDURE, 100,10,0,0,2, tick);
- case SC__BLOODYLUST:
//HP healing is performing after the calc_status call.
//Val2 holds HP penalty
if (!val4) val4 = skill->get_time2(iStatus->sc2skill(type),val1);
@@ -8950,7 +8944,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_BERSERK:
opt_flag = 0;
- // case SC__BLOODYLUST:
sc->opt3 |= OPT3_BERSERK;
break;
// case ???: // doesn't seem to do anything
@@ -9093,7 +9086,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
pet_sc_check(sd, type); //Skotlex: Pet Status Effect Healing
switch (type) {
- case SC__BLOODYLUST:
case SC_BERSERK:
if (!(sce->val2)) { //don't heal if already set
iStatus->heal(bl, status->max_hp, 0, 1); //Do not use percent_heal as this healing must override BERSERK's block.
@@ -9166,8 +9158,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
}
break;
- case SC_RAISINGDRAGON:
- sce->val2 = status->max_hp / 100;// Officially tested its 1%hp drain. [Jobbie]
+ case SC_RAISINGDRAGON:
+ sce->val2 = status->max_hp / 100;// Officially tested its 1%hp drain. [Jobbie]
break;
}
@@ -9537,15 +9529,18 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case SC_BERSERK:
case SC_SATURDAY_NIGHT_FEVER:
+ if(status->hp > 200 && sc && sc->data[SC__BLOODYLUST]){
+ status_percent_heal(bl, 100, 0);
+ status_change_end(bl, SC__BLOODYLUST, INVALID_TIMER);
+ }else
//If val2 is removed, no HP penalty (dispelled?) [Skotlex]
- if (status->hp > 100 && sce->val2)
+ if(status->hp > 100 && sce->val2)
iStatus->set_hp(bl, 100, 0);
if(sc->data[SC_ENDURE] && sc->data[SC_ENDURE]->val4 == 2)
{
sc->data[SC_ENDURE]->val4 = 0;
status_change_end(bl, SC_ENDURE, INVALID_TIMER);
}
- case SC__BLOODYLUST:
sc_start4(bl, SC_GDSKILL_REGENERATION, 100, 10,0,0,(RGN_HP|RGN_SP), skill->get_time(LK_BERSERK, sce->val1));
if( type == SC_SATURDAY_NIGHT_FEVER ) //Sit down force of Saturday Night Fever has the duration of only 3 seconds.
sc_start(bl,SC_SITDOWN_FORCE,100,sce->val1,skill->get_time2(WM_SATURDAY_NIGHT_FEVER,sce->val1));
@@ -9860,7 +9855,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
break;
case SC_BERSERK:
opt_flag = 0;
- // case SC__BLOODYLUST:
sc->opt3 &= ~OPT3_BERSERK;
break;
// case ???: // doesn't seem to do anything
@@ -10249,7 +10243,6 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
return 0;
}
break;
- case SC__BLOODYLUST:
case SC_BERSERK:
// 5% every 10 seconds [DracoRPG]
if( --( sce->val3 ) > 0 && iStatus->charge(bl, sce->val2, 0) && status->hp > 100 )
@@ -11070,7 +11063,6 @@ int status_change_clear_buffs (struct block_list* bl, int type)
if(!(type&4))
continue;
break;
- case SC__BLOODYLUST:
case SC_BERSERK:
case SC_SATURDAY_NIGHT_FEVER:
if(type&4)