Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Effect


        skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
        for (EffectTemplate et : skill.getEffectTemplates())
        {
          Env env = new Env(player, player, skill);
          env.value = Integer.MAX_VALUE;
          Effect e = et.getEffect(env);
          e.setPeriod(600000);
          e.getEffected().getEffectList().addEffect(e);
        }
        try
        {
          Thread.sleep(150);
        }
View Full Code Here


      }
    }
    // Count Active Aura
    int activeAura = 0;
    boolean psActive = false;
    Effect psEffect = null;
    if (getEffected().getEffectList() != null)
    {
      for (Effect e : getEffected().getEffectList().getAllEffects())
      {
        if (e == null)
        {
          continue;
        }
        if (e.getEffectType() == EffectType.GiantForceAura && !e.getStackType().contains("PartySolidarity") && !e.getSkill().isAuraSkill())
        {
          activeAura++;
        }
        if (e.getStackType().contains("PartySolidarity"))
        {
          psEffect = e;
          psActive = true;
        }
      }
    }
    if (activeAura >= 4)
    {
      if (!psActive || psEffect.getSkill().getLevel() < Math.min((activeAura - 3), 3) || psEffect.getSkill().getLevel() > Math.min((activeAura - 3), 3))
      {
        Skill PartySolidarity = SkillTable.getInstance().getInfo(1955, Math.min((activeAura - 3), 3));
        PartySolidarity.getEffects(getEffected(), getEffected(), false, false);
      }
    }
    else if (psActive)
    {
      psEffect.exit();
    }
    return true;
  }
