diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-20 14:35:02 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-20 14:35:02 +0000 |
commit | 844efd7ecae4adb6f2615bc15d4d891d9035703e (patch) | |
tree | a7b759c5ae5dc3b41aca0e9d2366b93c8498f542 /src/map/battle.c | |
parent | d11101c061a9571c34dbbe66534a3a4f1afa99b3 (diff) | |
download | hercules-844efd7ecae4adb6f2615bc15d4d891d9035703e.tar.gz hercules-844efd7ecae4adb6f2615bc15d4d891d9035703e.tar.bz2 hercules-844efd7ecae4adb6f2615bc15d4d891d9035703e.tar.xz hercules-844efd7ecae4adb6f2615bc15d4d891d9035703e.zip |
- Corrected fog of wall to behave as best known. Only takes effect when targetting a character inside it, -50hit/-75% damage when using normal-ranged attacks, -25% damage from all damage skills, 75% chance of all targetted damage skills of failing.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7764 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 9f46147b8..d900a4de4 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -350,9 +350,12 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i (flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) damage=damage*(100-sc->data[SC_DEFENDER].val2)/100; - if(sc->data[SC_FOGWALL].timer != -1 && - (flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) - damage >>=1; + if(sc->data[SC_FOGWALL].timer != -1) { + if(flag&BF_SKILL) //25% reduction + damage -= 25*damage/100; + else if ((flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) + damage >>= 2; //75% reduction + } if(sc->data[SC_ENERGYCOAT].timer!=-1 && flag&BF_WEAPON){ struct status_data *status = status_get_status_data(bl); @@ -398,15 +401,12 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i if (!damage) return 0; } - - //SC effects from caster side. + //SC effects from caster side. Currently none. +/* sc = status_get_sc(src); if (sc && sc->count) { - if(sc->data[SC_FOGWALL].timer != -1 && - (flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) - damage >>=1; } - +*/ if (battle_config.pk_mode && sd && damage) { if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex] @@ -943,7 +943,10 @@ static struct Damage battle_calc_weapon_attack( //Check for critical if(!flag.cri && sstatus->cri && - (!skill_num || skill_num == KN_AUTOCOUNTER || skill_num == SN_SHARPSHOOTING || skill_num == NJ_KIRIKAGE)) + (!skill_num || + skill_num == KN_AUTOCOUNTER || + skill_num == SN_SHARPSHOOTING || + skill_num == NJ_KIRIKAGE)) { short cri = sstatus->cri; if (sd) @@ -1056,9 +1059,8 @@ static struct Damage battle_calc_weapon_attack( hitrate+= sstatus->hit - flee; - if(wd.flag&BF_LONG && ( - (sc && sc->data[SC_FOGWALL].timer!=-1) || - (tsc && tsc->data[SC_FOGWALL].timer!=-1))) + if(wd.flag&BF_LONG && !skill_num && //Fogwall's hit penalty is only for normal ranged attacks. + tsc && tsc->data[SC_FOGWALL].timer!=-1) hitrate-=50; if(sd && flag.arrow) |