diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-16 19:35:27 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-16 19:35:27 +0000 |
commit | 0065f7bc871bb17c6d90994759cbf6c7dcee451b (patch) | |
tree | e4dbbe7e238f47d7424414ff0fb50f261ae61989 /src/map/battle.c | |
parent | ee11b9de9b49e292fd6fb0fbf15100288eb2be38 (diff) | |
download | hercules-0065f7bc871bb17c6d90994759cbf6c7dcee451b.tar.gz hercules-0065f7bc871bb17c6d90994759cbf6c7dcee451b.tar.bz2 hercules-0065f7bc871bb17c6d90994759cbf6c7dcee451b.tar.xz hercules-0065f7bc871bb17c6d90994759cbf6c7dcee451b.zip |
- Modified the bNoMagicDamage/bNoWeaponDamage bonuses to be a 0-100 setting. Meaning you can do bonus bNoMagicDamage,50; To make all magic damage be reduced by half. This bonus stack, so two cards with bNoMagicDamage,50 will give magic immunity.
- Removed setting gtb_pvp_only and replaced it with gtb_sc_immunity which specifies the threshold before the bNoMagicDamage starts blocking support statuses as well. ie: gtb_sc_imunity: 75 will mean that "bonus bNoMagicDamage,70;" reduces magic damage by 70%, but does not blocks heal or support status, while "bonus bNoMagicDamage,80;" does.
- Updated GTB's card script to be "bonus bNoMagicDamage,100;"
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7212 54d463be-8e91-2dee-dedb-b68131a5f0ec
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; |