Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2WorldRegion


            activeChar.teleToLocation(npc.getLoc());
            return true;
          }
          else if(!npc.isVisible())
          {
            L2WorldRegion region = L2World.getRegion(npc);
            if(region != null && region.getNpcsList(new GArray<L2NpcInstance>(region.getObjectsSize()), 0, npc.getReflection().getId()).contains(npc))
            {
              activeChar.sendMessage("type 2");
              activeChar.teleToLocation(npc.getLoc());
              return true;
            }
            L2WorldRegion currentRegion = npc.getCurrentRegion();
            if(currentRegion != null)
            {
              activeChar.sendMessage("type 3");
              activeChar.teleToLocation(npc.getLoc());
              return true;
            }
          }
          else if(npc.isDead())
          {
            for(AggroInfo aggro : npc.getAggroMap().values())
            {
              if(aggro.damage > 0 && aggro.hate == 0 && aggro.attacker != null && !aggro.attacker.isDead())
              {
                activeChar.sendMessage("type 4");
                activeChar.teleToLocation(npc.getLoc());
                return true;
              }
            }
          }
        }
        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 L2NpcInstance npc : L2ObjectsStorage.getAllNpcsForIterate())
        {
          if(npc == null || npc instanceof L2RaidBossInstance)
          {
            continue;
          }
          final L2CharacterAI char_ai = npc.getAI();
          if(char_ai instanceof DefaultAI)
          {
            try
            {
              final java.lang.reflect.Field field = l2p.gameserver.ai.DefaultAI.class.getDeclaredField("AI_TASK_DELAY");
              field.setAccessible(true);
              field.set(char_ai, interval);
              if(char_ai.isActive())
              {
                char_ai.stopAITask();
                char_ai.teleportHome(true);
                count++;
                L2WorldRegion region = npc.getCurrentRegion();
                if(region != null && !region.areNeighborsEmpty())
                {
                  char_ai.startAITask();
                  count2++;
                }
              }
View Full Code Here


        return ActiveFriends;
    }

    public GArray<L2NpcInstance> ActiveFriendTargets(boolean check_canSeeTarget) {
        GArray<L2NpcInstance> ActiveFriends = new GArray<L2NpcInstance>();
        L2WorldRegion region = L2World.getRegion(this);
        if (region != null && region.getObjectsSize() > 0) {
            for (L2NpcInstance obj : region.getNpcsList(new GArray<L2NpcInstance>(region.getObjectsSize()),
                    getObjectId(), getReflection().getId())) {
                if (obj != null && !obj.isDead()) {
                    if (!check_canSeeTarget || GeoEngine.canSeeTarget(this, obj, false)) {
                        ActiveFriends.add(obj);
                    }
View Full Code Here

    }
    if(!isGlobalAI() && System.currentTimeMillis() - _lastActiveCheck > 60000)
    {
      _lastActiveCheck = System.currentTimeMillis();
      L2NpcInstance actor = getActor();
      L2WorldRegion region = actor == null ? null : actor.getCurrentRegion();
      if(region == null || region.areNeighborsEmpty())
      {
        if(_aiTask == null)
        {
          return;
        }
View Full Code Here

      return;
    }
    final L2VehiclePoint bp = _path.get(_boat._runstate);
    if(!_boat.isDocked())
    {
      L2WorldRegion region = L2World.getRegion(bp.x, bp.y, bp.z, false);
      if(region != null)
      {
        for(L2Character cha : region.getCharactersList(new GArray<L2Character>(), _boat.getObjectId(), _boat.getReflection().getId()))
        {
          if(cha instanceof L2Vehicle && cha != _boat)
          {
            L2Vehicle otherBoat = (L2Vehicle) cha;
            if(otherBoat.isDocked() && canConflict(_boat.getName(), otherBoat.getName()))
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2WorldRegion

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.