Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2NpcInstance


        show(dialog.toString(), player, npc);
    }

    public void effects() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        StringBuilder dialog = new StringBuilder("<html><body><center><font color=\"LEVEL\">");
        dialog.append(npc.getName()).append("<br></font></center><br>");
        ConcurrentLinkedQueue<L2Effect> list = npc.getEffectList().getAllEffects();
        if (list != null && !list.isEmpty()) {
            for (L2Effect e : list) {
                dialog.append(e.getSkill().getName()).append("<br1>");
            }
        }
View Full Code Here


        show(dialog.toString(), player, npc);
    }

    public void stats() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        String dialog = Files.read("data/scripts/actions/player.L2NpcInstance.stats.htm", player);
        dialog = dialog.replaceFirst("%name%", npc.getName());
        dialog = dialog.replaceFirst("%level%", String.valueOf(npc.getLevel()));
        dialog = dialog.replaceFirst("%factionId%", npc.getFactionId());
        dialog = dialog.replaceFirst("%aggro%", String.valueOf(npc.getAggroRange()));
        dialog = dialog.replaceFirst("%race%", getNpcRaceById(npc.getTemplate().getRace()));
        dialog = dialog.replaceFirst("%herbs%", String.valueOf(npc.getTemplate().isDropHerbs));
        dialog = dialog.replaceFirst("%maxHp%", String.valueOf(npc.getMaxHp()));
        dialog = dialog.replaceFirst("%maxMp%", String.valueOf(npc.getMaxMp()));
        dialog = dialog.replaceFirst("%pDef%", String.valueOf(npc.getPDef(null)));
        dialog = dialog.replaceFirst("%mDef%", String.valueOf(npc.getMDef(null, null)));
        dialog = dialog.replaceFirst("%pAtk%", String.valueOf(npc.getPAtk(null)));
        dialog = dialog.replaceFirst("%mAtk%", String.valueOf(npc.getMAtk(null, null)));
        dialog = dialog.replaceFirst("%accuracy%", String.valueOf(npc.getAccuracy()));
        dialog = dialog.replaceFirst("%evasionRate%", String.valueOf(npc.getEvasionRate(null)));
        dialog = dialog.replaceFirst("%criticalHit%", String.valueOf(npc.getCriticalHit(null, null)));
        dialog = dialog.replaceFirst("%runSpeed%", String.valueOf(npc.getRunSpeed()));
        dialog = dialog.replaceFirst("%walkSpeed%", String.valueOf(npc.getWalkSpeed()));
        dialog = dialog.replaceFirst("%pAtkSpd%", String.valueOf(npc.getPAtkSpd()));
        dialog = dialog.replaceFirst("%mAtkSpd%", String.valueOf(npc.getMAtkSpd()));
        show(dialog, player, npc);
    }
