Skip to content

Commit

Permalink
Updated Defender and Neutral Barrier reductions (fixes #1065)
Browse files Browse the repository at this point in the history
* Defender now reduces Acid Demonstration damage (renewal mode).
* Defender no longer reduces Throw Zeny and Rapid Throw damage.
* Acid Demonstration now misses on targets in Neutral Barrier.
  • Loading branch information
aleos89 committed May 17, 2016
1 parent 0b126ba commit b3c1866
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/map/battle.c
Expand Up @@ -966,9 +966,7 @@ bool battle_check_sc(struct block_list *src, struct block_list *target, struct s
status_change_end(target, SC_SAFETYWALL, INVALID_TIMER);
}

if( (sc->data[SC_NEUTRALBARRIER] || sc->data[SC_NEUTRALBARRIER_MASTER]) && !(skill_get_nk(skill_id)&NK_IGNORE_FLEE) &&
(skill_id == NPC_EARTHQUAKE || (d->flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) )
{
if (sc->data[SC_NEUTRALBARRIER] && ((d->flag&(BF_LONG|BF_MAGIC)) == BF_LONG || skill_id == CR_ACIDDEMONSTRATION)) {
d->dmg_lv = ATK_MISS;
return false;
}
Expand Down Expand Up @@ -1266,7 +1264,13 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
}
#endif

if (sc->data[SC_DEFENDER] && (flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON))
if (sc->data[SC_DEFENDER] &&
skill_id != NJ_ZENYNAGE && skill_id != KO_MUCHANAGE &&
#ifdef RENEWAL
((flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON) || skill_id == CR_ACIDDEMONSTRATION))
#else
(flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON))
#endif
damage -= damage * sc->data[SC_DEFENDER]->val2 / 100;

if(sc->data[SC_ADJUSTMENT] && (flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON))
Expand Down Expand Up @@ -2462,7 +2466,7 @@ static bool is_attack_hitting(struct Damage wd, struct block_list *src, struct b
else if (nk&NK_IGNORE_FLEE)
return true;

if( sc && (sc->data[SC_NEUTRALBARRIER] || sc->data[SC_NEUTRALBARRIER_MASTER]) && (wd.flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON) )
if( sc && sc->data[SC_NEUTRALBARRIER] && (wd.flag&(BF_LONG|BF_MAGIC)) == BF_LONG )
return false;

flee = tstatus->flee;
Expand Down

0 comments on commit b3c1866

Please sign in to comment.