Autor Tema: [Aporte - Fix] - RandomEvents  (Leído 99 veces)

canonmagic

  • Jr. Member
  • **
  • Mensajes: 52
  • Karma: +0/-0
    • Ver Perfil
[Aporte - Fix] - RandomEvents
« en: Julio 12, 2018, 05:43:49 pm »
Buenas, anduve echandole un ojo a los RandomEvents y note que habia un par de cosas que parecian no funcionar bien asi que lo estuve revisando y le hize un par de arreglos aqui dejo los diff:

1.- Al EventRandomManager le hize un par de cambios en los timers porque estos se montaban uno encima del otro causando que los tiempos estuvieran incorrectos ademas de que se iniciaban multiples eventos a la vez, tambien habia un error que arregle con los mismos timers que no iniciaban el "endMod" cada vez que terminaba el timer del evento y un pequeño error en los array que causaba que el ultimo elemento de EVENTS no fuera seleccionado

2.- Al SearchChest le hize varios cambios: en el top de players debido a que generaba un 50% de pjs participantes en el top en vez de una cantidad determinada y si un solo player participaba no le daba absolutamente nada debido a que el array quedaba en 1/2 "Yo lo deje en un top 10" y un par de detalles en el html y anucios. Y agregue al terminar el uso del metodo para entregar los rewards. Ademas de el mismo error con EVENTS pero en este caso con los LOCS.

3.- Al html solo le agregue un pequeño detalle para el mod SearchChest "Decia kills en vez de puntos y se veia medio raro  ::)"

