Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Player


  {
  }

  public void toGH()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    if(!L2NpcInstance.canBypassCheck(player, npc))
    {
      return;
    }
    player.setVar("backCoords", player.getLoc().toXYZString());
    player.teleToLocation(_zone.getSpawn().rnd(30, 200, false), -2);
  }
View Full Code Here


    player.teleToLocation(_zone.getSpawn().rnd(30, 200, false), -2);
  }

  public void fromGH()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    if(!L2NpcInstance.canBypassCheck(player, npc))
    {
      return;
    }
    String var = player.getVar("backCoords");
    if(var == null || var.equals(""))
    {
      teleOut();
      return;
    }
    player.teleToLocation(new Location(var), 0);
  }
View Full Code Here

    if(target == null || !target.isPlayer())
    {
      activeChar.sendPacket(Msg.SELECT_TARGET);
      return;
    }
    L2Player player = (L2Player) target;
    String[] strvals = modifications.split("&");
    Integer[] vals = new Integer[strvals.length];
    for(int i = 0; i < strvals.length; i++)
    {
      strvals[i] = strvals[i].trim();
      vals[i] = strvals[i].isEmpty() ? null : Integer.valueOf(strvals[i]);
    }
    if(vals[0] != null)
    {
      player.setCurrentHp(vals[0], false);
    }
    if(vals[1] != null)
    {
      player.setCurrentMp(vals[1]);
    }
    if(vals[2] != null)
    {
      player.setKarma(vals[2]);
    }
    if(vals[3] != null)
    {
      player.setPvpFlag(vals[3]);
    }
    if(vals[4] != null)
    {
      player.setPvpKills(vals[4]);
    }
    if(vals[5] != null)
    {
      player.setClassId(vals[5], true);
    }
    player.sendChanges();
    editCharacter(activeChar); // Back to start
    player.broadcastUserInfo(true);
    player.decayMe();
    player.spawnMe(activeChar.getLoc());
  }
View Full Code Here

    player.teleToLocation(new Location(var), 0);
  }

  public void teleOut()
  {
    L2Player player = (L2Player) getSelf();
    L2NpcInstance npc = getNpc();
    if(player == null || npc == null)
    {
      return;
    }
    player.teleToLocation(46776, 185784, -3528, 0);
    show(player.isLangRus() ? "Я не знаю, как Вы попали сюда, но я могу Вас отправить за ограждение." : "I don't know from where you came here, but I can teleport you the another border side.", player, npc);
  }
View Full Code Here

  {
    if(val != 0 || !Config.SERVICES_GIRAN_HARBOR_ENABLED)
    {
      return "";
    }
    L2Player player = (L2Player) getSelf();
    if(player == null)
    {
      return "";
    }
    return player.isLangRus() ? ru : en;
  }
View Full Code Here

  {
    if(val != 0 || !Config.SERVICES_GIRAN_HARBOR_ENABLED)
    {
      return "";
    }
    L2Player player = (L2Player) getSelf();
    if(player == null || player.getReflection().getId() != -2)
    {
      return "";
    }
    return player.isLangRus() ? ru2 : en2;
  }
View Full Code Here

    if(target == null || !target.isPlayer())
    {
      activeChar.sendPacket(Msg.SELECT_TARGET);
      return;
    }
    L2Player player = (L2Player) target;
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuffer replyMSG = new StringBuffer("<html><body>");
    replyMSG.append("<table width=260><tr>");
    replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=180><center>Character Selection Menu</center></td>");
    replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table>");
    replyMSG.append("<br><br>");
    replyMSG.append("<center>Editing character: " + player.getName() + "</center><br>");
    replyMSG.append("<table width=250>");
    replyMSG.append("<tr><td width=40></td><td width=70>Curent:</td><td width=70>Max:</td><td width=70></td></tr>");
    replyMSG.append("<tr><td width=40>HP:</td><td width=70>" + player.getCurrentHp() + "</td><td width=70>" + player.getMaxHp() + "</td><td width=70>Karma: " + player.getKarma() + "</td></tr>");
    replyMSG.append("<tr><td width=40>MP:</td><td width=70>" + player.getCurrentMp() + "</td><td width=70>" + player.getMaxMp() + "</td><td width=70>Pvp Kills: " + player.getPvpKills() + "</td></tr>");
    replyMSG.append("<tr><td width=40>Load:</td><td width=70>" + player.getCurrentLoad() + "</td><td width=70>" + player.getMaxLoad() + "</td><td width=70>Pvp Flag: " + player.getPvpFlag() + "</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<table width=270><tr><td>Class<?> Template Id: " + player.getClassId() + "/" + player.getClassId().getId() + "</td></tr></table><br>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td>Note: Fill all values before saving the modifications.</td></tr>");
    replyMSG.append("</table><br>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=50>Hp:</td><td><edit var=\"hp\" width=50></td><td width=50>Mp:</td><td><edit var=\"mp\" width=50></td></tr>");
