Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2NpcInstance


  }

  @Override
  protected void onEvtSeeSpell(L2Skill skill, L2Character caster)
  {
    L2NpcInstance actor = getActor();
    if(actor == null || actor.isDead() || skill == null || caster == null)
    {
      return;
    }
    if(System.currentTimeMillis() - _last_scale_time > 5000)
    {
      _scale_count = 0;
    }
    if(skill.getId() == Water_Dragon_Scale)
    {
      _scale_count++;
      _last_scale_time = System.currentTimeMillis();
    }
    L2Player player = caster.getPlayer();
    if(player == null)
    {
      return;
    }
    int count = 1;
    L2Party party = player.getParty();
    if(party != null)
    {
      count = party.getMemberCount();
    }
    // Снимаем неуязвимость
    if(_scale_count >= count)
    {
      _scale_count = 0;
      actor.getEffectList().stopEffect(Invincible);
    }
  }
View Full Code Here


    L2Character target;
    if((target = prepareTarget()) == null)
    {
      return false;
    }
    L2NpcInstance actor = getActor();
    if(actor == null || actor.isDead())
    {
      return false;
    }
    double distance = actor.getDistance(target);
    double actor_hp_precent = actor.getCurrentHpPercents();
    int rnd_per = Rnd.get(100);
    if(actor_hp_precent < 15 && !_isUsedInvincible)
    {
      _isUsedInvincible = true;
      addTaskBuff(actor, Invincible);
      Functions.npcSay(actor, "Готовьтесь к смерти!!!");
      return true;
    }
    if(rnd_per < 5 && spawnTask == null && despawnTask == null)
    {
      actor.broadcastPacketToOthers(new MagicSkillUse(actor, actor, 5441, 1, 3000, 0));
      spawnTask = ThreadPoolManager.getInstance().scheduleGeneral(new SpawnMobsTask(), 3000);
      return true;
    }
    if(!actor.isAMuted() && rnd_per < 75)
    {
      return chooseTaskAndTargets(null, target, distance);
    }
    return chooseTaskAndTargets(Freezing, target, distance);
  }
View Full Code Here

    return chooseTaskAndTargets(Freezing, target, distance);
  }

  private void spawnMobs()
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    Location pos;
    L2Character hated;
    // Спавним 9 копий
    for(int i = 0; i < 9; i++)
    {
      try
      {
        pos = GeoEngine.findPointToStay(144298, 154420, -11854, 300, 320, actor.getReflection().getGeoIndex());
        L2Spawn sp = new L2Spawn(NpcTable.getTemplate(Tears_Copy));
        sp.setLoc(pos);
        sp.setReflection(actor.getReflection().getId());
        L2NpcInstance copy = sp.doSpawn(true);
        spawns.add(copy);
        // Атакуем случайную цель
        hated = actor.getRandomHated();
        if(hated != null)
        {
          copy.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, hated, Rnd.get(1, 100));
        }
      }
      catch(Exception e)
      {
        e.printStackTrace();
View Full Code Here

  }

  @Override
  protected boolean thinkActive()
  {
    L2NpcInstance actor = getActor();
    if(actor == null || actor.isDead())
    {
      return true;
    }
    if(_def_think)
    {
View Full Code Here

  private static final int GREAT_WOLF_NECKLACE = L2Pet.GREAT_WOLF.getControlItemId(); // Ожерелье Great Wolf

  public void evolve()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    L2Summon pl_pet = player.getPet();
View Full Code Here

  }

  @Override
  protected boolean thinkActive()
  {
    L2NpcInstance actor = getActor();
    if(actor == null || actor.isDead())
    {
      return true;
    }
    if(_def_think)
    {
      doTask();
      return true;
    }
    if(System.currentTimeMillis() > wait_timeout && (current_point > -1 || Rnd.chance(5)))
    {
      if(!wait)
      {
        switch(current_point)
        {
          case 0:
            wait_timeout = System.currentTimeMillis() + 10000;
            wait = true;
            return true;
          case 8:
            wait_timeout = System.currentTimeMillis() + 10000;
            wait = true;
            return true;
        }
      }
      wait_timeout = 0;
      wait = false;
      current_point++;
      if(current_point >= points.length)
      {
        current_point = 0;
      }
      actor.setRunning();
      addTaskMove(points[current_point], true);
      doTask();
      return true;
    }
    if(System.currentTimeMillis() - _lastSay > 20000)
View Full Code Here

    {
      case admin_delete:
        L2Object obj = activeChar.getTarget();
        if(obj != null && obj.isNpc())
        {
          L2NpcInstance target = (L2NpcInstance) obj;
          target.deleteMe();
          L2Spawn spawn = target.getSpawn();
          if(spawn != null)
          {
            spawn.stopRespawn();
          }
        }
View Full Code Here

  }

  public void ride_prices()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    show("data/scripts/services/ride-prices.htm", player, npc);
View Full Code Here

  }

  public void ride(String[] args)
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    boolean ru = player.isLangRus();
View Full Code Here

  {
    if(teleportTask != null || target == null || !target.isPlayer())
    {
      return;
    }
    L2NpcInstance actor = getActor();
    if(actor == null || actor.isDead())
    {
      return;
    }
    L2Player player = (L2Player) target;
    if(!((player.isInvisible() || player.isSilentMoving()) && actor.getNpcId() == 27351) && actor.isInRange(player, actor.getNpcId() == 27351 ? 400 : 150) && GeoEngine.canSeeTarget(actor, player, false))
    {
      Functions.npcSay(actor, txt[Rnd.get(txt.length)]);
      teleportTask = ThreadPoolManager.getInstance().scheduleAi(new TeleportTask(player), 3000, true);
      actor.doCast(SkillTable.getInstance().getInfo(5978, 1), player, false);
    }
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.instances.L2NpcInstance

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.