Removed explicit type arguments.

This commit is contained in:
MobiusDev
2018-09-09 15:59:32 +00:00
parent 744204e1cd
commit b50b43a1f9
56 changed files with 133 additions and 389 deletions

View File

@@ -128,10 +128,10 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
private static final Map<Integer, List<L2Npc>> STORED_MONSTER_SPAWNS = new HashMap<>();
static
{
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<>());
}
// @formatter:off
private static final int[][] CHEST_SPAWN_LOCATIONS =

View File

@@ -38,7 +38,7 @@ public final class GeneralDilios extends AbstractNpcAI
private static final int GUARD_ID = 32619;
private L2Npc _general = null;
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<L2Spawn, Boolean>());
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final NpcStringId[] DILIOS_TEXT =
{

View File

@@ -239,7 +239,7 @@ public final class Stage1 extends AbstractInstance implements IGameXmlReader
if (!_spawnList.containsKey(flag))
{
_spawnList.put(flag, new ArrayList<SODSpawn>());
_spawnList.put(flag, new ArrayList<>());
}
for (Node f = e.getFirstChild(); f != null; f = f.getNextSibling())

View File

@@ -1438,7 +1438,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1492,7 +1492,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -128,10 +128,10 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
private static final Map<Integer, List<L2Npc>> STORED_MONSTER_SPAWNS = new HashMap<>();
static
{
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<>());
}
// @formatter:off
private static final int[][] CHEST_SPAWN_LOCATIONS =

View File

@@ -38,7 +38,7 @@ public final class GeneralDilios extends AbstractNpcAI
private static final int GUARD_ID = 32619;
private L2Npc _general = null;
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<L2Spawn, Boolean>());
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final NpcStringId[] DILIOS_TEXT =
{

View File

@@ -239,7 +239,7 @@ public final class Stage1 extends AbstractInstance implements IGameXmlReader
if (!_spawnList.containsKey(flag))
{
_spawnList.put(flag, new ArrayList<SODSpawn>());
_spawnList.put(flag, new ArrayList<>());
}
for (Node f = e.getFirstChild(); f != null; f = f.getNextSibling())

View File

@@ -1458,7 +1458,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1512,7 +1512,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -128,10 +128,10 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
private static final Map<Integer, List<L2Npc>> STORED_MONSTER_SPAWNS = new HashMap<>();
static
{
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<>());
}
// @formatter:off
private static final int[][] CHEST_SPAWN_LOCATIONS =

View File

