Package l2p.extensions.multilang

Examples of l2p.extensions.multilang.CustomMessage


      offline.setString(2, type);
      rs = offline.executeQuery();
      if(rs.next())
      {
        end_.setTimeInMillis(rs.getLong(1) * 1000L);
        show(new CustomMessage("scripts.services.Bonus.bonus.alreadychar", player).addString(String.valueOf(end_.get(Calendar.DAY_OF_MONTH)) + "." + String.valueOf(end_.get(Calendar.MONTH) + 1) + "." + String.valueOf(end_.get(Calendar.YEAR))), player);
        return true;
      }
      return false;
    }
    catch(Exception e)
    {
      e.printStackTrace();
      show(new CustomMessage("common.Error", player), player);
      return false;
    }
    finally
    {
      DatabaseUtils.closeDatabaseCSR(con, offline, rs);
View Full Code Here


  {
    if(val == 0 && Config.SERVICES_RATE_SPECIAL_ENABLED)
    {
      String append = "";
      append += "[scripts_services.Bonus.bonus:buy" + " " + "1|";
      append += new CustomMessage("scripts.services.Bonus.bonus.buybonuscharexp", getSelf()).addNumber(Config.SERVICES_RATE_SPECIAL_DAYS).addNumber(Config.SERVICES_RATE_SPECIAL_ITEM_COUNT).addItemName(Config.SERVICES_RATE_SPECIAL_ITEM_ID).addString(String.valueOf(Config.SERVICES_RATE_SPECIAL_RATE));
      append += "]<br>";
      append += "[scripts_services.Bonus.bonus:buy" + " " + "2|";
      append += new CustomMessage("scripts.services.Bonus.bonus.buybonuscharsp", getSelf()).addNumber(Config.SERVICES_RATE_SPECIAL_DAYS).addNumber(Config.SERVICES_RATE_SPECIAL_ITEM_COUNT).addItemName(Config.SERVICES_RATE_SPECIAL_ITEM_ID).addString(String.valueOf(Config.SERVICES_RATE_SPECIAL_RATE));
      append += "]<br>";
      append += "[scripts_services.Bonus.bonus:buy" + " " + "3|";
      append += new CustomMessage("scripts.services.Bonus.bonus.buybonuschardrop", getSelf()).addNumber(Config.SERVICES_RATE_SPECIAL_DAYS).addNumber(Config.SERVICES_RATE_SPECIAL_ITEM_COUNT).addItemName(Config.SERVICES_RATE_SPECIAL_ITEM_ID).addString(String.valueOf(Config.SERVICES_RATE_SPECIAL_RATE));
      append += "]<br>";
      append += "[scripts_services.Bonus.bonus:buy" + " " + "4|";
      append += new CustomMessage("scripts.services.Bonus.bonus.buybonuscharadena", getSelf()).addNumber(Config.SERVICES_RATE_SPECIAL_DAYS).addNumber(Config.SERVICES_RATE_SPECIAL_ITEM_COUNT).addItemName(Config.SERVICES_RATE_SPECIAL_ITEM_ID).addString(String.valueOf(Config.SERVICES_RATE_SPECIAL_RATE));
      append += "]<br>";
      append += "[scripts_services.Bonus.bonus:buy" + " " + "5|";
      append += new CustomMessage("scripts.services.Bonus.bonus.buybonuscharspoil", getSelf()).addNumber(Config.SERVICES_RATE_SPECIAL_DAYS).addNumber(Config.SERVICES_RATE_SPECIAL_ITEM_COUNT).addItemName(Config.SERVICES_RATE_SPECIAL_ITEM_ID).addString(String.valueOf(Config.SERVICES_RATE_SPECIAL_RATE));
      append += "]<br>";
      append += "[scripts_services.Bonus.bonus:buy" + " " + "6|";
      append += new CustomMessage("scripts.services.Bonus.bonus.buybonuscharquest", getSelf()).addNumber(Config.SERVICES_RATE_SPECIAL_DAYS).addNumber(Config.SERVICES_RATE_SPECIAL_ITEM_COUNT).addItemName(Config.SERVICES_RATE_SPECIAL_ITEM_ID).addString(String.valueOf(Config.SERVICES_RATE_SPECIAL_RATE));
      append += "]";
      return append;
    }
    return "";
  }
View Full Code Here

      offline.executeUpdate();
    }
    catch(Exception e)
    {
      e.printStackTrace();
      show(new CustomMessage("common.Error", player), player);
      return;
    }
    finally
    {
      DatabaseUtils.closeDatabaseCS(con, offline);
    }
    removeItem(player, Config.SERVICES_RATE_SPECIAL_ITEM_ID, Config.SERVICES_RATE_SPECIAL_ITEM_COUNT);
    Log.add("Character " + player.getName() + " buy bonus for char " + player.getName(), "bonus_event");
    show(new CustomMessage("scripts.services.Bonus.bonus.buyokchar", player).addString(bonus_class), player);
  }
