Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Player


        dialog.append("</body></html>");
        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>");
            }
        }
        dialog.append("<br><center><button value=\"");
        dialog.append(player.isLangRus() ? "Обновить" : "Refresh");
        dialog.append("\" action=\"bypass -h scripts_actions.OnActionShift:effects\" width=100 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" /></center></body></html>");
        show(dialog.toString(), player, npc);
    }
View Full Code Here


        dialog.append("\" action=\"bypass -h scripts_actions.OnActionShift:effects\" width=100 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" /></center></body></html>");
        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);
View Full Code Here

        dialog = dialog.replaceFirst("%mAtkSpd%", String.valueOf(npc.getMAtkSpd()));
        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\">");
View Full Code Here

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

    public void aggro() {
        L2Player player = (L2Player) getSelf();
        L2NpcInstance npc = getNpc();
        if (player == null || npc == null) {
            return;
        }
        StringBuilder dialog = new StringBuilder("<html><body><table width=\"80%\"><tr><td>Attacker</td><td>Damage</td><td>Hate</td></tr>");
        // Сортировка аггролиста по хейту
        TreeSet<AggroInfo> aggroList = new TreeSet<AggroInfo>(new Comparator<AggroInfo>() {

            @Override
            public int compare(AggroInfo o1, AggroInfo o2) {
                int hateDiff = o1.hate - o2.hate;
                if (hateDiff != 0) {
                    return hateDiff;
                }
                return o1.damage - o2.damage;
            }
        });
        aggroList.addAll(npc.getAggroList());
        // Вывод результата
        for (AggroInfo aggroInfo : aggroList.descendingSet()) {
            if (aggroInfo.attacker != null && (aggroInfo.attacker.isPlayer() || aggroInfo.attacker.isSummon() || aggroInfo.attacker.isPet())) {
                dialog.append("<tr><td>" + aggroInfo.attacker.getName() + "</td><td>" + aggroInfo.damage + "</td><td>" + aggroInfo.hate + "</td></tr>");
            }
        }
        dialog.append("</table><br><center><button value=\"");
        dialog.append(player.isLangRus() ? "Обновить" : "Refresh");
        dialog.append("\" action=\"bypass -h scripts_actions.OnActionShift:aggro\" width=100 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" /></center></body></html>");
        show(dialog.toString(), player, npc);
    }
View Full Code Here

  /**
   * Вызывается у гейткиперов
   */
  public void reciveGift()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null || !L2NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    if(!isBirthdayToday(player))
    {
      show(Files.read(msgNotToday, player), player, npc);
      return;
    }
    if(isGiftRecivedToday(player))
    {
      show(Files.read(msgAlreadyRecived, player), player, npc);
      return;
    }
    for(L2NpcInstance n : L2World.getAroundNpc(npc))
    {
      if(n.getNpcId() == NPC_ALEGRIA)
      {
        show(Files.read(msgSpawned, player), player, npc);
        return;
      }
    }
    player.sendPacket(new PlaySound(1, "HB01", 0, 0, new Location()));
    try
    {
      Location loc = GeoEngine.findPointToStay(npc.getX(), npc.getY(), npc.getZ(), 40, 60, npc.getReflection().getGeoIndex());
      loc.setH(Util.getHeadingTo(loc, player.getLoc()));
      L2Spawn spawn = new L2Spawn(NpcTable.getTemplate(NPC_ALEGRIA));
      spawn.setLoc(loc);
      spawn.doSpawn(true);
      ThreadPoolManager.getInstance().scheduleAi(new DeSpawnScheduleTimerTask(spawn), 180000, false);
    }
View Full Code Here

  /**
   * Вызывается у NPC Alegria
   */
  public void reciveGiftAlegria()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null || !L2NpcInstance.canBypassCheck(player, player.getLastNpc()) || npc.isBusy())
    {
      return;
    }
    if(!isBirthdayToday(player))
    {
      show(Files.read(msgNotToday, player), player, npc);
      return;
    }
    if(isGiftRecivedToday(player))
    {
      show(Files.read(msgAlreadyRecived, player), player, npc);
      return;
    }
    npc.altUseSkill(SkillTable.getInstance().getInfo(BIRTHDAY_CAKE, 1), player);
    addItem(player, HAT, 1);
    show(Files.read("data/html/default/32600-2.htm ", player), player, npc);
    long now = System.currentTimeMillis() / 1000;
    player.setVar("Birthday", String.valueOf(now));
    DecayTaskManager.getInstance().addDecayTask(npc);
    npc.setBusy(true);
  }
View Full Code Here

    // List Players in a Table
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=80>Name:</td><td width=110>Class:</td><td width=40>Level:</td></tr>");
    for(int i = CharactersStart; i < CharactersEnd; i++)
    {
      L2Player p = players.get(i);
      replyMSG.append("<tr><td width=80>" + "<a action=\"bypass -h admin_character_list " + p.getName() + "\">" + p.getName() + "</a></td><td width=110>" + p.getTemplate().className + "</td><td width=40>" + p.getLevel() + "</td></tr>");
    }
    replyMSG.append("</table>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
View Full Code Here

    if(target == null)
    {
      activeChar.sendPacket(Msg.INVALID_TARGET);
      return;
    }
    L2Player player;
    if(target.isPlayer())
    {
      player = (L2Player) target;
    }
    else
    {
      return;
    }
    if(newKarma >= 0)
    {
      int oldKarma = player.getKarma();
      player.setKarma(newKarma);
      player.sendMessage("Admin has changed your karma from " + oldKarma + " to " + newKarma + ".");
      activeChar.sendMessage("Successfully Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
    }
    else
    {
      activeChar.sendMessage("You must enter a value for karma greater than or equal to 0.");
    }
View Full Code Here

    if(target == null)
    {
      activeChar.sendPacket(Msg.INVALID_TARGET);
      return;
    }
    L2Player player;
    if(target.isPlayer())
    {
      player = (L2Player) target;
    }
    else
    {
      return;
    }
    if(newFame >= 0)
    {
      int oldFame = player.getFame();
      player.setFame(newFame, "Admin manual");
      player.sendMessage("Admin has changed your fame from " + oldFame + " to " + newFame + ".");
      activeChar.sendMessage("Successfully Changed fame for " + player.getName() + " from (" + oldFame + ") to (" + newFame + ").");
    }
    else
    {
      activeChar.sendMessage("You must enter a value for fame greater than or equal to 0.");
    }
View Full Code Here

    L2NpcInstance actor = getActor();
    if(actor == null || caster == null || skill.getId() != BALLISTA_BOMB_SKILL_ID)
    {
      return;
    }
    L2Player player = caster.getPlayer();
    Siege siege = SiegeManager.getSiege(actor, true);
    if(siege != null && player != null && siege.getSiegeUnit().getType() == ResidenceType.Fortress)
    {
      L2Clan clan = player.getClan();
      if(clan != null && siege == clan.getSiege() && clan.isDefender())
      {
        return;
      }
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Player

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.