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

@@ -71,13 +71,11 @@ public class DamOverTimePercent extends AbstractEffect
{
return skill.isToggle();
}
damage = effected.getCurrentHp() - 1;
}
}
effector.doAttack(damage, effected, skill, true, false, false, false);
return skill.isToggle();
}
}

View File

@@ -1167,7 +1167,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);
@@ -4400,14 +4400,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())