Package com.l2jfrozen.gameserver.model.actor.position

Examples of com.l2jfrozen.gameserver.model.actor.position.L2CharPosition


    if (Config.DEBUG)
      _log.fine("DEBUG "+getType()+": client: x:" + _x + " y:" + _y + " z:" + _z + " server x:" + player.getX() + " y:" + player.getY() + " z:" + player.getZ());

    if (player.getAI() != null)
      player.getAI().notifyEvent(CtrlEvent.EVT_ARRIVED_BLOCKED, new L2CharPosition(_x, _y, _z, _heading));
  }
View Full Code Here


        {
          x -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_X);
          y -= Rnd.nextInt(FESTIVAL_MAX_OFFSET_Y);
        }

        L2CharPosition moveTo = new L2CharPosition(x, y, _startLocation._z, Rnd.nextInt(65536));

        festivalMob.setRunning();
        festivalMob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, moveTo);
        moveTo = null;
      }
View Full Code Here

      if(boat == null)
        return;
      activeChar.setBoat(boat);
      activeChar.setInBoat(true);
      activeChar.setInBoatPosition(_pos);
      activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO_IN_A_BOAT, new L2CharPosition(_pos.getX(), _pos.getY(), _pos.getZ(), 0), new L2CharPosition(_origin_pos.getX(), _origin_pos.getY(), _origin_pos.getZ(), 0));
    }

  }
View Full Code Here

    if(obj instanceof L2NpcInstance)
    {
      L2NpcInstance temp = (L2NpcInstance) obj;
      temp.setTarget(activeChar);
      temp.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(activeChar.getX(), activeChar.getY(), activeChar.getZ(), 0));
      //      temp.moveTo(player.getX(),player.getY(), player.getZ(), 0 );
    }

  }
View Full Code Here

        }
        break;
      case 53: // move to target
        if(target != null && pet != null && pet != target && !pet.isMovementDisabled())
        {
          pet.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(target.getX(), target.getY(), target.getZ(), 0));
        }
        break;
      case 54: // move to target hatch/strider
        if(target != null && pet != null && pet != target && !pet.isMovementDisabled())
        {
          pet.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(target.getX(), target.getY(), target.getZ(), 0));
        }
        break;
      case 96: // Quit Party Command Channel
        _log.info("98 Accessed");
        break;
View Full Code Here

    {
      if(Config.DEBUG) {
        _log.fine(getObjectId() + ": moving hometo" + " X:" + _homeX + " Y:" + _homeY + " Z:" + _homeZ);
      }
      clearAggroList();
      getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(_homeX, _homeY, _homeZ, 0));
    }
  }
View Full Code Here

      setisReturningToSpawnPoint(true);
      clearAggroList();

      if(hasAI())
      {
        getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(_homeX, _homeY, _homeZ, 0));
      }
    }
  }
View Full Code Here

    int destinationZ = _route.get(_currentPos).getMoveZ();

    //notify AI of MOVE_TO
    setWalkingToNextPoint(true);

    setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(destinationX, destinationY, destinationZ, 0));
  }
View Full Code Here

    {
      _isAttacked = false;
      if(npc.getNpcId() == GORDON)
      {
        npc.setWalking();
        npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(X, Y, Z, 0));
      }
    }
    else if(event.equalsIgnoreCase("check_ai"))
    {
      cancelQuestTimer("check_ai", null, null);
      if(!_isSpawned)
      {
        L2NpcInstance gordon_ai = findTemplate(GORDON);
        if(gordon_ai != null)
        {
          _isSpawned = true;
          startQuestTimer("Start", 1000, gordon_ai, null,true);
          return super.onAdvEvent(event, npc, player);
        }
      }
    }
    else if(event.equalsIgnoreCase("Start"))
    {
      //startQuestTimer("Start", 1000, npc, null);
      if(npc != null && _isSpawned)
      {
        // check if player have Cursed Weapon and in radius
        if(npc.getNpcId() == GORDON)
        {
          Collection<L2PcInstance> chars = npc.getKnownList().getKnownPlayers().values();
          if(chars != null && chars.size() > 0)
          {
            for(L2PcInstance pc : chars)
            {
              if(pc.isCursedWeaponEquipped() && pc.isInsideRadius(npc, 5000, false, false))
              {
                npc.setRunning();
                ((L2Attackable) npc).addDamageHate(pc, 0, 9999);
                npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, pc);
                _isAttacked = true;
                cancelQuestTimer("time_isAttacked", null, null);
                startQuestTimer("time_isAttacked", 180000, npc, null);
                return super.onAdvEvent(event, npc, player);
              }
            }
          }
        }
        // end check
        if(_isAttacked)
          return super.onAdvEvent(event, npc, player);

        if(npc.getNpcId() == GORDON && npc.getX() - 50 <= X && npc.getX() + 50 >= X && npc.getY() - 50 <= Y && npc.getY() + 50 >= Y)
        {
          _isWalkTo++;
          if(_isWalkTo > 55)
          {
            _isWalkTo = 1;
          }
          X = WALKS[_isWalkTo - 1][0];
          Y = WALKS[_isWalkTo - 1][1];
          Z = WALKS[_isWalkTo - 1][2];
          npc.setWalking();
          //TODO: find better way to prevent teleporting to the home location
          npc.getSpawn().setLocx(X);
          npc.getSpawn().setLocy(Y);
          npc.getSpawn().setLocz(Z);
          npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(X, Y, Z, 0));
        }
        // Test for unblock Npc
        if(npc.getX() != _npcMoveX && npc.getY() != _npcMoveY)
        {
          _npcMoveX = npc.getX();
          _npcMoveY = npc.getY();
          _npcBlock = 0;
        }
        else if(npc.getNpcId() == GORDON)
        {
          _npcBlock++;
          if(_npcBlock > 2)
          {
            npc.teleToLocation(X, Y, Z);
            return super.onAdvEvent(event, npc, player);
          }
          if(_npcBlock > 0)
          {
            //TODO: find better way to prevent teleporting to the home location
            npc.getSpawn().setLocx(X);
            npc.getSpawn().setLocy(Y);
            npc.getSpawn().setLocz(Z);
            npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(X, Y, Z, 0));
          }
        }
        // End Test unblock Npc
      }
    }
View Full Code Here

            signy = 1;
          }

          posX += Math.round((float) (signx * (range / 2 + Rnd.get(range)) - distance));
          posY += Math.round((float) (signy * (range / 2 + Rnd.get(range)) - distance));
          setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(posX, posY, posZ, 0));
          return;
        }
      }
    }
    weapon = null;
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.position.L2CharPosition

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.