Reworked Attackable rewardAttributeExp method.

This commit is contained in:
MobiusDevelopment 2022-04-30 22:39:30 +00:00
parent e2b5238d4e
commit 2e5a8e64d7
7 changed files with 14 additions and 21 deletions

View File

@ -720,13 +720,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}

View File

@ -720,13 +720,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}

View File

@ -720,13 +720,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}

View File

@ -725,13 +725,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}

View File

@ -730,13 +730,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}

View File

@ -730,13 +730,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}

View File

@ -730,13 +730,12 @@ public class Attackable extends Npc
private void rewardAttributeExp(Player player, long damage, long totalDamage)
{
if ((player.getActiveElementalSpiritType() > 0) && (getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE))
if ((getAttributeExp() > 0) && (getElementalSpiritType() != ElementalType.NONE) && (player.getActiveElementalSpiritType() > 0))
{
final int attributeExp = (int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus());
final ElementalSpirit spirit = player.getElementalSpirit(getElementalSpiritType().getSuperior());
if (spirit != null)
{
spirit.addExperience(attributeExp);
spirit.addExperience((int) (((getAttributeExp() * damage) / totalDamage) * player.getElementalSpiritXpBonus()));
}
}
}