Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2Character$HitTask


    }

    @Override
    public void calc(Env env)
    {
      L2Character p = env.player;
      //[Square(DEX)]*6 + lvl + weapon hitbonus;
      env.value += Math.sqrt(p.getDEX()) * 6;
      env.value += p.getLevel();
      if( p instanceof L2Summon) env.value += (p.getLevel() < 60) ? 4 : 5;
    }
View Full Code Here


    }

    @Override
    public void calc(Env env)
    {
      L2Character p = env.player;
      //[Square(DEX)]*6 + lvl;
      env.value += Math.sqrt(p.getDEX()) * 6;
      env.value += p.getLevel();
    }
View Full Code Here

    }

    @Override
    public void calc(Env env)
    {
      L2Character p = env.player;
      if( p instanceof L2Summon) env.value = 40;
      else if (p instanceof L2PcInstance && p.getActiveWeaponInstance() == null) env.value = 40;
      else
      {
        env.value *= DEXbonus[p.getDEX()];
        env.value *= 10;
        if(env.value > 500)
          env.value = 500;
      }
    }
View Full Code Here

    _isAggro = isAggro;
  }

  @Override
  public boolean testImpl(Env env) {
    L2Character target = env.target;
    if (target instanceof L2MonsterInstance)
    {
      return ((L2MonsterInstance)target).isAggressive() == _isAggro;
    }
    if (target instanceof L2PcInstance)
View Full Code Here

        if (effect.numCharges == 0)
          {effect.exit();}
        for (int index = 0;index < targets.length;index++)
        {
          L2ItemInstance weapon = caster.getActiveWeaponInstance();
          L2Character target = (L2Character)targets[index];
          if (target.isAlikeDead())
            continue;

      // TODO: should we use dual or not?
      // because if so, damage are lowered but we dont do anything special with dual then
      // like in doAttackHitByDual which in fact does the calcPhysDam call twice

      //boolean dual  = caster.isUsingDualWeapon();
      boolean shld = Formulas.getInstance().calcShldUse(caster, target);
      boolean crit = Formulas.getInstance().calcCrit(caster.getCriticalHit(target, this));
      boolean soul = (weapon != null
              && weapon.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT
              && weapon.getItemType() != L2WeaponType.DAGGER );

      // damage calculation, crit is static 2x
      int damage = (int)Formulas.getInstance().calcPhysDam(caster, target, this, shld, false, false, soul);
      if (crit) damage *= 2;

      if (damage > 0)
            {
                double finalDamage = damage;
                finalDamage = finalDamage+(modifier*finalDamage);
        target.reduceCurrentHp(finalDamage, caster);

        caster.sendDamageMessage(target, (int)finalDamage, false, crit, false);

        if (soul && weapon!= null)
          weapon.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
View Full Code Here

            }
        }

        for (int index = 0; index < targets.length; index++)
        {
      L2Character target = (L2Character)targets[index];
      if (target.isAlikeDead())
        continue;

      boolean charged = true;
      if (!_seedAny){
        for (int i=0;i<_seeds.length;i++){
          if (_seeds[i]!=0){
            L2Effect e = target.getFirstEffect(_seeds[i]);
            if (e==null || !e.getInUse()){
              charged = false;
              break;
            }
          }
        }
      }
      else {
        charged = false;
        for (int i=0;i<_seeds.length;i++){
          if (_seeds[i]!=0){
            L2Effect e = target.getFirstEffect(_seeds[i]);
            if (e!=null && e.getInUse()){
              charged = true;
              break;
            }
          }
        }
      }
      if (!charged){
        SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString("Target is not charged by elements.");
        activeChar.sendPacket(sm);
        continue;
      }

      boolean mcrit = Formulas.getInstance().calcMCrit(activeChar.getMCriticalHit(target, this));

      int damage = (int)Formulas.getInstance().calcMagicDam(
          activeChar, target, this, ss, bss, mcrit);

      if (damage > 0)
      {
        target.reduceCurrentHp(damage, activeChar);

              // Manage attack or cast break of the target (calculating rate, sending message...)
              if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, damage))
              {
                  target.breakAttack();
                  target.breakCast();
              }

              activeChar.sendDamageMessage(target, damage, false, false, false);

      }

      // activate attacked effects, if any
      target.stopSkillEffects(getId());
            getEffects(activeChar, target);
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.L2Character$HitTask

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.