Players with no mastery can only have one cubic.
This commit is contained in:
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
@@ -90,9 +90,10 @@ public class SummonCubic extends AbstractEffect
|
|||||||
{
|
{
|
||||||
// If maximum amount is reached, random cubic is removed.
|
// If maximum amount is reached, random cubic is removed.
|
||||||
// Players with no mastery can have only one cubic.
|
// Players with no mastery can have only one cubic.
|
||||||
final double allowedCubicCount = effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 0);
|
final double allowedCubicCount = player.getStat().getValue(Stats.MAX_CUBIC, 1);
|
||||||
final int currentCubicCount = player.getCubics().size();
|
|
||||||
// Extra cubics are removed, one by one, randomly.
|
// Extra cubics are removed, one by one, randomly.
|
||||||
|
final int currentCubicCount = player.getCubics().size();
|
||||||
if (currentCubicCount >= allowedCubicCount)
|
if (currentCubicCount >= allowedCubicCount)
|
||||||
{
|
{
|
||||||
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
player.getCubics().values().stream().skip((int) (currentCubicCount * Rnd.nextDouble())).findAny().get().deactivate();
|
||||||
@@ -107,7 +108,7 @@ public class SummonCubic extends AbstractEffect
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adding a new cubic.
|
// Adding a new cubic.
|
||||||
player.addCubic(new CubicInstance(effected.getActingPlayer(), effector.getActingPlayer(), template));
|
player.addCubic(new CubicInstance(player, effector.getActingPlayer(), template));
|
||||||
player.sendPacket(new ExUserInfoCubic(player));
|
player.sendPacket(new ExUserInfoCubic(player));
|
||||||
player.broadcastCharInfo();
|
player.broadcastCharInfo();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user