View Full Code Here

    }
    int _partnerId = activeChar.getPartnerId();
    long AdenaAmount = Config.WEDDING_DIVORCE_COSTS;
    if(activeChar.isMaried())
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.Divorced", activeChar));
    }
    else
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.Disengaged", activeChar));
    }
    activeChar.setMaried(false);
    activeChar.setPartnerId(0);
    Couple couple = CoupleManager.getInstance().getCouple(activeChar.getCoupleId());
    couple.divorce();
    couple = null;
    L2Player partner = L2ObjectsStorage.getPlayer(_partnerId);
    if(partner != null)
    {
      partner.setPartnerId(0);
      if(partner.isMaried())
      {
        partner.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PartnerDivorce", partner));
      }
      else
      {
        partner.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PartnerDisengage", partner));
      }
      partner.setMaried(false);
      // give adena
      if(activeChar.getAdena() >= AdenaAmount)
      {
View Full Code Here

  public boolean engage(L2Player activeChar)
  {
    // check target
    if(activeChar.getTarget() == null)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.NoneTargeted", activeChar));
      return false;
    }
    // check if target is a L2Player
    if(!activeChar.getTarget().isPlayer())
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.OnlyAnotherPlayer", activeChar));
      return false;
    }
    // check if player is already engaged
    if(activeChar.getPartnerId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.AlreadyEngaged", activeChar));
      if(Config.WEDDING_PUNISH_INFIDELITY)
      {
        activeChar.startAbnormalEffect(AbnormalEffect.BIG_HEAD);
        // Head
        // lets recycle the sevensigns debuffs
        int skillId;
        int skillLevel = 1;
        if(activeChar.getLevel() > 40)
        {
          skillLevel = 2;
        }
        if(activeChar.isMageClass())
        {
          skillId = 4361;
        }
        else
        {
          skillId = 4362;
        }
        L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);
        if(activeChar.getEffectList().getEffectsBySkill(skill) == null)
        {
          skill.getEffects(activeChar, activeChar, false, false);
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_S2S_EFFECT_CAN_BE_FELT).addSkillName(skillId, skillLevel));
        }
      }
      return false;
    }
    L2Player ptarget = (L2Player) activeChar.getTarget();
    // check if player target himself
    if(ptarget.getObjectId() == activeChar.getObjectId())
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.EngagingYourself", activeChar));
      return false;
    }
    if(ptarget.isMaried())
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PlayerAlreadyMarried", activeChar));
      return false;
    }
    if(ptarget.getPartnerId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PlayerAlreadyEngaged", activeChar));
      return false;
    }
    if(ptarget.isEngageRequest())
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PlayerAlreadyAsked", activeChar));
      return false;
    }
    if(ptarget.getPartnerId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PlayerAlreadyEngaged", activeChar));
      return false;
    }
    if(ptarget.getSex() == activeChar.getSex() && !Config.WEDDING_SAMESEX)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.SameSex", activeChar));
      return false;
    }
    // check if target has player on friendlist
    boolean FoundOnFriendList = false;
    int objectId;
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT friend_id FROM character_friends WHERE char_id=?");
      statement.setInt(1, ptarget.getObjectId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        objectId = rset.getInt("friend_id");
        if(objectId == activeChar.getObjectId())
        {
          FoundOnFriendList = true;
          break;
        }
      }
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    finally
    {
      DatabaseUtils.closeDatabaseCSR(con, statement, rset);
    }
    if(!FoundOnFriendList)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.NotInFriendlist", activeChar));
      return false;
    }
    ptarget.setEngageRequest(true, activeChar.getObjectId());
    // ptarget.sendMessage("Player "+activeChar.getName()+" wants to engage with you.");
    ptarget.sendPacket(new ConfirmDlg(SystemMessage.S1, 60000, 4).addString("Player " + activeChar.getName() + " asking you to engage. Do you want to start new relationship?"));
