Sync with L2jServer HighFive Mar 3rd 2016.
This commit is contained in:
@ -358,7 +358,8 @@ public final class L2World
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a L2Object from the world. <B><U> Concept</U> :</B> L2Object (including L2PcInstance) are identified in <B>_visibleObjects</B> of his current L2WorldRegion and in <B>_knownObjects</B> of other surrounding L2Characters <BR>
|
||||
* Remove an object from the world.<br>
|
||||
* <B><U> Concept</U> :</B> L2Object (including L2PcInstance) are identified in <B>_visibleObjects</B> of his current L2WorldRegion and in <B>_knownObjects</B> of other surrounding L2Characters <BR>
|
||||
* L2PcInstance are identified in <B>_allPlayers</B> of L2World, in <B>_allPlayers</B> of his current L2WorldRegion and in <B>_knownPlayer</B> of other surrounding L2Characters <B><U> Actions</U> :</B>
|
||||
* <li>Remove the L2Object object from _allPlayers* of L2World</li>
|
||||
* <li>Remove the L2Object object from _visibleObjects and _allPlayers* of L2WorldRegion</li>
|
||||
@ -369,39 +370,39 @@ public final class L2World
|
||||
* <li>Pickup an Item</li>
|
||||
* <li>Decay a L2Character</li>
|
||||
* @param object L2object to remove from the world
|
||||
* @param oldRegion L2WorldRegion in which the object was before removing
|
||||
* @param oldWorldRegion L2WorldRegion in which the object was before removing
|
||||
*/
|
||||
public void removeVisibleObject(L2Object object, L2WorldRegion oldRegion)
|
||||
public void removeVisibleObject(L2Object object, L2WorldRegion oldWorldRegion)
|
||||
{
|
||||
if (object == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldRegion != null)
|
||||
if (oldWorldRegion == null)
|
||||
{
|
||||
// Remove the object from the L2ObjectHashSet(L2Object) _visibleObjects of L2WorldRegion
|
||||
// If object is a L2PcInstance, remove it from the L2ObjectHashSet(L2PcInstance) _allPlayers of this L2WorldRegion
|
||||
oldRegion.removeVisibleObject(object);
|
||||
|
||||
// Go through all surrounding L2WorldRegion L2Characters
|
||||
for (L2WorldRegion reg : oldRegion.getSurroundingRegions())
|
||||
return;
|
||||
}
|
||||
|
||||
// Removes the object from the visible objects of world region.
|
||||
// If object is a player, removes it from the players map of this world region.
|
||||
oldWorldRegion.removeVisibleObject(object);
|
||||
|
||||
// Goes through all surrounding world region's creatures.
|
||||
// And removes the object from their known lists.
|
||||
for (L2WorldRegion worldRegion : oldWorldRegion.getSurroundingRegions())
|
||||
{
|
||||
for (L2Object obj : worldRegion.getVisibleObjects().values())
|
||||
{
|
||||
final Collection<L2Object> vObj = reg.getVisibleObjects().values();
|
||||
for (L2Object obj : vObj)
|
||||
if (obj != null)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
obj.getKnownList().removeKnownObject(object);
|
||||
}
|
||||
obj.getKnownList().removeKnownObject(object);
|
||||
}
|
||||
}
|
||||
|
||||
// If object is a L2Character :
|
||||
// Remove all L2Object from L2ObjectHashSet(L2Object) containing all L2Object detected by the L2Character
|
||||
// Remove all L2PcInstance from L2ObjectHashSet(L2PcInstance) containing all player ingame detected by the L2Character
|
||||
object.getKnownList().removeAllKnownObjects();
|
||||
}
|
||||
|
||||
// Removes all objects from the object's known list.
|
||||
object.getKnownList().removeAllKnownObjects();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,13 +25,12 @@ import com.l2jmobius.gameserver.model.events.impl.character.npc.OnNpcMoveRouteFi
|
||||
import com.l2jmobius.util.Rnd;
|
||||
|
||||
/**
|
||||
* Holds info about current walk progress
|
||||
* Holds info about current walk progress.
|
||||
* @author GKR, UnAfraid
|
||||
*/
|
||||
public class WalkInfo
|
||||
{
|
||||
private final String _routeName;
|
||||
|
||||
private ScheduledFuture<?> _walkCheckTask;
|
||||
private boolean _blocked = false;
|
||||
private boolean _suspended = false;
|
||||
@ -65,7 +64,7 @@ public class WalkInfo
|
||||
* Calculate next node for this WalkInfo and send debug message from given npc
|
||||
* @param npc NPC to debug message to be sent from
|
||||
*/
|
||||
public void calculateNextNode(L2Npc npc)
|
||||
public synchronized void calculateNextNode(L2Npc npc)
|
||||
{
|
||||
// Check this first, within the bounds of random moving, we have no conception of "first" or "last" node
|
||||
if (getRoute().getRepeatType() == WalkingManager.REPEAT_RANDOM)
|
||||
@ -124,7 +123,7 @@ public class WalkInfo
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_currentNode == -1) // First node arrived, when direction is first <-- last
|
||||
else if (_currentNode == WalkingManager.NO_REPEAT) // First node arrived, when direction is first <-- last
|
||||
{
|
||||
_currentNode = 1;
|
||||
_forward = true;
|
||||
@ -219,4 +218,10 @@ public class WalkInfo
|
||||
{
|
||||
_walkCheckTask = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "WalkInfo [_routeName=" + _routeName + ", _walkCheckTask=" + _walkCheckTask + ", _blocked=" + _blocked + ", _suspended=" + _suspended + ", _stoppedByAttack=" + _stoppedByAttack + ", _currentNode=" + _currentNode + ", _forward=" + _forward + ", _lastActionTime=" + _lastActionTime + "]";
|
||||
}
|
||||
}
|
||||
|
@ -11552,7 +11552,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
for (int i = 0; i < _htmlActionCaches.length; ++i)
|
||||
{
|
||||
if (validateHtmlAction(_htmlActionCaches[i], action))
|
||||
if ((_htmlActionCaches[i] != null) && validateHtmlAction(_htmlActionCaches[i], action))
|
||||
{
|
||||
_lastHtmlActionOriginObjId = _htmlActionOriginObjectIds[i];
|
||||
return _lastHtmlActionOriginObjId;
|
||||
@ -11567,13 +11567,13 @@ public final class L2PcInstance extends L2Playable
|
||||
* <ul>
|
||||
* <li>Inventory contains item</li>
|
||||
* <li>Item owner id == owner id</li>
|
||||
* <li>It isnt pet control item while mounting pet or pet summoned</li>
|
||||
* <li>It isnt active enchant item</li>
|
||||
* <li>It isnt cursed weapon/item</li>
|
||||
* <li>It isnt wear item</li>
|
||||
* <li>It isn't pet control item while mounting pet or pet summoned</li>
|
||||
* <li>It isn't active enchant item</li>
|
||||
* <li>It isn't cursed weapon/item</li>
|
||||
* <li>It isn't wear item</li>
|
||||
* </ul>
|
||||
* @param objectId item object id
|
||||
* @param action just for login porpouse
|
||||
* @param action just for login purpose
|
||||
* @return
|
||||
*/
|
||||
public boolean validateItemManipulation(int objectId, String action)
|
||||
|
@ -135,26 +135,4 @@ public final class SubClass
|
||||
{
|
||||
_vitalityPoints = vit;
|
||||
}
|
||||
|
||||
public void incLevel()
|
||||
{
|
||||
if (!_dualClass && (getLevel() == _maxLevel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_level++;
|
||||
setExp(ExperienceData.getInstance().getExpForLevel(getLevel()));
|
||||
}
|
||||
|
||||
public void decLevel()
|
||||
{
|
||||
if (getLevel() == Config.BASE_SUBCLASS_LEVEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_level--;
|
||||
setExp(ExperienceData.getInstance().getExpForLevel(getLevel()));
|
||||
}
|
||||
}
|
||||
|
@ -1148,7 +1148,6 @@ public final class Fort extends AbstractResidence
|
||||
for (L2Spawn spawnDat : _specialEnvoys)
|
||||
{
|
||||
spawnDat.doSpawn();
|
||||
spawnDat.startRespawn();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2481,7 +2481,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
* The lucky member is chosen by standard loot roll rules -<br>
|
||||
* each member rolls a random number, the one with the highest roll wins.
|
||||
* @param player the player whose party to check
|
||||
* @param npc the NPC used for distance and other checks (if {@link #checkPartyMember(L2PcInstance, L2Npc)} is overriden)
|
||||
* @param npc the NPC used for distance and other checks (if {@link #checkPartyMember(L2PcInstance, L2Npc)} is overridden)
|
||||
* @return the random party member or {@code null}
|
||||
*/
|
||||
public L2PcInstance getRandomPartyMember(L2PcInstance player, L2Npc npc)
|
||||
@ -2523,7 +2523,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
|
||||
/**
|
||||
* This method is called for every party member in {@link #getRandomPartyMember(L2PcInstance, L2Npc)}.<br>
|
||||
* It is intended to be overriden by the specific quest implementations.
|
||||
* It is intended to be overridden by the specific quest implementations.
|
||||
* @param player the player to check
|
||||
* @param npc the NPC that was passed to {@link #getRandomPartyMember(L2PcInstance, L2Npc)}
|
||||
* @return {@code true} if this party member passes the check, {@code false} otherwise
|
||||
@ -2612,7 +2612,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
|
||||
/**
|
||||
* This method is called for every party member in {@link #getRandomPartyMemberState(L2PcInstance, int, int, L2Npc)} if/after all the standard checks are passed.<br>
|
||||
* It is intended to be overriden by the specific quest implementations.<br>
|
||||
* It is intended to be overridden by the specific quest implementations.<br>
|
||||
* It can be used in cases when there are more checks performed than simply a quest condition check,<br>
|
||||
* for example, if an item is required in the player's inventory.
|
||||
* @param qs the {@link QuestState} object of the party member
|
||||
|
Reference in New Issue
Block a user