浏览代码

BETA: One new method for quests hasAtLeastOneQuestItem(L2PcInstance player, int... itemIds)
* Return true if the player has at least one item in the array.
* Minor code formmat and cleanup.

Zoey76 12 年之前
父节点
当前提交
b269e688f7

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/SpawnTable.java

@@ -232,8 +232,8 @@ public class SpawnTable
 				insert.setInt(4, spawn.getLocy());
 				insert.setInt(5, spawn.getLocz());
 				insert.setInt(6, spawn.getHeading());
-				insert.setInt(7, (int) (spawn.getRespawnDelay() / 1000));
-				insert.setInt(8, (int) (spawn.getRespawnMaxDelay() - spawn.getRespawnMinDelay()));				
+				insert.setInt(7, spawn.getRespawnDelay() / 1000);
+				insert.setInt(8, spawn.getRespawnMaxDelay() - spawn.getRespawnMinDelay());
 				insert.setInt(9, spawn.getLocation());
 				insert.execute();
 			}

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/HellboundManager.java

@@ -277,7 +277,7 @@ public class HellboundManager
 					spawnDat.setRespawnDelay(rs.getInt("respawn_delay"), rs.getInt("respawn_random"));
 					spawnDat.setMinLvl(rs.getInt("min_hellbound_level"));
 					spawnDat.setMaxLvl(rs.getInt("max_hellbound_level"));
-
+					
 					// _population.put(spawnDat, null);
 					_population.add(spawnDat);
 					SpawnTable.getInstance().addNewSpawn(spawnDat, false);

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java

@@ -99,7 +99,7 @@ public class RaidBossSpawnManager
 					spawnDat.setHeading(rset.getInt("heading"));
 					spawnDat.setRespawnDelay(rset.getInt("respawn_delay"), rset.getInt("respawn_random"));
 					respawnTime = rset.getLong("respawn_time");
-
+					
 					addNewSpawn(spawnDat, respawnTime, rset.getDouble("currentHP"), rset.getDouble("currentMP"), false);
 				}
 				else

+ 62 - 62
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java

@@ -52,23 +52,23 @@ public class WalkingManager extends DocumentParser
 	private static final byte REPEAT_GO_FIRST = 1;
 	private static final byte REPEAT_TELE_FIRST = 2;
 	private static final byte REPEAT_RANDOM = 3;
-
+	
 	protected Map<Integer, L2WalkRoute> _routes = new HashMap<>(); // all available routes
 	private final Map<Integer, WalkInfo> _activeRoutes = new HashMap<>(); // each record represents NPC, moving by predefined route from _routes, and moving progress
 	private final Map<Integer, NpcRoutesHolder> _routesToAttach = new HashMap<>(); // each record represents NPC and all available routes for it