View Full Code Here

  public boolean goToLove(L2Player activeChar)
  {
    if(!activeChar.isMaried())
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.YoureNotMarried", activeChar));
      return false;
    }
    if(activeChar.getPartnerId() == 0)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PartnerNotInDB", activeChar));
      return false;
    }
    L2Player partner = L2ObjectsStorage.getPlayer(activeChar.getPartnerId());
    if(partner == null)
    {
      activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.PartnerOffline", activeChar));
      return false;
    }
    if(partner.isInOlympiadMode() || partner.isFestivalParticipant() || activeChar.isMovementDisabled() || activeChar.isPMuted() || activeChar.isInOlympiadMode() || activeChar.getDuel() != null || activeChar.isFestivalParticipant() || partner.isInZone(no_summon))
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    if(activeChar.isInParty() && activeChar.getParty().isInDimensionalRift() || partner.isInParty() && partner.getParty().isInDimensionalRift())
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    if(activeChar.getTeleMode() != 0 || activeChar.getReflection().getId() != 0)
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    // "Нельзя вызывать персонажей в/из зоны свободного PvP"
    // "в зоны осад"
    // "на Олимпийский стадион"
    // "в зоны определенных рейд-боссов и эпик-боссов"
    if(partner.isInZoneBattle() || partner.isInZone(Siege) || partner.isInZone(no_restart) || partner.isInZone(OlympiadStadia) || activeChar.isInZoneBattle() || activeChar.isInZone(Siege) || activeChar.isInZone(no_restart) || activeChar.isInZone(OlympiadStadia) || partner.getReflection().getId() != 0 || partner.isInZone(no_summon))
    {
      activeChar.sendPacket(Msg.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
      return false;
    }
    activeChar.abortAttack(true, true);
    activeChar.abortCast(true);
    activeChar.sendActionFailed();
    activeChar.stopMove();
    int teleportTimer = Config.WEDDING_TELEPORT_INTERVAL * 1000;
    if(activeChar.getInventory().getAdena() < Config.WEDDING_TELEPORT_PRICE)
    {
      activeChar.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
      return false;
    }
    activeChar.reduceAdena(Config.WEDDING_TELEPORT_PRICE, true);
    activeChar.sendMessage(new CustomMessage("scripts.commands.voiced.Wedding.Teleport", activeChar).addNumber(teleportTimer / 60000));
    // SoE Animation section
    activeChar.broadcastPacket(new MagicSkillUse(activeChar, activeChar, 1050, 1, teleportTimer, 0));
    activeChar.sendPacket(new SetupGauge(0, teleportTimer));
    // End SoE Animation section
    // continue execution later
View Full Code Here

    {
      return false;
    }
    if(activeChar.getTeleMode() != 0)
    {
      activeChar.sendMessage(new CustomMessage("common.TryLater", activeChar));
      return false;
    }
    if(activeChar.isTerritoryFlagEquipped())
    {
      activeChar.sendPacket(Msg.YOU_CANNOT_TELEPORT_WHILE_IN_POSSESSION_OF_A_WARD);
      return false;
    }
    if(activeChar.getDuel() != null || activeChar.getTeam() != 0)
    {
      activeChar.sendMessage(new CustomMessage("common.RecallInDuel", activeChar));
      return false;
    }
    activeChar.abortAttack(true, true);
    activeChar.abortCast(true);
    activeChar.stopMove();
View Full Code Here

  public void check(String[] var)
  {
    if(var.length != 3)
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectValues", getSelf()), (L2Player) getSelf());
      return;
    }
    useVoicedCommand("password", (L2Player) getSelf(), var[0] + " " + var[1] + " " + var[2]);
  }
View Full Code Here

      return true;
    }
    String[] parts = target.split(" ");
    if(parts.length != 3)
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectValues", activeChar), activeChar);
      return false;
    }
    if(!parts[1].equals(parts[2]))
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectConfirmation", activeChar), activeChar);
      return false;
    }
    if(parts[1].equals(parts[0]))
    {
      show(new CustomMessage("scripts.commands.user.password.NewPassIsOldPass", activeChar), activeChar);
      return false;
    }
    if(parts[1].length() < 5 || parts[1].length() > 20)
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectSize", activeChar), activeChar);
      return false;
    }
    if(!Util.isMatchingRegexp(parts[1], Config.APASSWD_TEMPLATE))
    {
      show(new CustomMessage("scripts.commands.user.password.IncorrectInput", activeChar), activeChar);
      return false;
    }
    LSConnection.getInstance().sendPacket(new ChangePassword(activeChar.getAccountName(), parts[0], parts[1]));
    return true;
  }
View Full Code Here

    {
      return;
    }
    if(!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if(player.getLevel() > 19 || player.getClassId().getLevel() > 1)
    {
      show("Your level is too high!", player);
View Full Code Here

TOP

Related Classes of l2p.extensions.multilang.CustomMessage

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.