Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcInfo


   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    if (actor.isDead())
    {
      return true;
    }
    if ((_chatVar + chatDelay) < System.currentTimeMillis())
    {
View Full Code Here


   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && Rnd.chance(5))
    {
      final int DeBuff = DeBuffs[Rnd.get(DeBuffs.length)];
      final List<Effect> effect = attacker.getEffectList().getEffectsBySkillId(DeBuff);
      if (effect != null)
View Full Code Here

    public void runImpl()
    {
      for (String element : ZONES)
      {
        Zone zone = ReflectionUtils.getZone(element);
        NpcInstance npc = getKasha(zone);
        if ((npc != null) && (zone != null))
        {
          int curseLvl = 0;
          int yearningLvl = 0;
          int despairLvl = 0;
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && attacker.isPlayer())
    {
      final Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
View Full Code Here

   * @param aggro int
   */
  @Override
  protected void onEvtAggression(Creature attacker, int aggro)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && attacker.isPlayer())
    {
      final Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if (_firstTimeAttacked)
    {
      Functions.npcSay(actor, "A non-permitted target has been discovered.");
      Functions.npcSay(actor, "Starting intruder removal system.");
      _firstTimeAttacked = false;
View Full Code Here

   * @param killer Creature
   */
  @Override
  protected void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    actor.broadcastPacket(new PlaySound(PlaySound.Type.MUSIC, "BS02_D", 1, 0, actor.getLoc()));
    Functions.npcSay(actor, "A fatal error has occurred");
    Functions.npcSay(actor, "System is being shut down...");
    Functions.npcSay(actor, "......");
    try
    {
      final NpcInstance cubic1 = NpcHolder.getInstance().getTemplate(TELEPORTATION_CUBIC_ID).getNewInstance();
      cubic1.setReflection(actor.getReflection());
      cubic1.setCurrentHpMp(cubic1.getMaxHp(), cubic1.getMaxMp(), true);
      cubic1.spawnMe(CUBIC_1_POSITION);
      final NpcInstance cubic2 = NpcHolder.getInstance().getTemplate(TELEPORTATION_CUBIC_ID).getNewInstance();
      cubic2.setReflection(actor.getReflection());
      cubic2.setCurrentHpMp(cubic1.getMaxHp(), cubic1.getMaxMp(), true);
      cubic2.spawnMe(CUBIC_2_POSITION);
      ThreadPoolManager.getInstance().schedule(new DeSpawnScheduleTimerTask(cubic1, cubic2), CUBIC_DESPAWN_TIME);
    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

   */
  @Override
  protected void onEvtSpawn()
  {
    super.onEvtSpawn();
    final NpcInstance actor = getActor();
    if (Rnd.chance(50))
    {
      actor.setNpcState(1);
    }
    ThreadPoolManager.getInstance().scheduleAtFixedRate(new Switch(), 5 * 60 * 1000L, 5 * 60 * 1000L);
  }
 
View Full Code Here

     * Method runImpl.
     */
    @Override
    public void runImpl()
    {
      final NpcInstance actor = getActor();
      if (actor.getNpcState() == 1)
      {
        actor.setNpcState(2);
      }
      else
      {
        actor.setNpcState(1);
      }
    }
View Full Code Here

   * @param killer Creature
   */
  @Override
  protected void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    boolean isOverhit = false;
    if (actor instanceof MonsterInstance)
    {
      isOverhit = ((MonsterInstance) actor).getOverhitDamage() > 0;
    }
    final int npcId = actor.getNpcId();
    int nextId = 0;
    int type = 0;
    if ((npcId != getNextDoppler(npcId)) && (npcId != getNextVoid(npcId)))
    {
      type = 1;
      if (isOverhit)
      {
        if (Rnd.chance(70))
        {
          nextId = getNextDoppler(npcId);
        }
        else if (Rnd.chance(80))
        {
          nextId = getNextVoid(npcId);
        }
      }
      else if (Rnd.chance(65))
      {
        nextId = getNextDoppler(npcId);
      }
    }
    else if (npcId == getNextDoppler(npcId))
    {
      type = 2;
      if (isOverhit)
      {
        if (Rnd.chance(60))
        {
          nextId = getNextDoppler(npcId);
        }
        else if (Rnd.chance(90))
        {
          nextId = getNextVoid(npcId);
        }
      }
      else if (Rnd.chance(40))
      {
        nextId = getNextDoppler(npcId);
      }
      else if (Rnd.chance(50))
      {
        nextId = getNextVoid(npcId);
      }
    }
    else if (npcId == getNextVoid(npcId))
    {
      type = 3;
      if (isOverhit)
      {
        if (Rnd.chance(80))
        {
          nextId = getNextVoid(npcId);
        }
      }
      else if (Rnd.chance(50))
      {
        nextId = getNextVoid(npcId);
      }
    }
    final Reflection r = actor.getReflection();
    boolean spawnPossible = true;
    if (r instanceof KamalokaNightmare)
    {
      final KamalokaNightmare kama = (KamalokaNightmare) r;
      kama.addKilledKanabion(type);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.network.serverpackets.NpcInfo

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.