Refactored MaxVitalityItemsUsed to MinimumVitalityPoints.

This commit is contained in:
MobiusDev
2018-07-29 10:32:55 +00:00
parent 86fc4f43ed
commit 4a1a3ba909
17 changed files with 171 additions and 171 deletions

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -133,7 +134,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1091,10 +1091,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -24,11 +24,11 @@ import com.l2jmobius.gameserver.model.skills.Skill;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ConditionMaxVitalityItemsUsed extends Condition public class ConditionMinimumVitalityPoints extends Condition
{ {
private final int _count; private final int _count;
public ConditionMaxVitalityItemsUsed(int count) public ConditionMinimumVitalityPoints(int count)
{ {
_count = count; _count = count;
} }
@@ -39,7 +39,7 @@ public class ConditionMaxVitalityItemsUsed extends Condition
final L2PcInstance player = effector.getActingPlayer(); final L2PcInstance player = effector.getActingPlayer();
if (player != null) if (player != null)
{ {
return player.getVitalityItemsUsed() < _count; return player.getVitalityPoints() >= _count;
} }
return false; return false;
} }

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -133,7 +134,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1091,10 +1091,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -24,11 +24,11 @@ import com.l2jmobius.gameserver.model.skills.Skill;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ConditionMaxVitalityItemsUsed extends Condition public class ConditionMinimumVitalityPoints extends Condition
{ {
private final int _count; private final int _count;
public ConditionMaxVitalityItemsUsed(int count) public ConditionMinimumVitalityPoints(int count)
{ {
_count = count; _count = count;
} }
@@ -39,7 +39,7 @@ public class ConditionMaxVitalityItemsUsed extends Condition
final L2PcInstance player = effector.getActingPlayer(); final L2PcInstance player = effector.getActingPlayer();
if (player != null) if (player != null)
{ {
return player.getVitalityItemsUsed() < _count; return player.getVitalityPoints() >= _count;
} }
return false; return false;
} }

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -133,7 +134,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1091,10 +1091,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -24,11 +24,11 @@ import com.l2jmobius.gameserver.model.skills.Skill;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ConditionMaxVitalityItemsUsed extends Condition public class ConditionMinimumVitalityPoints extends Condition
{ {
private final int _count; private final int _count;
public ConditionMaxVitalityItemsUsed(int count) public ConditionMinimumVitalityPoints(int count)
{ {
_count = count; _count = count;
} }
@@ -39,7 +39,7 @@ public class ConditionMaxVitalityItemsUsed extends Condition
final L2PcInstance player = effector.getActingPlayer(); final L2PcInstance player = effector.getActingPlayer();
if (player != null) if (player != null)
{ {
return player.getVitalityItemsUsed() < _count; return player.getVitalityPoints() >= _count;
} }
return false; return false;
} }

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -132,7 +133,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1084,10 +1084,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -24,11 +24,11 @@ import com.l2jmobius.gameserver.model.skills.Skill;
/** /**
* @author Mobius * @author Mobius
*/ */
public class ConditionMaxVitalityItemsUsed extends Condition public class ConditionMinimumVitalityPoints extends Condition
{ {
private final int _count; private final int _count;
public ConditionMaxVitalityItemsUsed(int count) public ConditionMinimumVitalityPoints(int count)
{ {
_count = count; _count = count;
} }
@@ -39,7 +39,7 @@ public class ConditionMaxVitalityItemsUsed extends Condition
final L2PcInstance player = effector.getActingPlayer(); final L2PcInstance player = effector.getActingPlayer();
if (player != null) if (player != null)
{ {
return player.getVitalityItemsUsed() < _count; return player.getVitalityPoints() >= _count;
} }
return false; return false;
} }

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -133,7 +134,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1091,10 +1091,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -1,46 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class ConditionMaxVitalityItemsUsed extends Condition
{
private final int _count;
public ConditionMaxVitalityItemsUsed(int count)
{
_count = count;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
final L2PcInstance player = effector.getActingPlayer();
if (player != null)
{
return player.getVitalityItemsUsed() < _count;
}
return false;
}
}

View File

@@ -0,0 +1,46 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class ConditionMinimumVitalityPoints extends Condition
{
private final int _count;
public ConditionMinimumVitalityPoints(int count)
{
_count = count;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
final L2PcInstance player = effector.getActingPlayer();
if (player != null)
{
return player.getVitalityPoints() >= _count;
}
return false;
}
}

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -133,7 +134,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1091,10 +1091,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -1,46 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class ConditionMaxVitalityItemsUsed extends Condition
{
private final int _count;
public ConditionMaxVitalityItemsUsed(int count)
{
_count = count;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
final L2PcInstance player = effector.getActingPlayer();
if (player != null)
{
return player.getVitalityItemsUsed() < _count;
}
return false;
}
}

View File

@@ -0,0 +1,46 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class ConditionMinimumVitalityPoints extends Condition
{
private final int _count;
public ConditionMinimumVitalityPoints(int count)
{
_count = count;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
final L2PcInstance player = effector.getActingPlayer();
if (player != null)
{
return player.getVitalityPoints() >= _count;
}
return false;
}
}

View File

@@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot; import com.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr; import com.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance; import com.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
import com.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveSkillId;
import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId; import com.l2jmobius.gameserver.model.conditions.ConditionPlayerAgathionId;
@@ -133,7 +134,6 @@ import com.l2jmobius.gameserver.model.conditions.ConditionTargetWeight;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingItemType;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSkill;
import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType; import com.l2jmobius.gameserver.model.conditions.ConditionUsingSlotType;
import com.l2jmobius.gameserver.model.conditions.ConditionMaxVitalityItemsUsed;
import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill; import com.l2jmobius.gameserver.model.conditions.ConditionWithSkill;
import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.type.ArmorType; import com.l2jmobius.gameserver.model.items.type.ArmorType;
@@ -1091,10 +1091,10 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue()))); cond = joinAnd(cond, new ConditionTargetCheckCrtEffect(Boolean.parseBoolean(a.getNodeValue())));
break; break;
} }
case "maxvitalityitemsused": case "minimumvitalitypoints":
{ {
final int count = Integer.decode(getValue(a.getNodeValue(), null)); final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaxVitalityItemsUsed(count)); cond = joinAnd(cond, new ConditionMinimumVitalityPoints(count));
break; break;
} }
} }

View File

@@ -1,46 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class ConditionMaxVitalityItemsUsed extends Condition
{
private final int _count;
public ConditionMaxVitalityItemsUsed(int count)
{
_count = count;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
final L2PcInstance player = effector.getActingPlayer();
if (player != null)
{
return player.getVitalityItemsUsed() < _count;
}
return false;
}
}

View File

@@ -0,0 +1,46 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.conditions;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Mobius
*/
public class ConditionMinimumVitalityPoints extends Condition
{
private final int _count;
public ConditionMinimumVitalityPoints(int count)
{
_count = count;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
final L2PcInstance player = effector.getActingPlayer();
if (player != null)
{
return player.getVitalityPoints() >= _count;
}
return false;
}
}