View Full Code Here

  }

  public void rendershop(String[] val)
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    boolean isKamael = player.getRace() == Race.kamael;
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if(actor != null && attacker != null && attacker.isPlayer())
    {
      L2Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
View Full Code Here

  }

  @Override
  protected void onEvtAggression(L2Character attacker, int aggro)
  {
    L2NpcInstance actor = getActor();
    if(actor != null && attacker != null && attacker.isPlayer())
    {
      L2Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
View Full Code Here

  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    if(_firstTimeAttacked)
View Full Code Here

  }

  @Override
  protected void onEvtDead(L2Character killer)
  {
    L2NpcInstance actor = getActor();
    if(actor != null)
    {
      actor.broadcastPacket(new PlaySound(1, "BS02_D", 1, 0, actor.getLoc()));
      Functions.npcSay(actor, "Произошла фатальная ошибка");
      Functions.npcSay(actor, "Система выключается...");
      Functions.npcSay(actor, "......");
    }
    try
View Full Code Here

  }

  private static L2NpcInstance spawn(Location loc)
  {
    L2NpcTemplate template = NpcTable.getTemplate(loc.id);
    L2NpcInstance npc = template.getNewInstance();
    npc.setSpawnedLoc(loc);
    npc.onSpawn();
    npc.setHeading(loc.h);
    npc.setXYZInvisible(loc);
    npc.spawnMe();
    return npc;
  }
View Full Code Here

        show(dialog, player, npc);
    }

    public void resists() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        StringBuilder dialog = new StringBuilder("<html><body><center><font color=\"LEVEL\">");
        dialog.append(npc.getName()).append("<br></font></center><table width=\"80%\">");
        int FIRE_RECEPTIVE = (int) npc.calcStat(Stats.FIRE_RECEPTIVE, 0, null, null);
        if (FIRE_RECEPTIVE != 0) {
            dialog.append("<tr><td>Fire</td><td>").append(-FIRE_RECEPTIVE).append("</td></tr>");
        }
        int WIND_RECEPTIVE = (int) npc.calcStat(Stats.WIND_RECEPTIVE, 0, null, null);
        if (WIND_RECEPTIVE != 0) {
            dialog.append("<tr><td>Wind</td><td>").append(-WIND_RECEPTIVE).append("</td></tr>");
        }
        int WATER_RECEPTIVE = (int) npc.calcStat(Stats.WATER_RECEPTIVE, 0, null, null);
        if (WATER_RECEPTIVE != 0) {
            dialog.append("<tr><td>Water</td><td>").append(-WATER_RECEPTIVE).append("</td></tr>");
        }
        int EARTH_RECEPTIVE = (int) npc.calcStat(Stats.EARTH_RECEPTIVE, 0, null, null);
        if (EARTH_RECEPTIVE != 0) {
            dialog.append("<tr><td>Earth</td><td>").append(-EARTH_RECEPTIVE).append("</td></tr>");
        }
        int SACRED_RECEPTIVE = (int) npc.calcStat(Stats.SACRED_RECEPTIVE, 0, null, null);
        if (SACRED_RECEPTIVE != 0) {
            dialog.append("<tr><td>Light</td><td>").append(-SACRED_RECEPTIVE).append("</td></tr>");
        }
        int UNHOLY_RECEPTIVE = (int) npc.calcStat(Stats.UNHOLY_RECEPTIVE, 0, null, null);
        if (UNHOLY_RECEPTIVE != 0) {
            dialog.append("<tr><td>Darkness</td><td>").append(-UNHOLY_RECEPTIVE).append("</td></tr>");
        }
        int BLEED_RECEPTIVE = (int) npc.calcStat(Stats.BLEED_RECEPTIVE, null, null);
        if (BLEED_RECEPTIVE != 0) {
            dialog.append("<tr><td>Bleed</td><td>").append(BLEED_RECEPTIVE).append("</td></tr>");
        }
        int POISON_RECEPTIVE = (int) npc.calcStat(Stats.POISON_RECEPTIVE, null, null);
        if (POISON_RECEPTIVE != 0) {
            dialog.append("<tr><td>Poison</td><td>").append(POISON_RECEPTIVE).append("</td></tr>");
        }
        int STUN_RECEPTIVE = (int) npc.calcStat(Stats.STUN_RECEPTIVE, null, null);
        if (STUN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Stun</td><td>").append(STUN_RECEPTIVE).append("</td></tr>");
        }
        int ROOT_RECEPTIVE = (int) npc.calcStat(Stats.ROOT_RECEPTIVE, null, null);
        if (ROOT_RECEPTIVE != 0) {
            dialog.append("<tr><td>Root</td><td>").append(ROOT_RECEPTIVE).append("</td></tr>");
        }
        int SLEEP_RECEPTIVE = (int) npc.calcStat(Stats.SLEEP_RECEPTIVE, null, null);
        if (SLEEP_RECEPTIVE != 0) {
            dialog.append("<tr><td>Sleep</td><td>").append(SLEEP_RECEPTIVE).append("</td></tr>");
        }
        int PARALYZE_RECEPTIVE = (int) npc.calcStat(Stats.PARALYZE_RECEPTIVE, null, null);
        if (PARALYZE_RECEPTIVE != 0) {
            dialog.append("<tr><td>Paralyze</td><td>").append(PARALYZE_RECEPTIVE).append("</td></tr>");
        }
        int MENTAL_RECEPTIVE = (int) npc.calcStat(Stats.MENTAL_RECEPTIVE, null, null);
        if (MENTAL_RECEPTIVE != 0) {
            dialog.append("<tr><td>Mental</td><td>").append(MENTAL_RECEPTIVE).append("</td></tr>");
        }
        int DEBUFF_RECEPTIVE = (int) npc.calcStat(Stats.DEBUFF_RECEPTIVE, null, null);
        if (DEBUFF_RECEPTIVE != 0) {
            dialog.append("<tr><td>Debuff</td><td>").append(DEBUFF_RECEPTIVE).append("</td></tr>");
        }
        int CANCEL_RECEPTIVE = (int) npc.calcStat(Stats.CANCEL_RECEPTIVE, null, null);
        if (CANCEL_RECEPTIVE != 0) {
            dialog.append("<tr><td>Cancel</td><td>").append(CANCEL_RECEPTIVE).append("</td></tr>");
        }
        int SWORD_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.SWORD_WPN_RECEPTIVE, null, null);
        if (SWORD_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Sword</td><td>").append(SWORD_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int DUAL_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.DUAL_WPN_RECEPTIVE, null, null);
        if (DUAL_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Dual Sword</td><td>").append(DUAL_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int BLUNT_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.BLUNT_WPN_RECEPTIVE, null, null);
        if (BLUNT_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Blunt</td><td>").append(BLUNT_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int DAGGER_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.DAGGER_WPN_RECEPTIVE, null, null);
        if (DAGGER_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Dagger/rapier</td><td>").append(DAGGER_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int BOW_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.BOW_WPN_RECEPTIVE, null, null);
        if (BOW_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Bow</td><td>").append(BOW_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int XBOW_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.CROSSBOW_WPN_RECEPTIVE, null, null);
        if (XBOW_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Crossbow</td><td>").append(XBOW_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int POLE_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.POLE_WPN_RECEPTIVE, null, null);
        if (POLE_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Polearm</td><td>").append(POLE_WPN_RECEPTIVE).append("%</td></tr>");
        }
        int FIST_WPN_RECEPTIVE = 100 - (int) npc.calcStat(Stats.FIST_WPN_RECEPTIVE, null, null);
        if (FIST_WPN_RECEPTIVE != 0) {
            dialog.append("<tr><td>Fist weapons</td><td>").append(FIST_WPN_RECEPTIVE).append("%</td></tr>");
        }
        if (FIRE_RECEPTIVE == 0 && WIND_RECEPTIVE == 0 && WATER_RECEPTIVE == 0 && EARTH_RECEPTIVE == 0 && UNHOLY_RECEPTIVE == 0 && SACRED_RECEPTIVE // primary elements
                == 0 && BLEED_RECEPTIVE == 0 && STUN_RECEPTIVE // phys debuff
View Full Code Here

  }

  public void toMDT()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    if(!L2NpcInstance.canBypassCheck(player, npc))
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.