Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Ветка 7 семи печатей
#1
Здравствуйте!
Помогите решить данные 3 ошибки.Их было всего 7,своими силами исправил только 4,а вот остальные 3 не получается,что только не пробовал.
Код:
----------
1. ERROR in \Q10294_SevenSignToTheMonastery.java (at line 152)
        ThreadPoolManager.[color=Red]schedule[/color](new MovieStartTask(player,24),7000L); //playe                        
r.showQuestMovie(24)
                          
The method schedule(Q10294_SevenSignToTheMonastery.MovieStartTask, long) is unde
fined for the type ThreadPoolManager
----------
2. ERROR in \Q10294_SevenSignToTheMonastery.java (at line 370)
        L2Npc npcTag = player.getKnownList().[color=Red]getKnownNpc[/color](AbyssalSaintessElcadia2
);
                            
The method getKnownNpc(int) is undefined for the type PcKnownList
----------
3. ERROR in \Q10294_SevenSignToTheMonastery.java (at line 373)
        npcTag.[color=Red]teleToLocationDelayed[/color](x, y, z, 0, false);
                  
The method teleToLocationDelayed(int, int, int, int, boolean) is undefined for t
he type L2Npc
----------
3 problems (3 errors)The method schedule(quests.Q10294_SevenSignToTheMonastery.Q
10294_SevenSignToTheMonastery.MovieStartTask, long) is undefined for the type l2
.brick.gameserver.ThreadPoolManager
The method getKnownNpc(int) is undefined for the type l2.brick.gameserver.model.
actor.knownlist.PcKnownList
The method teleToLocationDelayed(int, int, int, int, boolean) is undefined for t
he type l2.brick.gameserver.model.actor.L2Npc
Failed executing script: D:\Server\game\data\scripts\quests\Q10294_SevenSignToTh
eMonastery\Q10294_SevenSignToTheMonastery.java. See Q10294_SevenSignToTheMonaste
ry.java.error.log for details.

Красным выделил тот код,в котором сама ошибка
Помогите пожалуйста решить данные ошибки.Буду очень признателен!

Код 1-ой ошибки:
Код:
                {
                    ThreadPoolManager.schedule(new MovieStartTask(player,24),7000L); //player.showQuestMovie(24)
                    st.set("movie", "1");
                }
                return null;

Код 2-ой ошибки:
Код:
    }

    private void teleportWithTag(L2PcInstance player, int x, int y, int z) {
        L2Npc npcTag = player.getKnownList().getKnownNpc(AbyssalSaintessElcadia2);
        player.teleToLocation(x, y, z);
        if (npcTag != null)
            npcTag.teleToLocationDelayed(x, y, z, 0, false);
    }
Код 3-ей ошибки,элемент код 2-го кода.Сама линия,на которую ссылается сервер:
Код:
npcTag.teleToLocationDelayed(x, y, z, 0, false);
Ответ
#2
1. скорее всего у тебя пулменеджер на синглтоне, и там нужно сделать нечто .getInstance().schedule
2. возможно нет функционала по определениею нпц, но поиск объекта там точно есть. возьми его и проверь принадлежность к классу нпц
3. замени на teleToLocation(x, y, z);
Ответ
#3
KID Написал:1. скорее всего у тебя пулменеджер на синглтоне, и там нужно сделать нечто .getInstance().schedule
2. возможно нет функционала по определениею нпц, но поиск объекта там точно есть. возьми его и проверь принадлежность к классу нпц
3. замени на teleToLocation(x, y, z);

Спасибо тебе добрый человек,счас буду пробовать Smile

Добавлено через 1 час 19 минут
Эм.. добавил ".getInstance().",и все ровно ссылается на schedul

Код:
1. ERROR in \Q10294_SevenSignToTheMonastery.java (at line 152)
        ThreadPoolManager.getInstance().[color=Red]schedul[/color]e(new MovieStartTask(player,24),7
000L);                                                                
                                                    
The method schedule(Q10294_SevenSignToTheMonastery.MovieStartTask, long) is unde
fined for the type ThreadPoolManager

