Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Skill$AddedSkill


    if (getTemplate()._count <= 1)
    {
      return false;
    }
    Creature effector = getEffector();
    Skill skill = getSkill().getFirstAddedSkill();
    NpcInstance symbol = _symbol;
    double mpConsume = getSkill().getMpConsume();
    if ((effector == null) || (skill == null) || (symbol == null))
    {
      return false;
    }
    if (mpConsume > effector.getCurrentMp())
    {
      effector.sendPacket(Msg.NOT_ENOUGH_MP);
      return false;
    }
    effector.reduceCurrentMp(mpConsume, effector);
    for (Creature cha : World.getAroundCharacters(symbol, getSkill().getSkillRadius(), 200))
    {
      if (!cha.isDoor() && (cha.getEffectList().getEffectsBySkill(skill) == null) && (skill.checkTarget(effector, cha, cha, false, false) == null))
      {
        if (skill.isOffensive() && !GeoEngine.canSeeTarget(symbol, cha, false))
        {
          continue;
        }
        List<Creature> targets = new ArrayList<>(1);
        targets.add(cha);
View Full Code Here


    {
      if (player == null)
      {
        return;
      }
      Skill skill;
      for (int[] buff : _listBuff[player.isMageClass() ? 1 : 0])
      {
        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);
View Full Code Here

   */
  private void negateEffectAtPower(Creature target, EffectType type, int power)
  {
    for (Effect e : target.getEffectList().getAllEffects())
    {
      Skill skill = e.getSkill();
      if ((_onlyPhysical && skill.isMagic()) || !skill.isCancelable() || (skill.isOffensive() && !_negateDebuffs))
      {
        continue;
      }
      if (!skill.isOffensive() && (skill.getMagicLevel() > getMagicLevel()) && Rnd.chance(skill.getMagicLevel() - getMagicLevel()))
      {
        continue;
      }
      if ((e.getEffectType() == type) && (e.getStackOrder() <= power))
      {
View Full Code Here

   */
  private void negateEffectAtPower(Creature target, String stackType, int power)
  {
    for (Effect e : target.getEffectList().getAllEffects())
    {
      Skill skill = e.getSkill();
      if ((_onlyPhysical && skill.isMagic()) || !skill.isCancelable() || (skill.isOffensive() && !_negateDebuffs))
      {
        continue;
      }
      if (!skill.isOffensive() && (skill.getMagicLevel() > getMagicLevel()) && Rnd.chance(skill.getMagicLevel() - getMagicLevel()))
      {
        continue;
      }
      if (e.checkStackType(stackType) && (e.getStackOrder() <= power))
      {
View Full Code Here

  /**
   * Method paralyzePlayers.
   */
  public static void paralyzePlayers()
  {
    Skill revengeSkill = SkillTable.getInstance().getInfo(Skill.SKILL_RAID_CURSE, 1);
    for (Player player : getPlayers(players_list))
    {
      player.getEffectList().stopEffect(Skill.SKILL_MYSTIC_IMMUNITY);
      revengeSkill.getEffects(player, player, false, false);
    }
  }
View Full Code Here

   * @param info CubicTemplate.SkillInfo
   * @param delay int
   */
  private static void doHeal(final Player player, CubicTemplate.SkillInfo info, final int delay)
  {
    final Skill skill = info.getSkill();
    Creature target = null;
    if (player.getParty() == null)
    {
      if (!player.isCurrentHpFull() && !player.isDead())
      {
        target = player;
      }
    }
    else
    {
      double currentHp = Integer.MAX_VALUE;
      for (Player member : player.getParty().getPartyMembers())
      {
        if (member == null)
        {
          continue;
        }
        if (player.isInRange(member, info.getSkill().getCastRange()) && !member.isCurrentHpFull() && !member.isDead() && (member.getCurrentHp() < currentHp))
        {
          currentHp = member.getCurrentHp();
          target = member;
        }
      }
    }
    if (target == null)
    {
      return;
    }
    int chance = info.getChance((int) target.getCurrentHpPercents());
    if (!Rnd.chance(chance))
    {
      return;
    }
    final Creature aimTarget = target;
    player.broadcastPacket(new MagicSkillUse(player, aimTarget, skill.getDisplayId(), skill.getDisplayLevel(), skill.getHitTime(), 0));
    player.disableSkill(skill, delay * 1000L);
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final List<Creature> targets = new ArrayList<>(1);
        targets.add(aimTarget);
        player.broadcastPacket(new MagicSkillLaunched(player.getObjectId(), skill.getDisplayId(), skill.getDisplayLevel(), targets));
        player.callSkill(skill, targets, false);
      }
    }, skill.getHitTime());
  }
View Full Code Here

  {
    if (!Rnd.chance(info.getChance()))
    {
      return;
    }
    final Skill skill = info.getSkill();
    Creature target = null;
    if (player.isInCombat())
    {
      GameObject object = player.getTarget();
      target = (object != null) && object.isCreature() ? (Creature) object : null;
    }
    if ((target == null) || target.isDead() || (target.isDoor() && !info.isCanAttackDoor()) || !player.isInRangeZ(target, skill.getCastRange()) || !target.isAutoAttackable(player))
    {
      return;
    }
    final Creature aimTarget = target;
    player.broadcastPacket(new MagicSkillUse(player, target, skill.getDisplayId(), skill.getDisplayLevel(), skill.getHitTime(), 0));
    player.disableSkill(skill, delay * 1000L);
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final List<Creature> targets = new ArrayList<>(1);
        targets.add(aimTarget);
        player.broadcastPacket(new MagicSkillLaunched(player.getObjectId(), skill.getDisplayId(), skill.getDisplayLevel(), targets));
        player.callSkill(skill, targets, false);
        if (aimTarget.isNpc())
        {
          if (aimTarget.paralizeOnAttack(player))
          {
            if (Config.PARALIZE_ON_RAID_DIFF)
            {
              player.paralizeMe(aimTarget);
            }
          }
          else
          {
            int damage = skill.getEffectPoint() != 0 ? skill.getEffectPoint() : (int) skill.getPower();
            aimTarget.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, player, damage);
          }
        }
      }
    }, skill.getHitTime());
  }
View Full Code Here

  {
    if (!Rnd.chance(info.getChance()))
    {
      return;
    }
    final Skill skill = info.getSkill();
    Creature target = null;
    if (player.isInCombat())
    {
      GameObject object = player.getTarget();
      target = (object != null) && object.isCreature() ? (Creature) object : null;
    }
    if ((target == null) || target.isDead() || (target.isDoor() && !info.isCanAttackDoor()) || !player.isInRangeZ(target, skill.getCastRange()) || !target.isAutoAttackable(player))
    {
      return;
    }
    final Creature aimTarget = target;
    player.broadcastPacket(new MagicSkillUse(player, target, skill.getDisplayId(), skill.getDisplayLevel(), skill.getHitTime(), 0));
    player.disableSkill(skill, delay * 1000L);
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final List<Creature> targets = new ArrayList<>(1);
        targets.add(aimTarget);
        player.broadcastPacket(new MagicSkillLaunched(player.getObjectId(), skill.getDisplayId(), skill.getDisplayLevel(), targets));
        final boolean succ = Formulas.calcSkillSuccess(player, aimTarget, skill, info.getChance());
        if (succ)
        {
          player.callSkill(skill, targets, false);
        }
        if (aimTarget.isNpc())
        {
          if (aimTarget.paralizeOnAttack(player))
          {
            if (Config.PARALIZE_ON_RAID_DIFF)
            {
              player.paralizeMe(aimTarget);
            }
          }
          else
          {
            int damage = skill.getEffectPoint() != 0 ? skill.getEffectPoint() : (int) skill.getPower();
            aimTarget.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, player, damage);
          }
        }
      }
    }, skill.getHitTime());
  }
View Full Code Here

  {
    if (!Rnd.chance(info.getChance()))
    {
      return;
    }
    final Skill skill = info.getSkill();
    boolean hasDebuff = false;
    for (Effect e : player.getEffectList().getAllEffects())
    {
      if ((e != null) && e.isOffensive() && e.isCancelable() && !e.getTemplate()._applyOnCaster)
      {
        hasDebuff = true;
      }
    }
    if (!hasDebuff)
    {
      return;
    }
    player.broadcastPacket(new MagicSkillUse(player, player, skill.getDisplayId(), skill.getDisplayLevel(), skill.getHitTime(), 0));
    player.disableSkill(skill, delay * 1000L);
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final List<Creature> targets = new ArrayList<>(1);
        targets.add(player);
        player.broadcastPacket(new MagicSkillLaunched(player.getObjectId(), skill.getDisplayId(), skill.getDisplayLevel(), targets));
        player.callSkill(skill, targets, false);
      }
    }, skill.getHitTime());
  }
View Full Code Here

    {
      if (player == null)
      {
        return;
      }
      Skill skill;
      for (int[] buff : _listBuff[player.isMageClass() ? 1 : 0])
      {
        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);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Skill$AddedSkill

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.