Sync with L2jServer HighFive Oct 10th 2015.

This commit is contained in:
MobiusDev
2015-10-10 13:28:13 +00:00
parent 2a827d8120
commit 2dd6094e0f
39 changed files with 601 additions and 556 deletions

View File

@ -737,7 +737,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
* <li>Chose a target and order to attack it with magic skill or physical attack</li>
* </ul>
*/
protected synchronized void thinkAttack()
protected void thinkAttack()
{
final L2Attackable npc = getActiveChar();
if (npc.isCastingNow())
@ -750,10 +750,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead())
{
// Stop hating this target after the attack timeout or if target is dead
if (originalAttackTarget != null)
{
npc.stopHating(originalAttackTarget);
}
npc.stopHating(originalAttackTarget);
// Set the AI Intention to AI_INTENTION_ACTIVE
setIntention(AI_INTENTION_ACTIVE);

View File

@ -973,7 +973,7 @@ public class L2CharacterAI extends AbstractAI
_actor.setRunning();
}
// If pathfinding enabled the creature will go to the nearest obstacle.
// If pathfinding enabled the creature will go to the destination or it will go to the nearest obstacle.
final Location destination;
if (Config.PATHFINDING > 0)
{

View File

@ -1437,22 +1437,13 @@ public final class SkillTreesData implements IXmlReader
*/
public boolean isGMSkill(int skillId, int skillLevel)
{
final Map<Integer, L2SkillLearn> gmSkills = new HashMap<>();
gmSkills.putAll(_gameMasterSkillTree);
gmSkills.putAll(_gameMasterAuraSkillTree);
if (gmSkills.containsKey(SkillData.getSkillHashCode(skillId, skillLevel)))
if (skillLevel <= 0)
{
return true;
return _gameMasterSkillTree.values().stream().filter(s -> s.getSkillId() == skillId).findAny().isPresent() //
|| _gameMasterAuraSkillTree.values().stream().filter(s -> s.getSkillId() == skillId).findAny().isPresent();
}
for (L2SkillLearn skill : gmSkills.values())
{
if ((skill.getSkillId() == skillId) && (skillLevel == -1))
{
return true;
}
}
return false;
final int hashCode = SkillData.getSkillHashCode(skillId, skillLevel);
return _gameMasterSkillTree.containsKey(hashCode) || _gameMasterAuraSkillTree.containsKey(hashCode);
}
/**

View File

@ -95,4 +95,10 @@ public final class AggroInfo
{
return _attacker.getObjectId();
}
@Override
public String toString()
{
return "AggroInfo [attacker=" + _attacker + ", hate=" + _hate + ", damage=" + _damage + "]";
}
}

View File

@ -111,7 +111,6 @@ public class L2Attackable extends L2Npc
// Misc
private boolean _mustGiveExpSp;
protected int _onKillDelay = 5000;
private long _lastAttack;
/**
* Creates an attackable NPC.
@ -396,7 +395,7 @@ public class L2Attackable extends L2Npc
{
try
{
if (getAggroList().isEmpty())
if (_aggroList.isEmpty())
{
return;
}
@ -409,7 +408,7 @@ public class L2Attackable extends L2Npc
long totalDamage = 0;
// While Iterating over This Map Removing Object is Not Allowed
// Go through the _aggroList of the L2Attackable
for (AggroInfo info : getAggroList().values())
for (AggroInfo info : _aggroList.values())
{
if (info == null)
{
@ -710,7 +709,7 @@ public class L2Attackable extends L2Npc
}
// Get the AggroInfo of the attacker L2Character from the _aggroList of the L2Attackable
final AggroInfo ai = getAggroList().computeIfAbsent(attacker, AggroInfo::new);
final AggroInfo ai = _aggroList.computeIfAbsent(attacker, AggroInfo::new);
ai.addDamage(damage);
// Traps does not cause aggro
@ -768,12 +767,8 @@ public class L2Attackable extends L2Npc
return;
}
for (AggroInfo ai : getAggroList().values())
for (AggroInfo ai : _aggroList.values())
{
if (ai == null)
{
return;
}
ai.addHate(amount);
}
@ -788,10 +783,10 @@ public class L2Attackable extends L2Npc
return;
}
AggroInfo ai = getAggroList().get(target);
AggroInfo ai = _aggroList.get(target);
if (ai == null)
{
_log.info("target " + target + " not present in aggro list of " + this);
_log.info("Target " + target + " not present in aggro list of " + this);
return;
}
@ -815,7 +810,7 @@ public class L2Attackable extends L2Npc
{
return;
}
AggroInfo ai = getAggroList().get(target);
AggroInfo ai = _aggroList.get(target);
if (ai != null)
{
ai.stopHate();
@ -827,7 +822,7 @@ public class L2Attackable extends L2Npc
*/
public L2Character getMostHated()
{
if (getAggroList().isEmpty() || isAlikeDead())
if (_aggroList.isEmpty() || isAlikeDead())
{
return null;
}
@ -837,7 +832,7 @@ public class L2Attackable extends L2Npc
// While Interacting over This Map Removing Object is Not Allowed
// Go through the aggroList of the L2Attackable
for (AggroInfo ai : getAggroList().values())
for (AggroInfo ai : _aggroList.values())
{
if (ai == null)
{
@ -859,7 +854,7 @@ public class L2Attackable extends L2Npc
*/
public List<L2Character> get2MostHated()
{
if (getAggroList().isEmpty() || isAlikeDead())
if (_aggroList.isEmpty() || isAlikeDead())
{
return null;
}
@ -871,7 +866,7 @@ public class L2Attackable extends L2Npc
// While iterating over this map removing objects is not allowed
// Go through the aggroList of the L2Attackable
for (AggroInfo ai : getAggroList().values())
for (AggroInfo ai : _aggroList.values())
{
if (ai == null)
{
@ -901,13 +896,13 @@ public class L2Attackable extends L2Npc
public List<L2Character> getHateList()
{
if (getAggroList().isEmpty() || isAlikeDead())
if (_aggroList.isEmpty() || isAlikeDead())
{
return null;
}
List<L2Character> result = new ArrayList<>();
for (AggroInfo ai : getAggroList().values())
for (AggroInfo ai : _aggroList.values())
{
if (ai == null)
{
@ -926,12 +921,12 @@ public class L2Attackable extends L2Npc
*/
public int getHating(final L2Character target)
{
if (getAggroList().isEmpty() || (target == null))
if (_aggroList.isEmpty() || (target == null))
{
return 0;
}
final AggroInfo ai = getAggroList().get(target);
final AggroInfo ai = _aggroList.get(target);
if (ai == null)
{
return 0;
@ -943,14 +938,14 @@ public class L2Attackable extends L2Npc
if (act.isInvisible() || ai.getAttacker().isInvul() || act.isSpawnProtected())
{
// Remove Object Should Use This Method and Can be Blocked While Interacting
getAggroList().remove(target);
_aggroList.remove(target);
return 0;
}
}
if (!ai.getAttacker().isVisible() || ai.getAttacker().isInvisible())
{
getAggroList().remove(target);
_aggroList.remove(target);
return 0;
}
@ -1127,12 +1122,13 @@ public class L2Attackable extends L2Npc
}
/**
* @param player The L2Character searched in the _aggroList of the L2Attackable
* @return True if the _aggroList of this L2Attackable contains the L2Character.
* Verifies if the creature is in the aggro list.
* @param creature the creature
* @return {@code true} if the creature is in the aggro list, {@code false} otherwise
*/
public boolean containsTarget(L2Character player)
public boolean isInAggroList(L2Character creature)
{
return getAggroList().containsKey(player);
return _aggroList.containsKey(creature);
}
/**
@ -1140,7 +1136,7 @@ public class L2Attackable extends L2Npc
*/
public void clearAggroList()
{
getAggroList().clear();
_aggroList.clear();
// clear overhit values
_overhit = false;
@ -1576,16 +1572,6 @@ public class L2Attackable extends L2Npc
return _onKillDelay;
}
public long getLastAttack()
{
return _lastAttack;
}
public void setLastAttack(long lastAttack)
{
_lastAttack = lastAttack;
}
/**
* Check if the server allows Random Animation.
*/

View File

@ -4538,7 +4538,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
int gty = (originalY - L2World.MAP_MIN_Y) >> 4;
// Movement checks:
// when PATHFINDING > 0, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
// When pathfinding enabled, for all characters except monsters returning home (could be changed later to teleport if pathfinding fails)
if (((Config.PATHFINDING > 0) && (!(isAttackable() && ((L2Attackable) this).isReturningToSpawnPoint()))) //
|| (isPlayer() && !(isInVehicle && (distance > 1500))))
{
@ -5940,7 +5940,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
for (L2Object target : targets)
{
// EVT_ATTACKED and PvPStatus
if (target instanceof L2Character)
if (target.isCharacter())
{
if (skill.getEffectPoint() <= 0)
{
@ -6069,7 +6069,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
for (L2Object target : targets)
{
if (target instanceof L2Character)
if (target.isCharacter())
{
final L2Character creature = (L2Character) target;
if (creature.hasAI())

View File

@ -207,7 +207,7 @@ public abstract class L2Playable extends L2Character
// Notify L2Character AI
getAI().notifyEvent(CtrlEvent.EVT_DEAD);
super.updateEffectIcons();
updateEffectIcons();
return true;
}

View File

@ -436,21 +436,21 @@ public final class L2CubicInstance implements IIdentifiable
if (ownerTarget.isAttackable())
{
final L2Attackable attackable = (L2Attackable) ownerTarget;
if ((attackable.getAggroList().get(_owner) != null) && !attackable.isDead())
if (attackable.isInAggroList(_owner) && !attackable.isDead())
{
_target = (L2Character) ownerTarget;
return;
}
if (_owner.hasSummon())
{
if ((attackable.getAggroList().get(pet) != null) && !attackable.isDead())
if (attackable.isInAggroList(pet) && !attackable.isDead())
{
_target = (L2Character) ownerTarget;
return;
}
for (L2Summon servitor : _owner.getServitors().values())
{
if ((attackable.getAggroList().get(servitor) != null) && !attackable.isDead())
if (attackable.isInAggroList(servitor) && !attackable.isDead())
{
_target = (L2Character) ownerTarget;
return;

View File

@ -164,7 +164,7 @@ public class L2GuardInstance extends L2Attackable
else if (interact)
{
// Check if the L2PcInstance is in the _aggroList of the L2GuardInstance
if (containsTarget(player))
if (isInAggroList(player))
{
if (Config.DEBUG)
{

View File

@ -5271,6 +5271,12 @@ public final class L2PcInstance extends L2Playable
@Override
public boolean doDie(L2Character killer)
{
// Kill the L2PcInstance
if (!super.doDie(killer))
{
return false;
}
if (killer != null)
{
final L2PcInstance pk = killer.getActingPlayer();
@ -5325,12 +5331,6 @@ public final class L2PcInstance extends L2Playable
// Clear resurrect xp calculation
setExpBeforeDeath(0);
// Kill the L2PcInstance
if (!super.doDie(killer))
{
return false;
}
// Issues drop of Cursed Weapon.
if (isCursedWeaponEquipped())
{
@ -5352,12 +5352,13 @@ public final class L2PcInstance extends L2Playable
}
else
{
final boolean insidePvpZone = isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE);
final boolean insidePvpZone = isInsideZone(ZoneId.PVP);
final boolean insideSiegeZone = isInsideZone(ZoneId.SIEGE);
if ((pk == null) || !pk.isCursedWeaponEquipped())
{
onDieDropItem(killer); // Check if any item should be dropped
if (!insidePvpZone)
if (!insidePvpZone && !insideSiegeZone)
{
if ((pk != null) && (pk.getClan() != null) && (getClan() != null) && !isAcademyMember() && !(pk.isAcademyMember()))
{
@ -5380,7 +5381,7 @@ public final class L2PcInstance extends L2Playable
}
}
// If player is Lucky shouldn't get penalized.
if (!isLucky() && !insidePvpZone)
if (!isLucky() && (insideSiegeZone || !insidePvpZone))
{
calculateDeathExpPenalty(killer, isAtWarWith(pk));
}

View File

@ -541,7 +541,6 @@ public final class L2TeleporterInstance extends L2Npc
return;
}
Calendar cal = Calendar.getInstance();
int price = list.getPrice();
if (player.getLevel() < 41)
@ -550,6 +549,7 @@ public final class L2TeleporterInstance extends L2Npc
}
else if (!list.getIsForNoble())
{
final Calendar cal = Calendar.getInstance();
if ((cal.get(Calendar.HOUR_OF_DAY) >= 20) && (cal.get(Calendar.HOUR_OF_DAY) <= 23) && ((cal.get(Calendar.DAY_OF_WEEK) == 1) || (cal.get(Calendar.DAY_OF_WEEK) == 7)))
{
price /= 2;
@ -563,7 +563,7 @@ public final class L2TeleporterInstance extends L2Npc
_log.info("Teleporting player " + player.getName() + " to new location: " + list.getLocX() + ":" + list.getLocY() + ":" + list.getLocZ());
}
player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), false);
player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), player.getHeading(), -1);
}
}
else

View File

@ -18,8 +18,6 @@
*/
package com.l2jserver.gameserver.model.actor.knownlist;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@ -34,9 +32,9 @@ import com.l2jserver.gameserver.util.Util;
public class CharKnownList extends ObjectKnownList
{
private Map<Integer, L2PcInstance> _knownPlayers;
private Map<Integer, L2Summon> _knownSummons;
private Map<Integer, Integer> _knownRelations;
private volatile Map<Integer, L2PcInstance> _knownPlayers;
private volatile Map<Integer, L2Summon> _knownSummons;
private volatile Map<Integer, Integer> _knownRelations;
public CharKnownList(L2Character activeChar)
{
@ -50,7 +48,8 @@ public class CharKnownList extends ObjectKnownList
{
return false;
}
else if (object.isPlayer())
if (object.isPlayer())
{
getKnownPlayers().put(object.getObjectId(), object.getActingPlayer());
getKnownRelations().put(object.getObjectId(), -1);
@ -59,7 +58,6 @@ public class CharKnownList extends ObjectKnownList
{
getKnownSummons().put(object.getObjectId(), (L2Summon) object);
}
return true;
}
@ -127,12 +125,10 @@ public class CharKnownList extends ObjectKnownList
{
if (!fullCheck)
{
final Collection<L2PcInstance> plrs = getKnownPlayers().values();
final Iterator<L2PcInstance> pIter = plrs.iterator();
L2PcInstance player;
final Iterator<L2PcInstance> pIter = getKnownPlayers().values().iterator();
while (pIter.hasNext())
{
player = pIter.next();
L2PcInstance player = pIter.next();
if (player == null)
{
pIter.remove();
@ -146,13 +142,10 @@ public class CharKnownList extends ObjectKnownList
}
}
final Collection<L2Summon> sums = getKnownSummons().values();
final Iterator<L2Summon> sIter = sums.iterator();
L2Summon summon;
final Iterator<L2Summon> sIter = getKnownSummons().values().iterator();
while (sIter.hasNext())
{
summon = sIter.next();
L2Summon summon = sIter.next();
if (summon == null)
{
sIter.remove();
@ -172,12 +165,10 @@ public class CharKnownList extends ObjectKnownList
return;
}
// Go through knownObjects
final Collection<L2Object> objs = getKnownObjects().values();
final Iterator<L2Object> oIter = objs.iterator();
L2Object object;
final Iterator<L2Object> oIter = getKnownObjects().values().iterator();
while (oIter.hasNext())
{
object = oIter.next();
L2Object object = oIter.next();
if (object == null)
{
oIter.remove();
@ -208,8 +199,7 @@ public class CharKnownList extends ObjectKnownList
public List<L2Character> getKnownCharacters()
{
List<L2Character> result = new LinkedList<>();
final Collection<L2Object> objs = getKnownObjects().values();
for (L2Object obj : objs)
for (L2Object obj : getKnownObjects().values())
{
if (obj instanceof L2Character)
{
@ -219,12 +209,10 @@ public class CharKnownList extends ObjectKnownList
return result;
}
public Collection<L2Character> getKnownCharactersInRadius(long radius)
public List<L2Character> getKnownCharactersInRadius(long radius)
{
List<L2Character> result = new ArrayList<>();
final Collection<L2Object> objs = getKnownObjects().values();
for (L2Object obj : objs)
List<L2Character> result = new LinkedList<>();
for (L2Object obj : getKnownObjects().values())
{
if (obj instanceof L2Character)
{
@ -234,43 +222,13 @@ public class CharKnownList extends ObjectKnownList
}
}
}
return result;
}
public final Map<Integer, L2PcInstance> getKnownPlayers()
public final List<L2PcInstance> getKnownPlayersInRadius(long radius)
{
if (_knownPlayers == null)
{
_knownPlayers = new ConcurrentHashMap<>();
}
return _knownPlayers;
}
public final Map<Integer, Integer> getKnownRelations()
{
if (_knownRelations == null)
{
_knownRelations = new ConcurrentHashMap<>();
}
return _knownRelations;
}
public final Map<Integer, L2Summon> getKnownSummons()
{
if (_knownSummons == null)
{
_knownSummons = new ConcurrentHashMap<>();
}
return _knownSummons;
}
public final Collection<L2PcInstance> getKnownPlayersInRadius(long radius)
{
List<L2PcInstance> result = new ArrayList<>();
final Collection<L2PcInstance> plrs = getKnownPlayers().values();
for (L2PcInstance player : plrs)
List<L2PcInstance> result = new LinkedList<>();
for (L2PcInstance player : getKnownPlayers().values())
{
if (Util.checkIfInRange((int) radius, getActiveChar(), player, true))
{
@ -279,4 +237,55 @@ public class CharKnownList extends ObjectKnownList
}
return result;
}
public final Map<Integer, L2PcInstance> getKnownPlayers()
{
if (_knownPlayers == null)
{
synchronized (this)
{
if (_knownPlayers == null)
{
_knownPlayers = new ConcurrentHashMap<>();
}
}
}
return _knownPlayers;
}
public final Map<Integer, Integer> getKnownRelations()
{
if (_knownRelations == null)
{
synchronized (this)
{
if (_knownRelations == null)
{
_knownRelations = new ConcurrentHashMap<>();
}
}
}
return _knownRelations;
}
public final Map<Integer, L2Summon> getKnownSummons()
{
if (_knownSummons == null)
{
synchronized (this)
{
if (_knownSummons == null)
{
_knownSummons = new ConcurrentHashMap<>();
}
}
}
return _knownSummons;
}
@Override
public final String toString()
{
return getActiveChar() + " Known Objects " + getKnownObjects();
}
}

View File

@ -18,7 +18,6 @@
*/
package com.l2jserver.gameserver.model.actor.knownlist;
import java.util.Collection;
import java.util.concurrent.ScheduledFuture;
import com.l2jserver.gameserver.ThreadPoolManager;
@ -53,16 +52,14 @@ public class NpcKnownList extends CharKnownList
if (getActiveObject().isNpc() && (object instanceof L2Character))
{
final L2Npc npc = (L2Npc) getActiveObject();
// Broadcast correct walking NPC position.
if (object.isPlayer() && npc.isMoving() && !npc.isInCombat())
if (object.isPlayer() && getActiveChar().isMoving() && !getActiveChar().isInCombat())
{
((L2Character) object).broadcastPacket(new MoveToLocation(npc));
((L2Character) object).broadcastPacket(new MoveToLocation(getActiveChar()));
}
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnNpcCreatureSee(npc, (L2Character) object, object.isSummon()), npc);
EventDispatcher.getInstance().notifyEventAsync(new OnNpcCreatureSee(getActiveChar(), (L2Character) object, object.isSummon()), getActiveChar());
}
return true;
}
@ -120,33 +117,33 @@ public class NpcKnownList extends CharKnownList
@Override
public void run()
{
if (getActiveChar() instanceof L2Attackable)
if (!getActiveChar().isAttackable())
{
final L2Attackable monster = (L2Attackable) getActiveChar();
if (monster.getAI().getIntention() == CtrlIntention.AI_INTENTION_MOVE_TO)
return;
}
final L2Attackable monster = (L2Attackable) getActiveChar();
if (monster.getAI().getIntention() != CtrlIntention.AI_INTENTION_MOVE_TO)
{
return;
}
for (L2PcInstance pl : getKnownPlayers().values())
{
if (!pl.isDead() && !pl.isInvul() && pl.isInsideRadius(monster, monster.getAggroRange(), true, false) && (monster.isMonster() || (monster.isInstanceTypes(InstanceType.L2GuardInstance) && (pl.getKarma() > 0))))
{
final Collection<L2PcInstance> players = getKnownPlayers().values();
if (players != null)
// Send aggroRangeEnter
if (monster.getHating(pl) == 0)
{
for (L2PcInstance pl : players)
{
if (!pl.isDead() && !pl.isInvul() && pl.isInsideRadius(monster, monster.getAggroRange(), true, false) && (monster.isMonster() || (monster.isInstanceTypes(InstanceType.L2GuardInstance) && (pl.getKarma() > 0))))
{
// Send aggroRangeEnter
if (monster.getHating(pl) == 0)
{
monster.addDamageHate(pl, 0, 0);
}
// Skip attack for other targets, if one is already chosen for attack
if ((monster.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && !monster.isCoreAIDisabled())
{
WalkingManager.getInstance().stopMoving(getActiveChar(), false, true);
monster.addDamageHate(pl, 0, 100);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, pl, null);
}
}
}
monster.addDamageHate(pl, 0, 0);
}
// Skip attack for other targets, if one is already chosen for attack
if ((monster.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && !monster.isCoreAIDisabled())
{
WalkingManager.getInstance().stopMoving(getActiveChar(), false, true);
monster.addDamageHate(pl, 0, 100);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, pl, null);
}
}
}

View File

@ -18,7 +18,6 @@
*/
package com.l2jserver.gameserver.model.actor.knownlist;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ -26,13 +25,12 @@ import java.util.concurrent.ConcurrentHashMap;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2WorldRegion;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.util.Util;
public class ObjectKnownList
{
private final L2Object _activeObject;
private Map<Integer, L2Object> _knownObjects;
private volatile Map<Integer, L2Object> _knownObjects;
public ObjectKnownList(L2Object activeObject)
{
@ -116,18 +114,17 @@ public class ObjectKnownList
*/
public final void findObjects()
{
final L2WorldRegion region = getActiveObject().getWorldRegion();
if (region == null)
final L2WorldRegion worldRegion = getActiveObject().getWorldRegion();
if (worldRegion == null)
{
return;
}
if (getActiveObject().isPlayable())
{
for (L2WorldRegion regi : region.getSurroundingRegions()) // offer members of this and surrounding regions
for (L2WorldRegion surroundingRegion : worldRegion.getSurroundingRegions()) // offer members of this and surrounding regions
{
Collection<L2Object> vObj = regi.getVisibleObjects().values();
for (L2Object object : vObj)
for (L2Object object : surroundingRegion.getVisibleObjects().values())
{
if (object != getActiveObject())
{
@ -142,12 +139,11 @@ public class ObjectKnownList
}
else if (getActiveObject() instanceof L2Character)
{
for (L2WorldRegion regi : region.getSurroundingRegions()) // offer members of this and surrounding regions
for (L2WorldRegion surroundingRegion : worldRegion.getSurroundingRegions()) // offer members of this and surrounding regions
{
if (regi.isActive())
if (surroundingRegion.isActive())
{
Collection<L2Playable> vPls = regi.getVisiblePlayable().values();
for (L2Object object : vPls)
for (L2Object object : surroundingRegion.getVisiblePlayable().values())
{
if (object != getActiveObject())
{
@ -165,19 +161,10 @@ public class ObjectKnownList
*/
public void forgetObjects(boolean fullCheck)
{
// Go through knownObjects
final Collection<L2Object> objs = getKnownObjects().values();
final Iterator<L2Object> oIter = objs.iterator();
L2Object object;
final Iterator<L2Object> oIter = getKnownObjects().values().iterator();
while (oIter.hasNext())
{
object = oIter.next();
if (object == null)
{
oIter.remove();
continue;
}
final L2Object object = oIter.next();
if (!fullCheck && !object.isPlayable())
{
continue;
@ -214,7 +201,13 @@ public class ObjectKnownList
{
if (_knownObjects == null)
{
_knownObjects = new ConcurrentHashMap<>();
synchronized (this)
{
if (_knownObjects == null)
{
_knownObjects = new ConcurrentHashMap<>();
}
}
}
return _knownObjects;
}

View File

@ -424,4 +424,10 @@ public final class BuffInfo
}
return 0;
}
@Override
public String toString()
{
return "BuffInfo [effector=" + _effector + ", effected=" + _effected + ", skill=" + _skill + ", effects=" + _effects + ", tasks=" + _tasks + ", scheduledFutureTimeTask=" + _scheduledFutureTimeTask + ", abnormalTime=" + _abnormalTime + ", periodStartTicks=" + _periodStartTicks + ", isRemoved=" + _isRemoved + ", isInUse=" + _isInUse + "]";
}
}

View File

@ -977,7 +977,7 @@ public final class Skill implements IIdentifiable
public boolean isBad()
{
return _effectPoint < 0;
return (_effectPoint < 0) && (_targetType != L2TargetType.SELF);
}
public boolean checkCondition(L2Character activeChar, L2Object object, boolean itemOrWeapon)