Fixes AddEffWhenHit not triggering Magic or Misc (#5628)
* Fixes #5623. * Fixes an issue with AddEffWhenHit not triggering on Magic or Misc type attacks. Thanks to @24msz6eo and @Atemo!
This commit is contained in:
parent
c2303c8f65
commit
78b4f4420d
@ -2488,14 +2488,24 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|||||||
sd = BL_CAST(BL_PC, src);
|
sd = BL_CAST(BL_PC, src);
|
||||||
dstsd = BL_CAST(BL_PC, bl);
|
dstsd = BL_CAST(BL_PC, bl);
|
||||||
|
|
||||||
if(dstsd && attack_type&BF_WEAPON) { //Counter effects.
|
if(dstsd && attack_type & BF_WEAPONMASK) { //Counter effects.
|
||||||
for (const auto &it : dstsd->addeff_atked) {
|
for (const auto &it : dstsd->addeff_atked) {
|
||||||
rate = it.rate;
|
rate = it.rate;
|
||||||
if (attack_type&BF_LONG)
|
if (attack_type&BF_LONG)
|
||||||
rate += it.arrow_rate;
|
rate += it.arrow_rate;
|
||||||
if (!rate)
|
if (rate == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ((it.flag&(ATF_WEAPON|ATF_MAGIC|ATF_MISC)) != (ATF_WEAPON|ATF_MAGIC|ATF_MISC)) {
|
||||||
|
// Trigger has attack type consideration.
|
||||||
|
if ((it.flag&ATF_WEAPON && attack_type&BF_WEAPON) ||
|
||||||
|
(it.flag&ATF_MAGIC && attack_type&BF_MAGIC) ||
|
||||||
|
(it.flag&ATF_MISC && attack_type&BF_MISC))
|
||||||
|
;
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((it.flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT)) { //Trigger has range consideration.
|
if ((it.flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT)) { //Trigger has range consideration.
|
||||||
if((it.flag&ATF_LONG && !(attack_type&BF_LONG)) ||
|
if((it.flag&ATF_LONG && !(attack_type&BF_LONG)) ||
|
||||||
(it.flag&ATF_SHORT && !(attack_type&BF_SHORT)))
|
(it.flag&ATF_SHORT && !(attack_type&BF_SHORT)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user