diff options
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 7ca35dc6e..b7350fbd4 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -300,6 +300,9 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i return 0; } + if(sc->data[SC_HERMODE].timer != -1 && flag&BF_MAGIC) + return 0; + if(sc->data[SC_FOGWALL].timer != -1 && flag&BF_MAGIC && rand()%100 < 75 && !(skill_get_inf(skill_num)&INF_GROUND_SKILL)) return 0; @@ -313,7 +316,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i status_change_end(bl, SC_KAUPE, -1); return 0; } - + //Now damage increasing effects if(sc->data[SC_AETERNA].timer!=-1 && skill_num != PA_PRESSURE && skill_num != PF_SOULBURN){ damage<<=1; @@ -382,6 +385,14 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i if((--sci->val3)<=0 || (sci->val2<=0) || skill_num == AL_HOLYLIGHT) status_change_end(bl, SC_KYRIE, -1); } + + //Special no damage states + if(flag&BF_WEAPON && sd && sd->special_state.no_weapon_damage) + damage -= damage*sd->special_state.no_weapon_damage/100; + + if(flag&BF_MAGIC && sd && sd->special_state.no_magic_damage) + damage -= damage*sd->special_state.no_magic_damage/100; + if (damage <= 0) return 0; } @@ -1076,11 +1087,6 @@ static struct Damage battle_calc_weapon_attack( flag.hit =1; } //End hit/miss calculation - if(tsd && tsd->special_state.no_weapon_damage) { - if (wd.div_ < 0) wd.div_*=-1; - return wd; - } - if (flag.hit && !flag.infdef) //No need to do the math for plants { //Hitting attack @@ -2354,12 +2360,6 @@ struct Damage battle_calc_magic_attack( if (flag.infdef && ad.damage > 0) ad.damage = 1; - if (tsd && status_isimmune(target)) { - if (sd && battle_config.gtb_pvp_only) { // [MouseJstr] - MATK_RATE(100 - battle_config.gtb_pvp_only); - } else ad.damage = 0; - } - ad.damage=battle_calc_damage(src,target,ad.damage,ad.div_,skill_num,skill_lv,ad.flag); if (map_flag_gvg(target->m)) ad.damage=battle_calc_gvg_damage(src,target,ad.damage,ad.div_,skill_num,skill_lv,ad.flag); @@ -3280,7 +3280,7 @@ static const struct battle_data_short { { "item_auto_get", &battle_config.item_auto_get }, { "drop_rate0item", &battle_config.drop_rate0item }, { "pvp_exp", &battle_config.pvp_exp }, - { "gtb_pvp_only", &battle_config.gtb_pvp_only }, + { "gtb_sc_immunity", &battle_config.gtb_sc_immunity}, { "guild_max_castles", &battle_config.guild_max_castles }, { "death_penalty_type", &battle_config.death_penalty_type }, { "death_penalty_base", &battle_config.death_penalty_base }, @@ -3675,7 +3675,7 @@ void battle_set_defaults() { battle_config.base_exp_rate=100; battle_config.job_exp_rate=100; battle_config.pvp_exp=1; - battle_config.gtb_pvp_only=0; + battle_config.gtb_sc_immunity=50; battle_config.death_penalty_type=0; battle_config.death_penalty_base=0; battle_config.death_penalty_job=0; |