Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2MonsterInstance


//    if(attacker.getEffectList().getEffectsBySkillId(L2Skill.SKILL_MYSTIC_IMMUNITY) != null)
//    {
//      return false;
//    }
    int max_attacker_level = 0xFFFF;
    L2MonsterInstance leader;
    if(isRaid() || (isMinion() && (leader = ((L2MinionInstance) this).getLeader()) != null && leader.isRaid()))
    {
      max_attacker_level = getLevel() + Config.RAID_MAX_LEVEL_DIFF;
    }
    else if(getAI() instanceof DefaultAI)
    {
View Full Code Here


      // Спаун мобов вокруг обелиска
      for(int i = 0; i < 6; i++)
      {
        for(int mobId : MOBS)
        {
          L2MonsterInstance npc = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(mobId));
          npc.setSpawnedLoc(Rnd.coordsRandomize(OBELISK_LOC.clone().setZ(-12224), 500, 900));
          npc.setReflection(actor.getReflection());
          npc.onSpawn();
          npc.spawnMe(npc.getSpawnedLoc());
        }
      }
      // Таск открытия двери
      // Возможно на оффе дверь открывается по какому-то другому тригеру
      ThreadPoolManager.getInstance().scheduleGeneral(new OpenDoorTask(DOOR, refId), OPEN_DOOR_DELAY);
View Full Code Here

  @Override
  public void startAITask()
  {
    if(_aiTask == null)
    {
      L2MonsterInstance actor = (L2MonsterInstance) getActor();
      if(actor != null)
      {
        actor.removeMinions();
        actor.setNewMinionList();
        actor.getMinionList().spawnSingleMinionSync(Servitors[Rnd.get(Servitors.length)]);
        if(Rnd.chance(50))
        {
          actor.getMinionList().spawnSingleMinionSync(Servitors[Rnd.get(Servitors.length)]);
        }
        _lastMinionCount = actor.getMinionList().countSpawnedMinions();
        reapplyFunc(actor, _lastMinionCount);
      }
    }
    super.startAITask();
  }
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2MonsterInstance actor = (L2MonsterInstance) getActor();
    if(actor == null)
    {
      return;
    }
    int minionCount = actor.getMinionList() == null ? 0 : actor.getMinionList().countSpawnedMinions();
    if(minionCount != _lastMinionCount)
    {
      _lastMinionCount = minionCount;
      reapplyFunc(actor, _lastMinionCount);
    }
View Full Code Here

    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    L2MonsterInstance boss = ((L2MinionInstance) actor).getLeader();
    if(boss != null && !boss.isDead())
    {
      Location loc = actor.getLoc();
      L2MinionInstance newMinion = new L2MinionInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(Eidolon_ID), boss);
      newMinion.setSpawnedLoc(loc);
      newMinion.onSpawn();
      newMinion.spawnMe(loc);
      newMinion.getAI().setGlobalAggro(0);
      newMinion.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, boss.getRandomHated(), 1);
      MinionList ml = boss.getMinionList();
      if(ml != null)
      {
        ml.addSpawnedMinion(newMinion);
      }
    }
View Full Code Here

      _interval = interval;
    }

    public void run()
    {
      L2MonsterInstance behemoth = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(29069));
      behemoth.onSpawn();
      behemoth.setSpawnedLoc(new Location(Rnd.get(175000, 179900), Rnd.get(112400, 116000), -7709));
      behemoth.spawnMe(behemoth.getSpawnedLoc());
      _monsters.add(behemoth);
      if(_behemothSpawnTask != null)
      {
        _behemothSpawnTask.cancel(false);
        _behemothSpawnTask = null;
View Full Code Here

    }

    public void run()
    {
      int npcId = Rnd.get(29070, 29076);
      L2MonsterInstance bomber = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(npcId));
      bomber.onSpawn();
      bomber.setSpawnedLoc(new Location(Rnd.get(175000, 179900), Rnd.get(112400, 116000), -7709));
      bomber.spawnMe(bomber.getSpawnedLoc());
      _monsters.add(bomber);
      // set self destruction.
      _selfDestructionTask = ThreadPoolManager.getInstance().scheduleGeneral(new SelfDestructionOfBomber(bomber), 3000);
      if(_bomberSpawnTask != null)
      {
View Full Code Here

  protected void onEvtSpawn()
  {
    // Спауним охрану
    for(Location loc : _mysticSpawnPoints)
    {
      L2MonsterInstance mob = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(FOUNDRY_MYSTIC_ID));
      mob.setSpawnedLoc(loc);
      mob.onSpawn();
      mob.spawnMe(loc);
    }
    for(Location loc : _spiritGuardSpawnPoints)
    {
      L2MonsterInstance mob = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(FOUNDRY_SPIRIT_GUARD_ID));
      mob.setSpawnedLoc(loc);
      mob.onSpawn();
      mob.spawnMe(loc);
    }
  }
View Full Code Here

      if(actor == null || actor.isDead())
      {
        return;
      }
      Reflection r = actor.getReflection();
      L2MonsterInstance mob = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(_mobId));
      mob.setSpawnedLoc(actor.getLoc());
      mob.setReflection(r);
      mob.onSpawn();
      mob.spawnMe(mob.getSpawnedLoc());
      mob.setRunning();
      mob.getAI().setMaxPursueRange(20000);
      mob.getAI().setGlobalAggro(0);
      // После спауна мобы бегут к тиату или в фортресс, если тиата еще нету
      L2NpcInstance tiat = findTiat(r.getId());
      Location homeLoc;
      if(tiat != null && !tiat.isDead())
      {
        homeLoc = Rnd.coordsRandomize(tiat.getLoc(), 200, 500);
        mob.setSpawnedLoc(homeLoc);
        mob.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, tiat.getRandomHated(), 1);
        mob.getAI().addTaskMove(homeLoc, true);
      }
      else
      {
        homeLoc = Rnd.coordsRandomize(TIATROOM_LOC, 200, 500);
        mob.setSpawnedLoc(homeLoc);
        mob.getAI().addTaskMove(homeLoc, true);
      }
    }
View Full Code Here

      Reflection r = actor.getReflection();
      for(int i = 0; i < 8; i++)
      {
        for(int mobId : MOBS)
        {
          L2MonsterInstance npc = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(mobId));
          npc.setSpawnedLoc(Rnd.coordsRandomize(actor.getLoc(), 400, 1000));
          npc.setReflection(actor.getReflection());
          npc.onSpawn();
          npc.spawnMe(npc.getSpawnedLoc());
          r.addSpawn(npc.getSpawn());
          L2Character randomHated = actor.getRandomHated();
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, randomHated != null ? randomHated : attacker, Rnd.get(1, 100));
        }
      }
    }
    super.onEvtAttacked(attacker, damage);
  }
View Full Code Here

TOP

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

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.