View Full Code Here

  }

  private void showCharacterActions(L2Player activeChar)
  {
    L2Object target = activeChar.getTarget();
    L2Player player;
    if(target != null && target.isPlayer())
    {
      player = (L2Player) target;
    }
    else
    {
      return;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuffer replyMSG = new StringBuffer("<html><body>");
    replyMSG.append("<table width=260><tr>");
    replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=180><center>Character Selection Menu</center></td>");
    replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table><br><br>");
    replyMSG.append("<center>Admin Actions for: " + player.getName() + "</center><br>");
    replyMSG.append("<center><table width=200><tr>");
    replyMSG.append("<td width=100>Argument(*):</td><td width=100><edit var=\"arg\" width=100></td>");
    replyMSG.append("</tr></table><br></center>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=90><button value=\"Teleport\" action=\"bypass -h admin_teleportto " + player.getName() + "\" width=85 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=90><button value=\"Recall\" action=\"bypass -h admin_recall " + player.getName() + "\" width=85 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=90><button value=\"Quests\" action=\"bypass -h admin_quests " + player.getName() + "\" width=85 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

  }

  private void addExpSp(final L2Player activeChar)
  {
    final L2Object target = activeChar.getTarget();
    L2Player player;
    if(target != null && target.isPlayer() && (activeChar == target || activeChar.getPlayerAccess().CanEditCharAll))
    {
      player = (L2Player) target;
    }
    else
    {
      activeChar.sendPacket(Msg.INVALID_TARGET);
      return;
    }
    final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    final StringBuffer replyMSG = new StringBuffer("<html><body>");
    replyMSG.append("<table width=260><tr>");
    replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=180><center>Character Selection Menu</center></td>");
    replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table>");
    replyMSG.append("<br><br>");
    replyMSG.append("<table width=270><tr><td>Name: " + player.getName() + "</td></tr>");
    replyMSG.append("<tr><td>Lv: " + player.getLevel() + " " + player.getTemplate().className + "</td></tr>");
    replyMSG.append("<tr><td>Exp: " + player.getExp() + "</td></tr>");
    replyMSG.append("<tr><td>Sp: " + player.getSp() + "</td></tr></table>");
    replyMSG.append("<br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr>");
    replyMSG.append("<tr><td>ruin the game...</td></tr></table><br>");
    replyMSG.append("<table width=270><tr><td>Note: Fill all values before saving the modifications.,</td></tr>");
    replyMSG.append("<tr><td>Note: Use 0 if no changes are needed.</td></tr></table><br>");
    replyMSG.append("<center><table><tr>");
View Full Code Here

    if(target == null || !target.isPlayer())
    {
      activeChar.sendPacket(Msg.SELECT_TARGET);
      return;
    }
    L2Player player = (L2Player) target;
    String[] strvals = ExpSp.split("&");
    long[] vals = new long[strvals.length];
    for(int i = 0; i < strvals.length; i++)
    {
      strvals[i] = strvals[i].trim();
      vals[i] = strvals[i].isEmpty() ? 0 : Long.parseLong(strvals[i]);
    }
    player.addExpAndSp(vals[0], vals[1], false, false);
    player.sendMessage("Admin is adding you " + vals[0] + " exp and " + vals[1] + " SP.");
    activeChar.sendMessage("Added " + vals[0] + " exp and " + vals[1] + " SP to " + player.getName() + ".");
  }
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.