Addition of item condition MaximumVitalityPoints.
Contributed by nasseka.
This commit is contained in:
parent
df605dec7d
commit
f1c9c24194
@ -553,6 +553,9 @@
|
|||||||
<set name="is_sellable" val="false" />
|
<set name="is_sellable" val="false" />
|
||||||
<set name="is_stackable" val="true" />
|
<set name="is_stackable" val="true" />
|
||||||
<set name="handler" val="ItemSkills" />
|
<set name="handler" val="ItemSkills" />
|
||||||
|
<cond>
|
||||||
|
<player MaximumVitalityPoints="140000" />
|
||||||
|
</cond>
|
||||||
<skills>
|
<skills>
|
||||||
<skill id="39577" level="1" /> <!-- Vitality -->
|
<skill id="39577" level="1" /> <!-- Vitality -->
|
||||||
</skills>
|
</skills>
|
||||||
|
@ -63,7 +63,8 @@
|
|||||||
<xs:attribute name="levelRange" type="xs:string" use="optional" />
|
<xs:attribute name="levelRange" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="insideZoneId" type="xs:string" use="optional" />
|
<xs:attribute name="insideZoneId" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="vehicleMounted" type="xs:boolean" use="optional" />
|
<xs:attribute name="vehicleMounted" type="xs:boolean" use="optional" />
|
||||||
<xs:attribute name="MinimumVitalityPoints" type="xs:unsignedShort" use="optional" />
|
<xs:attribute name="MaximumVitalityPoints" type="xs:unsignedInt" use="optional" />
|
||||||
|
<xs:attribute name="MinimumVitalityPoints" type="xs:unsignedInt" use="optional" />
|
||||||
<xs:attribute name="class_id_restriction" type="xs:string" use="optional" />
|
<xs:attribute name="class_id_restriction" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="symbolsealpoints" type="xs:unsignedShort" use="optional" />
|
<xs:attribute name="symbolsealpoints" type="xs:unsignedShort" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
@ -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 org.l2jmobius.gameserver.model.conditions;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.items.Item;
|
||||||
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author `NasSeKa`
|
||||||
|
*/
|
||||||
|
public class ConditionMaximumVitalityPoints extends Condition
|
||||||
|
{
|
||||||
|
private final int _count;
|
||||||
|
|
||||||
|
public ConditionMaximumVitalityPoints(int count)
|
||||||
|
{
|
||||||
|
_count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
|
||||||
|
{
|
||||||
|
final PlayerInstance player = effector.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
return player.getVitalityPoints() < _count;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -49,6 +49,7 @@ import org.l2jmobius.gameserver.model.conditions.ConditionGameTime.CheckGameTime
|
|||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
|
||||||
|
import org.l2jmobius.gameserver.model.conditions.ConditionMaximumVitalityPoints;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
|
import org.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
|
import org.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
|
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
|
||||||
@ -890,6 +891,12 @@ public abstract class DocumentBase
|
|||||||
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
|
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "maximumvitalitypoints":
|
||||||
|
{
|
||||||
|
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
||||||
|
cond = joinAnd(cond, new ConditionMaximumVitalityPoints(count));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "minimumvitalitypoints":
|
case "minimumvitalitypoints":
|
||||||
{
|
{
|
||||||
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
||||||
|
@ -553,6 +553,9 @@
|
|||||||
<set name="is_sellable" val="false" />
|
<set name="is_sellable" val="false" />
|
||||||
<set name="is_stackable" val="true" />
|
<set name="is_stackable" val="true" />
|
||||||
<set name="handler" val="ItemSkills" />
|
<set name="handler" val="ItemSkills" />
|
||||||
|
<cond>
|
||||||
|
<player MaximumVitalityPoints="140000" />
|
||||||
|
</cond>
|
||||||
<skills>
|
<skills>
|
||||||
<skill id="39577" level="1" /> <!-- Vitality -->
|
<skill id="39577" level="1" /> <!-- Vitality -->
|
||||||
</skills>
|
</skills>
|
||||||
|
@ -63,7 +63,8 @@
|
|||||||
<xs:attribute name="levelRange" type="xs:string" use="optional" />
|
<xs:attribute name="levelRange" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="insideZoneId" type="xs:string" use="optional" />
|
<xs:attribute name="insideZoneId" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="vehicleMounted" type="xs:boolean" use="optional" />
|
<xs:attribute name="vehicleMounted" type="xs:boolean" use="optional" />
|
||||||
<xs:attribute name="MinimumVitalityPoints" type="xs:unsignedShort" use="optional" />
|
<xs:attribute name="MaximumVitalityPoints" type="xs:unsignedInt" use="optional" />
|
||||||
|
<xs:attribute name="MinimumVitalityPoints" type="xs:unsignedInt" use="optional" />
|
||||||
<xs:attribute name="class_id_restriction" type="xs:string" use="optional" />
|
<xs:attribute name="class_id_restriction" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="symbolsealpoints" type="xs:unsignedShort" use="optional" />
|
<xs:attribute name="symbolsealpoints" type="xs:unsignedShort" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
@ -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 org.l2jmobius.gameserver.model.conditions;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.items.Item;
|
||||||
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author `NasSeKa`
|
||||||
|
*/
|
||||||
|
public class ConditionMaximumVitalityPoints extends Condition
|
||||||
|
{
|
||||||
|
private final int _count;
|
||||||
|
|
||||||
|
public ConditionMaximumVitalityPoints(int count)
|
||||||
|
{
|
||||||
|
_count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
|
||||||
|
{
|
||||||
|
final PlayerInstance player = effector.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
return player.getVitalityPoints() < _count;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -49,6 +49,7 @@ import org.l2jmobius.gameserver.model.conditions.ConditionGameTime.CheckGameTime
|
|||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
|
||||||
|
import org.l2jmobius.gameserver.model.conditions.ConditionMaximumVitalityPoints;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
|
import org.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
|
import org.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
|
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
|
||||||
@ -890,6 +891,12 @@ public abstract class DocumentBase
|
|||||||
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
|
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "maximumvitalitypoints":
|
||||||
|
{
|
||||||
|
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
||||||
|
cond = joinAnd(cond, new ConditionMaximumVitalityPoints(count));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "minimumvitalitypoints":
|
case "minimumvitalitypoints":
|
||||||
{
|
{
|
||||||
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
||||||
|
@ -553,6 +553,9 @@
|
|||||||
<set name="is_sellable" val="false" />
|
<set name="is_sellable" val="false" />
|
||||||
<set name="is_stackable" val="true" />
|
<set name="is_stackable" val="true" />
|
||||||
<set name="handler" val="ItemSkills" />
|
<set name="handler" val="ItemSkills" />
|
||||||
|
<cond>
|
||||||
|
<player MaximumVitalityPoints="140000" />
|
||||||
|
</cond>
|
||||||
<skills>
|
<skills>
|
||||||
<skill id="39577" level="1" /> <!-- Vitality -->
|
<skill id="39577" level="1" /> <!-- Vitality -->
|
||||||
</skills>
|
</skills>
|
||||||
|
@ -63,7 +63,8 @@
|
|||||||
<xs:attribute name="levelRange" type="xs:string" use="optional" />
|
<xs:attribute name="levelRange" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="insideZoneId" type="xs:string" use="optional" />
|
<xs:attribute name="insideZoneId" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="vehicleMounted" type="xs:boolean" use="optional" />
|
<xs:attribute name="vehicleMounted" type="xs:boolean" use="optional" />
|
||||||
<xs:attribute name="MinimumVitalityPoints" type="xs:unsignedShort" use="optional" />
|
<xs:attribute name="MaximumVitalityPoints" type="xs:unsignedInt" use="optional" />
|
||||||
|
<xs:attribute name="MinimumVitalityPoints" type="xs:unsignedInt" use="optional" />
|
||||||
<xs:attribute name="class_id_restriction" type="xs:string" use="optional" />
|
<xs:attribute name="class_id_restriction" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="symbolsealpoints" type="xs:unsignedShort" use="optional" />
|
<xs:attribute name="symbolsealpoints" type="xs:unsignedShort" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
@ -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 org.l2jmobius.gameserver.model.conditions;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.items.Item;
|
||||||
|
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author `NasSeKa`
|
||||||
|
*/
|
||||||
|
public class ConditionMaximumVitalityPoints extends Condition
|
||||||
|
{
|
||||||
|
private final int _count;
|
||||||
|
|
||||||
|
public ConditionMaximumVitalityPoints(int count)
|
||||||
|
{
|
||||||
|
_count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean testImpl(Creature effector, Creature effected, Skill skill, Item item)
|
||||||
|
{
|
||||||
|
final PlayerInstance player = effector.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
return player.getVitalityPoints() < _count;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -49,6 +49,7 @@ import org.l2jmobius.gameserver.model.conditions.ConditionGameTime.CheckGameTime
|
|||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicAnd;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicNot;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
|
import org.l2jmobius.gameserver.model.conditions.ConditionLogicOr;
|
||||||
|
import org.l2jmobius.gameserver.model.conditions.ConditionMaximumVitalityPoints;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
|
import org.l2jmobius.gameserver.model.conditions.ConditionMinDistance;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
|
import org.l2jmobius.gameserver.model.conditions.ConditionMinimumVitalityPoints;
|
||||||
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
|
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
|
||||||
@ -890,6 +891,12 @@ public abstract class DocumentBase
|
|||||||
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
|
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "maximumvitalitypoints":
|
||||||
|
{
|
||||||
|
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
||||||
|
cond = joinAnd(cond, new ConditionMaximumVitalityPoints(count));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "minimumvitalitypoints":
|
case "minimumvitalitypoints":
|
||||||
{
|
{
|
||||||
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
final int count = Integer.decode(getValue(a.getNodeValue(), null));
|
||||||
|
Loading…
Reference in New Issue
Block a user