Código
### Eclipse Workspace Patch 1.0
#P C4_Mods
Index: src/main/engine/events/daily/randoms/EventRandomManager.java
===================================================================
--- src/main/engine/events/daily/randoms/EventRandomManager.java (revision 1100)
+++ src/main/engine/events/daily/randoms/EventRandomManager.java (working copy)
@@ -69,7 +69,7 @@
  switch (getState())
  {
  case START:
- startTimer("randomEvent", ConfigData.RANDOM_TIME_BETWEEN_EVENTS * 60 * 1000, null, null, true);// 1hs
+ startTimer("randomEvent", ConfigData.RANDOM_TIME_BETWEEN_EVENTS * 60 * 1000, null, null, false);// 1hs
  break;
  case END:
 
@@ -84,8 +84,13 @@
  {
  case "randomEvent":
  {
+ // Para asegurarse que no haya otro Mod activo
+ if (mod != null)
+ {
+ mod.endMod();
+ }
  // Random event
- mod = EVENTS.get(Rnd.get(EVENTS.size() - 1));
+ mod = EVENTS.get(Rnd.get(EVENTS.size()));
  // Init mod
  mod.startMod();
  // Start finish task
@@ -99,6 +104,8 @@
  {
  mod.endMod();
  }
+ // Se crea el bucle de timers para evitar la sobreposicion de tiempos
+ startTimer("randomEvent", ConfigData.RANDOM_TIME_BETWEEN_EVENTS * 60 * 1000, null, null, false);// 1hs
  break;
  }
  }

Código
### Eclipse Workspace Patch 1.0
#P C4_Mods
Index: src/main/engine/events/daily/randoms/type/SearchChest.java
===================================================================
--- src/main/engine/events/daily/randoms/type/SearchChest.java (revision 1100)
+++ src/main/engine/events/daily/randoms/type/SearchChest.java (working copy)
@@ -28,14 +28,14 @@
 import main.holders.objects.NpcHolder;
 import main.holders.objects.PlayerHolder;
 import main.packets.ObjectPosition;
+import main.util.UtilMessage;
 import main.util.UtilSpawn;
 import main.util.builders.html.Html;
 import net.sf.l2j.gameserver.model.actor.instance.enums.TeamType;
 import net.sf.l2j.gameserver.model.holder.LocationHolder;
 import net.sf.l2j.gameserver.model.skills.effects.enums.AbnormalEffectType;
 import net.sf.l2j.gameserver.model.world.L2World;
-import net.sf.l2j.gameserver.network.clientpackets.Say2.SayType;
-import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
+import net.sf.l2j.gameserver.network.clientpackets.Say2;
 import net.sf.l2j.gameserver.util.Broadcast;
 import net.sf.l2j.util.lib.Rnd;
 
@@ -51,7 +51,7 @@
  // DEATH_PASS,
  // DRAGON_VALLEY,
  // TOWER_OF_INSOLENCE,
- BLASSING_SWAMP,
+ BLAZING_SWAMP,
  // PLAINS_OF_GLORY,
  // BREKA_STRONGHOLD,
  // FIELD_OF_MASSACRE,
@@ -164,107 +164,107 @@
  LOCS.get(LocType.CEMETERY).add(new LocationHolder(179220, 15465, -3172));
 
  // ------------------------------------------------------------------------
- LOCS.put(LocType.BLASSING_SWAMP, new ArrayList<>());
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142085, -18114, -3231));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143236, -20535, -3163));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145300, -21378, -3176));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149386, -23931, -3432));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144639, -25477, -2155));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143405, -25055, -2066));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148154, -20274, -3049));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(150048, -17955, -3044));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152342, -11796, -4483));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152425, -8279, -4492));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151391, -7563, -4461));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(150069, -6352, -4376));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147601, -5950, -4550));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146238, -7036, -4496));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143215, -8306, -4636));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139472, -10414, -4656));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137645, -12104, -4287));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137864, -13163, -4294));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139132, -13934, -4327));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138927, -15927, -4299));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140554, -15782, -4422));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142994, -14669, -4439));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144522, -16152, -4147));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146336, -16757, -3777));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149626, -16429, -3091));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151635, -15976, -2929));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153734, -14038, -3746));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154818, -11801, -3994));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154852, -9708, -4236));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(155657, -6926, -4085));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153094, -16560, -2955));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146155, -9388, -4446));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145330, -10950, -4447));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145132, -12112, -4434));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144651, -12501, -4378));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144333, -14525, -4343));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144012, -15937, -4259));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145288, -16169, -4025));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146727, -15983, -4062));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147839, -15992, -4306));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148698, -15210, -4450));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149801, -14660, -4434));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(150152, -14597, -4464));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151305, -13845, -4516));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152095, -13914, -4458));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152413, -13002, -4457));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153099, -12243, -4505));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147504, -17241, -3348));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148583, -17219, -3094));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146317, -19304, -3442));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146425, -19299, -3443));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145537, -20635, -3158));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144771, -21653, -3136));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143060, -21486, -3151));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141506, -19838, -3214));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141690, -18305, -3211));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140768, -18034, -3173));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139095, -15698, -4285));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138352, -15226, -4280));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137501, -13594, -4295));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137396, -12341, -4175));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138590, -10545, -4624));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137535, -10498, -3955));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138607, -9138, -4407));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140096, -8822, -4680));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140922, -9044, -4569));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140769, -8009, -4629));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140979, -6620, -4773));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139267, -6912, -4759));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139951, -5786, -4805));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140010, -4901, -4780));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141300, -5982, -4782));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143746, -5066, -4662));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142558, -4465, -4765));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143940, -4408, -4690));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145139, -4277, -4555));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145965, -4587, -4504));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146551, -5802, -4503));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147661, -6197, -4398));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148820, -5439, -4539));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149097, -6689, -4424));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149307, -7918, -4380));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151157, -7614, -4485));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151892, -6289, -4368));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152241, -7053, -4473));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153694, -7964, -4483));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154275, -7484, -4472));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153906, -8368, -4482));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153284, -9849, -4445));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152906, -10818, -4417));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154112, -11378, -4417));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152305, -12215, -4473));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149152, -11586, -4448));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148476, -13337, -4389));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144990, -12759, -4430));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143693, -10567, -4627));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142818, -8733, -4573));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141121, -10344, -4618));
+ LOCS.put(LocType.BLAZING_SWAMP, new ArrayList<>());
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142085, -18114, -3231));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143236, -20535, -3163));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145300, -21378, -3176));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149386, -23931, -3432));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144639, -25477, -2155));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143405, -25055, -2066));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148154, -20274, -3049));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(150048, -17955, -3044));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152342, -11796, -4483));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152425, -8279, -4492));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151391, -7563, -4461));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(150069, -6352, -4376));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147601, -5950, -4550));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146238, -7036, -4496));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143215, -8306, -4636));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139472, -10414, -4656));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137645, -12104, -4287));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137864, -13163, -4294));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139132, -13934, -4327));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138927, -15927, -4299));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140554, -15782, -4422));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142994, -14669, -4439));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144522, -16152, -4147));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146336, -16757, -3777));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149626, -16429, -3091));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151635, -15976, -2929));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153734, -14038, -3746));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154818, -11801, -3994));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154852, -9708, -4236));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(155657, -6926, -4085));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153094, -16560, -2955));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146155, -9388, -4446));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145330, -10950, -4447));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145132, -12112, -4434));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144651, -12501, -4378));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144333, -14525, -4343));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144012, -15937, -4259));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145288, -16169, -4025));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146727, -15983, -4062));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147839, -15992, -4306));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148698, -15210, -4450));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149801, -14660, -4434));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(150152, -14597, -4464));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151305, -13845, -4516));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152095, -13914, -4458));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152413, -13002, -4457));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153099, -12243, -4505));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147504, -17241, -3348));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148583, -17219, -3094));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146317, -19304, -3442));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146425, -19299, -3443));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145537, -20635, -3158));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144771, -21653, -3136));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143060, -21486, -3151));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141506, -19838, -3214));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141690, -18305, -3211));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140768, -18034, -3173));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139095, -15698, -4285));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138352, -15226, -4280));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137501, -13594, -4295));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137396, -12341, -4175));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138590, -10545, -4624));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137535, -10498, -3955));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138607, -9138, -4407));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140096, -8822, -4680));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140922, -9044, -4569));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140769, -8009, -4629));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140979, -6620, -4773));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139267, -6912, -4759));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139951, -5786, -4805));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140010, -4901, -4780));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141300, -5982, -4782));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143746, -5066, -4662));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142558, -4465, -4765));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143940, -4408, -4690));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145139, -4277, -4555));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145965, -4587, -4504));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146551, -5802, -4503));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147661, -6197, -4398));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148820, -5439, -4539));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149097, -6689, -4424));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149307, -7918, -4380));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151157, -7614, -4485));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151892, -6289, -4368));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152241, -7053, -4473));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153694, -7964, -4483));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154275, -7484, -4472));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153906, -8368, -4482));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153284, -9849, -4445));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152906, -10818, -4417));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154112, -11378, -4417));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152305, -12215, -4473));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149152, -11586, -4448));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148476, -13337, -4389));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144990, -12759, -4430));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143693, -10567, -4627));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142818, -8733, -4573));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141121, -10344, -4618));
  // ------------------------------------------------------------------------
  }
 
