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

@ -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())

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

@ -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())

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

@ -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())

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

@ -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())

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

@ -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())

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

@ -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())

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

@ -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())

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

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

View File

@ -71,10 +71,10 @@ public class DamOverTimePercent extends AbstractEffect
{
return info.getSkill().isToggle();
}
damage = info.getEffected().getCurrentHp() - 1;
}
}
info.getEffected().reduceCurrentHpByDOT(damage, info.getEffector(), info.getSkill());
info.getEffected().notifyDamageReceived(damage, info.getEffector(), info.getSkill(), false, true);
return info.getSkill().isToggle();

View File

@ -71,10 +71,10 @@ public class DamOverTimePercent extends AbstractEffect
{
return info.getSkill().isToggle();
}
damage = info.getEffected().getCurrentHp() - 1;
}
}
info.getEffected().reduceCurrentHpByDOT(damage, info.getEffector(), info.getSkill());
info.getEffected().notifyDamageReceived(damage, info.getEffector(), info.getSkill(), false, true);
return info.getSkill().isToggle();

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

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

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

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

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

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

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())

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())

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

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

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