Fixed passive effects not applied when conditions are met.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment 2020-06-14 21:09:20 +00:00
parent e56a1374d3
commit f17155b4f0
45 changed files with 45 additions and 105 deletions

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1251,6 +1251,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1257,6 +1257,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1257,6 +1257,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -926,12 +926,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1257,6 +1257,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1286,6 +1286,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1362,6 +1362,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1362,6 +1362,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected(), true))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1355,6 +1355,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1257,6 +1257,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1257,6 +1257,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1286,6 +1286,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1362,6 +1362,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1362,6 +1362,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected(), true))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1355,6 +1355,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);

View File

@ -922,12 +922,6 @@ public class EffectList
LOGGER.warning("Passive " + skill + " with abnormal type: " + skill.getAbnormalType() + "!");
}
// Check for passive skill conditions.
if (!skill.checkCondition(info.getEffector(), info.getEffected()))
{
return;
}
// Remove previous passives of this id.
_passives.stream().filter(Objects::nonNull).filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
{

View File

@ -1257,6 +1257,8 @@ public abstract class Inventory extends ItemContainer
item.updateDatabase();
}
getOwner().getStat().recalculateStats(!getOwner().isPlayer());
if (getOwner().isPlayer())
{
getOwner().sendPacket(new ExUserInfoEquipSlot(getOwner().getActingPlayer()));

View File

@ -1375,7 +1375,7 @@ public class Skill implements IIdentifiable
}
}
if (passive && checkConditions(SkillConditionScope.PASSIVE, effector, effector))
if (passive)
{
final BuffInfo info = new BuffInfo(effector, effector, this, true, item, null);
applyEffectScope(EffectScope.GENERAL, info, false, true);