@@ -288,9 +288,8 @@
  spawn();
  break;
  case END:
-
+ giveRewards();
  playerPoints.clear();
-
  unspawn();
  break;
  }
@@ -301,26 +300,24 @@
  var pointsOrdered = new LinkedHashMap<String, Integer>();
 
  // Sort the list according to your scores
- var LIMIT = playerPoints.size() / 2;
-
+ var LIMIT = 10;
  playerPoints.entrySet().stream().sorted(Entry.<String, Integer> comparingByValue().reversed()).limit(LIMIT).forEach(e ->
  {
  pointsOrdered.put(e.getKey(), e.getValue());
  });
-
  for (var player : L2World.getInstance().getAllPlayers())
  {
  if (pointsOrdered.containsKey(player.getName()))
  {
- // A message is sent to all participants informing the winning team.
- Broadcast.toAllOnlinePlayers(new CreatureSay(SayType.TELL, "", "Congratulations winner!"));
+ // A message is sent to all winners.
+ UtilMessage.sendCreatureMsg(player, Say2.SayType.ANNOUNCEMENT, "Event: ", "Congratulations Winner!!");
  // Prizes are awarded.
  ConfigData.CHEST_REWARDS.forEach(rh -> player.getInventory().addItem("Event", rh.getRewardId(), rh.getRewardCount(), player, true));
  }
  }
 
  // The html of the ranking is generated
- var hb = Html.eventRanking(pointsOrdered);
+ var hb = Html.eventRankingPoints(pointsOrdered);
 
  for (var player : L2World.getInstance().getAllPlayers())
  {
@@ -331,7 +328,7 @@
  }
  else
  {
- // UtilMessage.sendScreenMessage("Ganador de la busqueda del tesoro: " + pointsOrdered.get(key), time, list);
+ // Broadcast.announceToOnlinePlayers("Ganador del evento: " + pointsOrdered.get(player.getName()));
  }
  }
  }