-
+	
 	/**
 	 * Holds depending between NPC's spawn point and route
 	 */
 	private class NpcRoutesHolder
 	{
 		private final Map<String, Integer> _correspondences;
-
+		
 		public NpcRoutesHolder()
 		{
 			_correspondences = new HashMap<>();
 		}
-
+		
 		/**
 		 * Add correspondence between specific route and specific spawn point
 		 * @param routeId id of route
@@ -78,7 +78,7 @@ public class WalkingManager extends DocumentParser
 		{
 			_correspondences.put(getUniqueKey(loc), routeId);
 		}
-
+		
 		/**
 		 * @param npc
 		 * @return route id for given NPC.
@@ -93,7 +93,7 @@ public class WalkingManager extends DocumentParser
 			
 			return -1;
 		}
-
+		
 		/**
 		 * @param loc
 		 * @return unique text string for given Location.
@@ -103,7 +103,7 @@ public class WalkingManager extends DocumentParser
 			return (loc.getX() + "-" + loc.getY() + "-" + loc.getZ());
 		}
 	}
-
+	
 	/**
 	 * Holds info about current walk progress
 	 */
@@ -117,12 +117,12 @@ public class WalkingManager extends DocumentParser
 		protected boolean _forward = true; // Determines first --> last or first <-- last direction
 		private final int _routeId;
 		protected long _lastActionTime; // Debug field
-
+		
 		public WalkInfo(int routeId)
 		{
 			_routeId = routeId;
 		}
-
+		
 		/**
 		 * @return id of route of this WalkInfo.
 		 */
@@ -130,7 +130,7 @@ public class WalkingManager extends DocumentParser
 		{
 			return _routes.get(_routeId);
 		}
-
+		
 		/**
 		 * @return current node of this WalkInfo.
 		 */
@@ -138,7 +138,7 @@ public class WalkingManager extends DocumentParser
 		{
 			return getRoute().getNodeList().get(_currentNode);
 		}
-
+		
 		/**
 		 * Calculate next node for this WalkInfo and send debug message from given npc
 		 * @param npc NPC to debug message to be sent from
@@ -149,16 +149,16 @@ public class WalkingManager extends DocumentParser
 			if (getRoute().getRepeatType() == REPEAT_RANDOM)
 			{
 				int newNode = _currentNode;
-
+				
 				while (newNode == _currentNode)
 				{
 					newNode = Rnd.get(getRoute().getNodesCount());
 				}
-
+				
 				_currentNode = newNode;
 				npc.sendDebugMessage("Route id: " + getRoute().getId() + ", next random node is " + _currentNode);
 			}
-
+			
 			else
 			{
 				if (_forward)
@@ -169,17 +169,17 @@ public class WalkingManager extends DocumentParser
 				{
 					_currentNode--;
 				}
-
+				
 				if (_currentNode == getRoute().getNodesCount()) // Last node arrived
 				{
 					npc.sendDebugMessage("Route id: " + getRoute().getId() + ", last node arrived");
-
+					
 					if (!getRoute().repeatWalk())
 					{
 						cancelMoving(npc);
 						return;
 					}
-
+					
 					switch (getRoute().getRepeatType())
 					{
 						case REPEAT_GO_BACK:
@@ -195,7 +195,7 @@ public class WalkingManager extends DocumentParser
 							break;
 					}
 				}
-
+				
 				else if (_currentNode == -1) // First node arrived, when direction is first <-- last
 				{
 					_currentNode = 1;
@@ -204,19 +204,19 @@ public class WalkingManager extends DocumentParser
 			}
 		}
 	}
-
+	
 	protected WalkingManager()
 	{
 		load();
 	}
-
+	
 	@Override
 	public final void load()
 	{
 		parseDatapackFile("data/Routes.xml");
 		_log.info(getClass().getSimpleName() + ": Loaded " + _routes.size() + " walking routes.");
 	}
-
+	
 	@Override
 	protected void parseDocument()
 	{
@@ -249,7 +249,7 @@ public class WalkingManager extends DocumentParser
 				{
 					repeatType = -1;
 				}
-
+				
 				final List<L2NpcWalkerNode> list = new ArrayList<>();
 				for (Node r = d.getFirstChild(); r != null; r = r.getNextSibling())
 				{
@@ -260,7 +260,7 @@ public class WalkingManager extends DocumentParser
 						int y = parseInt(attrs, "Y");
 						int z = parseInt(attrs, "Z");
 						int delay = parseInt(attrs, "delay");
-
+						
 						String chatString = null;
 						NpcStringId npcString = null;
 						Node node = attrs.getNamedItem("string");
@@ -296,7 +296,7 @@ public class WalkingManager extends DocumentParser
 						}
 						list.add(new L2NpcWalkerNode(0, npcString, chatString, x, y, z, delay, parseBoolean(attrs, "run")));
 					}
-
+					
 					else if (r.getNodeName().equals("target"))
 					{
 						NamedNodeMap attrs = r.getAttributes();
@@ -304,11 +304,11 @@ public class WalkingManager extends DocumentParser
 						{
 							int npcId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
 							int x = 0, y = 0, z = 0;
-
+							
 							x = Integer.parseInt(attrs.getNamedItem("spawnX").getNodeValue());
 							y = Integer.parseInt(attrs.getNamedItem("spawnY").getNodeValue());
 							z = Integer.parseInt(attrs.getNamedItem("spawnZ").getNodeValue());
-
+							
 							NpcRoutesHolder holder = _routesToAttach.containsKey(npcId) ? _routesToAttach.get(npcId) : new NpcRoutesHolder();
 							holder.addRoute(routeId, new Location(x, y, z));
 							_routesToAttach.put(npcId, holder);
@@ -324,7 +324,7 @@ public class WalkingManager extends DocumentParser
 			}
 		}
 	}
-
+	
 	/**
 	 * @param npc NPC to check
 	 * @return {@code true} if given NPC, or its leader is controlled by Walking Manager and moves currently.
@@ -344,22 +344,22 @@ public class WalkingManager extends DocumentParser
 				monster = ((L2MonsterInstance) npc).getLeader();
 			}
 		}
-
+		
 		if (((monster != null) && !isRegistered(monster)) || !isRegistered(npc))
 		{
 			return false;
 		}
-
+		
 		WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
-
+		
 		if (walk._stoppedByAttack || walk._suspended)
 		{
 			return false;
 		}
-
+		
 		return true;
 	}
-
+	
 	/**
 	 * @param npc NPC to check
 	 * @return {@code true} if given NPC controlled by Walking Manager.
@@ -368,7 +368,7 @@ public class WalkingManager extends DocumentParser
 	{
 		return _activeRoutes.containsKey(npc.getObjectId());
 	}
-
+	
 	/**
 	 * Start to move given NPC by given route
 	 * @param npc NPC to move
@@ -384,14 +384,14 @@ public class WalkingManager extends DocumentParser
 				if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE) || (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE))
 				{
 					WalkInfo walk = new WalkInfo(routeId);
-
+					
 					if (npc.isDebug())
 					{
 						walk._lastActionTime = System.currentTimeMillis();
 					}
-
+					
 					L2NpcWalkerNode node = walk.getCurrentNode();
-
+					
 					// adjust next waypoint, if NPC spawns at first waypoint
 					if ((npc.getX() == node.getMoveX()) && (npc.getY() == node.getMoveY()))
 					{
@@ -399,13 +399,13 @@ public class WalkingManager extends DocumentParser
 						node = walk.getCurrentNode();
 						npc.sendDebugMessage("Route id " + routeId + ", spawn point is same with first waypoint, adjusted to next");
 					}
-
+					
 					if (!npc.isInsideRadius(node.getMoveX(), node.getMoveY(), node.getMoveZ(), 3000, true, false))
 					{
 						npc.sendDebugMessage("Route id " + routeId + ", NPC is too far from starting point, walking will no start");
 						return;
 					}
-
+					
 					npc.sendDebugMessage("Starting to move at route " + routeId);
 					npc.setIsRunning(node.getRunning());
 					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(node.getMoveX(), node.getMoveY(), node.getMoveZ(), 0));
@@ -417,9 +417,9 @@ public class WalkingManager extends DocumentParser
 							startMoving(npc, routeId);
 						}
 					}, 60000, 60000); // start walk check task, for resuming walk after fight
-
+					
 					npc.getKnownList().startTrackingTask();
-
+					
 					_activeRoutes.put(npc.getObjectId(), walk); // register route
 				}
 				else
@@ -441,14 +441,14 @@ public class WalkingManager extends DocumentParser
 				if ((npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE) || (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE))
 				{
 					WalkInfo walk = _activeRoutes.get(npc.getObjectId());
-
+					
 					// Prevent call simultaneously from scheduled task and onArrived() or temporarily stop walking for resuming in future
 					if (walk._blocked || walk._suspended)
 					{
 						npc.sendDebugMessage("Trying continue to move at route " + routeId + ", but cannot now (operation is blocked)");
 						return;
 					}
-
+					
 					walk._blocked = true;
 					L2NpcWalkerNode node = walk.getCurrentNode();
 					npc.sendDebugMessage("Route id: " + routeId + ", continue to node " + walk._currentNode);
@@ -464,7 +464,7 @@ public class WalkingManager extends DocumentParser
 			}
 		}
 	}
-
+	
 	/**
 	 * Cancel NPC moving permanently
 	 * @param npc NPC to cancel
@@ -478,7 +478,7 @@ public class WalkingManager extends DocumentParser
 			npc.getKnownList().stopTrackingTask();
 		}
 	}
-
+	
 	/**
 	 * Resumes previously stopped moving
 	 * @param npc NPC to resume
@@ -495,7 +495,7 @@ public class WalkingManager extends DocumentParser
 		walk._stoppedByAttack = false;
 		startMoving(npc, walk.getRoute().getId());
 	}
-
+	
 	/**
 	 * Pause NPC moving until it will be resumed
 	 * @param npc NPC to pause moving
@@ -505,7 +505,7 @@ public class WalkingManager extends DocumentParser
 	public void stopMoving(L2Npc npc, boolean suspend, boolean stoppedByAttack)
 	{
 		L2MonsterInstance monster = null;
-
+		
 		if (npc.isMonster())
 		{
 			if (((L2MonsterInstance) npc).getLeader() == null)
@@ -517,17 +517,17 @@ public class WalkingManager extends DocumentParser
 				monster = ((L2MonsterInstance) npc).getLeader();
 			}
 		}
-
+		
 		if (((monster != null) && !isRegistered(monster)) || !isRegistered(npc))
 		{
 			return;
 		}
-
+		
 		WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
-
+		
 		walk._suspended = suspend;
 		walk._stoppedByAttack = stoppedByAttack;
-
+		
 		if (monster != null)
 		{
 			monster.stopMove(null);
@@ -539,7 +539,7 @@ public class WalkingManager extends DocumentParser
 			npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
 		}
 	}
-
+	
 	/**
 	 * Manage "node arriving"-related tasks: schedule move to next node; send ON_NODE_ARRIVED event to Quest script
 	 * @param npc NPC to manage
@@ -556,9 +556,9 @@ public class WalkingManager extends DocumentParser
 					quest.notifyNodeArrived(npc);
 				}
 			}
-
+			
 			WalkInfo walk = _activeRoutes.get(npc.getObjectId());
-
+			
 			// Opposite should not happen... but happens sometime
 			if ((walk._currentNode >= 0) && (walk._currentNode < walk.getRoute().getNodesCount()))
 			{
@@ -570,7 +570,7 @@ public class WalkingManager extends DocumentParser
 					walk.calculateNextNode(npc);
 					int delay = walk.getCurrentNode().getDelay();
 					walk._blocked = true; // prevents to be ran from walk check task, if there is delay in this node.
-
+					
 					if (npc.isDebug())
 					{
 						walk._lastActionTime = System.currentTimeMillis();
@@ -580,7 +580,7 @@ public class WalkingManager extends DocumentParser
 			}
 		}
 	}
-
+	
 	/**
 	 * Manage "on death"-related tasks: permanently cancel moving of died NPC
 	 * @param npc NPC to manage
@@ -589,7 +589,7 @@ public class WalkingManager extends DocumentParser
 	{
 		cancelMoving(npc);
 	}
-
+	
 	/**
 	 * Manage "on spawn"-related tasks: start NPC moving, if there is route attached to its spawn point
 	 * @param npc NPC to manage
@@ -599,25 +599,25 @@ public class WalkingManager extends DocumentParser
 		if (_routesToAttach.containsKey(npc.getNpcId()))
 		{
 			int routeId = _routesToAttach.get(npc.getNpcId()).getRouteId(npc);
-
+			
 			if (routeId > 0)
 			{
 				startMoving(npc, routeId);
 			}
 		}
 	}
-
+	
 	private class ArrivedTask implements Runnable
 	{
 		WalkInfo _walk;
 		L2Npc _npc;
-
+		
 		public ArrivedTask(L2Npc npc, WalkInfo walk)
 		{
 			_npc = npc;
 			_walk = walk;
 		}
-
+		
 		@Override
 		public void run()
 		{
@@ -625,12 +625,12 @@ public class WalkingManager extends DocumentParser
 			startMoving(_npc, _walk.getRoute().getId());
 		}
 	}
-
+	
 	public static final WalkingManager getInstance()
 	{
 		return SingletonHolder._instance;
 	}
-
+	
 	private static class SingletonHolder
 	{
 		protected static final WalkingManager _instance = new WalkingManager();

+ 13 - 13
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Spawn.java

@@ -222,7 +222,7 @@ public class L2Spawn
 	{
 		return _heading;
 	}
-
+	
 	/**
 	 * @return min respawn delay.
 	 */
@@ -230,7 +230,7 @@ public class L2Spawn
 	{
 		return _respawnMinDelay;
 	}
-
+	
 	/**
 	 * @return max respawn delay.
 	 */
@@ -238,7 +238,7 @@ public class L2Spawn
 	{
 		return _respawnMaxDelay;
 	}
-
+	
 	/**
 	 * Set the maximum number of L2NpcInstance that this L2Spawn can manage.
 	 * @param amount
@@ -613,7 +613,7 @@ public class L2Spawn
 	}
 	
 	/**
-	 * Set bounds for random calculation and delay for respawn 
+	 * Set bounds for random calculation and delay for respawn
 	 * @param delay delay in seconds
 	 * @param randomInterval random interval in seconds
 	 */
@@ -625,36 +625,36 @@ public class L2Spawn
 			{
 				_log.warning("respawn delay is negative for spawn:" + this);
 			}
-
-			int minDelay = delay - randomInterval; 
+			
+			int minDelay = delay - randomInterval;
 			int maxDelay = delay + randomInterval;
-
+			
 			_respawnMinDelay = Math.max(10, minDelay) * 1000;
 			_respawnMaxDelay = Math.max(10, maxDelay) * 1000;
 		}
