Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2MonsterInstance


  @Override
  public void startAITask()
  {
    if(_aiTask == null)
    {
      L2MonsterInstance actor = (L2MonsterInstance) getActor();
      if(actor != null)
      {
        changeAura(actor);
      }
    }
View Full Code Here


      if(party != null && party.getMemberCount() > 2)
      {
        _penaltyMobsNotSpawned = false;
        for(int i = 0; i < 2; i++)
        {
          L2MonsterInstance npc = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(PENALTY_MOBS[Rnd.get(PENALTY_MOBS.length)]));
          npc.setSpawnedLoc(((L2MonsterInstance) actor).getMinionPosition());
          npc.setReflection(actor.getReflection());
          npc.onSpawn();
          npc.spawnMe(npc.getSpawnedLoc());
          npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, Rnd.get(1, 100));
        }
      }
    }
    super.onEvtAttacked(attacker, damage);
  }
View Full Code Here

    public void run()
    {
      if(count <= 10)
      {
        int i = Rnd.get(locs.length);
        L2MonsterInstance mob = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(18493));
        mob.setSpawnedLoc(new Location(locs[i]));
        mob.onSpawn();
        mob.spawnMe(new Location(locs[i]));
        count++;
      }
    }
View Full Code Here

      actor.broadcastPacket(new ExShowScreenMessage("Войны выходите. Защитите Seed of Destruction.", 3000, ScreenMessageAlign.MIDDLE_CENTER, false));
      Reflection r = actor.getReflection();
      for(int index = 0; index < TRAPS_COUNT; index++)
      {
        // Не спауним ловушки, если они уже есть в том месте
        L2MonsterInstance oldTrap = null;
        if(index < _traps.size())
        {
          oldTrap = _traps.get(index);
        }
        if(oldTrap != null && !oldTrap.isDead())
        {
          continue;
        }
        L2MonsterInstance trap = new L2MonsterInstance(IdFactory.getInstance().getNextId(), NpcTable.getTemplate(TRAP_NPC_ID));
        trap.setSpawnedLoc(TRAP_LOCS[index]);
        trap.setReflection(r);
        trap.onSpawn();
        trap.spawnMe(trap.getSpawnedLoc());
        r.addSpawn(trap.getSpawn());
        if(index < _traps.size())
        {
          _traps.remove(index);
        }
        _traps.add(index, trap);
View Full Code Here

    super(actor);
  }
 
  public void notifyEpidosIndexReached()
  {
    L2MonsterInstance actor = (L2MonsterInstance)getActor();
    if (actor.isDead())
      SpawnTaskManager.getInstance().cancelSpawnTask(actor);
   
    getActor().moveToLocation(TowerOfNaiaManager.CENTRAL_COLUMN, 0, false);
    ThreadPoolManager.getInstance().scheduleGeneral(new DespawnTask(), 3000);
  }
View Full Code Here

  @Override
  protected void onEvtSpawn()
  {
    super.onEvtSpawn();
   
    L2MonsterInstance actor = (L2MonsterInstance)getActor();
    if (TowerOfNaiaManager.isEpidosSpawned())
      actor.decayMe();
    else
      TowerOfNaiaManager.addSpore(actor);
  }
View Full Code Here

    }
    double target_hp_precent = target.getCurrentHpPercents();
    double actor_hp_precent = actor.getCurrentHpPercents();
    // Изначально все дружественные цели живые
    double frendly_target_hp_precent = 100;
    L2MonsterInstance targetToHeal = null;
    if(actor.isMinion())
    {
      // Ищем самую дохлую дружественную цель
      L2MonsterInstance master = ((L2MinionInstance) actor).getLeader();
      if(master != null && !master.isDead() && master.isInCombat())
      {
        if(frendly_target_hp_precent > master.getCurrentHpPercents())
        {
          targetToHeal = master;
          frendly_target_hp_precent = master.getCurrentHpPercents();
        }
        MinionList list = master.getMinionList();
        if(list != null)
        {
          for(L2MinionInstance m : list.getSpawnedMinions())
          {
            if(m != actor && frendly_target_hp_precent > m.getCurrentHpPercents())
View Full Code Here

    {
      return false;
    }
    if(actor.isMinion())
    {
      L2MonsterInstance leader = ((L2MinionInstance) actor).getLeader();
      if(leader == null)
      {
        return false;
      }
      double distance = actor.getDistance(leader.getX(), leader.getY());
      if(distance > 1000)
      {
        actor.teleToLocation(leader.getMinionPosition());
      }
      else if(distance > 200)
      {
        addTaskMove(leader.getMinionPosition(), false);
      }
      return false;
    }
    if(randomAnimation())
    {
View Full Code Here

      try
      {
        if(actor != null)
        {
          Reflection r = actor.getReflection();
          L2MonsterInstance npc = (L2MonsterInstance) NpcTable.getTemplate(transformer).getNewInstance();
          npc.setSpawnedLoc(actor.getLoc());
          npc.setReflection(r);
          npc.onSpawn();
          npc.spawnMe(npc.getSpawnedLoc());
          if(r.getId() > 0)
          {
            r.addSpawn(npc.getSpawn());
          }
          if(killer != null && killer.isPlayable())
          {
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, 100);
            killer.setTarget(npc);
            killer.sendPacket(npc.makeStatusUpdate(StatusUpdate.CUR_HP, StatusUpdate.MAX_HP));
          }
        }
      }
      catch(Exception e)
      {
View Full Code Here

        {
          int chance = getInt("transformChance", 5);
          if(chance == 100 || ((L2MonsterInstance) actor).getChampion() == 0 && actor.getCurrentHpPercents() > 50 && Rnd.chance(chance))
          {
            Reflection r = actor.getReflection();
            L2MonsterInstance npc = (L2MonsterInstance) NpcTable.getTemplate(transformer).getNewInstance();
            npc.setSpawnedLoc(actor.getLoc());
            npc.setReflection(r);
            npc.onSpawn();
            npc.setChampion(((L2MonsterInstance) actor).getChampion());
            npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp(), true);
            npc.spawnMe(npc.getSpawnedLoc());
            if(r.getId() > 0)
            {
              r.addSpawn(npc.getSpawn());
            }
            npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, 100);
            actor.decayMe();
            actor.doDie(actor);
            attacker.setTarget(npc);
            attacker.sendPacket(npc.makeStatusUpdate(StatusUpdate.CUR_HP, StatusUpdate.MAX_HP));
            return;
          }
        }
        catch(Exception e)
        {
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.