Gain HP bonus only from enchanted armor items.
This commit is contained in:
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final int bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus * chaBonus;
|
baseValue *= conBonus * chaBonus;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final int bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus * chaBonus;
|
baseValue *= conBonus * chaBonus;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final int bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus * chaBonus;
|
baseValue *= conBonus * chaBonus;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final int bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus * chaBonus;
|
baseValue *= conBonus * chaBonus;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final long bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus * chaBonus;
|
baseValue *= conBonus * chaBonus;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final long bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus * chaBonus;
|
baseValue *= conBonus * chaBonus;
|
||||||
|
@@ -26,9 +26,6 @@ public enum ArmorType implements ItemType
|
|||||||
HEAVY,
|
HEAVY,
|
||||||
MAGIC,
|
MAGIC,
|
||||||
SIGIL,
|
SIGIL,
|
||||||
RING,
|
|
||||||
EARRING,
|
|
||||||
NECKLACE,
|
|
||||||
|
|
||||||
// L2J CUSTOM
|
// L2J CUSTOM
|
||||||
SHIELD;
|
SHIELD;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final int bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus;
|
baseValue *= conBonus;
|
||||||
return Stats.defaultValue(creature, stat, baseValue);
|
return Stats.defaultValue(creature, stat, baseValue);
|
||||||
|
@@ -26,9 +26,6 @@ public enum ArmorType implements ItemType
|
|||||||
HEAVY,
|
HEAVY,
|
||||||
MAGIC,
|
MAGIC,
|
||||||
SIGIL,
|
SIGIL,
|
||||||
RING,
|
|
||||||
EARRING,
|
|
||||||
NECKLACE,
|
|
||||||
|
|
||||||
// L2J CUSTOM
|
// L2J CUSTOM
|
||||||
SHIELD;
|
SHIELD;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final int bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus;
|
baseValue *= conBonus;
|
||||||
return Stats.defaultValue(creature, stat, baseValue);
|
return Stats.defaultValue(creature, stat, baseValue);
|
||||||
|
@@ -26,9 +26,6 @@ public enum ArmorType implements ItemType
|
|||||||
HEAVY,
|
HEAVY,
|
||||||
MAGIC,
|
MAGIC,
|
||||||
SIGIL,
|
SIGIL,
|
||||||
RING,
|
|
||||||
EARRING,
|
|
||||||
NECKLACE,
|
|
||||||
|
|
||||||
// L2J CUSTOM
|
// L2J CUSTOM
|
||||||
SHIELD;
|
SHIELD;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final long bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus;
|
baseValue *= conBonus;
|
||||||
return Stats.defaultValue(creature, stat, baseValue);
|
return Stats.defaultValue(creature, stat, baseValue);
|
||||||
|
@@ -26,9 +26,6 @@ public enum ArmorType implements ItemType
|
|||||||
HEAVY,
|
HEAVY,
|
||||||
MAGIC,
|
MAGIC,
|
||||||
SIGIL,
|
SIGIL,
|
||||||
RING,
|
|
||||||
EARRING,
|
|
||||||
NECKLACE,
|
|
||||||
|
|
||||||
// L2J CUSTOM
|
// L2J CUSTOM
|
||||||
SHIELD;
|
SHIELD;
|
||||||
|
@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||||
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
import com.l2jmobius.gameserver.model.stats.IStatsFunction;
|
||||||
@@ -52,11 +53,18 @@ public class MaxHpFinalizer implements IStatsFunction
|
|||||||
|
|
||||||
// Apply enchanted item's bonus HP
|
// Apply enchanted item's bonus HP
|
||||||
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
for (L2ItemInstance item : player.getInventory().getPaperdollItems(L2ItemInstance::isEnchanted))
|
||||||
|
{
|
||||||
|
if (item.isArmor())
|
||||||
|
{
|
||||||
|
final long bodyPart = item.getItem().getBodyPart();
|
||||||
|
if ((bodyPart != L2Item.SLOT_NECK) && (bodyPart != L2Item.SLOT_LR_EAR) && (bodyPart != L2Item.SLOT_LR_FINGER))
|
||||||
{
|
{
|
||||||
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
baseValue += EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
final double conBonus = creature.getCON() > 0 ? BaseStats.CON.calcBonus(creature) : 1.;
|
||||||
baseValue *= conBonus;
|
baseValue *= conBonus;
|
||||||
return Stats.defaultValue(creature, stat, baseValue);
|
return Stats.defaultValue(creature, stat, baseValue);
|
||||||
|
Reference in New Issue
Block a user