View Full Code Here

          for (Summon summon : player.getSummonList())
          {
            for (EffectTemplate et : skill.getEffectTemplates())
            {
              Env env = new Env(summon, summon, skill);
              Effect effect = et.getEffect(env);
              effect.setPeriod(time);
              summon.getEffectList().addEffect(effect);
              summon.updateEffectIconsImpl();
            }
          }
      }
      else
      {
        for (EffectTemplate et : skill.getEffectTemplates())
        {
          Env env = new Env(player, player, skill);
          Effect effect = et.getEffect(env);
          effect.setPeriod(time);
          player.getEffectList().addEffect(effect);
          player.updateEffectIconsImpl();
        }
      }
      player.reduceAdena(pice);
      ShowHtml(page, player);
    }
    else if (bypass.startsWith("_bbsbaim"))
    {
      StringTokenizer st2 = new StringTokenizer(bypass, ";");
      String[] mBypass = st2.nextToken().split(":");
      player.setVar("isPlayerBuff", player.getVarB("isPlayerBuff") ? "0" : "1", -1);
      ShowHtml(mBypass[1], player);
    }
    else if (bypass.startsWith("_bbsbregen"))
    {
      StringTokenizer st2 = new StringTokenizer(bypass, ";");
      String[] mBypass = st2.nextToken().split(":");
      int pice = Config.COMMUNITYBOARD_BUFF_PICE;
      if (player.getAdena() < (pice * 10))
      {
        player.sendMessage("It is not enough money!");
        ShowHtml(mBypass[1], player);
        return;
      }
      if (!player.getVarB("isPlayerBuff"))
      {
        if (player.getSummonList().getServitors() != null)
        {
          for (Summon summon : player.getSummonList())
          {
            summon.setCurrentHpMp(summon.getMaxHp(), summon.getMaxMp());
            summon.setCurrentCp(summon.getMaxCp(), true);
          }
        }
      }
      else
      {
        player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
        player.setCurrentCp(player.getMaxCp());
      }
      player.reduceAdena(pice * 10);
      ShowHtml(mBypass[1], player);
    }
    else if (bypass.startsWith("_bbsbcansel"))
    {
      StringTokenizer st2 = new StringTokenizer(bypass, ";");
      String[] mBypass = st2.nextToken().split(":");
      if (player.getVarB("isPlayerBuff") && (player.getEffectList().getEffectsBySkillId(Skill.SKILL_RAID_CURSE) == null))
      {
        player.getEffectList().stopAllEffects();
      }
      else if (!player.getVarB("isPlayerBuff") && (player.getSummonList().getServitors() != null))
      {
        for (Summon summon : player.getSummonList())
        {
          summon.getEffectList().stopAllEffects();
        }
      }
      ShowHtml(mBypass[1], player);
    }
    else if (bypass.startsWith("_bbsbsave"))
    {
      StringTokenizer st2 = new StringTokenizer(bypass, ";");
      String[] mBypass = st2.nextToken().split(":");
      String name = "";
      try
      {
        if (mBypass[2].length() > 1)
        {
          name = mBypass[2].substring(1);
        }
      }
      catch (ArrayIndexOutOfBoundsException e)
      {
        player.sendMessage("You did not enter a name to save!");
        return;
      }
      SBufferScheme scheme = new SBufferScheme();
      if (ManageBbsBuffer.getCountOnePlayer(player.getObjectId()) >= 3)
      {
        player.sendMessage("Exceeded the number of schemes!");
        ShowHtml(mBypass[1], player);
        return;
      }
      if (ManageBbsBuffer.existName(player.getObjectId(), name))
      {
        player.sendMessage("Scheme with that name already exists!");
        ShowHtml(mBypass[1], player);
        return;
      }
      if (name.length() > 15)
      {
        name = name.substring(0, 15);
      }
      if (name.length() > 0)
      {
        scheme.obj_id = player.getObjectId();
        scheme.name = name;
        Effect skill[] = player.getEffectList().getAllFirstEffects();
        if (skill != null)
        {
          for (Effect element : skill)
          {
            if (Config.COMMUNITYBOARD_BUFF_ALLOW.contains(element.getSkill().getId()))
View Full Code Here

        for (EffectTemplate et : skill.getEffectTemplates())
        {
          for (Summon summon : player.getSummonList())
          {
            Env env = new Env(summon, summon, skill);
            Effect effect = et.getEffect(env);
            effect.setPeriod(time);
            summon.getEffectList().addEffect(effect);
            summon.updateEffectIconsImpl();
          }
        }
      }
      else
      {
        for (EffectTemplate et : skill.getEffectTemplates())
        {
          Env env = new Env(player, player, skill);
          Effect effect = et.getEffect(env);
          effect.setPeriod(time);
          player.getEffectList().addEffect(effect);
          player.updateEffectIconsImpl();
        }
      }
    }
View Full Code Here

  {
    if (param.length < 4)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final long price = Long.parseLong(param[param.length - 1]);
    if (!NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    if ((price > 0) && (player.getAdena() < price))
    {
      player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
      return;
    }
    if (player.getMountType() == 2)
    {
      player.sendMessage("Телепортаци�? верхом на виверне невозможна.");
      return;
    }
    if (player.getLastNpc() != null)
    {
      final int npcId = player.getLastNpc().getNpcId();
      switch (npcId)
      {
        case 30483:
          if (player.getLevel() >= Config.CRUMA_GATEKEEPER_LVL)
          {
            show("teleporter/30483-no.htm", player);
            return;
          }
          break;
        case 32864:
        case 32865:
        case 32866:
        case 32867:
        case 32868:
        case 32869:
        case 32870:
          if (player.getLevel() < 80)
          {
            show("teleporter/" + npcId + "-no.htm", player);
            return;
          }
          break;
      }
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final int castleId = (param.length > 4) ? Integer.parseInt(param[3]) : 0;
    if (player.getReflection().isDefault())
    {
      final Castle castle = (castleId > 0) ? ResidenceHolder.getInstance().getResidence(Castle.class, castleId) : null;
      if ((castle != null) && castle.getSiegeEvent().isInProgress())
      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
    final Location pos = Location.findPointToStay(x, y, z, 50, 100, player.getGeoIndex());
    if (price > 0)
    {
      player.reduceAdena(price, true);
    }
    player.teleToLocation(pos);
  }
View Full Code Here

  {
    if (param.length < 5)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final long count = Long.parseLong(param[3]);
    final int item = Integer.parseInt(param[4]);
    if (!NpcInstance.canBypassCheck(player, player.getLastNpc()))
    {
      return;
    }
    if (count > 0)
    {
      if (!player.getInventory().destroyItemByItemId(item, count))
      {
        player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_REQUIRED_ITEMS);
        return;
      }
      player.sendPacket(SystemMessage2.removeItems(item, count));
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final Location pos = Location.findPointToStay(x, y, z, 20, 70, player.getGeoIndex());
    player.teleToLocation(pos);
  }
View Full Code Here

  {
    if (param.length < 5)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    player.setReflection(Integer.parseInt(param[4]));
    Gatekeeper(param);
  }
View Full Code Here

   * Method TokenJump.
   * @param param String[]
   */
  public void TokenJump(String[] param)
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (player.getLevel() <= 19)
    {
      QuestGatekeeper(param);
    }
    else
    {
View Full Code Here

  /**
   * Method NoblessTeleport.
   */
  public void NoblessTeleport()
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (player.isNoble() || Config.ALLOW_NOBLE_TP_TO_ALL)
    {
      show("scripts/noble.htm", player);
    }
    else
    {
View Full Code Here

  {
    if (param.length < 2)
    {
      throw new IllegalArgumentException();
    }
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    final String page = param[0];
    final int item = Integer.parseInt(param[1]);
    final long price = Long.parseLong(param[2]);
    if (getItemCount(player, item) < price)
    {
      player.sendPacket((item == 57) ? Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA : SystemMsg.INCORRECT_ITEM_COUNT);
      return;
    }
    removeItem(player, item, price);
    show(page, player);
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Effect

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.