Квесты правлю 1 раз,вопросик еще можно вам?
Можно поинтересоваться как сделать "Функционал по определению НПС"?
Ответ
#4
Скинь код ThreadPoolManager
Ответ
#5
KID Написал:Скинь код ThreadPoolManager

Вот держите:
Код:
public class ThreadPoolManager
{
    private static class SingletonHolder
    {

        protected static final ThreadPoolManager _instance = new ThreadPoolManager();


        private SingletonHolder()
        {
        }
    }

    private class PurgeTask
        implements Runnable
    {

        public void run()
        {
            _effectsScheduledThreadPool.purge();
            _generalScheduledThreadPool.purge();
            _aiScheduledThreadPool.purge();
        }

        final ThreadPoolManager this$0;

        private PurgeTask()
        {
            this$0 = ThreadPoolManager.this;
            super();
        }

    }

    private static class PriorityThreadFactory
        implements ThreadFactory
    {

        public Thread newThread(Runnable r)
        {
            Thread t = new Thread(_group, r);
            t.setName((new StringBuilder()).append(_name).append("-").append(_threadNumber.getAndIncrement()).toString());
            t.setPriority(_prio);
            return t;
        }

        public ThreadGroup getGroup()
        {
            return _group;
        }

        private int _prio;
        private String _name;
        private AtomicInteger _threadNumber;
        private ThreadGroup _group;

        public PriorityThreadFactory(String name, int prio)
        {
            _threadNumber = new AtomicInteger(1);
            _prio = prio;
            _name = name;
            _group = new ThreadGroup(_name);
        }
    }

    private static final class RunnableWrapper
        implements Runnable
    {

        public final void run()
        {
            try
            {
                _r.run();
            }
            catch(Throwable e)
            {
                Thread t = Thread.currentThread();
                Thread.UncaughtExceptionHandler h = t.getUncaughtExceptionHandler();
                if(h != null)
                    h.uncaughtException(t, e);
            }
        }

        private final Runnable _r;

        public RunnableWrapper(Runnable r)
        {
            _r = r;
        }
    }


    public static ThreadPoolManager getInstance()
    {
        return SingletonHolder._instance;
    }

    private ThreadPoolManager()
    {
        _effectsScheduledThreadPool = new ScheduledThreadPoolExecutor(Config.THREAD_P_EFFECTS, new PriorityThreadFactory("EffectsSTPool", 5));
        _generalScheduledThreadPool = new ScheduledThreadPoolExecutor(Config.THREAD_P_GENERAL, new PriorityThreadFactory("GeneralSTPool", 5));
        _ioPacketsThreadPool = new ThreadPoolExecutor(Config.IO_PACKET_THREAD_CORE_SIZE, 0x7fffffff, 5L, TimeUnit.SECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory("I/O Packet Pool", 6));
        _generalPacketsThreadPool = new ThreadPoolExecutor(Config.GENERAL_PACKET_THREAD_CORE_SIZE, Config.GENERAL_PACKET_THREAD_CORE_SIZE + 2, 15L, TimeUnit.SECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory("Normal Packet Pool", 6));
        _generalThreadPool = new ThreadPoolExecutor(Config.GENERAL_THREAD_CORE_SIZE, Config.GENERAL_THREAD_CORE_SIZE + 2, 5L, TimeUnit.SECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory("General Pool", 5));
        _aiScheduledThreadPool = new ScheduledThreadPoolExecutor(Config.AI_MAX_THREAD, new PriorityThreadFactory("AISTPool", 5));
        scheduleGeneralAtFixedRate(new PurgeTask(), 0x927c0L, 0x493e0L);
    }

    public static long validateDelay(long delay)
    {
        if(delay < 0L)
            delay = 0L;
        else
        if(delay > 0x431bde82d7bL)
            delay = 0x431bde82d7bL;
        return delay;
    }

    public ScheduledFuture scheduleEffect(Runnable r, long delay)
    {
        try
        {
            delay = validateDelay(delay);
            return _effectsScheduledThreadPool.schedule(new RunnableWrapper(r), delay, TimeUnit.MILLISECONDS);
        }
        catch(RejectedExecutionException e)
        {
            return null;
        }
    }

