Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2NpcInstance


  }

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

  }

  @Override
  protected void onEvtSeeSpell(L2Skill skill, L2Character caster)
  {
    L2NpcInstance actor = getActor();
    if(actor == null || actor.isDead() || skill == null)
    {
      return;
    }
    if(skill.getId() == Growth_Accelerator)
    {
      if(Rnd.chance(92))
      {
        try
        {
          L2Spawn sp = new L2Spawn(NpcTable.getTemplate(Stakato_Cheif));
          Location pos = GeoEngine.findPointToStay(actor.getX(), actor.getY(), actor.getZ(), 0, 0, actor.getReflection().getGeoIndex());
          sp.setLoc(pos);
          L2NpcInstance npc = sp.doSpawn(true);
          actor.broadcastPacket(new SocialAction(actor.getObjectId(), 1));
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster, Rnd.get(1, 100));
          actor.doDie(caster);
        }
        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

  }

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

  }

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

  }

  @Override
  protected void onEvtSeeSpell(L2Skill skill, L2Character caster)
  {
    L2NpcInstance actor = getActor();
    if(actor == null || caster == null)
    {
      return;
    }
    int trexMaxHp = actor.getMaxHp();
    int skillId = skill.getId();
    int minhp = 0;
    int maxhp = 0;
    double trexCurrentHp = actor.getCurrentHp();
    switch(skillId)
    {
      case 3626:
        minhp = (60 * trexMaxHp) / 100;
        maxhp = (100 * trexMaxHp) / 100;
        break;
      case 3267:
        minhp = (25 * trexMaxHp) / 100;
        maxhp = (65 * trexMaxHp) / 100;
        break;
      case 3268:
        minhp = (0 * trexMaxHp) / 100;
        maxhp = (25 * trexMaxHp) / 100;
        break;
    }
    if(trexCurrentHp < minhp || trexCurrentHp > maxhp)
    {
      actor.getEffectList().stopEffect(skill);
      caster.sendMessage("The conditions are not right to use this skill now."); // TODO: retail msg
    }
  }
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    if(System.currentTimeMillis() - _lastFactionNotifyTime > actor.minFactionNotifyInterval)
    {
      for(L2NpcInstance npc : actor.getAroundNpc(3000, 500))
      {
        if(npc.getNpcId() == FOUNDRY_MYSTIC_ID || npc.getNpcId() == FOUNDRY_SPIRIT_GUARD_ID)
        {
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, new Object[] {attacker, Rnd.get(1, 100)});
        }
View Full Code Here

  @Override
  protected void onEvtDead(L2Character killer)
  {
    _lastFactionNotifyTime = 0;
    super.onEvtDead(killer);
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    // Удаляем охрану
    for(L2NpcInstance npc : actor.getAroundNpc(3000, 500))
    {
      if(npc.getNpcId() == FOUNDRY_MYSTIC_ID || npc.getNpcId() == FOUNDRY_SPIRIT_GUARD_ID)
      {
        npc.deleteMe();
      }
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    GArray<L2Character> targetList = new GArray<L2Character>();
    for(L2Character character : actor.getAroundCharacters(900, 200))
    {
      if(character.isNpc())
      {
        targetList.add(character);
      }
    }
    if(targetList.size() == 0)
    {
      return;
    }
    for(int i = 0; i < targetList.size(); i++)
    {
      L2Character target = targetList.get(i);
      target.setCurrentHp(target.getCurrentHp() - 10000, true);
      if(target.getCurrentHp() <= 0)
      {
        target.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
      }
    }
    // Only for displaying animation in client
    actor.doCast(SkillTable.getInstance().getInfo(5714, 1), attacker, true);
    actor.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
  }
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.