All pastes #337542 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-02 21:40 UTC
rendered paste body
    public class AutoChatInstance
    {
        protected int _npcId;
        private long _defaultDelay = DEFAULT_CHAT_DELAY;
        private String[] _defaultTexts;
        private boolean _defaultRandom = false;

        private boolean _globalChat = false;
        private boolean _isActive;

        private Map<Integer, AutoChatDefinition> _chatDefinitions = new FastMap<Integer, AutoChatDefinition>();
        public ScheduledFuture _chatTask;

        protected AutoChatInstance(int npcId, String[] chatTexts, long chatDelay, boolean isGlobal)
        {
            _defaultTexts = chatTexts;
            _npcId = npcId;
            _defaultDelay = chatDelay;
            _globalChat = isGlobal;

            if (_log.isDebugEnabled())
                _log.info("AutoChatHandler: Registered auto chat for NPC ID " + _npcId
                    + " (Global Chat = " + _globalChat + ").");

            setActive(true);
        }

        protected AutoChatDefinition getChatDefinition(int objectId)
        {
            return _chatDefinitions.get(objectId);
        }

        protected AutoChatDefinition[] getChatDefinitions()
        {
            return _chatDefinitions.values().toArray(
                                                     new AutoChatDefinition[_chatDefinitions.values().size()]);
        }