    public ScheduledFuture scheduleEffectAtFixedRate(Runnable r, long initial, long delay)
    {
        try
        {
            delay = validateDelay(delay);
            initial = validateDelay(initial);
            return _effectsScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(r), initial, delay, TimeUnit.MILLISECONDS);
        }
        catch(RejectedExecutionException e)
        {
            return null;
        }
    }

    /**
     * @deprecated Method removeEffect is deprecated
     */

    @Deprecated
    public boolean removeEffect(RunnableScheduledFuture r)
    {
        return _effectsScheduledThreadPool.remove(r);
    }

    public ScheduledFuture scheduleGeneral(Runnable r, long delay)
    {
        try
        {
            delay = validateDelay(delay);
            return _generalScheduledThreadPool.schedule(new RunnableWrapper(r), delay, TimeUnit.MILLISECONDS);
        }
        catch(RejectedExecutionException e)
        {
            return null;
        }
    }

    public ScheduledFuture scheduleGeneralAtFixedRate(Runnable r, long initial, long delay)
    {
        try
        {
            delay = validateDelay(delay);
            initial = validateDelay(initial);
            return _generalScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(r), initial, delay, TimeUnit.MILLISECONDS);
        }
        catch(RejectedExecutionException e)
        {
            return null;
        }
    }

    /**
     * @deprecated Method removeGeneral is deprecated
     */

    @Deprecated
    public boolean removeGeneral(RunnableScheduledFuture r)
    {
        return _generalScheduledThreadPool.remove(r);
    }

    public ScheduledFuture scheduleAi(Runnable r, long delay)
    {
        try
        {
            delay = validateDelay(delay);
            return _aiScheduledThreadPool.schedule(new RunnableWrapper(r), delay, TimeUnit.MILLISECONDS);
        }
        catch(RejectedExecutionException e)
        {
            return null;
        }
    }

    public ScheduledFuture scheduleAiAtFixedRate(Runnable r, long initial, long delay)
    {
        try
        {
            delay = validateDelay(delay);
            initial = validateDelay(initial);
            return _aiScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(r), initial, delay, TimeUnit.MILLISECONDS);
        }
        catch(RejectedExecutionException e)
        {
            return null;
        }
    }

    public void executePacket(Runnable pkt)
    {
        _generalPacketsThreadPool.execute(pkt);
    }

    public void executeCommunityPacket(Runnable r)
    {
        _generalPacketsThreadPool.execute(r);
    }

    public void executeIOPacket(Runnable pkt)
    {
        _ioPacketsThreadPool.execute(pkt);
    }

    public void executeTask(Runnable r)
    {
        _generalThreadPool.execute(r);
    }

    public void executeAi(Runnable r)
    {
        _aiScheduledThreadPool.execute(new RunnableWrapper(r));
    }

    public String[] getStats()
    {
        return (new String[] {
            "STP:", " + Effects:", (new StringBuilder()).append(" |- ActiveThreads:   ").append(_effectsScheduledThreadPool.getActiveCount()).toString(), (new StringBuilder()).append(" |- getCorePoolSize: ").append(_effectsScheduledThreadPool.getCorePoolSize()).toString(), (new StringBuilder()).append(" |- PoolSize:        ").append(_effectsScheduledThreadPool.getPoolSize()).toString(), (new StringBuilder()).append(" |- MaximumPoolSize: ").append(_effectsScheduledThreadPool.getMaximumPoolSize()).toString(), (new StringBuilder()).append(" |- CompletedTasks:  ").append(_effectsScheduledThreadPool.getCompletedTaskCount()).toString(), (new StringBuilder()).append(" |- ScheduledTasks:  ").append(_effectsScheduledThreadPool.getTaskCount() - _effectsScheduledThreadPool.getCompletedTaskCount()).toString(), " | -------", " + General:",
            (new StringBuilder()).append(" |- ActiveThreads:   ").append(_generalScheduledThreadPool.getActiveCount()).toString(), (new StringBuilder()).append(" |- getCorePoolSize: ").append(_generalScheduledThreadPool.getCorePoolSize()).toString(), (new StringBuilder()).append(" |- PoolSize:        ").append(_generalScheduledThreadPool.getPoolSize()).toString(), (new StringBuilder()).append(" |- MaximumPoolSize: ").append(_generalScheduledThreadPool.getMaximumPoolSize()).toString(), (new StringBuilder()).append(" |- CompletedTasks:  ").append(_generalScheduledThreadPool.getCompletedTaskCount()).toString(), (new StringBuilder()).append(" |- ScheduledTasks:  ").append(_generalScheduledThreadPool.getTaskCount() - _generalScheduledThreadPool.getCompletedTaskCount()).toString(), " | -------", " + AI:", (new StringBuilder()).append(" |- ActiveThreads:   ").append(_aiScheduledThreadPool.getActiveCount()).toString(), (new StringBuilder()).append(" |- getCorePoolSize: ").append(_aiScheduledThreadPool.getCorePoolSize()).toString(),
            (new StringBuilder()).append(" |- PoolSize:        ").append(_aiScheduledThreadPool.getPoolSize()).toString(), (new StringBuilder()).append(" |- MaximumPoolSize: ").append(_aiScheduledThreadPool.getMaximumPoolSize()).toString(), (new StringBuilder()).append(" |- CompletedTasks:  ").append(_aiScheduledThreadPool.getCompletedTaskCount()).toString(), (new StringBuilder()).append(" |- ScheduledTasks:  ").append(_aiScheduledThreadPool.getTaskCount() - _aiScheduledThreadPool.getCompletedTaskCount()).toString(), "TP:", " + Packets:", (new StringBuilder()).append(" |- ActiveThreads:   ").append(_generalPacketsThreadPool.getActiveCount()).toString(), (new StringBuilder()).append(" |- getCorePoolSize: ").append(_generalPacketsThreadPool.getCorePoolSize()).toString(), (new StringBuilder()).append(" |- MaximumPoolSize: ").append(_generalPacketsThreadPool.getMaximumPoolSize()).toString(), (new StringBuilder()).append(" |- LargestPoolSize: ").append(_generalPacketsThreadPool.getLargestPoolSize()).toString(),
            (new StringBuilder()).append(" |- PoolSize:        ").append(_generalPacketsThreadPool.getPoolSize()).toString(), (new StringBuilder()).append(" |- CompletedTasks:  ").append(_generalPacketsThreadPool.getCompletedTaskCount()).toString(), (new StringBuilder()).append(" |- QueuedTasks:     ").append(_generalPacketsThreadPool.getQueue().size()).toString(), " | -------", " + I/O Packets:", (new StringBuilder()).append(" |- ActiveThreads:   ").append(_ioPacketsThreadPool.getActiveCount()).toString(), (new StringBuilder()).append(" |- getCorePoolSize: ").append(_ioPacketsThreadPool.getCorePoolSize()).toString(), (new StringBuilder()).append(" |- MaximumPoolSize: ").append(_ioPacketsThreadPool.getMaximumPoolSize()).toString(), (new StringBuilder()).append(" |- LargestPoolSize: ").append(_ioPacketsThreadPool.getLargestPoolSize()).toString(), (new StringBuilder()).append(" |- PoolSize:        ").append(_ioPacketsThreadPool.getPoolSize()).toString(),
            (new StringBuilder()).append(" |- CompletedTasks:  ").append(_ioPacketsThreadPool.getCompletedTaskCount()).toString(), (new StringBuilder()).append(" |- QueuedTasks:     ").append(_ioPacketsThreadPool.getQueue().size()).toString(), " | -------", " + General Tasks:", (new StringBuilder()).append(" |- ActiveThreads:   ").append(_generalThreadPool.getActiveCount()).toString(), (new StringBuilder()).append(" |- getCorePoolSize: ").append(_generalThreadPool.getCorePoolSize()).toString(), (new StringBuilder()).append(" |- MaximumPoolSize: ").append(_generalThreadPool.getMaximumPoolSize()).toString(), (new StringBuilder()).append(" |- LargestPoolSize: ").append(_generalThreadPool.getLargestPoolSize()).toString(), (new StringBuilder()).append(" |- PoolSize:        ").append(_generalThreadPool.getPoolSize()).toString(), (new StringBuilder()).append(" |- CompletedTasks:  ").append(_generalThreadPool.getCompletedTaskCount()).toString(),
            (new StringBuilder()).append(" |- QueuedTasks:     ").append(_generalThreadPool.getQueue().size()).toString(), " | -------", " + Javolution stats:", (new StringBuilder()).append(" |- FastList:        ").append(FastList.report()).toString(), (new StringBuilder()).append(" |- FastMap:        ").append(FastMap.report()).toString(), (new StringBuilder()).append(" |- FastSet:        ").append(FastSet.report()).toString(), " | -------"
        });
    }

    public void shutdown()
    {
        _shutdown = true;
        try
        {
            _effectsScheduledThreadPool.awaitTermination(1L, TimeUnit.SECONDS);
            _generalScheduledThreadPool.awaitTermination(1L, TimeUnit.SECONDS);
            _generalPacketsThreadPool.awaitTermination(1L, TimeUnit.SECONDS);
            _ioPacketsThreadPool.awaitTermination(1L, TimeUnit.SECONDS);
            _generalThreadPool.awaitTermination(1L, TimeUnit.SECONDS);
            _effectsScheduledThreadPool.shutdown();
            _generalScheduledThreadPool.shutdown();
            _generalPacketsThreadPool.shutdown();
            _ioPacketsThreadPool.shutdown();
            _generalThreadPool.shutdown();
            _log.info("All ThreadPools are now stopped");
        }
        catch(InterruptedException e)
        {
            _log.log(Level.WARNING, "", e);
        }
    }

    public boolean isShutdown()
    {
        return _shutdown;
    }

    public void purge()
    {
        _effectsScheduledThreadPool.purge();
        _generalScheduledThreadPool.purge();
        _aiScheduledThreadPool.purge();
        _ioPacketsThreadPool.purge();
        _generalPacketsThreadPool.purge();
        _generalThreadPool.purge();
    }

    public String getPacketStats()
    {
        StringBuilder sb = new StringBuilder(1000);
        ThreadFactory tf = _generalPacketsThreadPool.getThreadFactory();
        if(tf instanceof PriorityThreadFactory)
        {
            PriorityThreadFactory ptf = (PriorityThreadFactory)tf;
            int count = ptf.getGroup().activeCount();
            Thread threads[] = new Thread[count + 2];
            ptf.getGroup().enumerate(threads);
            StringUtil.append(sb, new String[] {
                "General Packet Thread Pool:\r\nTasks in the queue: ", String.valueOf(_generalPacketsThreadPool.getQueue().size()), "\r\nShowing threads stack trace:\r\nThere should be ", String.valueOf(count), " Threads\r\n"
            });
            Thread arr$[] = threads;
            int len$ = arr$.length;
            for(int i$ = 0; i$ < len$; i$++)
            {
                Thread t = arr$[i$];
                if(t == null)
                    continue;
                StringUtil.append(sb, new String[] {
                    t.getName(), "\r\n"
                });
                StackTraceElement arr$[] = t.getStackTrace();
                int len$ = arr$.length;
                for(int i$ = 0; i$ < len$; i$++)
                {
                    StackTraceElement ste = arr$[i$];
                    StringUtil.append(sb, new String[] {
                        ste.toString(), "\r\n"
                    });
                }

            }

        }
        sb.append("Packet Tp stack traces printed.\r\n");
        return sb.toString();
    }

    public String getIOPacketStats()
    {
        StringBuilder sb = new StringBuilder(1000);
        ThreadFactory tf = _ioPacketsThreadPool.getThreadFactory();
        if(tf instanceof PriorityThreadFactory)
        {
            PriorityThreadFactory ptf = (PriorityThreadFactory)tf;
            int count = ptf.getGroup().activeCount();
            Thread threads[] = new Thread[count + 2];
            ptf.getGroup().enumerate(threads);
            StringUtil.append(sb, new String[] {
                "I/O Packet Thread Pool:\r\nTasks in the queue: ", String.valueOf(_ioPacketsThreadPool.getQueue().size()), "\r\nShowing threads stack trace:\r\nThere should be ", String.valueOf(count), " Threads\r\n"
            });
            Thread arr$[] = threads;
            int len$ = arr$.length;
            for(int i$ = 0; i$ < len$; i$++)
            {
                Thread t = arr$[i$];
                if(t == null)
                    continue;
                StringUtil.append(sb, new String[] {
                    t.getName(), "\r\n"
                });
                StackTraceElement arr$[] = t.getStackTrace();
                int len$ = arr$.length;
                for(int i$ = 0; i$ < len$; i$++)
                {
                    StackTraceElement ste = arr$[i$];
                    StringUtil.append(sb, new String[] {
                        ste.toString(), "\r\n"
                    });
                }

            }

        }
        sb.append("Packet Tp stack traces printed.\r\n");
        return sb.toString();
    }

    public String getGeneralStats()
    {
        StringBuilder sb = new StringBuilder(1000);
        ThreadFactory tf = _generalThreadPool.getThreadFactory();
        if(tf instanceof PriorityThreadFactory)
        {
            PriorityThreadFactory ptf = (PriorityThreadFactory)tf;
            int count = ptf.getGroup().activeCount();
            Thread threads[] = new Thread[count + 2];
            ptf.getGroup().enumerate(threads);
            StringUtil.append(sb, new String[] {
                "General Thread Pool:\r\nTasks in the queue: ", String.valueOf(_generalThreadPool.getQueue().size()), "\r\nShowing threads stack trace:\r\nThere should be ", String.valueOf(count), " Threads\r\n"
            });
            Thread arr$[] = threads;
            int len$ = arr$.length;
            for(int i$ = 0; i$ < len$; i$++)
            {
                Thread t = arr$[i$];
                if(t == null)
                    continue;
                StringUtil.append(sb, new String[] {
                    t.getName(), "\r\n"
                });
                StackTraceElement arr$[] = t.getStackTrace();
                int len$ = arr$.length;
                for(int i$ = 0; i$ < len$; i$++)
                {
                    StackTraceElement ste = arr$[i$];
                    StringUtil.append(sb, new String[] {
                        ste.toString(), "\r\n"
                    });
                }

            }

        }
        sb.append("Packet Tp stack traces printed.\r\n");
        return sb.toString();
    }


    protected static final Logger _log = Logger.getLogger(l2/brick/gameserver/ThreadPoolManager.getName());
    private ScheduledThreadPoolExecutor _effectsScheduledThreadPool;
    private ScheduledThreadPoolExecutor _generalScheduledThreadPool;
    private ScheduledThreadPoolExecutor _aiScheduledThreadPool;
    private ThreadPoolExecutor _generalPacketsThreadPool;
    private ThreadPoolExecutor _ioPacketsThreadPool;
    private ThreadPoolExecutor _generalThreadPool;
    private static final long MAX_DELAY = 0x431bde82d7bL;
    private boolean _shutdown;




}
Ответ
#6
schedule смени на scheduleGeneral
Ответ
#7
KID Написал:schedule смени на scheduleGeneral

