From ff0b12f05920c90e8587961f06b508ef61a44713 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 30 Jun 2019 14:27:23 +0000 Subject: [PATCH] Fixed cubic removal array index out of bounds exception. --- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- .../data/scripts/handlers/effecthandlers/SummonCubic.java | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java index c5f5a35a2e..e5ae62b8e9 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/SummonCubic.java @@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect // If maximum amount is reached, random cubic is removed. // Players with no mastery can have only one cubic. final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1); - final int currentCubicCount = player.getCubics().size() + 1; + final int currentCubicCount = player.getCubics().size(); // Extra cubics are removed, one by one, randomly. - for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++) + for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++) { final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)]; final CubicInstance removedCubic = player.getCubicById(removedCubicId);