Automatic seen creature initialization for registered NPC ids.
This commit is contained in:
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -981,6 +981,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -992,6 +996,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -981,6 +981,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -992,6 +996,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1071,6 +1075,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1071,6 +1075,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -982,6 +982,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -993,6 +997,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@@ -114,6 +115,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1272,6 +1275,7 @@ public class Npc extends Creature
|
|||||||
_killingBlowWeaponId = 0;
|
_killingBlowWeaponId = 0;
|
||||||
_isRandomAnimationEnabled = getTemplate().isRandomAnimationEnabled();
|
_isRandomAnimationEnabled = getTemplate().isRandomAnimationEnabled();
|
||||||
_isRandomWalkingEnabled = !WalkingManager.getInstance().isTargeted(this) && getTemplate().isRandomWalkEnabled();
|
_isRandomWalkingEnabled = !WalkingManager.getInstance().isTargeted(this) && getTemplate().isRandomWalkEnabled();
|
||||||
|
|
||||||
if (isTeleporting())
|
if (isTeleporting())
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcTeleport(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnNpcTeleport(this), this);
|
||||||
@@ -1285,6 +1289,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
WalkingManager.getInstance().onSpawn(this);
|
WalkingManager.getInstance().onSpawn(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -843,6 +843,10 @@ public abstract class AbstractScript extends ManagedScript
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,6 +858,10 @@ public abstract class AbstractScript extends ManagedScript
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@@ -114,6 +115,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1272,6 +1275,7 @@ public class Npc extends Creature
|
|||||||
_killingBlowWeaponId = 0;
|
_killingBlowWeaponId = 0;
|
||||||
_isRandomAnimationEnabled = getTemplate().isRandomAnimationEnabled();
|
_isRandomAnimationEnabled = getTemplate().isRandomAnimationEnabled();
|
||||||
_isRandomWalkingEnabled = !WalkingManager.getInstance().isTargeted(this) && getTemplate().isRandomWalkEnabled();
|
_isRandomWalkingEnabled = !WalkingManager.getInstance().isTargeted(this) && getTemplate().isRandomWalkEnabled();
|
||||||
|
|
||||||
if (isTeleporting())
|
if (isTeleporting())
|
||||||
{
|
{
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcTeleport(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnNpcTeleport(this), this);
|
||||||
@@ -1285,6 +1289,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
WalkingManager.getInstance().onSpawn(this);
|
WalkingManager.getInstance().onSpawn(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -843,6 +843,10 @@ public abstract class AbstractScript extends ManagedScript
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,6 +858,10 @@ public abstract class AbstractScript extends ManagedScript
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -116,6 +118,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1070,6 +1074,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -117,6 +119,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1082,6 +1086,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -117,6 +119,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1082,6 +1086,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -117,6 +119,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1082,6 +1086,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -114,6 +116,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1054,6 +1058,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -956,6 +956,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,6 +971,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -117,6 +119,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1083,6 +1087,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -957,6 +957,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -968,6 +972,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -117,6 +119,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1083,6 +1087,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -957,6 +957,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -968,6 +972,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ package org.l2jmobius.gameserver.model.actor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
@@ -117,6 +119,8 @@ public class Npc extends Creature
|
|||||||
public static final int INTERACTION_DISTANCE = 250;
|
public static final int INTERACTION_DISTANCE = 250;
|
||||||
/** Maximum distance where the drop may appear given this NPC position. */
|
/** Maximum distance where the drop may appear given this NPC position. */
|
||||||
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
public static final int RANDOM_ITEM_DROP_LIMIT = 70;
|
||||||
|
/** Ids of NPCs that see creatures through the OnCreatureSee event. */
|
||||||
|
private static final Set<Integer> CREATURE_SEE_IDS = ConcurrentHashMap.newKeySet();
|
||||||
/** The Spawn object that manage this NpcInstance */
|
/** The Spawn object that manage this NpcInstance */
|
||||||
private Spawn _spawn;
|
private Spawn _spawn;
|
||||||
/** The flag to specify if this NpcInstance is busy */
|
/** The flag to specify if this NpcInstance is busy */
|
||||||
@@ -1083,6 +1087,16 @@ public class Npc extends Creature
|
|||||||
{
|
{
|
||||||
setClanId(getCastle().getOwnerId());
|
setClanId(getCastle().getOwnerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CREATURE_SEE_IDS.contains(getId()))
|
||||||
|
{
|
||||||
|
initSeenCreatures();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCreatureSeeId(int id)
|
||||||
|
{
|
||||||
|
CREATURE_SEE_IDS.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
@@ -957,6 +957,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, int... npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -968,6 +972,10 @@ public abstract class AbstractScript extends ManagedScript implements IEventTime
|
|||||||
*/
|
*/
|
||||||
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
protected final List<AbstractEventListener> setCreatureSeeId(Consumer<OnCreatureSee> callback, Collection<Integer> npcIds)
|
||||||
{
|
{
|
||||||
|
for (int id : npcIds)
|
||||||
|
{
|
||||||
|
Npc.addCreatureSeeId(id);
|
||||||
|
}
|
||||||
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
return registerConsumer(callback, EventType.ON_CREATURE_SEE, ListenerRegisterType.NPC, npcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user