Огромное тебе спасибО!!!!
Все вроде ошибочка исчезла
Код:
getInstance().scheduleGeneral

Добавлено через 9 минут
KID Написал:1. скорее всего у тебя пулменеджер на синглтоне, и там нужно сделать нечто .getInstance().schedule
2. возможно нет функционала по определениею нпц, но поиск объекта там точно есть. возьми его и проверь принадлежность к классу нпц
3. замени на teleToLocation(x, y, z);


А как сделать принадлежность к классу НПС?Подскажи пожалуйста.
Ответ
#8
Скинь код l2.brick.gameserver.model.actor.knownlist.PcKnownList
Ответ
#9
KID Написал:Скинь код l2.brick.gameserver.model.actor.knownlist.PcKnownList
PcKnownList
Код:
:
public class PcKnownList extends PlayableKnownList
{

    public PcKnownList(L2PcInstance activeChar)
    {
        super(activeChar);
    }

    public boolean addKnownObject(L2Object object)
    {
        if(!super.addKnownObject(object))
            return false;
        if(object.getPoly().isMorphed() && object.getPoly().getPolyType().equals("item"))
        {
            getActiveChar().sendPacket(new SpawnItem(object));
        } else
        {
            object.sendInfo(getActiveChar());
            if(object instanceof L2Character)
            {
                L2Character obj = (L2Character)object;
                if(obj.hasAI())
                    obj.getAI().describeStateToPlayer(getActiveChar());
            }
        }
        return true;
    }

