KnockBack and PullBack effects should ignore town NPCs.

This commit is contained in:
MobiusDevelopment 2019-03-31 20:40:13 +00:00
parent c40390286a
commit 1fd1f80099
22 changed files with 44 additions and 99 deletions

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect
private void knockBack(Creature effector, Creature effected)
{
if ((effected == null) || effected.isRaid())
// Prevent knocking back raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}

View File

@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect
@Override
public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
{
// Prevent pulling raids.
if ((effected == null) || effected.isRaid())
{
return;
}
// Prevent pulling NPCs.
if (!effected.isPlayable() && !effected.isMonster())
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}