@@ -38,7 +38,7 @@ public final class GeneralDilios extends AbstractNpcAI
private static final int GUARD_ID = 32619;
private L2Npc _general = null;
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<L2Spawn, Boolean>());
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final NpcStringId[] DILIOS_TEXT =
{

View File

@@ -239,7 +239,7 @@ public final class Stage1 extends AbstractInstance implements IGameXmlReader
if (!_spawnList.containsKey(flag))
{
_spawnList.put(flag, new ArrayList<SODSpawn>());
_spawnList.put(flag, new ArrayList<>());
}
for (Node f = e.getFirstChild(); f != null; f = f.getNextSibling())

View File

@@ -1458,7 +1458,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1512,7 +1512,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -128,10 +128,10 @@ public final class FourSepulchers extends AbstractNpcAI implements IGameXmlReade
private static final Map<Integer, List<L2Npc>> STORED_MONSTER_SPAWNS = new HashMap<>();
static
{
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<L2Npc>());
STORED_MONSTER_SPAWNS.put(1, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(2, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(3, new CopyOnWriteArrayList<>());
STORED_MONSTER_SPAWNS.put(4, new CopyOnWriteArrayList<>());
}
// @formatter:off
private static final int[][] CHEST_SPAWN_LOCATIONS =

View File

@@ -38,7 +38,7 @@ public final class GeneralDilios extends AbstractNpcAI
private static final int GUARD_ID = 32619;
private L2Npc _general = null;
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<L2Spawn, Boolean>());
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final NpcStringId[] DILIOS_TEXT =
{

View File

@@ -239,7 +239,7 @@ public final class Stage1 extends AbstractInstance implements IGameXmlReader
if (!_spawnList.containsKey(flag))
{
_spawnList.put(flag, new ArrayList<SODSpawn>());
_spawnList.put(flag, new ArrayList<>());
}
for (Node f = e.getFirstChild(); f != null; f = f.getNextSibling())

View File

@@ -1458,7 +1458,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1512,7 +1512,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -39,7 +39,7 @@ public final class GeneralDilios extends AbstractNpcAI
private static final int GUARD_ID = 32619;
private L2Npc _general = null;
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<L2Spawn, Boolean>());
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final NpcStringId[] DILIOS_TEXT =
{

View File

@@ -100,7 +100,7 @@ public final class Keltas extends AbstractNpcAI
};
// Misc
private L2MonsterInstance _spawnedKeltas = null;
private final Set<L2Spawn> _spawnedMonsters = Collections.newSetFromMap(new ConcurrentHashMap<L2Spawn, Boolean>());
private final Set<L2Spawn> _spawnedMonsters = Collections.newSetFromMap(new ConcurrentHashMap<>());
public Keltas()
{

View File

@@ -809,7 +809,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
}
else
{
_usedTextPassages.put(message, new ArrayList<L2Clan>());
_usedTextPassages.put(message, new ArrayList<>());
final int objId = npc.getObjectId();
final NpcSay say = new NpcSay(objId, ChatType.NPC_SHOUT, npc.getId(), message);
npc.broadcastPacket(say);

View File

@@ -1359,7 +1359,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1413,7 +1413,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -262,7 +262,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
}
final int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
_spawnList.putIfAbsent(flag, new ArrayList<FETSpawn>());
_spawnList.putIfAbsent(flag, new ArrayList<>());
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -107,9 +107,9 @@ public class SummonEffectsTable
public void addServitorEffect(L2PcInstance owner, int referenceSkill, Skill skill, int effectCurTime)
{
_servitorEffects.putIfAbsent(owner.getObjectId(), new HashMap<Integer, Map<Integer, List<SummonEffect>>>());
_servitorEffects.get(owner.getObjectId()).putIfAbsent(owner.getClassIndex(), new HashMap<Integer, List<SummonEffect>>());
getServitorEffects(owner).putIfAbsent(referenceSkill, new CopyOnWriteArrayList<SummonEffect>());
_servitorEffects.putIfAbsent(owner.getObjectId(), new HashMap<>());
_servitorEffects.get(owner.getObjectId()).putIfAbsent(owner.getClassIndex(), new HashMap<>());
getServitorEffects(owner).putIfAbsent(referenceSkill, new CopyOnWriteArrayList<>());
getServitorEffects(owner).get(referenceSkill).add(new SummonEffect(skill, effectCurTime));
}

View File

@@ -140,7 +140,7 @@ public class DoorData implements IGameXmlReader
if (!_regions.containsKey(region))
{
_regions.put(region, new ArrayList<L2DoorInstance>());
_regions.put(region, new ArrayList<>());
}
_regions.get(region).add(door);
}

View File