-
+		
 		else
 		{
 			_respawnMinDelay = 0;
 			_respawnMaxDelay = 0;
 		}
 	}
-
+	
 	public void setRespawnDelay(int delay)
 	{
 		setRespawnDelay(delay, 0);
 	}
-
+	
 	public int getRespawnDelay()
 	{
 		return (_respawnMinDelay + _respawnMaxDelay) / 2;
 	}
-
+	
 	public boolean hasRespawnRandom()
 	{
 		return _respawnMinDelay != _respawnMaxDelay;
-	}	
-
+	}
+	
 	public L2Npc getLastSpawn()
 	{
 		return _lastSpawn;

+ 12 - 12
L2J_Server_BETA/java/com/l2jserver/gameserver/model/Location.java

@@ -27,7 +27,7 @@ public final class Location
 	private final int _z;
 	private int _heading;
 	private int _instanceId;
-
+	
 	public Location(int x, int y, int z)
 	{
 		_x = x;
@@ -35,7 +35,7 @@ public final class Location
 		_z = z;
 		_instanceId = -1;
 	}
-
+	
 	public Location(int x, int y, int z, int heading)
 	{
 		_x = x;
@@ -44,7 +44,7 @@ public final class Location
 		_heading = heading;
 		_instanceId = -1;
 	}
-
+	
 	public Location(int x, int y, int z, int heading, int instanceId)
 	{
 		_x = x;
@@ -53,7 +53,7 @@ public final class Location
 		_heading = heading;
 		_instanceId = instanceId;
 	}
-
+	
 	public Location(L2Object obj)
 	{
 		_x = obj.getX();
@@ -61,7 +61,7 @@ public final class Location
 		_z = obj.getZ();
 		_instanceId = obj.getInstanceId();
 	}
-
+	
 	public Location(L2Character obj)
 	{
 		_x = obj.getX();
@@ -70,38 +70,38 @@ public final class Location
 		_heading = obj.getHeading();
 		_instanceId = obj.getInstanceId();
 	}
-
+	
 	public int getX()
 	{
 		return _x;
 	}
-
+	
 	public int getY()
 	{
 		return _y;
 	}
-
+	
 	public int getZ()
 	{
 		return _z;
 	}
-
+	
 	public int getHeading()
 	{
 		return _heading;
 	}
-
+	
 	public int getInstanceId()
 	{
 		return _instanceId;
 	}
-
+	
 	@Override
 	public String toString()
 	{
 		return "[" + getClass().getSimpleName() + "] X: " + _x + " Y: " + _y + " Z: " + _z + " Heading: " + _heading + " InstanceId: " + _instanceId;
 	}
-
+	
 	/**
 	 * @param instanceId the instance Id to set
 	 */

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Attackable.java

@@ -1007,7 +1007,7 @@ public class L2Attackable extends L2Npc
 				{
 					WalkingManager.getInstance().stopMoving(this, false, true);
 				}
-
+				
 				L2PcInstance player = attacker.getActingPlayer();
 				if (player != null)
 				{

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -3911,11 +3911,11 @@ public abstract class L2Character extends L2Object
 		public void detachAI()
 		{
 			// Skip character, if it is controlled by Walking Manager
-			if (L2Character.this.isWalker())
+			if (isWalker())
 			{
 				return;
 			}
-
+			
 			_ai = null;
 		}
 	}

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Npc.java

@@ -1445,7 +1445,7 @@ public class L2Npc extends L2Character
 				quest.notifySpawn(this);
 			}
 		}