    protected boolean removeKnownObject(L2Object object, boolean forget)
    {
        if(!super.removeKnownObject(object, forget))
            return false;
        if(object instanceof L2AirShipInstance)
        {
            if(((L2AirShipInstance)object).getCaptainId() != 0 && ((L2AirShipInstance)object).getCaptainId() != getActiveChar().getObjectId())
                getActiveChar().sendPacket(new DeleteObject(((L2AirShipInstance)object).getCaptainId()));
            if(((L2AirShipInstance)object).getHelmObjectId() != 0)
                getActiveChar().sendPacket(new DeleteObject(((L2AirShipInstance)object).getHelmObjectId()));
        }
        getActiveChar().sendPacket(new DeleteObject(object));
        if(Config.CHECK_KNOWN && (object instanceof L2Npc) && getActiveChar().isGM())
            getActiveChar().sendMessage((new StringBuilder()).append("Removed NPC: ").append(((L2Npc)object).getName()).toString());
        return true;
    }

    public final L2PcInstance getActiveChar()
    {
        return (L2PcInstance)super.getActiveChar();
    }

    public int getDistanceToForgetObject(L2Object object)
    {
        if(object instanceof L2Vehicle)
            return 10000;
        int knownlistSize = getKnownObjects().size();
        if(knownlistSize <= 25)
            return 4000;
        if(knownlistSize <= 35)
            return 3500;
        return knownlistSize > 70 ? 2310 : 2910;
    }