@@ -63,7 +63,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -181,7 +181,7 @@ public class SchemeBufferTable
{
if (!_schemesTable.containsKey(playerId))
{
_schemesTable.put(playerId, new HashMap<String, ArrayList<Integer>>());
_schemesTable.put(playerId, new HashMap<>());
}
else if (_schemesTable.get(playerId).size() >= Config.BUFFER_MAX_SCHEMES)
{

View File

@@ -98,7 +98,7 @@ public final class DimensionalRiftManager
if (!_rooms.containsKey(type))
{
_rooms.put(type, new HashMap<Byte, DimensionalRiftRoom>(9));
_rooms.put(type, new HashMap<>(9));
}
_rooms.get(type).put(room_id, new DimensionalRiftRoom(type, room_id, xMin, xMax, yMin, yMax, z1, z2, xT, yT, zT, isBossRoom));

View File

@@ -14,351 +14,95 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager;
package ai.areas.Gracia.AI.NPC.GeneralDilios;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.enums.Team;
import com.l2jmobius.gameserver.instancemanager.tasks.PenaltyRemoveTask;
import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.itemcontainer.PcInventory;
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ExCubeGameAddPlayer;
import com.l2jmobius.gameserver.network.serverpackets.ExCubeGameChangeTeam;
import com.l2jmobius.gameserver.network.serverpackets.ExCubeGameRemovePlayer;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* This class manage the player add/remove, team change and event arena status,<br>
* as the clearance of the participants list or liberate the arena.
* @author BiggBoss
* Dilios AI
* @author JIV, Sephiroth, Apocalipce
*/
public final class HandysBlockCheckerManager
public final class GeneralDilios extends AbstractNpcAI
{
// All the participants and their team classified by arena
private static final ArenaParticipantsHolder[] _arenaPlayers = new ArenaParticipantsHolder[4];
private static final int GENERAL_ID = 32549;
private static final int GUARD_ID = 32619;
// Arena votes to start the game
private static final Map<Integer, Integer> _arenaVotes = new HashMap<>();
private L2Npc _general = null;
private final Set<L2Spawn> _guards = Collections.newSetFromMap(new ConcurrentHashMap<>());
// Arena Status, True = is being used, otherwise, False
private static final Map<Integer, Boolean> _arenaStatus = new HashMap<>();
// Registration request penalty (10 seconds)
protected static Set<Integer> _registrationPenalty = Collections.synchronizedSet(new HashSet<Integer>());
/**
* Return the number of event-start votes for the specified arena id
* @param arenaId
* @return int (number of votes)
*/
public synchronized int getArenaVotes(int arenaId)
private static final NpcStringId[] DILIOS_TEXT =
{
return _arenaVotes.get(arenaId);
NpcStringId.MESSENGER_INFORM_THE_PATRONS_OF_THE_KEUCEREUS_ALLIANCE_BASE_WE_RE_GATHERING_BRAVE_ADVENTURERS_TO_ATTACK_TIAT_S_MOUNTED_TROOP_THAT_S_ROOTED_IN_THE_SEED_OF_DESTRUCTION,
// NpcStringId.MESSENGER_INFORM_THE_PATRONS_OF_THE_KEUCEREUS_ALLIANCE_BASE_THE_SEED_OF_DESTRUCTION_IS_CURRENTLY_SECURED_UNDER_THE_FLAG_OF_THE_KEUCEREUS_ALLIANCE,
// NpcStringId.MESSENGER_INFORM_THE_PATRONS_OF_THE_KEUCEREUS_ALLIANCE_BASE_TIATS_MOUNTED_TROOP_IS_CURRENTLY_TRYING_TO_RETAKE_SEED_OF_DESTRUCTION_COMMIT_ALL_THE_AVAILABLE_REINFORCEMENTS_INTO_SEED_OF_DESTRUCTION,
NpcStringId.MESSENGER_INFORM_THE_BROTHERS_IN_KUCEREUS_CLAN_OUTPOST_BRAVE_ADVENTURERS_WHO_HAVE_CHALLENGED_THE_SEED_OF_INFINITY_ARE_CURRENTLY_INFILTRATING_THE_HALL_OF_EROSION_THROUGH_THE_DEFENSIVELY_WEAK_HALL_OF_SUFFERING,
// NpcStringId.MESSENGER_INFORM_THE_BROTHERS_IN_KUCEREUS_CLAN_OUTPOST_SWEEPING_THE_SEED_OF_INFINITY_IS_CURRENTLY_COMPLETE_TO_THE_HEART_OF_THE_SEED_EKIMUS_IS_BEING_DIRECTLY_ATTACKED_AND_THE_UNDEAD_REMAINING_IN_THE_HALL_OF_SUFFERING_ARE_BEING_ERADICATED,
NpcStringId.MESSENGER_INFORM_THE_PATRONS_OF_THE_KEUCEREUS_ALLIANCE_BASE_THE_SEED_OF_INFINITY_IS_CURRENTLY_SECURED_UNDER_THE_FLAG_OF_THE_KEUCEREUS_ALLIANCE
// NpcStringId.MESSENGER_INFORM_THE_PATRONS_OF_THE_KEUCEREUS_ALLIANCE_BASE_THE_RESURRECTED_UNDEAD_IN_THE_SEED_OF_INFINITY_ARE_POURING_INTO_THE_HALL_OF_SUFFERING_AND_THE_HALL_OF_EROSION
// NpcStringId.MESSENGER_INFORM_THE_BROTHERS_IN_KUCEREUS_CLAN_OUTPOST_EKIMUS_IS_ABOUT_TO_BE_REVIVED_BY_THE_RESURRECTED_UNDEAD_IN_SEED_OF_INFINITY_SEND_ALL_REINFORCEMENTS_TO_THE_HEART_AND_THE_HALL_OF_SUFFERING
};
public GeneralDilios()
{
addSpawnId(GENERAL_ID, GUARD_ID);
}
/**
* Add a new vote to start the event for the specified arena id
* @param arena
*/
public synchronized void increaseArenaVotes(int arena)
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final int newVotes = _arenaVotes.get(arena) + 1;
final ArenaParticipantsHolder holder = _arenaPlayers[arena];
if ((newVotes > (holder.getAllPlayers().size() / 2)) && !holder.getEvent().isStarted())
if (event.startsWith("command_"))
{
clearArenaVotes(arena);
if ((holder.getBlueTeamSize() == 0) || (holder.getRedTeamSize() == 0))
int value = Integer.parseInt(event.substring(8));
if (value < 6)
{
return;
}
if (Config.HBCE_FAIR_PLAY)
{
holder.checkAndShuffle();
}
ThreadPool.execute(holder.getEvent().new StartEvent());
_general.broadcastPacket(new NpcSay(_general.getObjectId(), ChatType.NPC_GENERAL, GENERAL_ID, NpcStringId.STABBING_THREE_TIMES));
startQuestTimer("guard_animation_0", 3400, null, null);
}
else
{
_arenaVotes.put(arena, newVotes);
value = -1;
_general.broadcastPacket(new NpcSay(_general.getObjectId(), ChatType.NPC_SHOUT, GENERAL_ID, DILIOS_TEXT[getRandom(DILIOS_TEXT.length)]));
}
startQuestTimer("command_" + (value + 1), 60000, null, null);
}
else if (event.startsWith("guard_animation_"))
{
final int value = Integer.parseInt(event.substring(16));
for (L2Spawn guard : _guards)
{
guard.getLastSpawn().broadcastSocialAction(4);
}
if (value < 2)
{
startQuestTimer("guard_animation_" + (value + 1), 1500, null, null);
}
}
return super.onAdvEvent(event, npc, player);
}
/**
* Will clear the votes queue (of event start) for the specified arena id
* @param arena
*/
public synchronized void clearArenaVotes(int arena)
@Override
public String onSpawn(L2Npc npc)
{
_arenaVotes.put(arena, 0);
}
protected HandysBlockCheckerManager()
if (npc.getId() == GENERAL_ID)
{
// Initialize arena status
_arenaStatus.put(0, false);
_arenaStatus.put(1, false);
_arenaStatus.put(2, false);
_arenaStatus.put(3, false);
// Initialize arena votes
_arenaVotes.put(0, 0);
_arenaVotes.put(1, 0);
_arenaVotes.put(2, 0);
_arenaVotes.put(3, 0);
startQuestTimer("command_0", 60000, null, null);
_general = npc;
}
/**
* Returns the players holder
* @param arena
* @return ArenaParticipantsHolder
*/
public ArenaParticipantsHolder getHolder(int arena)
else if (npc.getId() == GUARD_ID)
{
return _arenaPlayers[arena];
_guards.add(npc.getSpawn());
}
/**
* Initializes the participants holder
*/
public void startUpParticipantsQueue()
{
for (int i = 0; i < 4; ++i)
{
_arenaPlayers[i] = new ArenaParticipantsHolder(i);
}
}
/**
* Add the player to the specified arena (through the specified arena manager) and send the needed server -> client packets
* @param player
* @param arenaId
* @return
*/
public boolean addPlayerToArena(L2PcInstance player, int arenaId)
{
final ArenaParticipantsHolder holder = _arenaPlayers[arenaId];
synchronized (holder)
{
boolean isRed;
for (int i = 0; i < 4; i++)
{
if (_arenaPlayers[i].getAllPlayers().contains(player))
{
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_ALREADY_REGISTERED_ON_THE_MATCH_WAITING_LIST);
msg.addString(player.getName());
player.sendPacket(msg);
return false;
}
}
if (player.isCursedWeaponEquipped())
{
player.sendPacket(SystemMessageId.YOU_CANNOT_REGISTER_WHILE_IN_POSSESSION_OF_A_CURSED_WEAPON);
return false;
}
if (player.isOnEvent() || player.isInOlympiadMode())
{
player.sendMessage("Couldnt register you due other event participation");
return false;
}
if (OlympiadManager.getInstance().isRegistered(player))
{
OlympiadManager.getInstance().unRegisterNoble(player);
player.sendPacket(SystemMessageId.APPLICANTS_FOR_THE_OLYMPIAD_UNDERGROUND_COLISEUM_OR_KRATEI_S_CUBE_MATCHES_CANNOT_REGISTER);
}
// if(UnderGroundColiseum.getInstance().isRegisteredPlayer(player))
// {
// UngerGroundColiseum.getInstance().removeParticipant(player);
// player.sendPacket(SystemMessageId.COLISEUM_OLYMPIAD_KRATEIS_APPLICANTS_CANNOT_PARTICIPATE));
// }
// if(KrateiCubeManager.getInstance().isRegisteredPlayer(player))
// {
// KrateiCubeManager.getInstance().removeParticipant(player);
// player.sendPacket(SystemMessageId.COLISEUM_OLYMPIAD_KRATEIS_APPLICANTS_CANNOT_PARTICIPATE));
// }
if (_registrationPenalty.contains(player.getObjectId()))
{
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_SECONDS_BEFORE_ATTEMPTING_TO_REGISTER_AGAIN);
return false;
}
if (holder.getBlueTeamSize() < holder.getRedTeamSize())
{
holder.addPlayer(player, 1);
isRed = false;
}
else
{
holder.addPlayer(player, 0);
isRed = true;
}
holder.broadCastPacketToTeam(new ExCubeGameAddPlayer(player, isRed));
return true;
}
}
/**
* Will remove the specified player from the specified team and arena and will send the needed packet to all his team mates / enemy team mates
* @param player
* @param arenaId
* @param team
*/
public void removePlayer(L2PcInstance player, int arenaId, int team)
{
final ArenaParticipantsHolder holder = _arenaPlayers[arenaId];
synchronized (holder)
{
final boolean isRed = team == 0;
holder.removePlayer(player, team);
holder.broadCastPacketToTeam(new ExCubeGameRemovePlayer(player, isRed));
// End event if theres an empty team
final int teamSize = isRed ? holder.getRedTeamSize() : holder.getBlueTeamSize();
if (teamSize == 0)
{
holder.getEvent().endEventAbnormally();
}
_registrationPenalty.add(player.getObjectId());
schedulePenaltyRemoval(player.getObjectId());
}
}
/**
* Will change the player from one team to other (if possible) and will send the needed packets
* @param player
* @param arena
* @param team
*/
public void changePlayerToTeam(L2PcInstance player, int arena, int team)
{
final ArenaParticipantsHolder holder = _arenaPlayers[arena];
synchronized (holder)
{
final boolean isFromRed = holder.getRedPlayers().contains(player);
if ((isFromRed && (holder.getBlueTeamSize() == 6)) || (!isFromRed && (holder.getRedTeamSize() == 6)))
{
player.sendMessage("The team is full");
return;
}
final int futureTeam = isFromRed ? 1 : 0;
holder.addPlayer(player, futureTeam);
holder.removePlayer(player, isFromRed ? 0 : 1);
holder.broadCastPacketToTeam(new ExCubeGameChangeTeam(player, isFromRed));
}
}
/**
* Will erase all participants from the specified holder
* @param arenaId
*/
public synchronized void clearPaticipantQueueByArenaId(int arenaId)
{
_arenaPlayers[arenaId].clearPlayers();
}
/**
* Returns true if arena is holding an event at this momment
* @param arenaId
* @return boolean
*/
public boolean arenaIsBeingUsed(int arenaId)
{
return (arenaId >= 0) && (arenaId <= 3) && _arenaStatus.get(arenaId);
}
/**
* Set the specified arena as being used
* @param arenaId
*/
public void setArenaBeingUsed(int arenaId)
{
_arenaStatus.put(arenaId, true);
}
/**
* Set as free the specified arena for future events
* @param arenaId
*/
public void setArenaFree(int arenaId)
{
_arenaStatus.put(arenaId, false);
}
/**
* Called when played logs out while participating in Block Checker Event
* @param player
*/
public void onDisconnect(L2PcInstance player)
{
final int arena = player.getBlockCheckerArena();
final int team = getHolder(arena).getPlayerTeam(player);
getInstance().removePlayer(player, arena, team);
if (player.getTeam() == Team.NONE)
{
return;
}
player.stopAllEffects();
// Remove team aura
player.setTeam(Team.NONE);
// Remove the event items
final PcInventory inv = player.getInventory();
if (inv.getItemByItemId(13787) != null)
{
inv.destroyItemByItemId("Handys Block Checker", 13787, inv.getInventoryItemCount(13787, 0), player, player);
}
if (inv.getItemByItemId(13788) != null)
{
inv.destroyItemByItemId("Handys Block Checker", 13788, inv.getInventoryItemCount(13788, 0), player, player);
}
player.setInsideZone(ZoneId.PVP, false);
// Teleport Back
player.teleToLocation(-57478, -60367, -2370);
}
public void removePenalty(int objectId)
{
_registrationPenalty.remove(objectId);
}
private void schedulePenaltyRemoval(int objId)
{
ThreadPool.schedule(new PenaltyRemoveTask(objId), 10000);
}
/**
* Gets the single instance of {@code HandysBlockCheckerManager}.
* @return single instance of {@code HandysBlockCheckerManager}
*/
public static HandysBlockCheckerManager getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder
{
protected static final HandysBlockCheckerManager _instance = new HandysBlockCheckerManager();
return super.onSpawn(npc);
}
}

