Examples of CharacterAI


Examples of lineage2.gameserver.ai.CharacterAI

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

Examples of lineage2.gameserver.ai.CharacterAI

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

Examples of lineage2.gameserver.ai.CharacterAI

  {
    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

Examples of lineage2.gameserver.ai.CharacterAI

        {
          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

Examples of lineage2.gameserver.ai.CharacterAI

    {
      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

Examples of lineage2.gameserver.ai.CharacterAI

   * @param template NpcTemplate
   */
  public DeadManInstance(int objectId, NpcTemplate template)
  {
    super(objectId, template);
    setAI(new CharacterAI(this));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.