Prohibit entering combat with self damage skills.

This commit is contained in:
MobiusDevelopment
2020-08-29 21:06:19 +00:00
parent a5219616ff
commit 2e51962345
32 changed files with 122 additions and 122 deletions

View File

@@ -1166,7 +1166,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// Flag the attacker if it's a PlayerInstance outside a PvP area
final PlayerInstance player = getActingPlayer();
if (player != null)
if ((player != null) && (player != target))
{
AttackStanceTaskManager.getInstance().addAttackStanceTask(player);
player.updatePvPStatus(target);
@@ -4397,14 +4397,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
// Start attack stance and notify being attacked.
if (target.hasAI())
if ((this != target))
{
target.getAI().clientStartAutoAttack();
target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, this);
if (target.hasAI())
{
target.getAI().clientStartAutoAttack();
target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, this);
}
getAI().clientStartAutoAttack();
}
getAI().clientStartAutoAttack();
// ImmobileDamageBonus and ImmobileDamageResist effect bonuses.
double damage = damageValue;
if (target.isImmobilized())