View File

@@ -43,7 +43,7 @@ public class MacroList implements IRestorable
private final L2PcInstance _owner;
private int _revision;
private int _macroId;
private final Map<Integer, Macro> _macroses = Collections.synchronizedMap(new LinkedHashMap<Integer, Macro>());
private final Map<Integer, Macro> _macroses = Collections.synchronizedMap(new LinkedHashMap<>());
public MacroList(L2PcInstance owner)
{

View File

@@ -5888,7 +5888,7 @@ public final class L2PcInstance extends L2Playable
{
synchronized (this)
{
_manufactureItems = Collections.synchronizedMap(new LinkedHashMap<Integer, L2ManufactureItem>());
_manufactureItems = Collections.synchronizedMap(new LinkedHashMap<>());
}
}
return _manufactureItems;

View File

@@ -195,7 +195,7 @@ public class L2SchemeBufferInstance extends L2Npc
}
}
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<Integer>());
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<>());
showGiveBuffsWindow(player);
}
catch (Exception e)

View File

@@ -432,7 +432,7 @@ public class L2Event
// Insert empty lists at _teams.
for (int i = 0; i < _teamsNumber; i++)
{
_teams.put(i + 1, new CopyOnWriteArrayList<L2PcInstance>());
_teams.put(i + 1, new CopyOnWriteArrayList<>());
}
int i = 0;

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -1434,7 +1434,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1488,7 +1488,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -181,7 +181,7 @@ public class SchemeBufferTable
{
if (!_schemesTable.containsKey(playerId))
{
_schemesTable.put(playerId, new HashMap<String, ArrayList<Integer>>());
_schemesTable.put(playerId, new HashMap<>());
}
else if (_schemesTable.get(playerId).size() >= Config.BUFFER_MAX_SCHEMES)
{

View File

@@ -195,7 +195,7 @@ public class L2SchemeBufferInstance extends L2Npc
}
}
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<Integer>());
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<>());
showGiveBuffsWindow(player);
}
catch (Exception e)

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -1434,7 +1434,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1488,7 +1488,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -181,7 +181,7 @@ public class SchemeBufferTable
{
if (!_schemesTable.containsKey(playerId))
{
_schemesTable.put(playerId, new HashMap<String, ArrayList<Integer>>());
_schemesTable.put(playerId, new HashMap<>());
}
else if (_schemesTable.get(playerId).size() >= Config.BUFFER_MAX_SCHEMES)
{

View File

@@ -195,7 +195,7 @@ public class L2SchemeBufferInstance extends L2Npc
}
}
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<Integer>());
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<>());
showGiveBuffsWindow(player);
}
catch (Exception e)

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}

