Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - fissban

Páginas: [1] 2 3 4 5 6 ... 11
1
Issues / Re:[Problema] SkillDurationList
« en: Agosto 09, 2018, 03:34:04 pm »
mostrame el config

2
General / Re:[Duda - Skills SA]
« en: Julio 30, 2018, 11:54:15 pm »
es simple...algo asi

Código
	    <add order="0x40" stat="PHYSICAL_ATTACK" val="#final">
      <player hp="30"/>
    </add>

3
Issues / Re:[SA & Efectos adicionales - Armas] - Error Parte 1
« en: Julio 28, 2018, 12:39:07 pm »
igual esto que arme fue con miras a un futuro.

Mi idea es comenzar a trasladar muchos skillhandlers a effectos, es decir que el skill quedaria para definir la accion del lanzamiento del mismo y las acciones luego de ser lanzado que quede dependiente de los efectos pero si intento hacer todo hoy no terminaba en navidad :P

4
Issues / Re:[SA & Efectos adicionales - Armas] - Error Parte 1
« en: Julio 28, 2018, 02:23:23 am »
disculpa que no te avise, aca te dejo el diff de lo que hice estos dias

https://sourceforge.net/p/l2jadminsc4/code/1130/

5
Issues / Re:[Error Crítico] Quest Fate's Whisper
« en: Julio 28, 2018, 01:53:10 am »
disculpa la demora pero esta con otro tema del pack, aqui te dejo un diff y confirmame si te va bien

Código
Index: data/html/quests/Q234_FatesWhisper/7833-01a.htm
===================================================================
--- data/html/quests/Q234_FatesWhisper/7833-01a.htm (revision 1125)
+++ data/html/quests/Q234_FatesWhisper/7833-01a.htm (working copy)
@@ -1,4 +1,6 @@
-<html><body>Magister Kaspar:<br>
+<html><body>
+Magister Kaspar:<br>
 Oh! You're the one who explored the Tower of Insolence on behalf of Reorin! Hardin's Academy is not your ordinary place of learning. It constantly monitors world affairs.<br>
 Recently there have been interesting developments around the Tower of Insolence. Even now, forces are gathering to fight over ancient relics that are supposedly hidden in the tower. Of course, our interests are different from theirs...<br>
-<a action="bypass -h Quest Q234_FatesWhisper 7833-01b.htm">"What are your interests?"</a>
\ No newline at end of file
+<a action="bypass -h Quest Q234_FatesWhisper 7833-01b.htm">"What are your interests?"</a>
+</body></html>
\ No newline at end of file

6
Issues / Re:[SA & Efectos adicionales - Armas] - Error Parte 1
« en: Julio 20, 2018, 10:41:56 pm »
hice varios ajustes, probalo y me contas

Código
Index: java/net/sf/l2j/gameserver/handler/skill/SkillHeal.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/skill/SkillHeal.java (revision 1128)
+++ java/net/sf/l2j/gameserver/handler/skill/SkillHeal.java (working copy)
@@ -13,7 +13,6 @@
 import net.sf.l2j.gameserver.model.actor.instance.enums.ShotType;
 import net.sf.l2j.gameserver.model.skills.Skill;
 import net.sf.l2j.gameserver.model.skills.enums.SkillType;
-import net.sf.l2j.gameserver.model.skills.stats.enums.StatsType;
 import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
 import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate.StatusUpdateType;
 import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
