Sync with L2jServer HighFive Mar 25th 2015.

This commit is contained in:
MobiusDev
2015-03-25 06:48:51 +00:00
parent e0c66b1412
commit 82606870c0
194 changed files with 2619 additions and 2869 deletions

View File

@@ -249,7 +249,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
}
case WHITELIST:
{
for (BuffInfo info : player.getEffectList().getBuffs().values())
for (BuffInfo info : player.getEffectList().getBuffs())
{
if (!inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
@@ -259,7 +259,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
for (L2Summon summon : player.getServitors().values())
{
for (BuffInfo info : summon.getEffectList().getBuffs().values())
for (BuffInfo info : summon.getEffectList().getBuffs())
{
if (!inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
@@ -271,7 +271,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
final L2Summon pet = player.getPet();
if (pet != null)
{
for (BuffInfo info : pet.getEffectList().getBuffs().values())
for (BuffInfo info : pet.getEffectList().getBuffs())
{
if (!inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
@@ -283,7 +283,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
}
case BLACKLIST:
{
for (BuffInfo info : player.getEffectList().getBuffs().values())
for (BuffInfo info : player.getEffectList().getBuffs())
{
if (inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
@@ -293,7 +293,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
for (L2Summon summon : player.getServitors().values())
{
for (BuffInfo info : summon.getEffectList().getBuffs().values())
for (BuffInfo info : summon.getEffectList().getBuffs())
{
if (inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
@@ -305,7 +305,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
final L2Summon pet = player.getPet();
if (pet != null)
{
for (BuffInfo info : pet.getEffectList().getBuffs().values())
for (BuffInfo info : pet.getEffectList().getBuffs())
{
if (inst.getBuffExceptionList().contains(info.getSkill().getId()))
{

View File

@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jserver.Config;
import com.l2jserver.gameserver.GeoData;
@@ -107,7 +108,7 @@ public final class CrystalCaverns extends AbstractInstance
0,
0
}; // 0: not spawned, 1: spawned, 2: cleared
public Map<L2DoorInstance, L2PcInstance> openedDoors = new HashMap<>();
public Map<L2DoorInstance, L2PcInstance> openedDoors = new ConcurrentHashMap<>();
public Map<Integer, Map<L2Npc, Boolean>> npcList2 = new HashMap<>();
public Map<L2Npc, L2Npc> oracles = new HashMap<>();
public List<L2Npc> keyKeepers = new ArrayList<>();
@@ -1378,27 +1379,24 @@ public final class CrystalCaverns extends AbstractInstance
{
return "";
}
CrystalGolem cryGolem = world.crystalGolems.get(npc);
List<L2Object> crystals = new ArrayList<>();
int minDist = 300000;
for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300))
{
if ((object instanceof L2ItemInstance) && (object.getId() == CRYSTALFOOD))
if (object.isItem() && (object.getId() == CRYSTALFOOD))
{
crystals.add(object);
}
}
int minDist = 300000;
for (L2Object crystal : crystals)
{
int dx = npc.getX() - crystal.getX();
int dy = npc.getY() - crystal.getY();
int d = (dx * dx) + (dy * dy);
if (d < minDist)
{
minDist = d;
cryGolem.foodItem = (L2ItemInstance) crystal;
int dx = npc.getX() - object.getX();
int dy = npc.getY() - object.getY();
int d = (dx * dx) + (dy * dy);
if (d < minDist)
{
minDist = d;
cryGolem.foodItem = (L2ItemInstance) object;
}
}
}
if (minDist != 300000)
{
startQuestTimer("getFood", 2000, npc, null);

View File

@@ -21,7 +21,9 @@ package instances.DarkCloudMansion;
import instances.AbstractInstance;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
@@ -46,7 +48,7 @@ public final class DarkCloudMansion extends AbstractInstance
{
protected class DMCWorld extends InstanceWorld
{
protected HashMap<String, DMCRoom> rooms = new HashMap<>();
protected Map<String, DMCRoom> rooms = new ConcurrentHashMap<>();
}
// NPCs
@@ -230,7 +232,7 @@ public final class DarkCloudMansion extends AbstractInstance
protected static class DMCRoom
{
public ArrayList<DMCNpc> npcList = new ArrayList<>();
public List<DMCNpc> npcList = new ArrayList<>();
public int counter = 0;
public int reset = 0;
public int founded = 0;

View File

@@ -22,6 +22,7 @@ import instances.AbstractInstance;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import quests.Q00196_SevenSignsSealOfTheEmperor.Q00196_SevenSignsSealOfTheEmperor;
@@ -47,8 +48,8 @@ public final class DisciplesNecropolisPast extends AbstractInstance
{
protected class DNPWorld extends InstanceWorld
{
protected final ArrayList<L2Npc> anakimGroup = new ArrayList<>();
protected final ArrayList<L2Npc> lilithGroup = new ArrayList<>();
protected final List<L2Npc> anakimGroup = new ArrayList<>();
protected final List<L2Npc> lilithGroup = new ArrayList<>();
protected int countKill = 0;
}
@@ -180,7 +181,7 @@ public final class DisciplesNecropolisPast extends AbstractInstance
teleportPlayer(player, ENTER, world.getInstanceId());
}
private void makeCast(L2Npc npc, ArrayList<L2Npc> targets)
private void makeCast(L2Npc npc, List<L2Npc> targets)
{
npc.setTarget(targets.get(getRandom(targets.size())));
if (SKILLS.containsKey(npc.getId()))

View File

@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.locks.Lock;
@@ -82,10 +83,10 @@ import com.l2jserver.gameserver.util.Util;
*/
public final class FinalEmperialTomb extends AbstractInstance
{
private class FETWorld extends InstanceWorld
protected class FETWorld extends InstanceWorld
{
protected Lock lock = new ReentrantLock();
protected CopyOnWriteArrayList<L2Npc> npcList = new CopyOnWriteArrayList<>();
protected List<L2Npc> npcList = new CopyOnWriteArrayList<>();
protected int darkChoirPlayerCount = 0;
protected FrintezzaSong OnSong = null;
protected ScheduledFuture<?> songTask = null;
@@ -98,17 +99,13 @@ public final class FinalEmperialTomb extends AbstractInstance
protected L2Npc scarletDummy = null;
protected L2GrandBossInstance frintezza = null;
protected L2GrandBossInstance activeScarlet = null;
protected List<L2MonsterInstance> demons = new ArrayList<>();
protected Map<L2MonsterInstance, Integer> portraits = new HashMap<>();
protected List<L2MonsterInstance> demons = new CopyOnWriteArrayList<>();
protected Map<L2MonsterInstance, Integer> portraits = new ConcurrentHashMap<>();
protected int scarlet_x = 0;
protected int scarlet_y = 0;
protected int scarlet_z = 0;
protected int scarlet_h = 0;
protected int scarlet_a = 0;
protected FETWorld()
{
}
}
protected static class FETSpawn
@@ -298,11 +295,9 @@ public final class FinalEmperialTomb extends AbstractInstance
_log.severe("[Final Emperial Tomb] Missing flag in npc List npcId: " + npcId + ", skipping");
continue;
}
int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
if (!_spawnList.containsKey(flag))
{
_spawnList.put(flag, new ArrayList<FETSpawn>());
}
_spawnList.putIfAbsent(flag, new ArrayList<FETSpawn>());
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{
@@ -848,7 +843,7 @@ public final class FinalEmperialTomb extends AbstractInstance
if ((_world.frintezza != null) && !_world.frintezza.isDead() && (_world.activeScarlet != null) && !_world.activeScarlet.isDead())
{
List<L2Character> targetList = new ArrayList<>();
final List<L2Character> targetList = new ArrayList<>();
if (skill.hasEffectType(L2EffectType.STUN) || skill.isDebuff())
{
for (int objId : _world.getAllowed())
@@ -879,7 +874,7 @@ public final class FinalEmperialTomb extends AbstractInstance
{
targetList.add(_world.activeScarlet);
}
if (targetList.size() > 0)
if (!targetList.isEmpty())
{
_world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()]));
}

View File

@@ -19,7 +19,6 @@
package instances.KaraphonHabitat;
import instances.AbstractInstance;
import quests.Q10745_TheSecretIngredients.Q10745_TheSecretIngredients;
import com.l2jserver.gameserver.instancemanager.InstanceManager;