View File

@@ -1434,7 +1434,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = client.getConnectionAddress().getHostAddress();
if (ipMap.get(ip) == null)
{
ipMap.put(ip, new ArrayList<L2PcInstance>());
ipMap.put(ip, new ArrayList<>());
}
ipMap.get(ip).add(player);
@@ -1488,7 +1488,7 @@ public class AdminEditChar implements IAdminCommandHandler
final IpPack pack = new IpPack(client.getConnectionAddress().getHostAddress(), client.getTrace());
if (ipMap.get(pack) == null)
{
ipMap.put(pack, new ArrayList<L2PcInstance>());
ipMap.put(pack, new ArrayList<>());
}
ipMap.get(pack).add(player);

View File

@@ -65,7 +65,7 @@ public class EnchantItemOptionsData implements IGameXmlReader
final int itemId = parseInteger(d.getAttributes(), "id");
if (!_data.containsKey(itemId))
{
_data.put(itemId, new HashMap<Integer, EnchantOptions>());
_data.put(itemId, new HashMap<>());
}
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{

View File

@@ -181,7 +181,7 @@ public class SchemeBufferTable
{
if (!_schemesTable.containsKey(playerId))
{
_schemesTable.put(playerId, new HashMap<String, ArrayList<Integer>>());
_schemesTable.put(playerId, new HashMap<>());
}
else if (_schemesTable.get(playerId).size() >= Config.BUFFER_MAX_SCHEMES)
{

View File

@@ -195,7 +195,7 @@ public class L2SchemeBufferInstance extends L2Npc
}
}
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<Integer>());
SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<>());
showGiveBuffsWindow(player);
}
catch (Exception e)

View File

@@ -100,7 +100,7 @@ public class DBDumper
{
if (!keys.containsKey(dset.getString(4)))
{
keys.put(dset.getString(4), new ArrayList<String>());
keys.put(dset.getString(4), new ArrayList<>());
}
keys.get(dset.getString(4)).add(dset.getString(1));
}