-
+		
 		if (!isTeleporting())
 		{
 			WalkingManager.getInstance().onSpawn(this);
@@ -1800,7 +1800,7 @@ public class L2Npc extends L2Character
 			player.sendPacket(new AbstractNpcInfo.NpcInfo(this, player));
 		}
 	}
-
+	
 	/**
 	 * @return {@code true} if this L2Npc is registered in WalkingManager
 	 */
@@ -1809,7 +1809,7 @@ public class L2Npc extends L2Character
 	{
 		return WalkingManager.getInstance().isRegistered(this);
 	}
-
+	
 	@Override
 	public boolean isChargedShot(ShotType type)
 	{

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2MonsterInstance.java

@@ -238,7 +238,7 @@ public class L2MonsterInstance extends L2Attackable
 	{
 		return true;
 	}
-
+	
 	/**
 	 * @return true if this L2MonsterInstance (or its master) is registered in WalkingManager
 	 */

+ 9 - 9
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/knownlist/AttackableKnownList.java

@@ -32,7 +32,7 @@ public class AttackableKnownList extends NpcKnownList
 	{
 		super(activeChar);
 	}
-
+	
 	@Override
 	protected boolean removeKnownObject(L2Object object, boolean forget)
 	{
@@ -40,7 +40,7 @@ public class AttackableKnownList extends NpcKnownList
 		{
 			return false;
 		}
-
+		
 		// Remove the L2Object from the _aggrolist of the L2Attackable
 		if (object instanceof L2Character)
 		{
@@ -48,7 +48,7 @@ public class AttackableKnownList extends NpcKnownList
 		}
 		// Set the L2Attackable Intention to AI_INTENTION_IDLE
 		final Collection<L2PcInstance> known = getKnownPlayers().values();
-
+		
 		// FIXME: This is a temporary solution && support for Walking Manager
 		if (getActiveChar().hasAI() && ((known == null) || known.isEmpty()) && !getActiveChar().isWalker())
 		{
@@ -57,19 +57,19 @@ public class AttackableKnownList extends NpcKnownList
 		
 		return true;
 	}
-
+	
 	@Override
 	public L2Attackable getActiveChar()
 	{
 		return (L2Attackable) super.getActiveChar();
 	}
-
+	
 	@Override
 	public int getDistanceToForgetObject(L2Object object)
 	{
 		return (int) (getDistanceToWatchObject(object) * 1.5);
 	}
-
+	
 	@Override
 	public int getDistanceToWatchObject(L2Object object)
 	{
@@ -77,14 +77,14 @@ public class AttackableKnownList extends NpcKnownList
 		{
 			return 0;
 		}
-
+		
 		if (object.isPlayable())
 		{
 			return object.getKnownList().getDistanceToWatchObject(getActiveObject());
 		}
-
+		
 		int max = Math.max(300, Math.max(getActiveChar().getAggroRange(), Math.max(getActiveChar().getFactionRange(), getActiveChar().getEnemyRange())));
-
+		
 		return max;
 	}
 }

+ 12 - 12
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/knownlist/NpcKnownList.java

@@ -34,24 +34,24 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 public class NpcKnownList extends CharKnownList
 {
 	private ScheduledFuture<?> _trackingTask = null;
-
+	
 	public NpcKnownList(L2Npc activeChar)
 	{
 		super(activeChar);
 	}
-
+	
 	@Override
 	public L2Npc getActiveChar()
 	{
 		return (L2Npc) super.getActiveChar();
 	}
-
+	
 	@Override
 	public int getDistanceToForgetObject(L2Object object)
 	{
 		return 2 * getDistanceToWatchObject(object);
 	}
-
+	
 	@Override
 	public int getDistanceToWatchObject(L2Object object)
 	{
@@ -59,20 +59,20 @@ public class NpcKnownList extends CharKnownList
 		{
 			return 0;
 		}
-
+		
 		if (object instanceof L2FestivalGuideInstance)
 		{
 			return 4000;
 		}
-
+		
 		if (object.isPlayable())
 		{
 			return 1500;
 		}
-
+		
 		return 500;
 	}
-
+	
 	// Support for Walking monsters aggro
 	public void startTrackingTask()
 	{
@@ -81,7 +81,7 @@ public class NpcKnownList extends CharKnownList
 			_trackingTask = ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new TrackingTask(), 2000, 2000);
 		}
 	}