@@ -37,7 +36,7 @@
  // check for other effects
  try
  {
- ISkillHandler handler = SkillHandler.getHandler(SkillType.BUFF);
+ var handler = SkillHandler.getHandler(SkillType.BUFF);
 
  if (handler != null)
  {
@@ -49,9 +48,9 @@
  //
  }
 
- for (L2Object target2 : targets)
+ for (var target2 : targets)
  {
- L2Character target = (L2Character) target2;
+ var target = (L2Character) target2;
 
  // We should not heal if char is dead
  if ((target == null) || target.isDead())
@@ -65,34 +64,35 @@
  continue;
  }
 
- boolean sps = activeChar.isChargedShot(ShotType.SPIRITSHOTS);
- boolean bss = activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
+ var sps = activeChar.isChargedShot(ShotType.SPIRITSHOTS);
+ var bss = activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
 
- double hp = skill.getPower();
+ var hp = skill.getPower();
 
- if (skill.getSkillType() == SkillType.HEAL_PERCENT)
- {
- hp = (target.getStat().getMaxHp() * hp) / 100.0;
- }
- else
+ switch (skill.getSkillType())
  {
- if (bss)
+ case HEAL:
  {
- hp *= 1.5;
+ if (bss)
+ {
+ hp = skill.getPower() * 1.5;
+ }
+ else if (sps)
+ {
+ hp = skill.getPower() * 1.3;
+ }
+ break;
  }
- else if (sps)
+ case HEAL_PERCENT:
  {
- hp *= 1.3;
+ hp = (target.getStat().getMaxHp() * skill.getPower()) / 100.0;
+ break;
  }
- }
-
- if (skill.getSkillType() == SkillType.HEAL_STATIC)
- {
- hp = skill.getPower();
- }
- else if (skill.getSkillType() != SkillType.HEAL_PERCENT)
- {
- hp *= target.calcStat(StatsType.HEAL_HP_RATE, 100, null, null) / 100;
+ case HEAL_STATIC:
+ {
+ hp = skill.getPower();
+ break;
+ }
  }
 
  target.setCurrentHp(hp + target.getCurrentHp());

8
Issues / Re:[MOD - EventCooperative] - Error
« en: Julio 17, 2018, 01:31:08 pm »
Creo que tendre que sentarme a testearlo yo no? jeje

Aqui te dejo como lo tengo yo actualmente al ctf.

Código
package main.engine.events.cooperative.types;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;

import main.data.ConfigData;
import main.engine.events.cooperative.AbstractCooperative;
import main.holders.objects.CharacterHolder;
import main.holders.objects.NpcHolder;
import main.holders.objects.PlayerHolder;
import main.util.Util;
import main.util.UtilInventory;
import main.util.UtilMessage;
import main.util.builders.html.Html;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.data.ItemData;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.instance.enums.TeamType;
import net.sf.l2j.gameserver.model.items.enums.ParpedollType;
import net.sf.l2j.gameserver.model.party.Party;
import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;

/**
 * @author fissban
 */
public class CaptureTheFlag extends AbstractCooperative
{
/** FlagItem */
private static final int FLAG_ITEM = 6718;
/** Points of blue team */
private static volatile int pointsBlue = 0;
/** Points of red team */
private static volatile int pointsRed = 0;
/** Points of each player */
private static Map<String, Integer> playerPoints = new ConcurrentHashMap<>();
/** Flags and holders instances */
private static Map<Integer, NpcHolder> flagAndHolders = new HashMap<>();

public CaptureTheFlag()
{
super();
}

@Override
public boolean canAttack(CharacterHolder attacker, CharacterHolder victim)
{
if (Util.areObjectType(L2PcInstance.class, attacker, victim))
{
// Check if the 2 players are participating in the event.
if (playerInEvent(attacker, victim))
{
// Check the team of each character.
if (attacker.getTeam() != victim.getTeam())
{
return true;
}
}
}

return false;
}

@Override
public void createParty()
{
// Leader Party Blue
PlayerHolder lpb = null;
// Leader Party Red
PlayerHolder lpr = null;

if (getPlayersInEvent().size() <= 3)
{
return;
}

for (var ph : getPlayersInEvent())
{
if (ph == null)
{
continue;
}

// Remove from old party
if (ph.getInstance().getParty() != null)
{
ph.getInstance().getParty().removePartyMember(ph.getInstance(), true);
}

PlayerHolder leader = null;

switch (ph.getTeam())
{
case BLUE:
leader = lpb;
break;
case RED:
leader = lpr;
break;
}

// If there is no leader yet, we assign one
if (leader == null)
{
leader = ph;
continue;
}

// If the party exceeds the limit of members we start the creation of a new one
if (leader != null && leader.getInstance().getParty() != null && leader.getInstance().getParty().getMemberCount() >= 7)
{
switch (ph.getTeam())
{
case BLUE:
lpb = ph;
continue;
case RED:
lpr = ph;
continue;
}
}

// Created the party
if (leader.getInstance().getParty() == null)
{
Party party = new Party(leader.getInstance());
party.addPartyMember(ph.getInstance());
}
// Added a new party member
else
{
leader.getInstance().getParty().addPartyMember(ph.getInstance());
}
}
}

@Override
public void createTeams()
{
var lastTeam = TeamType.BLUE;

for (var ph : getPlayersInEvent())
{
// Save the character's location before being sent to the event.
ph.setLastLoc(ph.getInstance().getX(), ph.getInstance().getY(), ph.getInstance().getZ());

switch (lastTeam)
{
case RED:
// Teleport
ph.getInstance().teleToLocation(ConfigData.TVT_SPAWN_TEAM_BLUE, ConfigData.TVT_RADIUS_SPAWN);
// Set team
ph.setTeam(TeamType.BLUE);
// Set last team
lastTeam = TeamType.BLUE;
break;
case BLUE:
// Teleport
ph.getInstance().teleToLocation(ConfigData.TVT_SPAWN_TEAM_RED, ConfigData.TVT_RADIUS_SPAWN);
// Set el team
ph.setTeam(TeamType.RED);
// Set last team
lastTeam = TeamType.RED;
break;
default:
// Never happens!
break;
}
}
}

@Override
public void giveRewards()
{
// Check the winning team.
var teamWinner = TeamType.NONE;

// Tied teams
if (pointsBlue == pointsRed)
{
//
}
else if (pointsBlue > pointsRed)
{
teamWinner = TeamType.BLUE;
}
else
{
teamWinner = TeamType.RED;
}

if (teamWinner == TeamType.NONE)
{
UtilMessage.sendAnnounceMsg("The event ends in a draw!", getPlayersInEvent());
}
else
{
UtilMessage.sendAnnounceMsg("The team " + teamWinner.name() + " was the winner!", getPlayersInEvent());

for (var ph : getPlayersInEvent())
{
// Prizes are awarded to the winning team.
if (ph.getTeam() == teamWinner)
{
ConfigData.TVT_REWARDS.forEach(rh -> UtilInventory.giveItems(ph, rh.getRewardId(), rh.getRewardCount(), 0));
}
}
}
}

// LISTENERS -----------------------------------------------------------------------------------------

/**
* @param ph
* @return
*/
@Override
public boolean onExitWorld(PlayerHolder ph)
{
if (ph.hasFlag())
{
unequipFlag(ph, true);
}

return super.onExitWorld(ph);
}

@Override
public void onDeath(CharacterHolder character)
{
// Check if the character is inside the event
if (!playerInEvent(character))
{
return;
}

var ph = character.getActingPlayer();

if (ph.hasFlag())
{
unequipFlag(ph, true);
}

var death = ThreadPoolManager.getInstance().schedule(() ->
{
deathTasks.remove(character.getObjectId());

// Revive
revivePlayer(ph);
// Heal
healToMax(ph);
// Buff
giveBuff(ph);

}, 10 * 1000); // 10 sec

deathTasks.put(character.getObjectId(), death);
}

@Override
public void onKill(CharacterHolder killer, CharacterHolder victim, boolean isPet)
{
if (Util.areObjectType(L2Playable.class, killer, victim))
{
var killerPc = killer.getActingPlayer();
var victimPc = victim.getActingPlayer();

if (playerInEvent(killerPc, victimPc))
{
// Increase the points of each team
if (killerPc.getTeam() == TeamType.BLUE)
{
pointsBlue += ConfigData.CTF_POINT_KILL_PLAYER;
}
else
{
pointsRed += ConfigData.CTF_POINT_KILL_PLAYER;
}

// Send all the characters of the event the amount of points.
sendPointsToAllParticipant();
// Increase the points of each player
increasePlayerPoint(killerPc, ConfigData.CTF_POINT_KILL_PLAYER);
}
}
}

@Override
public boolean onInteract(PlayerHolder ph, CharacterHolder character)
{
if (!Util.areObjectType(L2Npc.class, character))
{
return false;
}

// Check if the player participates in the event.
if (!playerInEvent(ph))
{
return false;
}

var flag = (NpcHolder) character;

if (flag.getId() == ConfigData.CTF_FLAG_ID)
{
if (ph.hasFlag())
{
return false;
}
if (ph.getTeam() != flag.getTeam())
{
equipFlag(ph, flag);
return true;
}
return false;
}

if (flag.getId() == ConfigData.CTF_HOLDER_ID)
{
if (ph.hasFlag())
{
if (ph.getTeam() == flag.getTeam())
{
unequipFlag(ph, false);

increasePlayerPoint(ph, ConfigData.CTF_POINT_DELIVER_FLAG);

switch (ph.getTeam())
{
case BLUE:
pointsBlue += ConfigData.CTF_POINT_DELIVER_FLAG;
break;
case RED:
pointsRed += ConfigData.CTF_POINT_DELIVER_FLAG;
break;
}

sendPointsToAllParticipant();
return true;
}
}
return false;
}

return true;
}

@Override
public void onUnequip(CharacterHolder player)
{
if (player instanceof PlayerHolder)
{
var ph = (PlayerHolder) player;
var flag = ph.getInstance().getInventory().getPaperdollItem(ParpedollType.RHAND);

if (flag == null && ph.hasFlag())
{
// drop flag
unequipFlag(ph, true);
}
}
}

// XXX MISC ------------------------------------------------------------------------------------------------------------

@Override
public void onStart()
{
var xRed = ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getX();
var yRed = ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getY();
var zRed = ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getZ();

var xBlue = ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getX();
var yBlue = ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getY();
var zBlue = ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getZ();

// Flag spawn
addSpawnNpc(ConfigData.CTF_FLAG_ID, xBlue, yBlue, zBlue, 0, 0, 0, TeamType.BLUE);
addSpawnNpc(ConfigData.CTF_FLAG_ID, xRed, yRed, zRed, 0, 0, 0, TeamType.RED);
// Holder spawn
addSpawnNpc(ConfigData.CTF_HOLDER_ID, xBlue - 100, yBlue, zBlue, 0, 0, 0, TeamType.BLUE);// FIXME chequear el -100 si queda bien
addSpawnNpc(ConfigData.CTF_HOLDER_ID, xRed - 100, yRed, zRed, 0, 0, 0, TeamType.RED);// FIXME chequear el -100 si queda bien
}

@Override
public void onEnd()
{
// Cancel party
getPlayersInEvent().stream().filter(ph -> ph.getInstance().getParty() != null).forEach(ph -> ph.getInstance().getParty().removePartyMember(ph.getInstance(), true));

// Unspawn all flags and holders
flagAndHolders.values().stream().filter(npc -> npc.getInstance() != null).forEach(npc ->
{
// stop respawn
if (npc.getInstance().getSpawn() != null)
{
npc.getInstance().getSpawn().stopRespawn();
}
// remove from world
npc.getInstance().deleteMe();
});

// Generate ranking
var pointsOrdered = new LinkedHashMap<String, Integer>();

// Send html showing the points of each player
// order the list according to your scores
var LIMIT = 10;
playerPoints.entrySet().stream().sorted(Entry.<String, Integer> comparingByValue().reversed()).limit(LIMIT).forEach(e -> pointsOrdered.put(e.getKey(), e.getValue()));

// Generate the html of the ranking
var hb = Html.eventRanking(pointsOrdered);
// Send the html to each character in the event
sendHtml(null, hb, getPlayersInEvent());

// Clear
flagAndHolders.clear();
playerPoints.clear();
pointsBlue = 0;
pointsRed = 0;
}

/**
* Revive a character and send it to the spawn point according to his team
* @param ph
*/
private void revivePlayer(PlayerHolder ph)
{
if (!ph.getInstance().isDead())
{
return;
}

ph.getInstance().doRevive();

switch (ph.getTeam())
{
case BLUE:
ph.getInstance().teleToLocation(ConfigData.CTF_SPAWN_TEAM_BLUE, ConfigData.CTF_RADIUS_SPAWN);
break;
case RED:
ph.getInstance().teleToLocation(ConfigData.CTF_SPAWN_TEAM_RED, ConfigData.CTF_RADIUS_SPAWN);
break;
}
}

/**
* Increase by 1 the number of points of a character
* @param ph
*/
private static void increasePlayerPoint(PlayerHolder ph, int p)
{
if (!playerPoints.containsKey(ph.getName()))
{
playerPoints.put(ph.getName(), 0);
}

int points = playerPoints.get(ph.getName()) + p;
playerPoints.put(ph.getName(), points);
}

/**
* Equip a character with a flag.
* @param ph
* @param flagTeam
*/
private static void equipFlag(PlayerHolder ph, NpcHolder npc)
{
var teamType = ph.getTeam();

// get and remove flag from memory
var flag = flagAndHolders.remove(npc.getObjectId());
// stop flag respawn
if (flag.getInstance().getSpawn() != null)
{
flag.getInstance().getSpawn().stopRespawn();
}
// remove flag from world
flag.getInstance().deleteMe();

ph.setHasFlag(true);
// Equip flag
var flagItem = ItemData.getInstance().createItem("", FLAG_ITEM, 1, ph.getInstance(), null);
if (flagItem != null)
{
ph.getInstance().getInventory().equipItem(flagItem);
}
// Send Message
UtilMessage.sendAnnounceMsg("The " + teamType.name().toLowerCase() + " team has taken the flag!", getPlayersInEvent());
}

/**
* We remove the flag of a character.
* @param ph
*/
private void unequipFlag(PlayerHolder ph, boolean drop)
{
// Create new spawn
switch (ph.getTeam())
{
case BLUE:
var xRed = drop ? ph.getInstance().getX() : ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getX();
var yRed = drop ? ph.getInstance().getY() : ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getY();
var zRed = drop ? ph.getInstance().getZ() : ConfigData.CTF_FLAG_SPAWN_TEAM_RED.getZ();
addSpawnNpc(ConfigData.CTF_FLAG_ID, xRed, yRed, zRed, 0, 0, 0, TeamType.RED);
break;
case RED:
var xBlue = drop ? ph.getInstance().getX() : ConfigData.CTF_FLAG_SPAWN_TEAM_BLUE.getX();
var yBlue = drop ? ph.getInstance().getY() : ConfigData.CTF_FLAG_SPAWN_TEAM_BLUE.getY();
var zBlue = drop ? ph.getInstance().getZ() : ConfigData.CTF_FLAG_SPAWN_TEAM_BLUE.getZ();
addSpawnNpc(ConfigData.CTF_FLAG_ID, xBlue, yBlue, zBlue, 0, 0, 0, TeamType.BLUE);
break;
}

// Unequip flag
var flag = ph.getInstance().getInventory().getPaperdollItem(ParpedollType.RHAND);
if (flag != null)
{
var items = ph.getInstance().getInventory().unEquipItemInSlotAndRecord(ParpedollType.RHAND);

var iu = new InventoryUpdate();
iu.addItems(items);
ph.getInstance().sendPacket(iu);
}

var teamType = ph.getTeam();
if (drop)
{
UtilMessage.sendAnnounceMsg("The " + teamType.name().toLowerCase() + " has drop flag!", getPlayersInEvent());
}
else
{
UtilMessage.sendAnnounceMsg("The " + teamType.name().toLowerCase() + " team has delivered the flag!", getPlayersInEvent());
}
}

@Override
public NpcHolder addSpawnNpc(int npcId, int x, int y, int z, int heading, int randomOffset, long despawnDelay, TeamType teamType)
{
var npc = super.addSpawnNpc(npcId, x, y, z, heading, randomOffset, despawnDelay, teamType);
flagAndHolders.put(npc.getObjectId(), npc);
return npc;
}

/**
* Send all the characters a message on the screen showing the points of each team
*/
private static void sendPointsToAllParticipant()
{
UtilMessage.sendAnnounceMsg("BLUE " + pointsBlue + " | " + pointsRed + " RED", getPlayersInEvent());
}
}


Aqui habia agregado apra evitar que se desequipen la bandera.

Código
	@Override
public void onUnequip(CharacterHolder player)
{
if (player instanceof PlayerHolder)
{
var ph = (PlayerHolder) player;
var flag = ph.getInstance().getInventory().getPaperdollItem(ParpedollType.RHAND);

if (flag == null && ph.hasFlag())
{
// drop flag
unequipFlag(ph, true);
}
}
}

pero quizas herre aqui
Código
if (flag == null && ph.hasFlag())

9
Issues / Re:[MOD - EventCooperative] - Error
« en: Julio 15, 2018, 12:08:03 pm »
ya subi todos los fix que se han echo y algun que otro que no se discutio aqui.
https://sourceforge.net/p/l2jadminsc4/code/1126/

Gracias

10
Issues / Re:[MOD - EventCooperative] - Error
« en: Julio 14, 2018, 12:04:58 pm »
Bueno ahora si lanzo bien el TP, acerca de los rewards estos solo son entregados cuando hay mas de 1 player "No tendria sentido un cooperative de 1 player  ::)", estuve probandolo y va bien hasta cierto punto, eso si... parece que el problema de el evento era por el checkafk debido a que ahora si envia al coliseo pero yo le configure 60 segs del anti-afks y me saca del evento inclusive moviendo al char en esos 60 segs, desactive el anti-afk y ya no sucedia mas ese problema "creo que es otro detalle entre los true/false". Aparte de unos detalles en los eventos como que las banderas se buguearon cuando sali del evento con ella y al deletearla en la mochila  fuera del evento causo que en el otro evento se bugueasen las banderas y dropeaba banderas cada vez que moria "Aun sin tenerla xD" pero las banderas quedaban como NPC y no pickeables ademas de que el spawn de la 2da bandera "Creo que era la red" no estaba... Yo en un rato que me desocupe reviso si puedo arreglarlo y te mando el fix

como has salido del evento?

aca un pequeño fix para quitarte la bandera....sin test obvio xD

Código
Index: src/main/engine/events/cooperative/types/CaptureTheFlag.java
===================================================================
--- src/main/engine/events/cooperative/types/CaptureTheFlag.java (revision 1121)
+++ src/main/engine/events/cooperative/types/CaptureTheFlag.java (working copy)
@@ -22,7 +22,9 @@
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.enums.TeamType;
 import net.sf.l2j.gameserver.model.items.enums.ParpedollType;
+import net.sf.l2j.gameserver.model.items.enums.SlotType;
 import net.sf.l2j.gameserver.model.party.Party;
+import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
 
 /**
  * @author fissban
@@ -490,7 +492,12 @@
  var flag = ph.getInstance().getInventory().getPaperdollItem(ParpedollType.RHAND);
  if (flag != null)
  {
- ph.getInstance().getInventory().equipItem(flag);
+ SlotType slot = ph.getInstance().getInventory().getSlotFromItem(flag);
+ var items = ph.getInstance().getInventory().unEquipItemInBodySlotAndRecord(slot);
+
+ InventoryUpdate iu = new InventoryUpdate();
+ iu.addItems(items);
+ ph.getInstance().sendPacket(iu);
  }
 
  var teamType = ph.getTeam();

11
Issues / Re:[MOD - EventCooperative] - Error
« en: Julio 13, 2018, 07:33:15 pm »
Buen test...revisare los temas apena este frente a mi pc

12
Issues / Re:[Aporte - Fix] - RandomEvents
« 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.

13
Issues / Re:(Error) SQL npc_Skills
« en: Julio 13, 2018, 09:56:43 am »

14
Issues / Re:[MOD - EventCooperative] - Error
« en: Julio 13, 2018, 12:42:23 am »
Código
Index: .
===================================================================
--- . (revision 1121)
+++ . (working copy)

Property changes on: .
___________________________________________________________________
Modified: svn:ignore
## -1 +1,2 ##
+bin
 build
Index: dist/game/config/engine/EventsCooperative.properties
===================================================================
--- dist/game/config/engine/EventsCooperative.properties (revision 1121)
+++ dist/game/config/engine/EventsCooperative.properties (working copy)
@@ -76,7 +76,7 @@
 CtF_FlagId = 60018
 
 # Holder npc id
-Ctf_HolderId = 6001
+Ctf_HolderId = 60019
 
 # Points deliver flag
 Ctf_DeliverFlag = 30
Index: src/main/data/ConfigData.java
===================================================================
--- src/main/data/ConfigData.java (revision 1121)
+++ src/main/data/ConfigData.java (working copy)
@@ -282,7 +282,7 @@
  loadPvpReward();
  loadSpreeKills();
  loadSubclassAcumulatives();
- loadCoperative();
+ loadCooperative();
  loadRandoms();
  }
 
@@ -307,7 +307,7 @@
  ALL_FLAGS_Enabled = config.getProperty("Flags_Enabled", true);
  }
 
- private static void loadCoperative()
+ private static void loadCooperative()
  {
  UtilProperties config = load(COOPERATIVE_FILE);
 
Index: src/main/engine/events/cooperative/AbstractCooperative.java
===================================================================
--- src/main/engine/events/cooperative/AbstractCooperative.java (revision 1121)
+++ src/main/engine/events/cooperative/AbstractCooperative.java (working copy)
@@ -115,9 +115,9 @@
  /**
  * Launch the events and their times.
  */
- public void start(List<Integer> playersInEvent)
+ public void start(List<Integer> list)
  {
- playersInEvent.addAll(playersInEvent);
+ playersInEvent.addAll(list);
 
  start = ThreadPoolManager.getInstance().scheduleAtFixedRate(() ->
  {
@@ -132,7 +132,7 @@
  }
  case PREPARE_TO_TELEPORT:
  {
- world = WorldData.create(WORLD_ID, true);
+ world = WorldData.create(WORLD_ID, false);
  // Create doors
  addSpawnDoor(24190001);
  addSpawnDoor(24190002);
@@ -172,12 +172,14 @@
  giveBuff(ph);
  });
 
+ // The characters are sent to a custom world
+ getPlayersInEvent().forEach(ph -> world.add(ph));
+
  // Create teams.
  createTeams();
+ // Create partys.
+ createParty();
 
- // The characters are sent to a custom world
- getPlayersInEvent().forEach(ph -> world.add(ph));
-
  // Define the next state
  setEventState(EventState.PREPARE_TO_FIGHT);
  break;
@@ -204,7 +206,6 @@
  setEventState(EventState.START);
  }
 
- createParty();
  break;
  }
  case START:
