Addition of item condition MaximumVitalityPoints.

Contributed by nasseka.
This commit is contained in:
MobiusDevelopment 2021-07-01 22:47:43 +00:00
parent df605dec7d
commit f1c9c24194
12 changed files with 174 additions and 3 deletions

View File

@ -553,6 +553,9 @@
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="handler" val="ItemSkills" />
<cond>
<player MaximumVitalityPoints="140000" />
</cond>
<skills>
<skill id="39577" level="1" /> <!-- Vitality -->
</skills>

View File

@ -63,7 +63,8 @@
<xs:attribute name="levelRange" 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="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="symbolsealpoints" type="xs:unsignedShort" use="optional" />
</xs:complexType>

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 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;
}
}

View File

@ -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.ConditionLogicNot;
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.ConditionMinimumVitalityPoints;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
@ -890,6 +891,12 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
break;
}
case "maximumvitalitypoints":
{
final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaximumVitalityPoints(count));
break;
}
case "minimumvitalitypoints":
{
final int count = Integer.decode(getValue(a.getNodeValue(), null));

View File

@ -553,6 +553,9 @@
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="handler" val="ItemSkills" />
<cond>
<player MaximumVitalityPoints="140000" />
</cond>
<skills>
<skill id="39577" level="1" /> <!-- Vitality -->
</skills>

View File

@ -63,7 +63,8 @@
<xs:attribute name="levelRange" 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="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="symbolsealpoints" type="xs:unsignedShort" use="optional" />
</xs:complexType>

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 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;
}
}

View File

@ -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.ConditionLogicNot;
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.ConditionMinimumVitalityPoints;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
@ -890,6 +891,12 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
break;
}
case "maximumvitalitypoints":
{
final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaximumVitalityPoints(count));
break;
}
case "minimumvitalitypoints":
{
final int count = Integer.decode(getValue(a.getNodeValue(), null));

View File

@ -553,6 +553,9 @@
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="handler" val="ItemSkills" />
<cond>
<player MaximumVitalityPoints="140000" />
</cond>
<skills>
<skill id="39577" level="1" /> <!-- Vitality -->
</skills>

View File

@ -63,7 +63,8 @@
<xs:attribute name="levelRange" 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="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="symbolsealpoints" type="xs:unsignedShort" use="optional" />
</xs:complexType>

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 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;
}
}

View File

@ -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.ConditionLogicNot;
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.ConditionMinimumVitalityPoints;
import org.l2jmobius.gameserver.model.conditions.ConditionPlayerActiveEffectId;
@ -890,6 +891,12 @@ public abstract class DocumentBase
cond = joinAnd(cond, new ConditionPlayerInInstance(Boolean.parseBoolean(a.getNodeValue())));
break;
}
case "maximumvitalitypoints":
{
final int count = Integer.decode(getValue(a.getNodeValue(), null));
cond = joinAnd(cond, new ConditionMaximumVitalityPoints(count));
break;
}
case "minimumvitalitypoints":
{
final int count = Integer.decode(getValue(a.getNodeValue(), null));