-
+	
 	// Support for Walking monsters aggro
 	public void stopTrackingTask()
 	{
@@ -91,7 +91,7 @@ public class NpcKnownList extends CharKnownList
 			_trackingTask = null;
 		}
 	}
-
+	
 	// Support for Walking monsters aggro
 	private class TrackingTask implements Runnable
 	{
@@ -99,7 +99,7 @@ public class NpcKnownList extends CharKnownList
 		{
 			//
 		}
-
+		
 		@Override
 		public void run()
 		{
@@ -120,7 +120,7 @@ public class NpcKnownList extends CharKnownList
 								{
 									monster.addDamageHate(pl, 0, 0);
 								}
-
+								
 								// Skip attack for other targets, if one is already choosen for attack
 								if ((monster.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && !monster.isCoreAIDisabled())
 								{

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Instance.java

@@ -539,7 +539,7 @@ public class Instance
 								{
 									respawnRandom = Integer.parseInt(d.getAttributes().getNamedItem("respawnRandom").getNodeValue());
 								}
-
+								
 								npcTemplate = NpcTable.getInstance().getTemplate(npcId);
 								if (npcTemplate != null)
 								{

+ 25 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -1208,7 +1208,7 @@ public class Quest extends ManagedScript
 			_log.log(Level.WARNING, "Exception on onNodeArrived() in notifyNodeArrived(): " + e.getMessage(), e);
 		}
 	}
-
+	
 	// These are methods that java calls to invoke scripts.
 	
 	/**
@@ -1556,7 +1556,7 @@ public class Quest extends ManagedScript
 	{
 		return null;
 	}
-
+	
 	/**
 	 * This function is called whenever a walker NPC (controlled by WalkingManager) arrive a walking node
 	 * @param npc registered NPC
@@ -1566,7 +1566,7 @@ public class Quest extends ManagedScript
 	{
 		return null;
 	}
-
+	
 	/**
 	 * Show an error message to the specified player.
 	 * @param player the player to whom to send the error (must be a GM)
@@ -2436,7 +2436,7 @@ public class Quest extends ManagedScript
 		}
 		return value;
 	}
-
+	
 	/**
 	 * Register addNodeArrived trigger for NPC
 	 * @param npcId id of NPC to register
@@ -2446,7 +2446,7 @@ public class Quest extends ManagedScript
 	{
 		return addEventId(npcId, QuestEventType.ON_NODE_ARRIVED);
 	}
-
+	
 	/**
 	 * Register addNodeArrived trigger for NPC
 	 * @param npcIds id of NPC to register
@@ -2462,7 +2462,7 @@ public class Quest extends ManagedScript
 		}
 		return value;
 	}
-
+	
 	/**
 	 * Use this method to get a random party member from a player's party.<br>
 	 * Useful when distributing rewards after killing an NPC.
@@ -3159,6 +3159,25 @@ public class Quest extends ManagedScript
 		return true;
 	}
 	
+	/**
+	 * Check for multiple items in player's inventory.
+	 * @param player the player whose inventory to check for quest items
+	 * @param itemIds a list of item Ids to check for
+	 * @return {@code true} if at least one items exist in player's inventory, {@code false} otherwise
+	 */
+	public boolean hasAtLeastOneQuestItem(L2PcInstance player, int... itemIds)
+	{
+		final PcInventory inv = player.getInventory();
+		for (int itemId : itemIds)
+		{
+			if (inv.getItemByItemId(itemId) != null)
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+	
 	/**
 	 * Get the enchantment level of an item in player's inventory.
 	 * @param player the player whose item to check

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -2185,7 +2185,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	{
 		return _npcId;
 	}
-
+	
 	/**
 	 * @return the _faceId
 	 */
@@ -2193,7 +2193,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	{
 		return _faceId;
 	}
-
+	
 	/**
 	 * @return the _hairColorId
 	 */
@@ -2201,7 +2201,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	{
 		return _hairColorId;
 	}
-
+	
 	/**
 	 * @return the _hairStyleId
 	 */