    public int getDistanceToWatchObject(L2Object object)
    {
        if(object instanceof L2Vehicle)
            return 8000;
        int knownlistSize = getKnownObjects().size();
        if(knownlistSize <= 25)
            return 3400;
        if(knownlistSize <= 35)
            return 2900;
        return knownlistSize > 70 ? 1700 : 2300;
    }

    public volatile L2Playable getActiveChar()
    {
        return getActiveChar();
    }

    public volatile L2Character getActiveChar()
    {
        return getActiveChar();
    }
}
Ответ
#10
и еще PlayableKnownList
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Квест 7 печатей как включить, как управлять! v1kt0r 5 2,930 04-29-2017, 01:17 PM
Последний пост: zGoSu
  Квест 7 печатей. Гварды не видят под шд CKREPKA 3 1,973 08-06-2015, 02:49 AM
Последний пост: Deazer
  Event 7 печатей GameAdvisor 2 1,459 07-28-2015, 05:08 PM
Последний пост: GameAdvisor
  Опции семи печатей CB atures 3 1,514 08-15-2013, 02:48 AM
Последний пост: Visor
  период 7 печатей/осады Kabanitos 3 1,884 10-18-2011, 09:30 PM
Последний пост: L2scripts-Guard
  ID скила НПС в 4 квесте 7 печатей krisadr 2 1,918 03-30-2011, 12:22 PM
Последний пост: krisadr
  7 печатей WooT 5 3,143 09-18-2010, 12:02 PM
Последний пост: Ozzy
  7 печатей xHAMMERx 7 3,296 08-23-2010, 12:23 PM
Последний пост: Drizzy

Перейти к форуму:


Пользователи, просматривающие эту тему: 8 Гость(ей)