Package lineage2.gameserver.ai

Examples of lineage2.gameserver.ai.CharacterAI$Timer


  public void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    super.onEvtDead(killer);
    actor.deleteMe();
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final NpcTemplate template = NpcHolder.getInstance().getTemplate(18602);
View Full Code Here


          getZone("[soi_hos_attack_attackup_5]").setActive(false);
          spawnRoom(6);
        }
      }
      else if(self.getNpcId() == Yehan)
        ThreadPoolManager.getInstance().schedule(new RunnableImpl(){
          @Override
          public void runImpl() throws Exception
          {
            spawnRoom(7);
            setReenterTime(System.currentTimeMillis());
View Full Code Here

   * @param time String
   * @param shutdownMode int
   */
  public void schedule(String time, int shutdownMode)
  {
    SchedulingPattern cronTime;
    try
    {
      cronTime = new SchedulingPattern(time);
    }
    catch (InvalidPatternException e)
    {
      return;
    }
    int seconds = (int) ((cronTime.next(System.currentTimeMillis()) / 1000L) - (System.currentTimeMillis() / 1000L));
    schedule(seconds, shutdownMode);
  }
View Full Code Here

  {
    _instance = this;
    _serverStarted = time();
    _listeners = new GameServerListenerList();
    new File("./log/").mkdir();
    version = new Version(GameServer.class);
    _log.info("=================================================");
    _log.info("Revision: ................ " + version.getRevisionNumber());
    _log.info("Build date: .............. " + version.getBuildDate());
    _log.info("Compiler version: ........ " + version.getBuildJdk());
    _log.info("=================================================");
View Full Code Here

    }
    catch (Exception e)
    {
      _log.error("Unable to create ai of NPC " + npcId, e);
    }
    return new CharacterAI(npc);
  }
View Full Code Here

    {
      synchronized (this)
      {
        if (_ai == null)
        {
          _ai = new CharacterAI(this);
        }
      }
    }
    return _ai;
  }
View Full Code Here

  {
    if (newAI == null)
    {
      return;
    }
    CharacterAI oldAI = _ai;
    synchronized (this)
    {
      _ai = newAI;
    }
    if (oldAI != null)
    {
      if (oldAI.isActive())
      {
        oldAI.stopAITask();
        newAI.startAITask();
        newAI.setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
      }
    }
  }
View Full Code Here

        {
          activeChar.sendMessage("target is not a character");
          return false;
        }
        Creature target = (Creature) obj;
        CharacterAI ai = target.getAI();
        if (ai == null)
        {
          activeChar.sendMessage("ai == null");
          return false;
        }
        Creature actor = ai.getActor();
        if (actor == null)
        {
          activeChar.sendMessage("actor == null");
          return false;
        }
        activeChar.sendMessage("actor: " + actor);
        break;
      case admin_setvar:
        if (wordList.length != 3)
        {
          activeChar.sendMessage("Incorrect argument count!!!");
          return false;
        }
        ServerVariables.set(wordList[1], wordList[2]);
        activeChar.sendMessage("Value changed.");
        break;
      case admin_set_ai_interval:
        if (wordList.length != 2)
        {
          activeChar.sendMessage("Incorrect argument count!!!");
          return false;
        }
        int interval = Integer.parseInt(wordList[1]);
        int count = 0;
        int count2 = 0;
        for (final NpcInstance npc : GameObjectsStorage.getAllNpcsForIterate())
        {
          if ((npc == null) || (npc instanceof RaidBossInstance))
          {
            continue;
          }
          final CharacterAI char_ai = npc.getAI();
          if (char_ai instanceof DefaultAI)
          {
            try
            {
              final java.lang.reflect.Field field = lineage2.gameserver.ai.DefaultAI.class.getDeclaredField("AI_TASK_DELAY");
              field.setAccessible(true);
              field.set(char_ai, interval);
              if (char_ai.isActive())
              {
                char_ai.stopAITask();
                count++;
                WorldRegion region = npc.getCurrentRegion();
                if ((region != null) && region.isActive())
                {
                  char_ai.startAITask();
                  count2++;
                }
              }
            }
            catch (Exception e)
View Full Code Here

    {
      yy = 0;
      for (int y = 179280; y >= 178530; y -= 125)
      {
        NpcInstance newNpc = addSpawnToInstance(SC, new Location(x, y, -6115, 16215), 0, world.instanceId);
        newNpc.setAI(new CharacterAI(newNpc));
        if (templist[yy][xx] == 0)
        {
          newNpc.setBusy(true);
          newNpc.addStatFunc(new FuncMul(Stats.MAGIC_DEFENCE, 0x30, this, 1000));
          newNpc.addStatFunc(new FuncMul(Stats.POWER_DEFENCE, 0x30, this, 1000));
View Full Code Here

   * @param template NpcTemplate
   */
  public DeadManInstance(int objectId, NpcTemplate template)
  {
    super(objectId, template);
    setAI(new CharacterAI(this));
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.ai.CharacterAI$Timer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.