Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2NpcInstance


    if(monsterList != null)
    {
      for(Location loc : monsterList)
      {
        L2NpcTemplate template = NpcTable.getTemplate(loc.id);
        L2NpcInstance npc;
        if(template.isInstanceOf(L2SepulcherMonsterInstance.class))
        {
          npc = new L2SepulcherMonsterInstance(IdFactory.getInstance().getNextId(), template);
        }
        else
        {
          npc = new L2SepulcherNpcInstance(IdFactory.getInstance().getNextId(), template);
        }
        npc.onSpawn();
        npc.setSpawnedLoc(loc);
        npc.spawnMe(loc);
        _allMobs.add(npc);
      }
    }
  }
View Full Code Here


  }

  @Override
  public void onIntentionAttack(L2Character target)
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    if(getIntention() != CtrlIntention.AI_INTENTION_ACTIVE)
View Full Code Here

  }

  @Override
  protected void onEvtDead(L2Character killer)
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    switch(getActor().getNpcId())
View Full Code Here

  }

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

  }

  @Override
  protected void thinkAttack()
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    Reflection r = actor.getReflection();
    for(L2Player pl : r.getPlayers())
    {
      if(pl != null && Functions.getItemCount(pl, 13846) >= 4)
      {
        actor.decayMe();
      }
    }
    super.thinkAttack();
  }
View Full Code Here

  }

  @Override
  protected void onEvtSeeSpell(L2Skill skill, L2Character caster)
  {
    L2NpcInstance actor = getActor();
    if(actor == null || caster == null || skill.getId() != BALLISTA_BOMB_SKILL_ID)
    {
      return;
    }
    L2Player player = caster.getPlayer();
    Siege siege = SiegeManager.getSiege(actor, true);
    if(siege != null && player != null && siege.getSiegeUnit().getType() == ResidenceType.Fortress)
    {
      L2Clan clan = player.getClan();
      if(clan != null && siege == clan.getSiege() && clan.isDefender())
      {
        return;
      }
    }
    _bombsUseCounter++;
    if(Rnd.chance(20) || _bombsUseCounter > 4)
    {
      actor.doDie(caster);
    }
  }
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

      try
      {
        Location pos = GeoEngine.findPointToStay(player.getX(), player.getY(), player.getZ(), 100, 120, player.getReflection().getGeoIndex());
        L2Spawn sp = new L2Spawn(NpcTable.getTemplate(25667));
        sp.setLoc(pos);
        L2NpcInstance npc = sp.doSpawn(true);
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, player, Rnd.get(1, 100));
      }
      catch(ClassNotFoundException e)
      {
        e.printStackTrace();
      }
View Full Code Here

  {
    if(System.currentTimeMillis() - _lastTeleport < TELEPORT_PERIOD)
    {
      return false;
    }
    L2NpcInstance _thisActor = getActor();
    Location loc = _points[Rnd.get(_points.length)];
    if(_thisActor.getLoc().equals(loc))
    {
      return false;
    }
    _thisActor.broadcastPacketToOthers(new MagicSkillUse(_thisActor, _thisActor, 4671, 1, 1000, 0));
    ThreadPoolManager.getInstance().scheduleGeneral(new Teleport(loc), 1000);
    _lastTeleport = System.currentTimeMillis();
    return true;
  }
View Full Code Here

  }

  @Override
  public void onIntentionAttack(L2Character target)
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    if(getIntention() != CtrlIntention.AI_INTENTION_ACTIVE)
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.