Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Effect$ActionDispelListener


    L2Player player = L2ObjectsStorage.getPlayer(objectId);
    L2Skill skill = SkillTable.getInstance().getInfo(id, level);
    for(EffectTemplate et : skill.getEffectTemplates())
    {
      Env env = new Env(pet ? player.getPet() : player, pet ? player.getPet() : player, skill);
      L2Effect effect = et.getEffect(env);
      effect.setPeriod(Config.communityBuffTimeModifier * 60 * 1000);
      (pet ? player.getPet() : player).getEffectList().addEffect(effect);
    }
  }
View Full Code Here


  public int GetRandomFishLvl(L2Player player)
  {
    int skilllvl = 0;
    // Проверка на Fisherman's Potion
    L2Effect effect = player.getEffectList().getEffectByStackType("fishPot");
    if(effect != null)
    {
      skilllvl = (int) effect.getSkill().getPower();
    }
    else
    {
      skilllvl = player.getSkillLevel(1315);
    }
View Full Code Here

        boolean update = false;
        L2Effect[] a = eff.toArray(new L2Effect[eff.size()]);
        // Сначало крадем песни/танцы
        for(int i = 0; counter < maxCount && i < a.length; i++)
        {
          L2Effect e = a[a.length - i - 1];
          if(e != null && e.getSkill().isMusic() && e.getSkill().isCancelable() && !e.getSkill().isToggle() && !e.getSkill().isPassive() && !e.getSkill().isOffensive() && e.getEffectType() != EffectType.Vitality && !e._template._applyOnCaster)
          {
            L2Effect stealedEffect = cloneEffect(activeChar, e);
            e.exit();
            if(stealedEffect != null)
            {
              activeChar.getEffectList().addEffect(stealedEffect);
              update = true;
            }
            counter++;
          }
        }
        // Потом остальное
        for(int i = 0; counter < maxCount && i < a.length; i++)
        {
          L2Effect e = a[a.length - i - 1];
          if(e != null && !e.getSkill().isMusic() && e.getSkill().isCancelable() && !e.getSkill().isToggle() && !e.getSkill().isPassive() && (!e.getSkill().isOffensive() || e.getSkill().getId() == 368) && e.getEffectType() != EffectType.Vitality && (!e._template._applyOnCaster || e.getSkill().getId() == 368))
          {
            L2Effect stealedEffect = cloneEffect(activeChar, e);
            e.exit();
            if(stealedEffect != null)
            {
              activeChar.getEffectList().addEffect(stealedEffect);
              update = true;
View Full Code Here

  private L2Effect cloneEffect(L2Character cha, L2Effect eff)
  {
    L2Skill skill = eff.getSkill();
    for(EffectTemplate et : skill.getEffectTemplates())
    {
      L2Effect effect = et.getEffect(new Env(cha, cha, skill));
      if(effect != null)
      {
        effect.setCount(eff.getCount());
        if(eff.getCount() == 1)
        {
          effect.setPeriod(eff.getPeriod() - eff.getTime());
        }
        else
        {
          effect.setPeriod(eff.getPeriod());
        }
        return effect;
      }
    }
    return null;
View Full Code Here

              ConcurrentLinkedQueue<L2Effect> eff = target.getEffectList().getAllEffects();
              if(eff.size() == 0)
              {
                break;
              }
              L2Effect e = eff.toArray(new L2Effect[eff.size()])[Rnd.get(eff.size())];
              L2Skill skill = e.getSkill();
              // Если у бафа выше уровень чем у скилла Cancel, то есть шанс, что этот баф не снимется
              if(!skill.isOffensive() && skill.getMagicLevel() > getMagicLevel() && Rnd.chance(skill.getMagicLevel() - getMagicLevel()))
              {
                counter++;
                antiloop--;
                continue;
              }
              if(skill.isCancelable())
              {
                e.exit();
                counter++;
              }
              antiloop--;
            }
          }
          else
          {
            counter = 0;
            if(_dispelType.contains("negative"))
            {
              for(L2Effect e : target.getEffectList().getAllEffects())
              {
                if(counter < _negateCount && e.getSkill().isOffensive() && e.getSkill().isCancelable())
                {
                  e.exit();
                  counter++;
                }
              }
            }
            counter = 0;
            if(_dispelType.contains("positive"))
            {
              for(L2Effect e : target.getEffectList().getAllEffects())
              {
                L2Skill skill = e.getSkill();
                if(counter < _negateCount && !skill.isOffensive() && skill.isCancelable())
                {
                  // Если у бафа выше уровень чем у скилла Cancel, то есть шанс, что этот баф не снимется
                  if(skill.getMagicLevel() > getMagicLevel() && Rnd.chance(skill.getMagicLevel() - getMagicLevel()))
                  {
                    counter++;
                    continue;
                  }
                  e.exit();
                  counter++;
                }
              }
            }
          }
View Full Code Here

        {
          for(WeakReference<L2Effect> we : _dispelTasks[_currentDispelCell].getList())
          {
            try
            {
              L2Effect eff = we.get();
              if(eff == null || eff.isFinished())
              {
                continue;
              }
              works.add(eff);
              // TODO не баг, но так получается лишний цикл (пустой, т.к. сработает eff.isFinished())
              if(!eff.isEnded())
              {
                addDispelTask(eff, (int) (eff.getPeriod() / 1000));
              }
            }
            catch(Exception e)
            {
              e.printStackTrace();
View Full Code Here

    L2Character target = env.target;
    if(target == null)
    {
      return false;
    }
    L2Effect effect = target.getEffectList().getEffectByType(_effectType);
    if(effect == null)
    {
      return false;
    }
    if(_level == -1 || effect.getSkill().getLevel() >= _level)
    {
      return true;
    }
    return false;
  }
View Full Code Here

    L2Character character = env.character;
    if(character == null)
    {
      return false;
    }
    L2Effect effect = character.getEffectList().getEffectByType(_effectType);
    if(effect == null)
    {
      return false;
    }
    if(_level == -1 || effect.getSkill().getLevel() >= _level)
    {
      return true;
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Effect$ActionDispelListener

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.