@@ -472,8 +473,9 @@
  {
  // prevent memory leak
  ph.setTeam(TeamType.NONE);
+ // remove from custom world
  world.remove(ph);
-
+ // sql query from new xyz
  removeOfflinePlayer(objId);
  }
  else
@@ -481,7 +483,7 @@
  players.add(ph);
  }
  });
-
+ players.forEach(id -> System.out.println(id.getName() + ";"));
  return players;
  }
 
@@ -534,9 +536,9 @@
  */
  public boolean playerInEvent(CharacterHolder... players)
  {
- for (var player : players)
+ for (var p : players)
  {
- if (!playersInEvent.contains(player.getObjectId()))
+ if (!playersInEvent.contains(p.getObjectId()))
  {
  return false;
  }
Index: src/main/engine/events/cooperative/EventCooperativeManager.java
===================================================================
--- src/main/engine/events/cooperative/EventCooperativeManager.java (revision 1121)
+++ src/main/engine/events/cooperative/EventCooperativeManager.java (working copy)
@@ -257,31 +257,31 @@
  * <li>We check that all registered players are online.</li>
  * <li>Check the player's ip with the others registered.</li>
  * @param ph
- * @param removeOffline -> remove offline players from {@link #_registerPlayers}
+ * @param removeOffline -> remove offline players from {@link #registerPlayers}
  * @return
  */
  public static boolean isRegisterPlayerIp(PlayerHolder ph, boolean removeOffline)
  {
- if (ConfigData.COOPERATIVE_CHECK_PLAYER_IP)
+ if (removeOffline)
  {
- return false;
+ checkPlayerRegister();
  }
 
- if (removeOffline)
+ if (!ConfigData.COOPERATIVE_CHECK_PLAYER_IP)
  {
- checkPlayerRegister();
+ return false;
  }
 
  for (var objId : registerPlayers)
  {
- var pc = L2World.getInstance().getPlayer(objId);
-
  // Do not check the ip of the same player in case it was already registered
- if (ph.getObjectId() == pc.getObjectId())
+ if (ph.getObjectId() == objId)
  {
  continue;
  }
 
+ var pc = L2World.getInstance().getPlayer(objId);
+
  if (pc.getConnection().getIP().equals(ph.getInstance().getConnection().getIP()))
  {
  return true;
@@ -299,7 +299,7 @@
  // Check the characters offline
  List<Integer> aux = registerPlayers.stream().filter(objId -> L2World.getInstance().getPlayer(objId) == null).collect(Collectors.toList());
  // Remove offline players from the registry
- aux.forEach(objId -> registerPlayers.remove(Integer.valueOf(objId)));
+ aux.forEach(objId -> registerPlayers.remove(objId));
  }
 
  // XXX VOTE -------------------------------------------------------------------------------------------------------------------
Index: src/main/engine/events/cooperative/npc/RegisterNpc.java
===================================================================
--- src/main/engine/events/cooperative/npc/RegisterNpc.java (revision 1121)
+++ src/main/engine/events/cooperative/npc/RegisterNpc.java (working copy)
@@ -74,7 +74,7 @@
  {
  var hb = new HtmlBuilder(HtmlType.HTML);
  hb.append(Html.START);
- hb.append(Html.head("COPERATIVE EVENTS"));
+ hb.append(Html.head("COOPERATIVE EVENTS"));
  hb.append("<center>");
  hb.append("<br><br><br><br>");
  if (EventCooperativeManager.unRegister(ph))
@@ -95,7 +95,7 @@
  {
  var hb = new HtmlBuilder(HtmlType.HTML);
  hb.append(Html.START);
- hb.append(Html.head("COPERATIVE EVENTS"));
+ hb.append(Html.head("COOPERATIVE EVENTS"));
  hb.append("<center>");
  hb.append("<br><br><br><br>");
 
@@ -132,7 +132,7 @@
  {
  var hb = new HtmlBuilder(HtmlType.HTML);
  hb.append(Html.START);
- hb.append(Html.head("COPERATIVE EVENTS"));
+ hb.append(Html.head("COOPERATIVE EVENTS"));
  hb.append("<center>");
  hb.append("<br><br><br><br>");
 
@@ -169,7 +169,7 @@
  {
  var hb = new HtmlBuilder(HtmlType.HTML);
  hb.append(Html.START);
- hb.append(Html.head("COPERATIVE EVENTS"));
+ hb.append(Html.head("COOPERATIVE EVENTS"));
  hb.append("<center>");
  hb.append("<br>");
 

bueno ya esta aca el fix, lo que si al finalizar el evento no me dio el reward, chequealo y me contas.

15
Issues / Re:[MOD - EventCooperative] - Error
« en: Julio 10, 2018, 03:06:57 pm »
los worlds tienen un purge q se ejecuta cada 10 min, es muy loco pensar q se ejecuta justo en esos 5 seg q demora entre q se crea y se envia los players pero en alguna ocacion puede pasar, asique cambie para q no esos no se purgen y te dejoa lgun q otro cambio.

Código
Index: src/main/engine/events/cooperative/AbstractCooperative.java
===================================================================
--- src/main/engine/events/cooperative/AbstractCooperative.java (revision 1121)
+++ src/main/engine/events/cooperative/AbstractCooperative.java (working copy)
@@ -132,7 +132,7 @@
  }
  case PREPARE_TO_TELEPORT:
  {
- world = WorldData.create(WORLD_ID, true);
+ world = WorldData.create(WORLD_ID, false);
  // Create doors
  addSpawnDoor(24190001);
  addSpawnDoor(24190002);
Index: src/main/engine/events/cooperative/EventCooperativeManager.java
===================================================================
--- src/main/engine/events/cooperative/EventCooperativeManager.java (revision 1121)
+++ src/main/engine/events/cooperative/EventCooperativeManager.java (working copy)
@@ -257,31 +257,31 @@
  * <li>We check that all registered players are online.</li>
  * <li>Check the player's ip with the others registered.</li>
  * @param ph
- * @param removeOffline -> remove offline players from {@link #_registerPlayers}
+ * @param removeOffline -> remove offline players from {@link #registerPlayers}
  * @return
  */
  public static boolean isRegisterPlayerIp(PlayerHolder ph, boolean removeOffline)
  {
- if (ConfigData.COOPERATIVE_CHECK_PLAYER_IP)
+ if (removeOffline)
  {
- return false;
+ checkPlayerRegister();
  }
 
- if (removeOffline)
+ if (!ConfigData.COOPERATIVE_CHECK_PLAYER_IP)
  {
- checkPlayerRegister();
+ return false;
  }
 
  for (var objId : registerPlayers)
  {
- var pc = L2World.getInstance().getPlayer(objId);
-
  // Do not check the ip of the same player in case it was already registered
- if (ph.getObjectId() == pc.getObjectId())
+ if (ph.getObjectId() == objId)
  {
  continue;
  }
 
+ var pc = L2World.getInstance().getPlayer(objId);
+
  if (pc.getConnection().getIP().equals(ph.getInstance().getConnection().getIP()))
  {
  return true;

si no funciona tendre q sentarme a testearlo yo :s

Páginas: [1] 2 3 4 5 6 ... 11