From 2e5a8e64d7b8af3d56b40891c884f9f34706850d Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 30 Apr 2022 22:39:30 +0000 Subject: [PATCH] Reworked Attackable rewardAttributeExp method. --- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- .../org/l2jmobius/gameserver/model/actor/Attackable.java | 5 ++--- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 7a972d45aa..93ad0d53c4 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 7a972d45aa..93ad0d53c4 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 7a972d45aa..93ad0d53c4 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 35655c917e..12084802ed 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Attackable.java index b35b4c9f45..546e47f815 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 8c7fcba7c9..e2b366c103 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Attackable.java index 8c7fcba7c9..e2b366c103 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -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())); } } }