@@ -341,7 +338,7 @@
  // Delete all old chest.
  unspawn();
  // location type random.
- var locRandom = LocType.values()[Rnd.get(LocType.values().length - 1)];
+ var locRandom = LocType.values()[Rnd.get(LocType.values().length)];
  // List of locations.
  var locList = LOCS.get(locRandom);
  // Place name
@@ -395,10 +392,12 @@
  if (!playerPoints.containsKey(player.getName()))
  {
  playerPoints.put(player.getName(), 0);
+
  }
 
  var points = playerPoints.get(player.getName());
  playerPoints.put(player.getName(), ++points);
+ UtilMessage.sendCreatureMsg(player, Say2.SayType.ANNOUNCEMENT, "Event: ", "Punto Obtenido!!");
  }
 
  /**

Código
### Eclipse Workspace Patch 1.0
#P C4_Mods
Index: src/main/util/builders/html/Html.java
===================================================================
--- src/main/util/builders/html/Html.java (revision 1100)
+++ src/main/util/builders/html/Html.java (working copy)
@@ -136,6 +136,43 @@
  return hb;
  }
 
+ public static HtmlBuilder eventRankingPoints(Map<String, Integer> pointsOrdered)
+ {
+ var hb = new HtmlBuilder(HtmlType.HTML);
+ hb.append(START);
+ hb.append(head("TOP 10"));
+ hb.append("<center>");
+ hb.append("<br>");
+
+ hb.append(image(L2UI_CH3.br_bar2_mp, 280, 1));
+ hb.append("<table width=280 bgcolor=000000>");
+ hb.append("<tr>");
+ hb.append("<td width=16 align=center></td>");
+ hb.append("<td width=214 align=center>Player</td>");
+ hb.append("<td width=50 align=center>Points</td>");
+ hb.append("</tr>");
+ hb.append("</table>");
+ hb.append(image(L2UI_CH3.br_bar2_mp, 280, 1));
+
+ int cont = 0;
+ for (Entry<String, Integer> entry : pointsOrdered.entrySet())
+ {
+ cont++;
+ hb.append("<table width=280", cont % 2 == 0 ? " bgcolor=000000>" : ">");
+ hb.append("<tr>");
+ hb.append("<td width=16 height=22 align=center>", image(POS[cont - 1], 16, 16), "</td>");
+ hb.append("<td width=214 align=center>", entry.getKey(), "</td>");
+ hb.append("<td width=50 align=center>", entry.getValue(), "</td>");
+ hb.append("</tr>");
+ hb.append("</table>");
+ hb.append(image(L2UI_CH3.br_bar2_mp, 280, 1));
+ }
+ hb.append("</center>");
+ hb.append(END);
+
+ return hb;
+ }
+
  /**
  * A color is assigned according to the character's lvl
  * @param lvl

fissban

  • Administrador
  • Full Member
  • *
  • Mensajes: 196
  • Karma: +0/-0
    • Ver Perfil
Re:[Aporte - Fix] - RandomEvents
« Respuesta #1 en: Julio 13, 2018, 11:00:43 am »
varios de los arreglos que has echo me gustan aunque otros concidero que son de cada programador, como la entrega de los premios yo en su momento concidere premiar al 50% de los jugadores q mas cofres abran pero no concidere la posibiliadad de q solo hubiera un participante asiq hice este arreglo
Código
var LIMIT = playerPoints.size() > 1 ? playerPoints.size() / 2 : 1;

y durante el spawn de los chest los hice invulnerable para evitar que los maten con ataques de distancia.

Código
Index: src/main/engine/events/daily/randoms/type/SearchChest.java
===================================================================
--- src/main/engine/events/daily/randoms/type/SearchChest.java (revision 1121)
+++ src/main/engine/events/daily/randoms/type/SearchChest.java (working copy)
@@ -38,7 +38,7 @@
  // DEATH_PASS,
  // DRAGON_VALLEY,
  // TOWER_OF_INSOLENCE,
- BLASSING_SWAMP,
+ BLAZING_SWAMP,
  // PLAINS_OF_GLORY,
  // BREKA_STRONGHOLD,
  // FIELD_OF_MASSACRE,
@@ -151,107 +151,107 @@
  LOCS.get(LocType.CEMETERY).add(new LocationHolder(179220, 15465, -3172));
 
  // ------------------------------------------------------------------------
- LOCS.put(LocType.BLASSING_SWAMP, new ArrayList<>());
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142085, -18114, -3231));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143236, -20535, -3163));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145300, -21378, -3176));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149386, -23931, -3432));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144639, -25477, -2155));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143405, -25055, -2066));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148154, -20274, -3049));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(150048, -17955, -3044));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152342, -11796, -4483));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152425, -8279, -4492));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151391, -7563, -4461));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(150069, -6352, -4376));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147601, -5950, -4550));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146238, -7036, -4496));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143215, -8306, -4636));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139472, -10414, -4656));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137645, -12104, -4287));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137864, -13163, -4294));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139132, -13934, -4327));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138927, -15927, -4299));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140554, -15782, -4422));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142994, -14669, -4439));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144522, -16152, -4147));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146336, -16757, -3777));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149626, -16429, -3091));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151635, -15976, -2929));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153734, -14038, -3746));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154818, -11801, -3994));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154852, -9708, -4236));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(155657, -6926, -4085));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153094, -16560, -2955));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146155, -9388, -4446));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145330, -10950, -4447));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145132, -12112, -4434));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144651, -12501, -4378));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144333, -14525, -4343));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144012, -15937, -4259));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145288, -16169, -4025));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146727, -15983, -4062));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147839, -15992, -4306));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148698, -15210, -4450));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149801, -14660, -4434));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(150152, -14597, -4464));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151305, -13845, -4516));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152095, -13914, -4458));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152413, -13002, -4457));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153099, -12243, -4505));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147504, -17241, -3348));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148583, -17219, -3094));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146317, -19304, -3442));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146425, -19299, -3443));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145537, -20635, -3158));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144771, -21653, -3136));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143060, -21486, -3151));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141506, -19838, -3214));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141690, -18305, -3211));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140768, -18034, -3173));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139095, -15698, -4285));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138352, -15226, -4280));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137501, -13594, -4295));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137396, -12341, -4175));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138590, -10545, -4624));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(137535, -10498, -3955));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(138607, -9138, -4407));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140096, -8822, -4680));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140922, -9044, -4569));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140769, -8009, -4629));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140979, -6620, -4773));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139267, -6912, -4759));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(139951, -5786, -4805));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(140010, -4901, -4780));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141300, -5982, -4782));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143746, -5066, -4662));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142558, -4465, -4765));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143940, -4408, -4690));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145139, -4277, -4555));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(145965, -4587, -4504));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(146551, -5802, -4503));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(147661, -6197, -4398));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148820, -5439, -4539));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149097, -6689, -4424));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149307, -7918, -4380));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151157, -7614, -4485));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(151892, -6289, -4368));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152241, -7053, -4473));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153694, -7964, -4483));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154275, -7484, -4472));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153906, -8368, -4482));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(153284, -9849, -4445));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152906, -10818, -4417));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(154112, -11378, -4417));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(152305, -12215, -4473));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(149152, -11586, -4448));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(148476, -13337, -4389));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(144990, -12759, -4430));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(143693, -10567, -4627));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(142818, -8733, -4573));
- LOCS.get(LocType.BLASSING_SWAMP).add(new LocationHolder(141121, -10344, -4618));
+ LOCS.put(LocType.BLAZING_SWAMP, new ArrayList<>());
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142085, -18114, -3231));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143236, -20535, -3163));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145300, -21378, -3176));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149386, -23931, -3432));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144639, -25477, -2155));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143405, -25055, -2066));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148154, -20274, -3049));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(150048, -17955, -3044));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152342, -11796, -4483));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152425, -8279, -4492));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151391, -7563, -4461));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(150069, -6352, -4376));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147601, -5950, -4550));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146238, -7036, -4496));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143215, -8306, -4636));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139472, -10414, -4656));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137645, -12104, -4287));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137864, -13163, -4294));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139132, -13934, -4327));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138927, -15927, -4299));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140554, -15782, -4422));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142994, -14669, -4439));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144522, -16152, -4147));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146336, -16757, -3777));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149626, -16429, -3091));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151635, -15976, -2929));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153734, -14038, -3746));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154818, -11801, -3994));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154852, -9708, -4236));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(155657, -6926, -4085));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153094, -16560, -2955));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146155, -9388, -4446));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145330, -10950, -4447));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145132, -12112, -4434));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144651, -12501, -4378));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144333, -14525, -4343));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144012, -15937, -4259));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145288, -16169, -4025));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146727, -15983, -4062));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147839, -15992, -4306));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148698, -15210, -4450));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149801, -14660, -4434));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(150152, -14597, -4464));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151305, -13845, -4516));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152095, -13914, -4458));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152413, -13002, -4457));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153099, -12243, -4505));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147504, -17241, -3348));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148583, -17219, -3094));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146317, -19304, -3442));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146425, -19299, -3443));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145537, -20635, -3158));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144771, -21653, -3136));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143060, -21486, -3151));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141506, -19838, -3214));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141690, -18305, -3211));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140768, -18034, -3173));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139095, -15698, -4285));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138352, -15226, -4280));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137501, -13594, -4295));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137396, -12341, -4175));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138590, -10545, -4624));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(137535, -10498, -3955));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(138607, -9138, -4407));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140096, -8822, -4680));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140922, -9044, -4569));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140769, -8009, -4629));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140979, -6620, -4773));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139267, -6912, -4759));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(139951, -5786, -4805));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(140010, -4901, -4780));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141300, -5982, -4782));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142735, -5755, -4765));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143746, -5066, -4662));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142558, -4465, -4765));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143940, -4408, -4690));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145139, -4277, -4555));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(145965, -4587, -4504));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(146551, -5802, -4503));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(147661, -6197, -4398));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148820, -5439, -4539));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149097, -6689, -4424));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149307, -7918, -4380));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151157, -7614, -4485));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(151892, -6289, -4368));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152241, -7053, -4473));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153694, -7964, -4483));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154275, -7484, -4472));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153906, -8368, -4482));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(153284, -9849, -4445));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152906, -10818, -4417));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(154112, -11378, -4417));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(152305, -12215, -4473));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(149152, -11586, -4448));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(148476, -13337, -4389));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(144990, -12759, -4430));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(143693, -10567, -4627));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(142818, -8733, -4573));
+ LOCS.get(LocType.BLAZING_SWAMP).add(new LocationHolder(141121, -10344, -4618));
  // ------------------------------------------------------------------------
  }
 
@@ -288,7 +288,7 @@
  var pointsOrdered = new LinkedHashMap<String, Integer>();
 
  // Sort the list according to your scores
- var LIMIT = playerPoints.size() / 2;
+ var LIMIT = playerPoints.size() > 1 ? playerPoints.size() / 2 : 1;
 
  playerPoints.entrySet().stream().sorted(Entry.<String, Integer> comparingByValue().reversed()).limit(LIMIT).forEach(e ->
  {
@@ -328,7 +328,7 @@
  // Delete all old chest.
  unspawn();
  // location type random.
- var locRandom = LocType.values()[Rnd.get(LocType.values().length - 1)];
+ var locRandom = LocType.values()[Rnd.get(LocType.values().length)];
  // List of locations.
  var locList = LOCS.get(locRandom);
  // Place name
@@ -344,6 +344,7 @@
 
  var chest = UtilSpawn.npc(ConfigData.CHEST, new LocationHolder(x, y, z + 100), 0, 0, TeamType.NONE, 0);
  chest.getInstance().startAbnormalEffect(AbnormalEffectType.FLAME);
+ chest.getInstance().setIsInvul(true);
  chests.add(chest);
  }
 
@@ -393,11 +394,8 @@
  */
  private static void unspawn()
  {
- for (var mob : chests)
- {
- mob.getInstance().deleteMe();
- }
-
+ // delete all chest
+ chests.forEach(chest -> chest.getInstance().deleteMe());
  // clear variable.
  chests.clear();
  }


Veo que te has adaptado bien a mi estilo de diseño del engine xD
Gracias, ahora subo todo al svn.